text:
package com.nestedworld.nestedworld.ui.view.connected.main.tabs.map;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentManager;
import android.view.View;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.MapStyleOptions;
import com.google.android.gms.maps.model.Marker;
import com.nestedworld.nestedworld.R;
import com.nestedworld.nestedworld.data.database.entities.Portal;
import com.nestedworld.nestedworld.data.database.implementation.NestedWorldDatabase;
import com.nestedworld.nestedworld.data.database.updater.PortalUpdater;
import com.nestedworld.nestedworld.events.http.OnPortalUpdatedEvent;
import com.nestedworld.nestedworld.helpers.log.LogHelper;
import com.nestedworld.nestedworld.helpers.permission.PermissionHelper;
import com.nestedworld.nestedworld.ui.dialog.EngagePortalFightDialog;
import com.nestedworld.nestedworld.ui.view.base.BaseAppCompatActivity;
import com.nestedworld.nestedworld.ui.view.base.BaseFragment;
import com.rey.material.widget.ProgressView;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;

import java.util.Arrays;

import butterknife.BindView;

/**
 * A placeholder fragment containing a simple view.
 */
public class MapFragment extends BaseFragment implements LocationListener, GoogleMap.OnMarkerClickListener {

    public final static String FRAGMENT_NAME = MapFragment.class.getSimpleName();
    private final static int MIN_TIME = 10000; //Minimum time between 2 update (in millisecond)
    private final static int MIN_DIST = 1; //Minimum distance between 2 update (in meter)
    private final static int ZOOM = 15;
    /*
     * #############################################################################################
     * # Butterknife widget binding
     * #############################################################################################
     */
    @BindView(R.id.mapView)
    MapView mMapView;
    @BindView(R.id.progressView)
    ProgressView progressView;
    private NestedWorldMap mMap = null;

    /*
     * #############################################################################################
     * # Public (static) method
     * #############################################################################################
     */
    public static void load(@NonNull final FragmentManager fragmentManager) {
        fragmentManager.beginTransaction()
                .setCustomAnimations(R.anim.fade_out, R.anim.fade_in)
                .replace(R.id.container, new MapFragment())
                .addToBackStack(FRAGMENT_NAME)
                .commit();
    }

    /*
     * #############################################################################################
     * # EventBus
     * #############################################################################################
     */
    @Subscribe
    public void onPortalsUpdated(OnPortalUpdatedEvent event) {
        //Check if fragment hasn't been detach
        if (mContext == null) {
            return;
        }

        if (mMap != null) {
            ((BaseAppCompatActivity) mContext).runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mMap.draw(mContext, NestedWorldDatabase.getInstance()
                            .getDataBase()
                            .getPortalDao()
                            .loadAll());
                }
            });
        }
    }

    /*
     * #############################################################################################
     * # Life cycle
     * #############################################################################################
     */
    @Override
    protected int getLayoutResource() {
        return R.layout.fragment_tab_map;
    }

    @Override
    protected void init(@NonNull View rootView, @Nullable Bundle savedInstanceState) {
        if (!EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().register(this);
        }

        //Check if fragment hasn't been detach
        if (mContext == null) {
            return;
        }

        //init MapView
        try {
            mMapView.onCreate(savedInstanceState);
            mMapView.onResume();//We display the map immediately

            //retrieve GoogleMap from mapView
            mMapView.getMapAsync(new OnMapReadyCallback() {
                @Override
                public void onMapReady(GoogleMap googleMap) {
                    //Check if fragment hasn't been detach
                    if (mContext == null) {
                        return;
                    }

                    //Init the mapView
                    googleMap.setMapStyle(MapStyleOptions.loadRawResourceStyle(mContext, R.raw.map_style));
                    googleMap.setOnMarkerClickListener(MapFragment.this);

                    mMap = new NestedWorldMap(googleMap);
                    initMap();
                }
            });
        } catch (android.content.res.Resources.NotFoundException e) {
            //DO want you want, fk instant run
        }

    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);

        //check for REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS cause we've asked for 2 permission
        if (requestCode != PermissionHelper.REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS) {
            LogHelper.d(TAG, "Wrong request code");
            return;
        }

        //check if the 2 permission were granted
        for (int result : grantResults) {
            if (result != PackageManager.PERMISSION_GRANTED) {
                LogHelper.d(TAG, "Permission not granted");
                return;
            }
        }
        initMap();
    }

    @Override
    public void onResume() {
        super.onResume();

        //Check if fragment hasn't been detach
        if (mContext == null) {
            return;
        }

        if (mMap != null && mMapView != null) {
            mMapView.onResume();
        }
    }

    @Override
    public void onPause() {
        super.onPause();

        //Check if fragment hasn't been detach
        if (mContext == null) {
            return;
        }

        if (mMap != null && mMapView != null) {
            mMapView.onPause();
        }
    }

    @Override
    public void onDestroy() {
        //Check if fragment hasn't been detach
        if (EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().unregister(this);
        }

        if (mMap != null && mMapView != null) {
            mMapView.onDestroy();
        }

        super.onDestroy();
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();

        //Check if fragment hasn't been detach
        if (mContext == null) {
            return;
        }

        if (mMap != null && mMapView != null) {
            mMapView.onLowMemory();
        }
    }

    /*
     * #############################################################################################
     * # GoogleMap.OnMarkerClickListener implementation
     * #############################################################################################
     */
    @Override
    public boolean onMarkerClick(Marker marker) {
        final Portal portal = (Portal) marker.getTag();
        if (portal != null) {
            EngagePortalFightDialog.show(getChildFragmentManager(), portal);
            return true;
        }

        return false;
    }

    /*
     * #############################################################################################
     * # Location listener Implementation
     * #############################################################################################
     */
    @Override
    public void onLocationChanged(@NonNull final Location location) {
        //Check if fragment hasn't been detach
        if (mContext == null) {
            return;
        }

        //Get new position
        final double latitude = location.getLatitude();
        final double longitude = location.getLongitude();

        //Display some log
        LogHelper.d(TAG, "set location to: " + latitude + ", " + longitude);

        //Update map position
        mMap.moveCamera(location.getLatitude(), location.getLongitude(), ZOOM);

        //Retrieve portal around the new position
        new PortalUpdater(latitude, longitude).start(null);
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
        LogHelper.d(TAG, "status changed: " + provider);
    }

    @Override
    public void onProviderEnabled(String provider) {
        LogHelper.d(TAG, "provider enable: " + provider);
    }

    @Override
    public void onProviderDisabled(String provider) {
        LogHelper.d(TAG, "provider disable:" + provider);
    }

    /*
     * #############################################################################################
     * # Internal method
     * #############################################################################################
     */
    private void initMap() {
        //check if fragment hasn't been detach
        if (mContext == null) {
            return;
        }

        /*We check if we are allowed to retrieve the userPosition*/
        if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
                && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            LogHelper.d(TAG, "ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission needed");

            //We ask for the permission (it we'll call onRequestPermissionsResult who will call initMap())
            PermissionHelper.askForPermissionsFromFragment(
                    mContext,
                    this,
                    Arrays.asList(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION));
        } else {
            // Acquire a reference to the system Location Manager
            final LocationManager locationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);

            // Register the listener with the Location Manager to receive location updates
            for (String provider : locationManager.getProviders(false)) {

                if (locationManager.isProviderEnabled(provider)) {
                    //onProviderEnabled() will not be called if the provider is already enable so we call it
                    onProviderEnabled(LocationManager.GPS_PROVIDER);

                    //get location fix
                    final Location lastLocation = locationManager.getLastKnownLocation(provider);
                    if (lastLocation != null) {
                        //Update the NestedWorldMap
                        onLocationChanged(lastLocation);
                    }
                }

                locationManager.requestLocationUpdates(provider, MIN_TIME, MIN_DIST, this);
            }

            //Center the googleMap map on the userLocation
            mMap.getGoogleMap().setMapType(GoogleMap.MAP_TYPE_NORMAL);
            mMap.getGoogleMap().setMyLocationEnabled(true);
        }
    }
}


text:
package tv.loilo.promise;

/**
 * Class for the data transfer.
 * Uses in progress notification, etc.
 */
public final class Transfer<TData> implements TaggedCancelState {

    private final Object mTag;
    private final CancelToken mCancelToken;
    private final TData mData;

    public Transfer(TaggedCancelState cancelState, TData data) {
        mCancelToken = cancelState.getCancelToken();
        mTag = cancelState.getTag();
        mData = data;
    }

    public TData getData() {
        return mData;
    }

    @Override
    public CancelToken getCancelToken() {
        return mCancelToken;
    }

    @Override
    public Object getTag() {
        return mTag;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout_item"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/audio_browser_item_size" >

        <ImageView
            android:id="@+id/cover"
            android:layout_width="@dimen/audio_browser_item_size"
            android:layout_height="@dimen/audio_browser_item_size"
            android:layout_gravity="center" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_toRightOf="@+id/cover"
            android:paddingLeft="10dp"
            android:gravity="center_vertical"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:singleLine="true"
                android:ellipsize="middle"
                android:maxLines="1"
                android:text="@string/title"
                android:textColor="?attr/list_title"
                android:textSize="20sp" />

            <TextView
                android:id="@+id/subtitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:ellipsize="middle"
                android:maxLines="1"
                android:text="@string/artist"
                android:textColor="?attr/list_subtitle"
                android:textSize="14sp" />
        </LinearLayout>

        <ImageView
            android:id="@+id/item_more"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:background="@drawable/ic_more"
            android:clickable="true" />
    </RelativeLayout>

    <View
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?attr/item_footer" />

</LinearLayout>


text:
categories:
- tumblr
- archive
- video
date: 2007-09-03T08:06:12Z
title: Video 20070903
url: /2007/09/03/video-20070903/
---

<iframe width="500" height="375"  id="youtube_iframe" src="https://www.youtube.com/embed/MSXTpS0_Zbc?feature=oembed&enablejsapi=1&origin=https://safe.txmblr.com&wmode=opaque" frameborder="0" allowfullscreen></iframe>

120 Days @ EnergiMølla


text:
<?php

namespace Matryoshka\Model\Service;

use Matryoshka\Model\ModelManager;
use Zend\ServiceManager\Config;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
 * Class ModelManagerFactory
 */
class ModelManagerFactory implements FactoryInterface
{
    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return mixed
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $modelConfig = [];
        if (isset($config['matryoshka']) && isset($config['matryoshka']['model_manager'])) {
            $modelConfig = $config['matryoshka']['model_manager'];
        }
        return new ModelManager(new Config($modelConfig));
    }
}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Microsoft.WindowsAzure.Management.CloudService.Test.Tests
{
    using System.IO;
    using System.Management.Automation;
    using CloudService.Cmdlet;
    using CloudService.PHP.Cmdlet;
    using CloudService.Properties;
    using Microsoft.WindowsAzure.Management.CloudService.Model;
    using Microsoft.WindowsAzure.Management.CloudService.Test.TestData;
    using Microsoft.WindowsAzure.Management.Extensions;
    using Microsoft.WindowsAzure.Management.Services;
    using Microsoft.WindowsAzure.Management.Test.Stubs;
    using Microsoft.WindowsAzure.Management.Test.Tests.Utilities;
    using Utilities;
    using VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class AddAzurePHPWebRoleTests : TestBase
    {
        private MockCommandRuntime mockCommandRuntime;

        private AddAzurePHPWebRoleCommand addPHPWebCmdlet;

        [TestInitialize]
        public void SetupTest()
        {
            GlobalPathInfo.GlobalSettingsDirectory = Data.AzureSdkAppDir;
            CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
            mockCommandRuntime = new MockCommandRuntime();
        }

        [TestMethod]
        public void AddAzurePHPWebRoleProcess()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                string roleName = "WebRole1";
                string serviceName = "AzureService";
                string rootPath = files.CreateNewService(serviceName);
                addPHPWebCmdlet = new AddAzurePHPWebRoleCommand() { RootPath = rootPath, CommandRuntime = mockCommandRuntime };
                string expectedVerboseMessage = string.Format(Resources.AddRoleMessageCreatePHP, rootPath, roleName);

                addPHPWebCmdlet.ExecuteCmdlet();

                AzureAssert.ScaffoldingExists(Path.Combine(rootPath, roleName), Path.Combine(Resources.PHPScaffolding, Resources.WebRole));
                Assert.AreEqual<string>(roleName, ((PSObject)mockCommandRuntime.OutputPipeline[0]).GetVariableValue<string>(Parameters.RoleName));
                Assert.AreEqual<string>(expectedVerboseMessage, mockCommandRuntime.VerboseStream[0]);
            }
        }

        [TestMethod]
        public void AddAzurePHPWebRoleWillRecreateDeploymentSettings()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                string roleName = "WebRole1";
                string serviceName = "AzureService";
                string rootPath = files.CreateNewService(serviceName);
                addPHPWebCmdlet = new AddAzurePHPWebRoleCommand() { RootPath = rootPath, CommandRuntime = mockCommandRuntime };
                string expectedVerboseMessage = string.Format(Resources.AddRoleMessageCreatePHP, rootPath, roleName);
                string settingsFilePath = Path.Combine(rootPath, Resources.SettingsFileName);
                File.Delete(settingsFilePath);
                Assert.IsFalse(File.Exists(settingsFilePath));

                addPHPWebCmdlet.ExecuteCmdlet();

                AzureAssert.ScaffoldingExists(Path.Combine(rootPath, roleName), Path.Combine(Resources.PHPScaffolding, Resources.WebRole));
                Assert.AreEqual<string>(roleName, ((PSObject)mockCommandRuntime.OutputPipeline[0]).GetVariableValue<string>(Parameters.RoleName));
                Assert.AreEqual<string>(expectedVerboseMessage, mockCommandRuntime.VerboseStream[0]);
                Assert.IsTrue(File.Exists(settingsFilePath));
            }
        }
    }
}


text:
<?php
// ta https://stackoverflow.com/questions/19751354/how-to-import-sql-file-in-mysql-database-using-php
// Name of the file
$filename = '../u944640367_catal.sql';
// MySQL host
$mysql_host = 'mysql.hostinger.com.ua';
// MySQL username
$mysql_username = 'u944640367_auser';
// MySQL password
$mysql_password = 'qwerty12345';
// Database name
$mysql_database = 'u944640367_catal';

// Connect to MySQL server
mysql_connect($mysql_host, $mysql_username, $mysql_password) or die('Error connecting to MySQL server: ' . mysql_error());
// Select database
mysql_select_db($mysql_database) or die('Error selecting MySQL database: ' . mysql_error());

// Temporary variable, used to store current query
$templine = '';
// Read in entire file
$lines = file($filename);
// Loop through each line
foreach ($lines as $line)
{
// Skip it if it's a comment
    if (substr($line, 0, 2) == '--' || $line == '')
        continue;

// Add this line to the current segment
    $templine .= $line;
// If it has a semicolon at the end, it's the end of the query
    if (substr(trim($line), -1, 1) == ';')
    {
        // Perform the query
        mysql_query($templine) or print('Error performing query \'' . $templine . '\': ' . mysql_error() . '

');
        // Reset temp variable to empty
        $templine = '';
    }
}
echo "Tables imported successfully";


text:
package net.sf.jabref.logic.layout.format;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class LatexToUnicodeFormatterTest {

    public final LatexToUnicodeFormatter formatter = new LatexToUnicodeFormatter();

    @Test
    public void testPlainFormat() {
        assertEquals("aaa", formatter.format("aaa"));
    }

    @Test
    public void testFormatUmlaut() {
        assertEquals("ä", formatter.format("{\\\"{a}}"));
        assertEquals("Ä", formatter.format("{\\\"{A}}"));
    }

    @Test
    public void testFormatStripLatexCommands() {
        assertEquals("-", formatter.format("\\mbox{-}"));
    }

    @Test
    public void testFormatTextit() {
        // See #1464
        assertEquals("text", formatter.format("\\textit{text}"));
    }

    @Test
    public void testEscapedDollarSign() {
        assertEquals("$", formatter.format("\\$"));
    }

    @Test
    public void testEquationsSingleSymbol() {
        assertEquals("σ", formatter.format("$\\sigma$"));
    }

    @Test
    public void testEquationsMoreComplicatedFormatting() {
        assertEquals("A 32\u00A0mA ΣΔ-modulator", formatter.format("A 32~{mA} {$\\Sigma\\Delta$}-modulator"));
    }

    @Test
    public void formatExample() {
        assertEquals("Mönch", formatter.format(formatter.getExampleInput()));
    }

    @Test
    public void testChi() {
        // See #1464
        assertEquals("χ", formatter.format("$\\chi$"));
    }

    @Test
    public void testSWithCaron() {
        // Bug #1264
        assertEquals("Š", formatter.format("{\\v{S}}"));
    }

    @Test
    public void testCombiningAccentsCase1() {
        assertEquals("ḩ", formatter.format("{\\c{h}}"));
    }

    @Test
    public void testCombiningAccentsCase2() {
        assertEquals("a͍", formatter.format("\\spreadlips{a}"));
    }

    @Test
    public void unknownCommandIsKept() {
        assertEquals("aaaa", formatter.format("\\aaaa"));
    }

    @Test
    public void unknownCommandKeepsArgument() {
        assertEquals("bbbb", formatter.format("\\aaaa{bbbb}"));
    }

    @Test
    public void unknownCommandWithEmptyArgumentIsKept() {
        assertEquals("aaaa", formatter.format("\\aaaa{}"));
    }
}


text:
<?php

/** */
namespace Applications\Factory\Listener;

use Applications\Listener\EventApplicationCreated;
use Interop\Container\ContainerInterface;
use Interop\Container\Exception\ContainerException;
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
 * ${CARET}
 *
 * @author Bleek Carsten <bleek@cross-solution.de>
 * @author Mathias Gelhausen <gelhausen@cross-solution.de>
 * @todo write test
 */
class EventApplicationCreatedFactory implements FactoryInterface
{
    /**
     * Create a EventApplicationCreated listener
     *
     * @param  ContainerInterface $container
     * @param  string             $requestedName
     * @param  null|array         $options
     *
     * @return EventApplicationCreated
     * @throws ServiceNotFoundException if unable to resolve the service.
     * @throws ServiceNotCreatedException if an exception is raised when
     *     creating a service.
     * @throws ContainerException if any other error occurs
     */
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $mailService     = $container->get('Core/MailService');
        $listener        = new EventApplicationCreated($mailService);
        return $listener;
    }

    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     *
     * @return mixed
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this($serviceLocator, EventApplicationCreated::class);
    }
}


text:
<?php

namespace CharlesBAP\PokemonBattle\Model;

interface PokemonInterface
{
    /**
     * @return int
     */
    public function getId();

    /**
     * @return string
     */
    public function getName();

    /**
     * @param string $name
     *
     * @return PokemonInterface
     */
    public function setName($name);

    /**
     * @return int
     */
    public function getHP();

    /**
     * @param int $hp
     *
     * @return PokemonInterface
     */
    public function setHP($hp);

    /**
     * @param int $hp
     *
     * @return int
     */
    public function addHP($hp);

    /**
     * @param int $hp
     *
     * @return int
     */
    public function removeHP($hp);

    /**
     * @return int
     */
    public function getType();

    /**
     * @param int $type
     *
     * @return PokemonInterface
     */
    public function setType($type);
}


text:
\documentclass[twoside]{book}

% Packages required by doxygen
\usepackage{calc}
\usepackage{doxygen}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{textcomp}
\usepackage[table]{xcolor}

% Font selection
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{amssymb}
\usepackage{sectsty}
\renewcommand{\familydefault}{\sfdefault}
\allsectionsfont{%
  \fontseries{bc}\selectfont%
  \color{darkgray}%
}
\renewcommand{\DoxyLabelFont}{%
  \fontseries{bc}\selectfont%
  \color{darkgray}%
}

% Page & text layout
\usepackage{geometry}
\geometry{%
  a4paper,%
  top=2.5cm,%
  bottom=2.5cm,%
  left=2.5cm,%
  right=2.5cm%
}
\tolerance=750
\hfuzz=15pt
\hbadness=750
\setlength{\emergencystretch}{15pt}
\setlength{\parindent}{0cm}
\setlength{\parskip}{0.2cm}
\makeatletter
\renewcommand{\paragraph}{%
  \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%
    \normalfont\normalsize\bfseries\SS@parafont%
  }%
}
\renewcommand{\subparagraph}{%
  \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%
    \normalfont\normalsize\bfseries\SS@subparafont%
  }%
}
\makeatother

% Headers & footers
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}}
\fancyhead[CE]{\fancyplain{}{}}
\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}}
\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}}
\fancyhead[CO]{\fancyplain{}{}}
\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}}
\fancyfoot[LE]{\fancyplain{}{}}
\fancyfoot[CE]{\fancyplain{}{}}
\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Thu Jan 21 2016 04\-:38\-:24 for K\-T\-A\-B by Doxygen }}
\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Thu Jan 21 2016 04\-:38\-:24 for K\-T\-A\-B by Doxygen }}
\fancyfoot[CO]{\fancyplain{}{}}
\fancyfoot[RO]{\fancyplain{}{}}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\chaptermark}[1]{%
  \markboth{#1}{}%
}
\renewcommand{\sectionmark}[1]{%
  \markright{\thesection\ #1}%
}

% Indices & bibliography
\usepackage{natbib}
\usepackage[titles]{tocloft}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{5}
\makeindex

% Hyperlinks (required, but should be loaded last)
\usepackage{ifpdf}
\ifpdf
  \usepackage[pdftex,pagebackref=true]{hyperref}
\else
  \usepackage[ps2pdf,pagebackref=true]{hyperref}
\fi
\hypersetup{%
  colorlinks=true,%
  linkcolor=blue,%
  citecolor=blue,%
  unicode%
}

% Custom commands
\newcommand{\clearemptydoublepage}{%
  \newpage{\pagestyle{empty}\cleardoublepage}%
}

%===== C O N T E N T S =====

\begin{document}

% Titlepage & ToC
\hypersetup{pageanchor=false}
\pagenumbering{roman}
\begin{titlepage}
\vspace*{7cm}
\begin{center}%
{\Large K\-T\-A\-B }\\
\vspace*{1cm}
{\large Generated by Doxygen 1.8.6}\\
\vspace*{0.5cm}
{\small Thu Jan 21 2016 04:38:24}\\
\end{center}
\end{titlepage}
\clearemptydoublepage
\tableofcontents
\clearemptydoublepage
\pagenumbering{arabic}
\hypersetup{pageanchor=true}

%--- Begin generated contents ---
\chapter{Hierarchical Index}
\input{hierarchy}
\chapter{Class Index}
\input{annotated}
\chapter{Class Documentation}
\input{class_k_base_1_1_actor}
\input{class_tetris_1_1_board}
\input{class_k_graph_1_1_canvas}
\input{class_tetris_1_1_control_state}
\input{class_k_graph_1_1_coord_map}
\input{class_k_base_1_1_e_model}
\input{class_k_base_1_1_e_position}
\input{class_k_base_1_1_e_state}
\input{class_k_base_1_1_g_a_opt}
\input{class_k_base_1_1_g_h_c_search}
\input{class_k_base_1_1_k_exception}
\input{class_k_base_1_1_k_matrix}
\input{class_demo_leon_1_1_leon_actor}
\input{class_demo_leon_1_1_leon_model}
\input{class_demo_leon_1_1_leon_state}
\input{class_k_base_1_1_model}
\input{class_demo_mtch_1_1_mtch_actor}
\input{class_k_base_1_1_mtch_gene}
\input{class_demo_mtch_1_1_mtch_model}
\input{class_k_base_1_1_mtch_pstn}
\input{class_demo_mtch_1_1_mtch_state}
\input{class_k_graph_1_1_picture}
\input{class_k_base_1_1_position}
\input{class_k_base_1_1_p_r_n_g}
\input{class_tetris_1_1_p_v_canvas}
\input{class_tetris_1_1_shape}
\input{class_m_demo_1_1_s_q_l_d_b}
\input{class_k_base_1_1_state}
\input{class_tetris_1_1_t_app}
\input{class_u_demo_1_1_targeted_b_v}
\input{class_tetris_1_1_t_canvas}
\input{struct_m_demo_1_1_two_d_point}
\input{class_k_base_1_1_vctr_pstn}
\input{class_k_base_1_1_v_h_c_search}
\input{class_m_demo_1_1_z_actor}
%--- End generated contents ---

% Index
\newpage
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex

\end{document}


text:
//
//  BoxModel.h
//  BoxSDK
//
//  Created on 3/14/13.
//  Copyright (c) 2013 Box. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 * BoxModel is the base class for all objects that may be returned by the Box API.
 * It exposes two fields that every object has: a `type` and `modelID`.
 *
 * Models are immutable: they represent a snapshot of an object in Box from when it
 * was fetched via the API. This implies that models should only have accessor methods.
 * BoxModel objects should be manipulated via subclasses of BoxAPIResourceManager.
 *
 * Models should convert the on-the-wire representation used by the API to a native
 * objective-c type whenever possible. This includes transforming ISO 8601 timestamps
 * to `NSDate`s and JSON booleans to `BOOL`s.
 *
 * Model objects should assume the API may return inconsistent or garbage data when
 * implementing accessor methods. They should fail safely in these instances.
 *
 * Model objects may not always be instantiated with the full set of fields associated
 * with an object. Some API responses return mini representations of objects and ?fields
 * may cause objects to be returned with a subset of fields.
 *
 * Field names and object types have constants defined for them in `BoxSDKConstants.h`.
 *
 * @warning BoxModel instances disambiguate between fields that are not present and fields
 * that are present in the underlying JSON with the value null.
 *
 * Fields not present in the underlying JSON will be returned as `nil`.
 *
 * Fields present with the JSON value null will be returned as instances of `NSNull`.
 */
@interface BoxModel : NSObject

/** @name API representation */

/**
 * The JSON that is received from the Box API.
 */
@property (nonatomic, readonly) NSDictionary *rawResponseJSON;

/**
 * Whether the API call that instantiated this BoxModel expects to receive
 * a mini representation.
 */
@property (nonatomic, readonly, getter = isMini) BOOL mini;

/** @name Accessors */

/**
 * The type of object returned by the API.
 */
@property (nonatomic, readonly) NSString *type;

/**
 * The ID of this model. This field is unique for all objects of the same type but may
 * not be unique across model types.
 */
@property (nonatomic, readonly) NSString *modelID;

/** @name Initialization */

/**
 * Designated initializer.
 *
 * @param responseJSON The JSON representation of this model received from the Box API.
 * @param mini Whether the API call instantiating this model expects to receive the object
 *   in mini representation.
 *
 * @return A BoxModel object backed by a JSON dictionary.
 */
- (id)initWithResponseJSON:(NSDictionary *)responseJSON mini:(BOOL)mini;

/** Decode to native types */

/**
 * Convert an ISO 8601 date string to a native `NSDate`. ISO 8601 strings are
 * the Box API's on-the-wire representation for dates
 *
 * @param timestamp The ISO 8601 date timestamp.
 * @return A decoded date.
 */
- (NSDate *)dateWithISO8601String:(NSString *)timestamp;

/** @name Comparison */

/**
 * Compare this model to another model object using the supplied comparator.
 * Several comparators are provided in BoxModelComparators
 *
 * @param model Model object to compare to this one.
 * @param comparator Comparator to use for the comparison.
 * @return NSComparisonResult
 */
- (NSComparisonResult)compare:(BoxModel *)model usingComparator:(NSComparator)comparator;

@end


text:
package com.coscale.sdk.client.data;

import javax.annotation.Nullable;

import com.coscale.sdk.client.ApiClient;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

public class DataInsert {

    /** The source of the call. This is optional. */
    @Nullable
    public String source;

    /** JSON encoded array of dicts with keys */
    @Nullable
    public String data;

    /**
     * Default Constructor
     */
    public DataInsert() {
        this.source = ApiClient.getSource();
    }

    public DataInsert(String data) {
        this();
        this.data = data;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this).add("source", source).add("data", data).toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DataInsert other = (DataInsert) obj;

        return Objects.equal(this.source, other.source) && Objects.equal(this.data, other.data);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(source, data);
    }
}


text:
[![Build Status](https://travis-ci.org/Mordred/dokku-redirects-plugin.svg?branch=master)](https://travis-ci.org/Mordred/dokku-redirects-plugin)

[Dokku](https://github.com/progrium/dokku) plugin to create nginx vhost which redirects domains to primary domain.

DEPRECATED: Use https://github.com/dokku/dokku-redirect instead

## Installation

```bash
cd /var/lib/dokku/plugins
git clone https://github.com/mordred/dokku-redirects-plugin.git /var/lib/dokku/plugins/redirects-plugin
dokku plugins-install
```

## Commands

```bash
$ dokku help
    ...
    redirects <app>                                                   display redirects for an app
    redirects:set <app> DOMAIN1=DOMAIN2 [DOMAIN3=DOMAIN4 ...]         set one or more domains redirects
    ...
```

## Simple usage

Your need to have app running with the same name!

Create vhost with multiple where one domain redirects all request to another

```bash
$ dokku redirects:set myawesomeapp.com myawesomeapp.com=www.myawesomeapp.com # Server side
$ ssh dokku@server redirects:set myawesomeapp.com myawesomeapp.com=www.myawesomeapp.com # Client side
```

#### Extended usage
````
$ dokku redirects:set APPNAME DOMAIN-TO-REDIRECT=DESTINATION-DOMAIN # Server side
$ ssh dokku@server redirects:set APPNAME DOMAIN-TO-REDIRECT=DESTINATION-DOMAIN # Client side
```

## License
MIT


text:
def _smugbool(value):
    """Formats the value into an appropriate boolean representation for SmugMug.
    The SmugMug API will accept boolean values as either C{true|false} or C{1|0} so
    this function accepts both strings and boolean/integer Python values and returns
    the appropriate representation for the API.    There is no corresponding mapping
    for inbound data.
    """
    if value is None:
        return value
    if isinstance(value, str):
        return value.lower()
    return int(value)

__apikeys = dict((x.lower(), (x, f)) for x, f in (
    ("APIKey", None),
    ("AlbumKey", None),
    ("EmailAddress", None),
    ("FileName", None),
    ("Heavy", _smugbool),
    ("ImageKey", None),
    ("PasswordHash", None),
    ("Pretty", _smugbool),
    ("Strict", _smugbool),
    ("NickName", None),
))
"""A mapping between lower-cased names and their SmugMug API case and formatting
function.    This is a one-way mapping usually used to format a Python C{bool}
into its numeric value usable by the SmugMug API.
"""

def _smugmug_keyword(k, v=None):
    if k == "method":
        return False, k, v
    if k[0].isupper():
        return False, k, v
    lk = k.lower()
    if lk in __apikeys:
        key, func = __apikeys[lk]
        # del kwargs[k]
        # kwargs[key] = func(v) if func else v
        return True, key, func(v) if func else v
    else:
        # del kwargs[k]
        if lk.endswith("id"):
            # kwargs[lk[:-2].title() + "ID"] = v
            return True, lk[:-2].title() + "ID", v
        else:
            # kwargs[lk.title()] = v
            return True, lk.title(), v

def smugmug_keyword(keyword):
    t, k, v = _smugmug_keyword(keyword)
    return k

def smugmug_keywords(fn):
    """Prepare the keywords for sending to SmugMug.

    The following operations are performed::
        1. If the key is "method", continue.
        2. If the key starts with an upper case letter, continue.
        3. If the key is in {methods.apikeys}, replace the key.
        4. If the key ends with {id}, upper case the first letter
             and {ID} and replace the key.
        5. Else, upper case the first letter only and replace the
             key.

    @param fn: the decorated function
    """
    def mg(*args, **kwargs):
        items = kwargs.items()
        for k, v, in items:
            t, key, value = _smugmug_keyword(k, v)
            if t:
                del kwargs[k]
                kwargs[key] = value
        return fn(*args, **kwargs)
    return mg


text:
package org.olat.ims.qti.editor.beecom.objects;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.dom4j.Element;

/**
 * @author rkulow
 */
public class Feedback implements QTIObject {

	private String ident = null;
	private String title = null;
	private String view = null;
	private List materials = new ArrayList();

	/**
	 * Returns the ident.
	 *
	 * @return String
	 */
	public String getIdent() {
		return ident;
	}

	/**
	 * Returns the material.
	 *
	 * @return List
	 */
	public List getMaterials() {
		return materials;
	}

	/**
	 * Returns the title.
	 *
	 * @return String
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * Returns the view.
	 *
	 * @return String
	 */
	public String getView() {
		return view;
	}

	/**
	 * Sets the ident.
	 *
	 * @param ident The ident to set
	 */
	public void setIdent(final String ident) {
		this.ident = ident;
	}

	/**
	 * Sets the material.
	 *
	 * @param material The material to set
	 */
	public void setMaterials(final List materials) {
		this.materials = materials;
	}

	/**
	 * Sets the title.
	 *
	 * @param title The title to set
	 */
	public void setTitle(final String title) {
		this.title = title;
	}

	/**
	 * Sets the view.
	 *
	 * @param view The view to set
	 */
	public void setView(final String view) {
		this.view = view;
	}

	/**
	 * @see org.olat.ims.qti.editor.beecom.objects.QTIObject#addToElement(org.dom4j.Element)
	 */
	@Override
	public void addToElement(final Element root) {

		// don't presist feedbacks with no materials
		if (materials.size() == 0) { return; }

		final String rootName = root.getName();
		final Element feedback = root.addElement(rootName + "feedback");

		if (this.ident != null) {
			feedback.addAttribute("ident", this.ident);
		}
		if (this.title != null) {
			feedback.addAttribute("title", this.title);
		}
		if (this.view != null) {
			feedback.addAttribute("view", this.view);
		}

		for (final Iterator i = this.materials.iterator(); i.hasNext();) {
			final QTIObject obj = (QTIObject) i.next();
			if (obj != null) {
				obj.addToElement(feedback);
			}
		}
	}

}


text:
UTGB Devnote
=========
### Contents

scala-min project includes:
- Sample Scala codes.
- [ScalaTest](http://www.scalatest.org/) examples
- Pre-configured settings for developing with IntelliJ IDE
- A command for packaging projects with [sbt-pack](http://github.com/xerial/sbt-pack) plugin.
  - `sbt-pack` also generates installation scripts for you programs.

### Usage

Download tar.gz archive of this project, then extract the contents:

**Run tests**

    $ bin/sbt test

**Run tests when updates of source codes are detected**

    $ bin/sbt "~test"

**Run specific tests maching a pattern**

    $ bin/sbt "~test-only *HelloTest"

**Run tagged test only**

    $ bin/sbt "~test -- include(test1)"

**Create a runnable package**

    $ bin/sbt pack
    $ target/pack/bin/hello
    Hello World!!

**Install your program**

    $ bin/sbt pack
    $ cd target/pack; make install
    $ ~/local/bin/hello
    Hello World!!

**Create IntelliJ project files**

    $ bin/sbt gen-idea

**Add dendent libraries**

Edit `project/Build.scala`, then add libraries to `libraryDependences` variable.

### Customize

Rename the project name defined in `project/Build.scala` as you like.

### ToDo

- Add examples using command line parser


text:
layout: multipage
multipage: true
date: 2018-11-15
collection: news
stories:
  - title: "Bitwarden Completes Third-Party Security Audit"
    image: 'https://www.redeszone.net/app/uploads/2017/01/Bitwarden-1-300x170.png'
    link: 'https://blog.bitwarden.com/bitwarden-completes-third-party-security-audit-c1cc81b6d33'
    notes: |
      ## Why do I care about these guys?
      - 100% Open Source Codebase
      - Bug Bounty Program

      # Security Audit
      - Done by security experts at [Cure53](https://cure53.de/)
      - Full [technical report](https://cdn.bitwarden.net/misc/Bitwarden%20Security%20Assessment%20Report.pdf)
  - title: "Federated Blogging"
    image: 'https://writefreely.org/img/logo.svg'
    link: 'https://writefreely.org/'
    notes: |
      # Write Freely

      > **Write Freely** is free and open source software for starting a minimalist, federated blog - or an entire community.

      [Website](https://writefreely.org/)
      [Github](https://github.com/writeas/writefreely)

      > WriteFreely is just about writing -- everything is built around plain text / Markdown, and keeping everything as simple as possible. Federation is basically one-way right now

      # Plume

      > Federated blogging application, thanks to ActivityPub

      [Website](https://plume-org.github.io/Plume/)
      [Github](https://github.com/Plume-org/Plume)

      > Plume is trying to be more on-par with Medium, with reading and writing all built-in. It supports more of ActivityPub, including comments, likes, and boosts.

      #### [Pterotype](https://getpterotype.com/)
  - title: "Apple's new bootloader won't let you install GNU/Linux"
    image: 'https://i1.wp.com/media.boingboing.net/wp-content/uploads/2018/11/Think-Different.jpg'
    link: 'https://boingboing.net/2018/11/11/ring-minus-1.html'
    notes: |
      > Bootloader protection that doesn't allow an owner to decide which signatures they trust is security against the user: security that prevents the user from overriding the manufacturer, and so allows the manufacturer to lock the user in.

      > The chip comes with a user-inaccessible root of trust that allows for the installation of Apple and Microsoft operating systems, but not GNU/Linux and other open and free alternatives.

      > Google's flagship Pixel Chromebooks come with hardware switches that can be activated during the bootup to allow their owners to change which signatures the system trusts.

      > Publishing tools to allow for bootloader overrides is legally risky under section 1201 of the DMCA, which provides for 5 year prison sentences and $500,000 fines (for a first offense) for anyone who trafficks in tools to override access controls for copyrighted works.
---


text:
package org.apache.ignite.internal.processors.odbc;

import java.net.InetAddress;
import java.nio.ByteOrder;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.OdbcConfiguration;
import org.apache.ignite.configuration.SqlConnectorConfiguration;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.processors.GridProcessorAdapter;
import org.apache.ignite.internal.util.GridSpinBusyLock;
import org.apache.ignite.internal.util.HostAndPortRange;
import org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter;
import org.apache.ignite.internal.util.nio.GridNioCodecFilter;
import org.apache.ignite.internal.util.nio.GridNioFilter;
import org.apache.ignite.internal.util.nio.GridNioServer;
import org.apache.ignite.internal.util.nio.GridNioSession;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.spi.IgnitePortProtocol;
import org.apache.ignite.thread.IgniteThreadPoolExecutor;
import org.jetbrains.annotations.Nullable;

/**
 * SQL processor.
 */
public class SqlListenerProcessor extends GridProcessorAdapter {
    /** Default number of selectors. */
    private static final int DFLT_SELECTOR_CNT = Math.min(4, Runtime.getRuntime().availableProcessors());

    /** Default TCP direct buffer flag. */
    private static final boolean DFLT_TCP_DIRECT_BUF = false;

    /** Busy lock. */
    private final GridSpinBusyLock busyLock = new GridSpinBusyLock();

    /** TCP Server. */
    private GridNioServer<byte[]> srv;

    /** Executor service. */
    private ExecutorService execSvc;

    /**
     * @param ctx Kernal context.
     */
    public SqlListenerProcessor(GridKernalContext ctx) {
        super(ctx);
    }

    /** {@inheritDoc} */
    @Override public void start(boolean activeOnStart) throws IgniteCheckedException {
        IgniteConfiguration cfg = ctx.config();

        SqlConnectorConfiguration sqlCfg = prepareConfiguration(cfg);

        if (sqlCfg != null) {
            try {
                validateConfiguration(sqlCfg);

                // Resolve host.
                String host = sqlCfg.getHost();

                if (host == null)
                    host = cfg.getLocalHost();

                InetAddress hostAddr;

                try {
                    hostAddr = U.resolveLocalHost(host);
                }
                catch (Exception e) {
                    throw new IgniteCheckedException("Failed to resolve SQL connector host: " + host, e);
                }

                execSvc = new IgniteThreadPoolExecutor(
                    "sql-connector",
                    cfg.getIgniteInstanceName(),
                    sqlCfg.getThreadPoolSize(),
                    sqlCfg.getThreadPoolSize(),
                    0,
                    new LinkedBlockingQueue<Runnable>());

                Exception lastErr = null;

                int portTo = sqlCfg.getPort() + sqlCfg.getPortRange();

                if (portTo <= 0) // Handle int overflow.
                    portTo = Integer.MAX_VALUE;

                for (int port = sqlCfg.getPort(); port <= portTo && port <= 65535; port++) {
                    try {
                        GridNioFilter[] filters = new GridNioFilter[] {
                            new GridNioAsyncNotifyFilter(ctx.igniteInstanceName(), execSvc, log) {
                                @Override public void onSessionOpened(GridNioSession ses)
                                    throws IgniteCheckedException {
                                    proceedSessionOpened(ses);
                                }
                            },
                            new GridNioCodecFilter(new SqlListenerBufferedParser(), log, false)
                        };

                        int maxOpenCursors = sqlCfg.getMaxOpenCursorsPerConnection();

                        GridNioServer<byte[]> srv0 = GridNioServer.<byte[]>builder()
                            .address(hostAddr)
                            .port(port)
                            .listener(new SqlListenerNioListener(ctx, busyLock, maxOpenCursors))
                            .logger(log)
                            .selectorCount(DFLT_SELECTOR_CNT)
                            .igniteInstanceName(ctx.igniteInstanceName())
                            .serverName("sql-listener")
                            .tcpNoDelay(sqlCfg.isTcpNoDelay())
                            .directBuffer(DFLT_TCP_DIRECT_BUF)
                            .byteOrder(ByteOrder.nativeOrder())
                            .socketSendBufferSize(sqlCfg.getSocketSendBufferSize())
                            .socketReceiveBufferSize(sqlCfg.getSocketReceiveBufferSize())
                            .filters(filters)
                            .directMode(false)
                            .idleTimeout(Long.MAX_VALUE)
                            .build();

                        srv0.start();

                        srv = srv0;

                        ctx.ports().registerPort(port, IgnitePortProtocol.TCP, getClass());

                        log.info("SQL connector processor has started on TCP port " + port);

                        lastErr = null;

                        break;
                    }
                    catch (Exception e) {
                        lastErr = e;
                    }
                }

                assert (srv != null && lastErr == null) || (srv == null && lastErr != null);

                if (lastErr != null)
                    throw new IgniteCheckedException("Failed to bind to any [host:port] from the range [" +
                        "host=" + host + ", portFrom=" + sqlCfg.getPort() + ", portTo=" + portTo +
                        ", lastErr=" + lastErr + ']');
            }
            catch (Exception e) {
                throw new IgniteCheckedException("Failed to start SQL connector processor.", e);
            }
        }
    }

    /** {@inheritDoc} */
    @Override public void onKernalStop(boolean cancel) {
        if (srv != null) {
            busyLock.block();

            srv.stop();

            ctx.ports().deregisterPorts(getClass());

            if (execSvc != null) {
                U.shutdownNow(getClass(), execSvc, log);

                execSvc = null;
            }

            if (log.isDebugEnabled())
                log.debug("SQL connector processor stopped.");
        }
    }

    /**
     * Prepare connector configuration.
     *
     * @param cfg Ignote configuration.
     * @return Connector configuration.
     * @throws IgniteCheckedException If failed.
     */
    @SuppressWarnings("deprecation")
    @Nullable private SqlConnectorConfiguration prepareConfiguration(IgniteConfiguration cfg)
        throws IgniteCheckedException {
        SqlConnectorConfiguration res = cfg.getSqlConnectorConfiguration();

        OdbcConfiguration odbcCfg = cfg.getOdbcConfiguration();

        if (odbcCfg != null) {
            if (res == null) {
                // SQL connector is either default or null, so we replace it with ODBC stuff.
                HostAndPortRange hostAndPort = parseOdbcEndpoint(odbcCfg);

                res = new SqlConnectorConfiguration();

                res.setHost(hostAndPort.host());
                res.setPort(hostAndPort.portFrom());
                res.setPortRange(hostAndPort.portTo() - hostAndPort.portFrom());
                res.setThreadPoolSize(odbcCfg.getThreadPoolSize());
                res.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize());
                res.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize());
                res.setMaxOpenCursorsPerConnection(odbcCfg.getMaxOpenCursors());

                U.warn(log, "Automatically converted deprecated ODBC configuration to SQL connector configuration: " +
                    res);
            }
            else {
                // Non-default SQL connector is set, ignore ODBC.
                U.warn(log, "Deprecated ODBC configuration will be ignored because SQL connector configuration is " +
                    "set (either migrate to new SqlConnectorConfiguration or set " +
                    "IgniteConfiguration.sqlConnectorConfiguration to null explicitly).");
            }
        }

        return res;
    }

    /**
     * Validate SQL connector configuration.
     *
     * @param cfg Configuration.
     * @throws IgniteCheckedException If failed.
     */
    private void validateConfiguration(SqlConnectorConfiguration cfg) throws IgniteCheckedException {
        assertParameter(cfg.getPort() > 1024, "port > 1024");
        assertParameter(cfg.getPort() <= 65535, "port <= 65535");
        assertParameter(cfg.getPortRange() >= 0, "portRange > 0");
        assertParameter(cfg.getSocketSendBufferSize() >= 0, "socketSendBufferSize > 0");
        assertParameter(cfg.getSocketReceiveBufferSize() >= 0, "socketReceiveBufferSize > 0");
        assertParameter(cfg.getMaxOpenCursorsPerConnection() >= 0, "maxOpenCursorsPerConnection() >= 0");
        assertParameter(cfg.getThreadPoolSize() > 0, "threadPoolSize > 0");
    }

    /**
     * Parse ODBC endpoint.
     *
     * @param odbcCfg ODBC configuration.
     * @return ODBC host and port range.
     * @throws IgniteCheckedException If failed.
     */
    @SuppressWarnings("deprecation")
    private HostAndPortRange parseOdbcEndpoint(OdbcConfiguration odbcCfg) throws IgniteCheckedException {
        HostAndPortRange res;

        if (F.isEmpty(odbcCfg.getEndpointAddress())) {
            res = new HostAndPortRange(OdbcConfiguration.DFLT_TCP_HOST,
                OdbcConfiguration.DFLT_TCP_PORT_FROM,
                OdbcConfiguration.DFLT_TCP_PORT_TO
            );
        }
        else {
            res = HostAndPortRange.parse(odbcCfg.getEndpointAddress(),
                OdbcConfiguration.DFLT_TCP_PORT_FROM,
                OdbcConfiguration.DFLT_TCP_PORT_TO,
                "Failed to parse SQL connector endpoint address"
            );
        }

        return res;
    }
}


text:
<resources>
    <dimen name="fab_margin">16dp</dimen>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="appbar_padding_top">8dp</dimen>
    <dimen name="base_margin">16dp</dimen>
</resources>


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

namespace iServe.Models {
	public partial class CategoryTypeQuery {
	}
}


text:
<?php

namespace App\MainBundle\Document;

use Andchir\CommentsBundle\Document\CommentAbstract;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @MongoDB\Document(collection="comment",repositoryClass="App\Repository\CommentRepository")
 * @MongoDB\HasLifecycleCallbacks()
 */
class Comment extends CommentAbstract {

    /**
     * @MongoDB\Id(type="int", strategy="INCREMENT")
     * @Groups({"details", "list"})
     * @var int
     */
    protected $id;
    /**
     * @MongoDB\Field(type="string")
     * @Groups({"details", "list"})
     * @var string
     */
    protected $threadId;
    /**
     * @MongoDB\Field(type="string")
     * @Groups({"details", "list"})
     * @var string
     */
    protected $comment;
    /**
     * @MongoDB\Field(type="string")
     * @Groups({"details", "list"})
     * @var string
     */
    protected $reply;
    /**
     * @MongoDB\Field(type="int")
     * @Groups({"details", "list"})
     * @var int
     */
    protected $vote;
    /**
     * @MongoDB\Field(type="string")
     * @Groups({"details", "list"})
     * @var string
     */
    protected $status;
    /**
     * @MongoDB\ReferenceOne(targetDocument="App\MainBundle\Document\User")
     * @Groups({"details"})
     * @var User
     */
    protected $author;
    /**
     * @MongoDB\Field(type="date")
     * @Groups({"details", "list"})
     * @var \DateTime
     */
    protected $createdTime;
    /**
     * @MongoDB\Field(type="date")
     * @Groups({"details", "list"})
     * @var \DateTime
     */
    protected $publishedTime;
    /**
     * @Groups({"details", "list"})
     * @var bool
     */
    protected $isActive;

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @MongoDB\PrePersist()
     */
    public function prePersist()
    {
        $this->createdTime = new \DateTime();
        $this->publishedTime = new \DateTime();
    }
}


text:
'use strict';
// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('Ionicapp', ['ionic', 'config', 'Ionicapp.controllers', 'Ionicapp.services'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
  });
})

.config(function($stateProvider, $urlRouterProvider) {

  // Ionic uses AngularUI Router which uses the concept of states
  // Learn more here: https://github.com/angular-ui/ui-router
  // Set up the various states which the app can be in.
  // Each state's controller can be found in controllers.js
  $stateProvider

    // setup an abstract state for the tabs directive
    .state('tab', {
      url: '/tab',
      abstract: true,
      templateUrl: 'templates/tabs.html'
    })

    // Each tab has its own nav history stack:

    .state('tab.dash', {
      url: '/dash',
      views: {
        'tab-dash': {
          templateUrl: 'templates/tab-dash.html',
          controller: 'DashCtrl'
        }
      }
    })

    .state('tab.friends', {
      url: '/friends',
      views: {
        'tab-friends': {
          templateUrl: 'templates/tab-friends.html',
          controller: 'FriendsCtrl'
        }
      }
    })
    .state('tab.friend-detail', {
      url: '/friend/:friendId',
      views: {
        'tab-friends': {
          templateUrl: 'templates/friend-detail.html',
          controller: 'FriendDetailCtrl'
        }
      }
    })

    .state('tab.account', {
      url: '/account',
      views: {
        'tab-account': {
          templateUrl: 'templates/tab-account.html',
          controller: 'AccountCtrl'
        }
      }
    });

  // if none of the above states are matched, use this as the fallback
  $urlRouterProvider.otherwise('/tab/dash');

});


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.noun.dto;

import com.noun.dto.UserDto;
import com.noun.dto.ResourceDto;
import com.noun.entities.Resource;
import com.noun.entities.User;

/**
 *
 * @author azibit
 */
public class EntityMapper {

    public static User mapToUser(UserDto userDto){
        if(userDto == null){
            return  null;
        }

        User user = new User();
        user.setCourse(userDto.getCourse());
        user.setEmail(userDto.getEmail());
        user.setUserId(userDto.getUserId());
        user.setDept(userDto.getDept());
        user.setFaculty(userDto.getFaculty());
        user.setFirstName(userDto.getFirstName());
        user.setLastName(userDto.getLastName());
        user.setRole(userDto.getRole());
        user.setOtherName(userDto.getOtherName());
        user.setPassword(userDto.getPassword());
        return user;
    }

    public static UserDto mapToUserDto(User user){
        if(user == null){
            return  null;
        }
        UserDto userDto = new UserDto();
        userDto.setCourse(user.getCourse());
        userDto.setEmail(user.getEmail());
        userDto.setUserId(user.getUserId());
        userDto.setDept(user.getDept());
        userDto.setFaculty(user.getFaculty());
        userDto.setFirstName(user.getFirstName());
        userDto.setLastName(user.getLastName());
        userDto.setRole(user.getRole());
        userDto.setOtherName(user.getOtherName());
        userDto.setPassword(user.getPassword());
        return userDto;
    }

    public static Resource mapToResource(ResourceDto resourceDto){
        if(resourceDto == null){
            return  null;
        }
        Resource resource = new Resource();
        resource.setCourse(resourceDto.getCourse());
        resource.setId(resourceDto.getId());
        resource.setDateUploaded(resourceDto.getDateUploaded());
        resource.setDept(resourceDto.getDept());
        resource.setName(resourceDto.getName());
        resource.setUrl(resourceDto.getUrl());
        resource.setFaculty(resourceDto.getFaculty());

        return resource;
    }

    public static ResourceDto mapToResourceDto(Resource resource){
       if(resource == null){
            return  null;
        }
        ResourceDto resourceDto = new ResourceDto();
        resourceDto.setCourse(resource.getCourse());
        resourceDto.setId(resource.getId());
        resourceDto.setDateUploaded(resource.getDateUploaded());
        resourceDto.setDept(resource.getDept());
        resourceDto.setName(resource.getName());
        resourceDto.setUrl(resource.getUrl());
        resourceDto.setFaculty(resource.getFaculty());

        return resourceDto;
    }
}


text:
module Laika.Building.ByteString.Builder.BoundedPrims where

import Laika.Prelude
import Data.ByteString.Builder.Prim
import qualified Laika.Building.ByteString.Builder.FixedPrims as A

{-# INLINE fixed #-}
fixed :: FixedPrim a -> BoundedPrim a
fixed =
  liftFixedToBounded

{-# INLINE html #-}
html :: BoundedPrim Word8
html =
  greaterThanOr $ lesserThanOr $ ampersandOr $ doubleQuoteOr $ fixed word8

{-# INLINE betweenTagsHTML #-}
betweenTagsHTML :: BoundedPrim Word8
betweenTagsHTML =
  lesserThanOr $ ampersandOr $ fixed word8

{-# INLINE betweenDoubleQuotes #-}
betweenDoubleQuotes :: BoundedPrim Word8
betweenDoubleQuotes =
  doubleQuoteOr $ ampersandOr $ fixed word8

{-# INLINE inTagHTML #-}
inTagHTML :: BoundedPrim Word8
inTagHTML =
  greaterThanOr $ ampersandOr $ fixed word8

{-# INLINE greaterThanOr #-}
greaterThanOr :: BoundedPrim Word8 -> BoundedPrim Word8
greaterThanOr =
  condB (== 62) (fixed A.greaterThan)

{-# INLINE lesserThanOr #-}
lesserThanOr :: BoundedPrim Word8 -> BoundedPrim Word8
lesserThanOr =
  condB (== 60) (fixed A.lesserThan)

{-# INLINE ampersandOr #-}
ampersandOr :: BoundedPrim Word8 -> BoundedPrim Word8
ampersandOr =
  condB (== 38) (fixed A.ampersand)

{-# INLINE doubleQuoteOr #-}
doubleQuoteOr :: BoundedPrim Word8 -> BoundedPrim Word8
doubleQuoteOr =
  condB (== 34) (fixed A.doubleQuote)

{-# INLINE singleQuoteOr #-}
singleQuoteOr :: BoundedPrim Word8 -> BoundedPrim Word8
singleQuoteOr =
  condB (== 39) (fixed A.singleQuote)


text:
@import "../../variables.css";

.popoverTarget {
  position: static;
  display: inline-block;
}

.popoverPop {
  position: fixed;
  display: inline-block;
  padding: var(--gutter-static);
  border: 1px solid var(--color-border-p2);
  background-color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  outline: 0;
  pointer-events: all;

  & p {
    padding: 0;
    margin: 0;
  }
}

/* No padding on content */
.popoverPop.noPadding {
  padding: 0;
}

/* Transition */
.transition {
  opacity: 0;
  transition: opacity 0.07s;
}

.transition-entering {
  opacity: 0;
}

.transition-entered {
  opacity: 1;
}


text:
<?php
namespace Aws\EKS;

use Aws\AwsClient;

/**
 * This client is used to interact with the **Amazon Elastic Container Service for Kubernetes** service.
 * @method \Aws\Result associateEncryptionConfig(array $args = [])
 * @method \GuzzleHttp\Promise\Promise associateEncryptionConfigAsync(array $args = [])
 * @method \Aws\Result associateIdentityProviderConfig(array $args = [])
 * @method \GuzzleHttp\Promise\Promise associateIdentityProviderConfigAsync(array $args = [])
 * @method \Aws\Result createAddon(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createAddonAsync(array $args = [])
 * @method \Aws\Result createCluster(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createClusterAsync(array $args = [])
 * @method \Aws\Result createFargateProfile(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createFargateProfileAsync(array $args = [])
 * @method \Aws\Result createNodegroup(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createNodegroupAsync(array $args = [])
 * @method \Aws\Result deleteAddon(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteAddonAsync(array $args = [])
 * @method \Aws\Result deleteCluster(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteClusterAsync(array $args = [])
 * @method \Aws\Result deleteFargateProfile(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteFargateProfileAsync(array $args = [])
 * @method \Aws\Result deleteNodegroup(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteNodegroupAsync(array $args = [])
 * @method \Aws\Result deregisterCluster(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deregisterClusterAsync(array $args = [])
 * @method \Aws\Result describeAddon(array $args = [])
 * @method \GuzzleHttp\Promise\Promise describeAddonAsync(array $args = [])
 * @method \Aws\Result describeAddonVersions(array $args = [])
 * @method \GuzzleHttp\Promise\Promise describeAddonVersionsAsync(array $args = [])
 * @method \Aws\Result describeCluster(array $args = [])
 * @method \GuzzleHttp\Promise\Promise describeClusterAsync(array $args = [])
 * @method \Aws\Result describeFargateProfile(array $args = [])
 * @method \GuzzleHttp\Promise\Promise describeFargateProfileAsync(array $args = [])
 * @method \Aws\Result describeIdentityProviderConfig(array $args = [])
 * @method \GuzzleHttp\Promise\Promise describeIdentityProviderConfigAsync(array $args = [])
 * @method \Aws\Result describeNodegroup(array $args = [])
 * @method \GuzzleHttp\Promise\Promise describeNodegroupAsync(array $args = [])
 * @method \Aws\Result describeUpdate(array $args = [])
 * @method \GuzzleHttp\Promise\Promise describeUpdateAsync(array $args = [])
 * @method \Aws\Result disassociateIdentityProviderConfig(array $args = [])
 * @method \GuzzleHttp\Promise\Promise disassociateIdentityProviderConfigAsync(array $args = [])
 * @method \Aws\Result listAddons(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listAddonsAsync(array $args = [])
 * @method \Aws\Result listClusters(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listClustersAsync(array $args = [])
 * @method \Aws\Result listFargateProfiles(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listFargateProfilesAsync(array $args = [])
 * @method \Aws\Result listIdentityProviderConfigs(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listIdentityProviderConfigsAsync(array $args = [])
 * @method \Aws\Result listNodegroups(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listNodegroupsAsync(array $args = [])
 * @method \Aws\Result listTagsForResource(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
 * @method \Aws\Result listUpdates(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listUpdatesAsync(array $args = [])
 * @method \Aws\Result registerCluster(array $args = [])
 * @method \GuzzleHttp\Promise\Promise registerClusterAsync(array $args = [])
 * @method \Aws\Result tagResource(array $args = [])
 * @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
 * @method \Aws\Result untagResource(array $args = [])
 * @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
 * @method \Aws\Result updateAddon(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateAddonAsync(array $args = [])
 * @method \Aws\Result updateClusterConfig(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateClusterConfigAsync(array $args = [])
 * @method \Aws\Result updateClusterVersion(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateClusterVersionAsync(array $args = [])
 * @method \Aws\Result updateNodegroupConfig(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateNodegroupConfigAsync(array $args = [])
 * @method \Aws\Result updateNodegroupVersion(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateNodegroupVersionAsync(array $args = [])
 */
class EKSClient extends AwsClient {}


text:
<?php
    /****************************************************************/
    /* ATutor Calendar Module                                       */
    /* https://atutorcalendar.wordpress.com/                        */
    /*                                                              */
    /* This module provides standard calendar features in ATutor.   */
    /*                                                              */
    /* Author: Anurup Raveendran, Herat Gandhi                      */
    /* This program is free software. You can redistribute it and/or*/
    /* modify it under the terms of the GNU General Public License  */
    /* as published by the Free Software Foundation.                */
    /****************************************************************/

    /*******
     * module_uninstall.php performs reversion of module_install.php
     */

    /*******
     * the line below safe-guards this file from being accessed directly from
     * a web browser. It will only execute if required from within an ATutor script,
     * in our case the Module::uninstall() method.
     */
    if (!defined('AT_INCLUDE_PATH')) {
        exit;
    }

    /********
     * the following code is used for removing a module-specific directory created in module_install.php.
     * it generates appropriate error messages to aid in its creation.
     */
    $directory = AT_CONTENT_DIR .'calendar';

    // check if the directory exists
    if (is_dir($directory)) {
        require(AT_INCLUDE_PATH.'../mods/_core/file_manager/filemanager.inc.php');

        if (!clr_dir($directory))
            $msg->addError(array('MODULE_UNINSTALL', '<li>'.$directory.' can not be removed. Please manually remove it.</li>'));
    }

    /******
     * the following code checks if there are any errors (generated previously)
     * then uses the SqlUtility to run reverted database queries of module.sql,
     * ie. "create table" statement in module.sql is run as drop according table.
     */
    if (!$msg->containsErrors() && file_exists(dirname(__FILE__) . '/module.sql')) {
        // deal with the SQL file:
        require(AT_INCLUDE_PATH . 'classes/sqlutility.class.php');
        $sqlUtility = new SqlUtility();

        /*
         * the SQL file could be stored anywhere, and named anything, "module.sql" is simply
         * a convention we're using.
        */
        $sqlUtility->revertQueryFromFile(dirname(__FILE__) . '/module.sql', TABLE_PREFIX);
    }

?>


text:
package com.hp.autonomy.frontend.find.core.configuration.export;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.hp.autonomy.frontend.configuration.SimpleComponent;
import com.hp.autonomy.frontend.configuration.validation.OptionalConfigurationComponent;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

@SuppressWarnings({"InstanceVariableOfConcreteClass", "WeakerAccess"})
@Data
@EqualsAndHashCode(callSuper = false)
@Builder
@JsonDeserialize(builder = ExportConfig.ExportConfigBuilder.class)
public class ExportConfig extends SimpleComponent<ExportConfig> implements OptionalConfigurationComponent<ExportConfig> {
    private final PowerPointConfig powerpoint;

    @Override
    public Boolean getEnabled() {
        return true;
    }

    @JsonPOJOBuilder(withPrefix = "")
    public static class ExportConfigBuilder {}
}


text:
\hypertarget{dir_2a84f73b1e701dee5c24f1a567c8573a}{}\section{ftc-\/library/src/main/java/com/lasarobotics/library/drive Directory Reference}
\label{dir_2a84f73b1e701dee5c24f1a567c8573a}\index{ftc-\/library/src/main/java/com/lasarobotics/library/drive Directory Reference@{ftc-\/library/src/main/java/com/lasarobotics/library/drive Directory Reference}}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item
file {\bfseries Mecanum.\+java}
\item
file {\bfseries Swerve.\+java}
\item
file {\bfseries Tank.\+java}
\end{DoxyCompactItemize}


text:
package pl.addressbook.tests;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import pl.addressbook.model.ContactData;

import java.util.Arrays;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactPhonesTests extends TestBase {
   @BeforeMethod
   public void ensurePreconditions() {
      if (app.contact().all().size() == 0) {
         app.contact().createContact(new ContactData().withFirstname("Damian").withLastname("Litkowiec")
                 .withAddress("Lublin").withMobilePhone("123456789").withHomePhone("111").withMobilePhone("222")
                 .withWorkPhone("333").withEmail("litkowiec.damian@gmail.com").withEmail2("litkowiec.damian@gmail.com")
                 .withEmail3("litkowiec.damian@gmail.com"));//.withGroup("name 0"));
      }
   }

   @Test
   public void testContactPhones() {
      ContactData contact = app.contact().all().iterator().next();
      ContactData contactInfoFromEditForm = app.contact().infoFromEditForm(contact);

      assertThat(contact.getAddress(), equalTo(cleaned(contactInfoFromEditForm.getAddress())));
      assertThat(contact.getAllEmails(), equalTo(mergeEmails(contactInfoFromEditForm)));
      assertThat(contact.getAllPhones(), equalTo(mergePhones(contactInfoFromEditForm)));
   }

   private String mergePhones(ContactData contact) {
      return Arrays.asList(contact.getHomePhone(), contact.getMobilePhone(), contact.getWorkPhone())
              .stream().filter((s) -> !s.equals(""))
              .map(ContactPhonesTests::cleaned)
              .collect(Collectors.joining("\n"));
   }

   private String mergeEmails(ContactData contact) {
      return Arrays.asList(contact.getEmail(), contact.getEmail2(), contact.getEmail3())
              .stream().filter((s) -> !s.equals(""))
              .map(ContactPhonesTests::cleaned)
              .collect(Collectors.joining("\n"));
   }

   public static String cleaned(String replaceChar) {
      return replaceChar.replaceAll("\\s", "").replaceAll("[-()]", "");
   }
}


text:
export { SkyContribListActionBarComponent } from './list-action-bar.component';
export { SkyContribListActionBarItemComponent } from './list-action-bar-item.component';
export { SkyContribListActionBarModule } from './list-action-bar.module';


text:
/*jshint node:true */
/*global describe:false, it:false */

'use strict';

var should = require('chai').should();
var expect = require('chai').expect;
var stopForumSpam = require('../index');

describe('StopForumSpam', function() {
    var sfs = stopForumSpam;

    describe('.url', function() {
        it('should match the site\'s url', function() {
            expect(sfs).to.have.property('url','http://www.stopforumspam.com/api?');
        });
    });

    describe('.apiToken', function() {
        it('should match the environment variable for the token', function(){
            expect(sfs).to.have.property('apiToken', process.env.SFS_TOKEN);
        });
    });
});


text:
use libc::c_int;
use std::mem;
use std::rt::task::BlockedTask;
use std::rt::rtio::IoResult;

use access;
use homing::{HomeHandle, HomingMissile};
use timer::TimerWatcher;
use uvll;
use uvio::UvIoFactory;
use {Loop, UvError, uv_error_to_io_error, Request, wakeup};
use {UvHandle, wait_until_woken_after};

/// Management of a timeout when gaining access to a portion of a duplex stream.
pub struct AccessTimeout<T> {
    state: TimeoutState,
    timer: Option<Box<TimerWatcher>>,
    pub access: access::Access<T>,
}

pub struct Guard<'a, T:'static> {
    state: &'a mut TimeoutState,
    pub access: access::Guard<'a, T>,
    pub can_timeout: bool,
}

#[deriving(PartialEq)]
enum TimeoutState {
    NoTimeout,
    TimeoutPending(ClientState),
    TimedOut,
}

#[deriving(PartialEq)]
enum ClientState {
    NoWaiter,
    AccessPending,
    RequestPending,
}

struct TimerContext {
    timeout: *mut AccessTimeout<()>,
    callback: fn(*mut AccessTimeout<()>, &TimerContext),
    user_unblock: fn(uint) -> Option<BlockedTask>,
    user_payload: uint,
}

impl<T: Send> AccessTimeout<T> {
    pub fn new(data: T) -> AccessTimeout<T> {
        AccessTimeout {
            state: NoTimeout,
            timer: None,
            access: access::Access::new(data),
        }
    }

    /// Grants access to half of a duplex stream, timing out if necessary.
    ///
    /// On success, Ok(Guard) is returned and access has been granted to the
    /// stream. If a timeout occurs, then Err is returned with an appropriate
    /// error.
    pub fn grant<'a>(&'a mut self, m: HomingMissile) -> IoResult<Guard<'a, T>> {
        // First, flag that we're attempting to acquire access. This will allow
        // us to cancel the pending grant if we timeout out while waiting for a
        // grant.
        match self.state {
            NoTimeout => {},
            TimeoutPending(ref mut client) => *client = AccessPending,
            TimedOut => return Err(uv_error_to_io_error(UvError(uvll::ECANCELED)))
        }
        let access = self.access.grant(self as *mut _ as uint, m);

        // After acquiring the grant, we need to flag ourselves as having a
        // pending request so the timeout knows to cancel the request.
        let can_timeout = match self.state {
            NoTimeout => false,
            TimeoutPending(ref mut client) => { *client = RequestPending; true }
            TimedOut => return Err(uv_error_to_io_error(UvError(uvll::ECANCELED)))
        };

        Ok(Guard {
            access: access,
            state: &mut self.state,
            can_timeout: can_timeout
        })
    }

    pub fn timed_out(&self) -> bool {
        match self.state {
            TimedOut => true,
            _ => false,
        }
    }

    /// Sets the pending timeout to the value specified.
    ///
    /// The home/loop variables are used to construct a timer if one has not
    /// been previously constructed.
    ///
    /// The callback will be invoked if the timeout elapses, and the data of
    /// the time will be set to `data`.
    pub fn set_timeout(&mut self, ms: Option<u64>,
                       home: &HomeHandle,
                       loop_: &Loop,
                       cb: fn(uint) -> Option<BlockedTask>,
                       data: uint) {
        self.state = NoTimeout;
        let ms = match ms {
            Some(ms) => ms,
            None => return match self.timer {
                Some(ref mut t) => t.stop(),
                None => {}
            }
        };

        // If we have a timeout, lazily initialize the timer which will be used
        // to fire when the timeout runs out.
        if self.timer.is_none() {
            let mut timer = box TimerWatcher::new_home(loop_, home.clone());
            let mut cx = box TimerContext {
                timeout: self as *mut _ as *mut AccessTimeout<()>,
                callback: real_cb::<T>,
                user_unblock: cb,
                user_payload: data,
            };
            unsafe {
                timer.set_data(&mut *cx);
                mem::forget(cx);
            }
            self.timer = Some(timer);
        }

        let timer = self.timer.as_mut().unwrap();
        unsafe {
            let cx = uvll::get_data_for_uv_handle(timer.handle);
            let cx = cx as *mut TimerContext;
            (*cx).user_unblock = cb;
            (*cx).user_payload = data;
        }
        timer.stop();
        timer.start(timer_cb, ms, 0);
        self.state = TimeoutPending(NoWaiter);

        extern fn timer_cb(timer: *mut uvll::uv_timer_t) {
            let cx: &TimerContext = unsafe {
                &*(uvll::get_data_for_uv_handle(timer) as *const TimerContext)
            };
            (cx.callback)(cx.timeout, cx);
        }

        fn real_cb<T: Send>(timeout: *mut AccessTimeout<()>, cx: &TimerContext) {
            let timeout = timeout as *mut AccessTimeout<T>;
            let me = unsafe { &mut *timeout };

            match mem::replace(&mut me.state, TimedOut) {
                TimedOut | NoTimeout => unreachable!(),
                TimeoutPending(NoWaiter) => {}
                TimeoutPending(AccessPending) => {
                    match unsafe { me.access.dequeue(me as *mut _ as uint) } {
                        Some(task) => task.reawaken(),
                        None => unreachable!(),
                    }
                }
                TimeoutPending(RequestPending) => {
                    match (cx.user_unblock)(cx.user_payload) {
                        Some(task) => task.reawaken(),
                        None => unreachable!(),
                    }
                }
            }
        }
    }
}

impl<T: Send> Clone for AccessTimeout<T> {
    fn clone(&self) -> AccessTimeout<T> {
        AccessTimeout {
            access: self.access.clone(),
            state: NoTimeout,
            timer: None,
        }
    }
}

#[unsafe_destructor]
impl<'a, T> Drop for Guard<'a, T> {
    fn drop(&mut self) {
        match *self.state {
            TimeoutPending(NoWaiter) | TimeoutPending(AccessPending) =>
                unreachable!(),

            NoTimeout | TimedOut => {}
            TimeoutPending(RequestPending) => {
                *self.state = TimeoutPending(NoWaiter);
            }
        }
    }
}

#[unsafe_destructor]
impl<T> Drop for AccessTimeout<T> {
    fn drop(&mut self) {
        match self.timer {
            Some(ref timer) => unsafe {
                let data = uvll::get_data_for_uv_handle(timer.handle);
                let _data: Box<TimerContext> = mem::transmute(data);
            },
            None => {}
        }
    }
}

////////////////////////////////////////////////////////////////////////////////
// Connect timeouts
////////////////////////////////////////////////////////////////////////////////

pub struct ConnectCtx {
    pub status: c_int,
    pub task: Option<BlockedTask>,
    pub timer: Option<Box<TimerWatcher>>,
}

impl ConnectCtx {
    pub fn connect<T>(
        mut self, obj: T, timeout: Option<u64>, io: &mut UvIoFactory,
        f: |&Request, &T, uvll::uv_connect_cb| -> c_int
    ) -> Result<T, UvError> {
        let mut req = Request::new(uvll::UV_CONNECT);
        let r = f(&req, &obj, connect_cb);
        return match r {
            0 => {
                req.defuse(); // uv callback now owns this request
                match timeout {
                    Some(t) => {
                        let mut timer = TimerWatcher::new(io);
                        timer.start(timer_cb, t, 0);
                        self.timer = Some(timer);
                    }
                    None => {}
                }
                wait_until_woken_after(&mut self.task, &io.loop_, || {
                    let data = &self as *const _ as *mut ConnectCtx;
                    match self.timer {
                        Some(ref mut timer) => unsafe { timer.set_data(data) },
                        None => {}
                    }
                    req.set_data(data);
                });
                // Make sure an erroneously fired callback doesn't have access
                // to the context any more.
                req.set_data(0 as *mut int);

                // If we failed because of a timeout, drop the TcpWatcher as
                // soon as possible because it's data is now set to null and we
                // want to cancel the callback ASAP.
                match self.status {
                    0 => Ok(obj),
                    n => { drop(obj); Err(UvError(n)) }
                }
            }
            n => Err(UvError(n))
        };

        extern fn timer_cb(handle: *mut uvll::uv_timer_t) {
            // Don't close the corresponding tcp request, just wake up the task
            // and let RAII take care of the pending watcher.
            let cx: &mut ConnectCtx = unsafe {
                &mut *(uvll::get_data_for_uv_handle(handle) as *mut ConnectCtx)
            };
            cx.status = uvll::ECANCELED;
            wakeup(&mut cx.task);
        }

        extern fn connect_cb(req: *mut uvll::uv_connect_t, status: c_int) {
            // This callback can be invoked with ECANCELED if the watcher is
            // closed by the timeout callback. In that case we just want to free
            // the request and be along our merry way.
            let req = Request::wrap(req);
            if status == uvll::ECANCELED { return }

            // Apparently on windows when the handle is closed this callback may
            // not be invoked with ECANCELED but rather another error code.
            // Either ways, if the data is null, then our timeout has expired
            // and there's nothing we can do.
            let data = unsafe { uvll::get_data_for_req(req.handle) };
            if data.is_null() { return }

            let cx: &mut ConnectCtx = unsafe { &mut *(data as *mut ConnectCtx) };
            cx.status = status;
            match cx.timer {
                Some(ref mut t) => t.stop(),
                None => {}
            }
            // Note that the timer callback doesn't cancel the connect request
            // (that's the job of uv_close()), so it's possible for this
            // callback to get triggered after the timeout callback fires, but
            // before the task wakes up. In that case, we did indeed
            // successfully connect, but we don't need to wake someone up. We
            // updated the status above (correctly so), and the task will pick
            // up on this when it wakes up.
            if cx.task.is_some() {
                wakeup(&mut cx.task);
            }
        }
    }
}

pub struct AcceptTimeout<T> {
    access: AccessTimeout<AcceptorState<T>>,
}

struct AcceptorState<T> {
    blocked_acceptor: Option<BlockedTask>,
    pending: Vec<IoResult<T>>,
}

impl<T: Send> AcceptTimeout<T> {
    pub fn new() -> AcceptTimeout<T> {
        AcceptTimeout {
            access: AccessTimeout::new(AcceptorState {
                blocked_acceptor: None,
                pending: Vec::new(),
            })
        }
    }

    pub fn accept(&mut self,
                  missile: HomingMissile,
                  loop_: &Loop) -> IoResult<T> {
        // If we've timed out but we're not closed yet, poll the state of the
        // queue to see if we can peel off a connection.
        if self.access.timed_out() && !self.access.access.is_closed(&missile) {
            let tmp = self.access.access.get_mut(&missile);
            return match tmp.pending.remove(0) {
                Some(msg) => msg,
                None => Err(uv_error_to_io_error(UvError(uvll::ECANCELED)))
            }
        }

        // Now that we're not polling, attempt to gain access and then peel off
        // a connection. If we have no pending connections, then we need to go
        // to sleep and wait for one.
        //
        // Note that if we're woken up for a pending connection then we're
        // guaranteed that the check above will not steal our connection due to
        // the single-threaded nature of the event loop.
        let mut guard = try!(self.access.grant(missile));
        if guard.access.is_closed() {
            return Err(uv_error_to_io_error(UvError(uvll::EOF)))
        }

        match guard.access.pending.remove(0) {
            Some(msg) => return msg,
            None => {}
        }

        wait_until_woken_after(&mut guard.access.blocked_acceptor, loop_, || {});

        match guard.access.pending.remove(0) {
            _ if guard.access.is_closed() => {
                Err(uv_error_to_io_error(UvError(uvll::EOF)))
            }
            Some(msg) => msg,
            None => Err(uv_error_to_io_error(UvError(uvll::ECANCELED)))
        }
    }

    pub unsafe fn push(&mut self, t: IoResult<T>) {
        let state = self.access.access.unsafe_get();
        (*state).pending.push(t);
        let _ = (*state).blocked_acceptor.take().map(|t| t.reawaken());
    }

    pub fn set_timeout(&mut self,
                       ms: Option<u64>,
                       loop_: &Loop,
                       home: &HomeHandle) {
        self.access.set_timeout(ms, home, loop_, cancel_accept::<T>,
                                self as *mut _ as uint);

        fn cancel_accept<T: Send>(me: uint) -> Option<BlockedTask> {
            unsafe {
                let me: &mut AcceptTimeout<T> = mem::transmute(me);
                (*me.access.access.unsafe_get()).blocked_acceptor.take()
            }
        }
    }

    pub fn close(&mut self, m: HomingMissile) {
        self.access.access.close(&m);
        let task = self.access.access.get_mut(&m).blocked_acceptor.take();
        drop(m);
        let _ = task.map(|t| t.reawaken());
    }
}

impl<T: Send> Clone for AcceptTimeout<T> {
    fn clone(&self) -> AcceptTimeout<T> {
        AcceptTimeout { access: self.access.clone() }
    }
}


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity$PlaceholderFragment"
    >

    <LinearLayout
	    android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:padding="0dp"
        >

    <SeekBar
        android:id="@+id/pbarFiles"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginRight="5dp"
         />

    <TextView
        android:id="@+id/tvTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="0dp"
        android:text="Title:" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:padding="0dp"
        >

        <!--
            android:text="@string/open"
            android:text="@string/sd"
            android:text="@string/pause"
            android:text="@string/resume"
            android:text="@string/stop"
            android:text="@string/backward"
            android:text="@string/forward"
            android:text="@string/info"

         -->

        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnOpen"
	        android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:onClick="onClickOpen"
            android:padding="5dp"
            android:src="@drawable/folder_10" />

	    <ToggleButton
			android:background="@drawable/button_selector"
	        android:id="@+id/chbLoop"
            android:layout_weight="1"
	        android:layout_width="wrap_content"
	        android:layout_height="match_parent"
	        android:checked="true"
	        android:gravity="center"
	        android:textOff=""
	        android:textOn="Loop"
	        />

     	<AutoCompleteTextView
			android:background="@drawable/button_selector"
		    android:id="@+id/actvTitle"
            android:layout_weight="10"
		    android:layout_width="wrap_content"
		    android:layout_height="match_parent"
		    android:text="UTF-8"
		    android:hint="tag encoding"
		    />

        <!-- Button
			android:background="@drawable/button_selector"
            android:id="@+id/btnTitle"
	        android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="10"
            android:onClick="onClick"
            android:padding="0dp"
            android:text="TITLE"
            /-->

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_marginTop="0dp"
        android:padding="0dp"
        >

        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnStartSD"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:onClick="onClick"
            android:padding="5dp"
            android:src="@drawable/pause_play" />

        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnStop"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="onClick"
            android:padding="0dp"
            android:src="@drawable/stop"
            />

        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnFirstRecord"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:layout_width="0dp"
            android:onClick="onClick"
            android:padding="0dp"
            android:src="@drawable/back"
            />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_marginTop="0dp"
        android:padding="0dp"
        >
        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnPrev"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:onClick="onClick"
            android:padding="5dp"
            android:src="@drawable/previous"
            />
        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnBackward"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="onClick"
            android:padding="0dp"
            android:src="@drawable/rewind_1"
            />
        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnForward"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="onClick"
            android:padding="0dp"
            android:src="@drawable/fast_forward_1"
            />
        <ImageButton
			android:background="@drawable/button_selector"
            android:id="@+id/btnNext"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="onClick"
            android:padding="0dp"
            android:src="@drawable/skip"
            />

        </LinearLayout>

    <TextView
        android:id="@+id/textView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="Status:" />
    </LinearLayout>
    <LinearLayout
	    android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:padding="0dp" >

	<SeekBar
        android:id="@+id/pbarSound"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginRight="5dp"
         />

        <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView1"
        android:src="@drawable/picture" />

     <!--ProgressBar
        android:id="@+id/pbarSound"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@android:style/Widget.ProgressBar.Horizontal"
        android:layout_marginRight="5dp"
         /-->
    </LinearLayout>

</LinearLayout>