text:
package org.bitcoinj.core;

import java.math.BigInteger;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: HashEngineering
 * Date: 8/13/13
 * Time: 7:23 PM
 * To change this template use File | Settings | File Templates.
 */
public class CoinDefinition {

    public static final String coinName = "MaxCoin";
    public static final String coinTicker = "MAX";
    public static final String coinURIScheme = "maxcoin";
    public static final String cryptsyMarketId = "152";
    public static final String cryptsyMarketCurrency = "BTC";
    public static final String PATTERN_PRIVATE_KEY_START = "5";
    public static final String PATTERN_PRIVATE_KEY_START_COMPRESSED = "[Q]";
    public static final String PATTERN_PRIVATE_KEY_START_TESTNET = "9";
    public static final String PATTERN_PRIVATE_KEY_START_COMPRESSED_TESTNET = "c";

    public static String lowerCaseCoinName() { return coinName.toLowerCase(); }

    public enum CoinPrecision {
        Coins,
        Millicoins,
    }
    public static final CoinPrecision coinPrecision = CoinPrecision.Coins;

    public static final String BLOCKEXPLORER_BASE_URL_PROD = "http://max.cryptoexplore.com/";    //blockr.io
    public static final String BLOCKEXPLORER_ADDRESS_PATH = "address/";
    public static final String BLOCKEXPLORER_TRANSACTION_PATH = "tx/";
    public static final String BLOCKEXPLORER_BLOCK_PATH = "block/";
    public static final String BLOCKEXPLORER_BASE_URL_TEST = BLOCKEXPLORER_BASE_URL_PROD;

    public static final String DONATION_ADDRESS = "mLhpkXGWyDy2YBFtTzF9c6jYRZ1HXzUjcr";  //http://foundation.maxcoin.co.uk/donate/

    public static final String UNSPENT_API_URL = "http://explorer.maxcoin.co.uk/chain/Maxcoin/unspent/";
    public enum UnspentAPIType {
        BitEasy,
        Blockr,
        Abe
    };
    public static final UnspentAPIType UnspentAPI = UnspentAPIType.Abe;

    public static boolean checkpointFileSupport = true;
    public static int checkpointDaysBack = 21;

    public static final int TARGET_TIMESPAN = (int)(180);  // 3 minutes per difficulty cycle, on average.
    public static final int TARGET_SPACING = (int)(30);  // 30 seconds per block.
    public static final int INTERVAL = TARGET_TIMESPAN / TARGET_SPACING;  //108 blocks

    public static final int getInterval(int height, boolean testNet) {
            return INTERVAL;      //108
    }
    public static final int getIntervalCheckpoints() {
            return INTERVAL * 500;    //1080
    }

    public static int spendableCoinbaseDepth = 120; //main.h: static const int COINBASE_MATURITY
    public static final int MAX_MONEY = 106058400;//).multiply(Utils.COIN);                 //main.h:  MAX_MONEY
    //public static final String MAX_MONEY_STRING = "200000000";     //main.h:  MAX_MONEY

    public static final Coin DEFAULT_MIN_TX_FEE = Coin.valueOf(10000);   // MIN_TX_FEE
    public static final Coin DUST_LIMIT = Coin.valueOf(10000); //main.h CTransaction::GetMinFee        0.01 coins

    public static final int PROTOCOL_VERSION = 70005;          //version.h PROTOCOL_VERSION
    public static final int MIN_PROTOCOL_VERSION = 70000;        //version.h MIN_PROTO_VERSION - eliminate 60001 which are on the wrong fork
    public static final int INIT_PROTO_VERSION = 70000;            //version.h

    public static final int BLOCK_CURRENTVERSION = 1;   //CBlock::CURRENT_VERSION
    public static final int MAX_BLOCK_SIZE = 1 * 1000 * 1000;

    public static final boolean supportsBloomFiltering = false; //Requires PROTOCOL_VERSION 70000 in the client
    public static boolean supportsIrcDiscovery() {
        return PROTOCOL_VERSION <= 70000;
    }

    public static final int Port    = 8668;       //protocol.h GetDefaultPort(testnet=false)
    public static final int TestPort = 18668;     //protocol.h GetDefaultPort(testnet=true)

    //
    //  Production
    //
    public static final int AddressHeader = 110;             //base58.h CBitcoinAddress::PUBKEY_ADDRESS
    public static final int p2shHeader = 112;             //base58.h CBitcoinAddress::SCRIPT_ADDRESS
    public static final boolean allowBitcoinPrivateKey = true; //for backward compatibility with previous version of digitalcoin
    public static final long PacketMagic = 0xf9bebbd2;      //0xf9, 0xbe, 0xbb, 0xd2

    //Genesis Block Information from main.cpp: LoadBlockIndex
    static public long genesisBlockDifficultyTarget = (0x1e00ffff);         //main.cpp: LoadBlockIndex
    static public long genesisBlockTime = 1390822264L;                       //main.cpp: LoadBlockIndex
    static public long genesisBlockNonce = (11548217);                         //main.cpp: LoadBlockIndex
    static public String genesisHash = "0000002d0f86558a6e737a3a351043ee73906fe077692dfaa3c9328aaca21964"; //main.cpp: hashGenesisBlock
    static public int genesisBlockValue = 5;                                                              //main.cpp: LoadBlockIndex
    static public final int genesisBlockVersion = 112;
    //taken from the raw data of the block explorer
    static public String genesisTxInBytes = "04ffff001d01043453686170652d7368696674696e6720736f66747761726520646566656e647320616761696e737420626f746e6574206861636b73";   //"Digitalcoin, A Currency for a Digital Age"
    static public String genesisTxOutBytes = "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f";

    //net.cpp strDNSSeed
    static public String[] dnsSeeds = new String[] {
            "dnsseed.maxcoin.co.uk"
     };

    public static int minBroadcastConnections = 1;   //0 for default; we need more peers.

    //
    // TestNet - digitalcoin - not tested
    //
    public static final boolean supportsTestNet = false;
    public static final int testnetAddressHeader = 127;             //base58.h CBitcoinAddress::PUBKEY_ADDRESS_TEST
    public static final int testnetp2shHeader = 130;             //base58.h CBitcoinAddress::SCRIPT_ADDRESS_TEST
    public static final long testnetPacketMagic = 0x1e00ffff;      //0xfc, 0xc1, 0xb7, 0xdc
    public static final String testnetGenesisHash = "0000000a23e3eb42dc87b61d4015c80ffd85471d34e2c7210c7ca63b78a58612";
    static public long testnetGenesisBlockDifficultyTarget = (0x1e0ffff0L);         //main.cpp: LoadBlockIndex
    static public long testnetGenesisBlockTime = 1390434081L;                       //main.cpp: LoadBlockIndex
    static public long testnetGenesisBlockNonce = (1582968);                         //main.cpp: LoadBlockIndex

    public static int subsidyDecreaseBlockCount = 60*24*365*4;     //main.cpp GetBlockValue(height, fee)

    public static BigInteger proofOfWorkLimit = Utils.decodeCompactBits(0x1e00ffff);  //main.cpp bnProofOfWorkLimit (~uint256(0) >> 20); // digitalcoin: starting difficulty is 1 / 2^12

    static public String[] testnetDnsSeeds = new String[] {
          "not supported"
    };
    //from main.h: CAlert::CheckSignature
    public static final String SATOSHI_KEY = "04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284";
    public static final String TESTNET_SATOSHI_KEY = "04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a";

    /** The string returned by getId() for the main, production network where people trade things. */
    public static final String ID_MAINNET = "org.maxcoin.production";
    /** The string returned by getId() for the testnet. */
    public static final String ID_TESTNET = "org.maxcoin.test";
    /** Unit test network. */
    public static final String ID_UNITTESTNET = "com.google.maxcoin.unittest";

    //checkpoints.cpp Checkpoints::mapCheckpoints
    public static void initCheckpoints(Map<Integer, Sha256Hash> checkpoints)
    {

    }

    //Unit Test Information
    public static final String UNITTEST_ADDRESS = "DPHYTSm3f96dHRY3VG1vZAFC1QrEPkEQnt";
    public static final String UNITTEST_ADDRESS_PRIVATE_KEY = "QU1rjHbrdJonVUgjT7Mncw7PEyPv3fMPvaGXp9EHDs1uzdJ98hUZ";

}


text:
osReadWriteLock::osReadWriteLock()
{
    InitializeSRWLock(&m_rwlock);
}

osReadWriteLock::~osReadWriteLock()
{
}

void osReadWriteLock::lockRead()
{
    AcquireSRWLockShared(&m_rwlock);
}

bool osReadWriteLock::tryLockRead()
{
    return FALSE != TryAcquireSRWLockShared(&m_rwlock);
}

void osReadWriteLock::unlockRead()
{
    ReleaseSRWLockShared(&m_rwlock);
}

void osReadWriteLock::lockWrite()
{
    AcquireSRWLockExclusive(&m_rwlock);
}

bool osReadWriteLock::tryLockWrite()
{
    return FALSE != TryAcquireSRWLockExclusive(&m_rwlock);
}

void osReadWriteLock::unlockWrite()
{
    ReleaseSRWLockExclusive(&m_rwlock);
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>There and Back</title>
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/styles.css" rel="stylesheet">

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            Toggle navigation

            </button>

home

postcards

my adventures

favorites

my account

bank

Add Your Bank Account

                        <form role="form">

                                Routing Number
                                <input type="email" class="form-control" id="user" placeholder="123456789">

                                Account Number
                                <input type="email" class="form-control" id="user" placeholder="987654321">

                                Confirm Account
                                <input type="email" class="form-control" id="user" placeholder="987654321">

                            Accept and Continue
                        </form>


text:
import { Node, INodeOption } from './Node';

export interface ILightOption extends INodeOption {}

interface ILightUniformTemplate<T> {
    type: string;
    value: (instance: Light) => T
}

export class Light extends Node {

    constructor(option?: ILightOption);

    color: number[];

    intensity: number;

    castShadow: boolean;

    shadowResolution: number;
}


text:
List the name of available tables (only the usable ones)

#### Using the function

```sql
--- Returns a row for each table having given permission with the table name.
--- It also returns tables from others users if you've permission to see them. For example, consider the following scenario:
--- User X and User Y at account C.
--- User X has a public table T.
--- User Y will see table T.
--- Currently accepted permissions are: 'public', 'private' or 'all'
SELECT CDB_UserTables(perms)
```

REF: https://github.com/CartoDB/cartodb-postgresql/blob/master/scripts-available/CDB_UserTables.sql


text:
__IMPORTANT!__

In this release __we moved Resque jobs under own gitlab namespace__.

Despite a lot of advantages it requires from our users to __replace gitolite post-receive hook with new one__.

Most of projects has post-receive file as symlink to gitolite `/home/git/.gitolite/hooks/post-receive`.
But some of them may have a real file. In this case you should rewrite it with symlink to gitolite hook.

I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you

- - -

### 1. Stop server & resque

    sudo service gitlab stop

### 2. Update GitLab

```bash

# Get latest code
sudo -u gitlab -H git fetch
sudo -u gitlab -H git checkout v3.1.0

# Install new charlock_holmes
sudo gem install charlock_holmes --version '0.6.9'

# Install gems for MySQL
sudo -u gitlab -H bundle install --without development test postgres sqlite

# Migrate db
sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production

```

### 3. Update post-receive hooks

#### Gitolite 3

Step 1: Rewrite post-receive hook

```bash
# Rewrite hook for gitolite 3
sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
```

Step 2: Rewrite hooks in all projects to symlink gitolite hook

```bash
# 1. Check for valid path
sudo -u gitlab -H vim lib/support/rewrite-hooks.sh

# 2. Run script
sudo -u git -H lib/support/rewrite-hooks.sh
```

#### Gitolite v2

Step 1: rewrite post-receive hook for gitolite 2

```
sudo cp ./lib/hooks/post-receive /home/git/share/gitolite/hooks/common/post-receive
sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive
```

Step 2: Replace symlinks in project to valid place

    #!/bin/bash
    src="/home/git/repositories"
    for dir in `ls "$src/"`
    do
      if [ -d "$src/$dir" ]; then

        if [ "$dir" = "gitolite-admin.git" ]
        then
          continue
        fi

        project_hook="$src/$dir/hooks/post-receive"
        gitolite_hook="/home/git/share/gitolite/hooks/common/post-receive"

        ln -s -f $gitolite_hook $project_hook
      fi
    done

### 4. Check app status

```bash

# Check APP Status
sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production

```

### 5. Start all

    sudo service gitlab start


text:
package com.thoughtworks.go.domain.materials;

/**
 * Knows how to get a string representation of revision.
 */
public interface Revision {
    public String getRevision();
    public String getRevisionUrl();
    public boolean isRealRevision();
}


text:
package com.udmurtlyk.extrainputmethod.latin.userdictionary;

import com.udmurtlyk.extrainputmethod.latin.R;

import android.app.ListFragment;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.provider.UserDictionary;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AlphabetIndexer;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SectionIndexer;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;

import java.util.Locale;

// Caveat: This class is basically taken from
// packages/apps/Settings/src/com/android/settings/inputmethod/UserDictionarySettings.java
// in order to deal with some devices that have issues with the user dictionary handling

public class UserDictionarySettings extends ListFragment {

    public static final boolean IS_SHORTCUT_API_SUPPORTED =
            Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;

    private static final String[] QUERY_PROJECTION_SHORTCUT_UNSUPPORTED =
            { UserDictionary.Words._ID, UserDictionary.Words.WORD};
    private static final String[] QUERY_PROJECTION_SHORTCUT_SUPPORTED =
            { UserDictionary.Words._ID, UserDictionary.Words.WORD, UserDictionary.Words.SHORTCUT};
    private static final String[] QUERY_PROJECTION =
            IS_SHORTCUT_API_SUPPORTED ?
                    QUERY_PROJECTION_SHORTCUT_SUPPORTED : QUERY_PROJECTION_SHORTCUT_UNSUPPORTED;

    // The index of the shortcut in the above array.
    private static final int INDEX_SHORTCUT = 2;

    private static final String[] ADAPTER_FROM_SHORTCUT_UNSUPPORTED = {
        UserDictionary.Words.WORD,
    };

    private static final String[] ADAPTER_FROM_SHORTCUT_SUPPORTED = {
        UserDictionary.Words.WORD, UserDictionary.Words.SHORTCUT
    };

    private static final String[] ADAPTER_FROM = IS_SHORTCUT_API_SUPPORTED ?
            ADAPTER_FROM_SHORTCUT_SUPPORTED : ADAPTER_FROM_SHORTCUT_UNSUPPORTED;

    private static final int[] ADAPTER_TO_SHORTCUT_UNSUPPORTED = {
        android.R.id.text1,
    };

    private static final int[] ADAPTER_TO_SHORTCUT_SUPPORTED = {
        android.R.id.text1, android.R.id.text2
    };

    private static final int[] ADAPTER_TO = IS_SHORTCUT_API_SUPPORTED ?
            ADAPTER_TO_SHORTCUT_SUPPORTED : ADAPTER_TO_SHORTCUT_UNSUPPORTED;

    // Either the locale is empty (means the word is applicable to all locales)
    // or the word equals our current locale
    private static final String QUERY_SELECTION =
            UserDictionary.Words.LOCALE + "=?";
    private static final String QUERY_SELECTION_ALL_LOCALES =
            UserDictionary.Words.LOCALE + " is null";

    private static final String DELETE_SELECTION_WITH_SHORTCUT = UserDictionary.Words.WORD
            + "=? AND " + UserDictionary.Words.SHORTCUT + "=?";
    private static final String DELETE_SELECTION_WITHOUT_SHORTCUT = UserDictionary.Words.WORD
            + "=? AND " + UserDictionary.Words.SHORTCUT + " is null OR "
            + UserDictionary.Words.SHORTCUT + "=''";
    private static final String DELETE_SELECTION_SHORTCUT_UNSUPPORTED =
            UserDictionary.Words.WORD + "=?";

    private static final int OPTIONS_MENU_ADD = Menu.FIRST;

    private Cursor mCursor;

    protected String mLocale;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getActivity().getActionBar().setTitle(R.string.edit_personal_dictionary);
    }

    @Override
    public View onCreateView(
            LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(
                R.layout.user_dictionary_preference_list_fragment, container, false);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        final Intent intent = getActivity().getIntent();
        final String localeFromIntent =
                null == intent ? null : intent.getStringExtra("locale");

        final Bundle arguments = getArguments();
        final String localeFromArguments =
                null == arguments ? null : arguments.getString("locale");

        final String locale;
        if (null != localeFromArguments) {
            locale = localeFromArguments;
        } else if (null != localeFromIntent) {
            locale = localeFromIntent;
        } else {
            locale = null;
        }

        mLocale = locale;
        // WARNING: The following cursor is never closed! TODO: don't put that in a member, and
        // make sure all cursors are correctly closed. Also, this comes from a call to
        // Activity#managedQuery, which has been deprecated for a long time (and which FORBIDS
        // closing the cursor, so take care when resolving this TODO). We should either use a
        // regular query and close the cursor, or switch to a LoaderManager and a CursorLoader.
        mCursor = createCursor(locale);
        TextView emptyView = (TextView) getView().findViewById(android.R.id.empty);
        emptyView.setText(R.string.user_dict_settings_empty_text);

        final ListView listView = getListView();
        listView.setAdapter(createAdapter());
        listView.setFastScrollEnabled(true);
        listView.setEmptyView(emptyView);

        setHasOptionsMenu(true);
        // Show the language as a subtitle of the action bar
        getActivity().getActionBar().setSubtitle(
                UserDictionarySettingsUtils.getLocaleDisplayName(getActivity(), mLocale));
    }

    @SuppressWarnings("deprecation")
    private Cursor createCursor(final String locale) {
        // Locale can be any of:
        // - The string representation of a locale, as returned by Locale#toString()
        // - The empty string. This means we want a cursor returning words valid for all locales.
        // - null. This means we want a cursor for the current locale, whatever this is.
        // Note that this contrasts with the data inside the database, where NULL means "all
        // locales" and there should never be an empty string. The confusion is called by the
        // historical use of null for "all locales".
        // TODO: it should be easy to make this more readable by making the special values
        // human-readable, like "all_locales" and "current_locales" strings, provided they
        // can be guaranteed not to match locales that may exist.
        if ("".equals(locale)) {
            // Case-insensitive sort
            return getActivity().managedQuery(UserDictionary.Words.CONTENT_URI, QUERY_PROJECTION,
                    QUERY_SELECTION_ALL_LOCALES, null,
                    "UPPER(" + UserDictionary.Words.WORD + ")");
        } else {
            final String queryLocale = null != locale ? locale : Locale.getDefault().toString();
            return getActivity().managedQuery(UserDictionary.Words.CONTENT_URI, QUERY_PROJECTION,
                    QUERY_SELECTION, new String[] { queryLocale },
                    "UPPER(" + UserDictionary.Words.WORD + ")");
        }
    }

    private ListAdapter createAdapter() {
        return new MyAdapter(getActivity(), R.layout.user_dictionary_item, mCursor,
                ADAPTER_FROM, ADAPTER_TO, this);
    }

    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
        final String word = getWord(position);
        final String shortcut = getShortcut(position);
        if (word != null) {
            showAddOrEditDialog(word, shortcut);
        }
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        if (!UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
            final Locale systemLocale = getResources().getConfiguration().locale;
            if (!TextUtils.isEmpty(mLocale) && !mLocale.equals(systemLocale.toString())) {
                // Hide the add button for ICS because it doesn't support specifying a locale
                // for an entry. This new "locale"-aware API has been added in conjunction
                // with the shortcut API.
                return;
            }
        }
        MenuItem actionItem =
                menu.add(0, OPTIONS_MENU_ADD, 0, R.string.user_dict_settings_add_menu_title)
                .setIcon(R.drawable.ic_menu_add);
        actionItem.setShowAsAction(
                MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == OPTIONS_MENU_ADD) {
            showAddOrEditDialog(null, null);
            return true;
        }
        return false;
    }

    /**
     * Add or edit a word. If editingWord is null, it's an add; otherwise, it's an edit.
     * @param editingWord the word to edit, or null if it's an add.
     * @param editingShortcut the shortcut for this entry, or null if none.
     */
    private void showAddOrEditDialog(final String editingWord, final String editingShortcut) {
        final Bundle args = new Bundle();
        args.putInt(UserDictionaryAddWordContents.EXTRA_MODE, null == editingWord
                ? UserDictionaryAddWordContents.MODE_INSERT
                : UserDictionaryAddWordContents.MODE_EDIT);
        args.putString(UserDictionaryAddWordContents.EXTRA_WORD, editingWord);
        args.putString(UserDictionaryAddWordContents.EXTRA_SHORTCUT, editingShortcut);
        args.putString(UserDictionaryAddWordContents.EXTRA_LOCALE, mLocale);
        android.preference.PreferenceActivity pa =
                (android.preference.PreferenceActivity)getActivity();
        pa.startPreferencePanel(UserDictionaryAddWordFragment.class.getName(),
                args, R.string.user_dict_settings_add_dialog_title, null, null, 0);
    }

    private String getWord(final int position) {
        if (null == mCursor) return null;
        mCursor.moveToPosition(position);
        // Handle a possible race-condition
        if (mCursor.isAfterLast()) return null;

        return mCursor.getString(
                mCursor.getColumnIndexOrThrow(UserDictionary.Words.WORD));
    }

    private String getShortcut(final int position) {
        if (!IS_SHORTCUT_API_SUPPORTED) return null;
        if (null == mCursor) return null;
        mCursor.moveToPosition(position);
        // Handle a possible race-condition
        if (mCursor.isAfterLast()) return null;

        return mCursor.getString(
                mCursor.getColumnIndexOrThrow(UserDictionary.Words.SHORTCUT));
    }

    public static void deleteWord(final String word, final String shortcut,
            final ContentResolver resolver) {
        if (!IS_SHORTCUT_API_SUPPORTED) {
            resolver.delete(UserDictionary.Words.CONTENT_URI, DELETE_SELECTION_SHORTCUT_UNSUPPORTED,
                    new String[] { word });
        } else if (TextUtils.isEmpty(shortcut)) {
            resolver.delete(
                    UserDictionary.Words.CONTENT_URI, DELETE_SELECTION_WITHOUT_SHORTCUT,
                    new String[] { word });
        } else {
            resolver.delete(
                    UserDictionary.Words.CONTENT_URI, DELETE_SELECTION_WITH_SHORTCUT,
                    new String[] { word, shortcut });
        }
    }

    private static class MyAdapter extends SimpleCursorAdapter implements SectionIndexer {

        private AlphabetIndexer mIndexer;

        private ViewBinder mViewBinder = new ViewBinder() {

            @Override
            public boolean setViewValue(View v, Cursor c, int columnIndex) {
                if (!IS_SHORTCUT_API_SUPPORTED) {
                    // just let SimpleCursorAdapter set the view values
                    return false;
                }
                if (columnIndex == INDEX_SHORTCUT) {
                    final String shortcut = c.getString(INDEX_SHORTCUT);
                    if (TextUtils.isEmpty(shortcut)) {
                        v.setVisibility(View.GONE);
                    } else {
                        ((TextView)v).setText(shortcut);
                        v.setVisibility(View.VISIBLE);
                    }
                    v.invalidate();
                    return true;
                }

                return false;
            }
        };

        @SuppressWarnings("deprecation")
        public MyAdapter(Context context, int layout, Cursor c, String[] from, int[] to,
                UserDictionarySettings settings) {
            super(context, layout, c, from, to);

            if (null != c) {
                final String alphabet = context.getString(R.string.user_dict_fast_scroll_alphabet);
                final int wordColIndex = c.getColumnIndexOrThrow(UserDictionary.Words.WORD);
                mIndexer = new AlphabetIndexer(c, wordColIndex, alphabet);
            }
            setViewBinder(mViewBinder);
        }

        @Override
        public int getPositionForSection(int section) {
            return null == mIndexer ? 0 : mIndexer.getPositionForSection(section);
        }

        @Override
        public int getSectionForPosition(int position) {
            return null == mIndexer ? 0 : mIndexer.getSectionForPosition(position);
        }

        @Override
        public Object[] getSections() {
            return null == mIndexer ? null : mIndexer.getSections();
        }
    }
}


text:
package org.elasticsearch.test.integration.search.geo;

import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.geo.GeoDistance;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.test.integration.AbstractNodesTests;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.index.query.FilterBuilders.geoDistanceFilter;
import static org.elasticsearch.index.query.FilterBuilders.geoDistanceRangeFilter;
import static org.elasticsearch.index.query.QueryBuilders.filteredQuery;
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;

/**
 */
public class GeoDistanceTests extends AbstractNodesTests {

    private Client client;

    @BeforeClass
    public void createNodes() throws Exception {
        startNode("server1");
        startNode("server2");
        client = getClient();
    }

    @AfterClass
    public void closeNodes() {
        client.close();
        closeAllNodes();
    }

    protected Client getClient() {
        return client("server1");
    }

    @Test
    public void simpleDistanceTests() throws Exception {
        try {
            client.admin().indices().prepareDelete("test").execute().actionGet();
        } catch (Exception e) {
            // ignore
        }
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1")
                .startObject("properties").startObject("location").field("type", "geo_point").field("lat_lon", true).endObject().endObject()
                .endObject().endObject().string();
        client.admin().indices().prepareCreate("test").addMapping("type1", mapping).execute().actionGet();
        client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();

        client.prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject()
                .field("name", "New York")
                .startObject("location").field("lat", 40.7143528).field("lon", -74.0059731).endObject()
                .endObject()).execute().actionGet();

        // to NY: 5.286 km
        client.prepareIndex("test", "type1", "2").setSource(jsonBuilder().startObject()
                .field("name", "Times Square")
                .startObject("location").field("lat", 40.759011).field("lon", -73.9844722).endObject()
                .endObject()).execute().actionGet();

        // to NY: 0.4621 km
        client.prepareIndex("test", "type1", "3").setSource(jsonBuilder().startObject()
                .field("name", "Tribeca")
                .startObject("location").field("lat", 40.718266).field("lon", -74.007819).endObject()
                .endObject()).execute().actionGet();

        // to NY: 1.055 km
        client.prepareIndex("test", "type1", "4").setSource(jsonBuilder().startObject()
                .field("name", "Wall Street")
                .startObject("location").field("lat", 40.7051157).field("lon", -74.0088305).endObject()
                .endObject()).execute().actionGet();

        // to NY: 1.258 km
        client.prepareIndex("test", "type1", "5").setSource(jsonBuilder().startObject()
                .field("name", "Soho")
                .startObject("location").field("lat", 40.7247222).field("lon", -74).endObject()
                .endObject()).execute().actionGet();

        // to NY: 2.029 km
        client.prepareIndex("test", "type1", "6").setSource(jsonBuilder().startObject()
                .field("name", "Greenwich Village")
                .startObject("location").field("lat", 40.731033).field("lon", -73.9962255).endObject()
                .endObject()).execute().actionGet();

        // to NY: 8.572 km
        client.prepareIndex("test", "type1", "7").setSource(jsonBuilder().startObject()
                .field("name", "Brooklyn")
                .startObject("location").field("lat", 40.65).field("lon", -73.95).endObject()
                .endObject()).execute().actionGet();

        client.admin().indices().prepareRefresh().execute().actionGet();

        SearchResponse searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceFilter("location").distance("3km").point(40.7143528, -74.0059731)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(5l));
        assertThat(searchResponse.hits().hits().length, equalTo(5));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("4"), equalTo("5"), equalTo("6")));
        }
        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceFilter("location").distance("3km").point(40.7143528, -74.0059731).optimizeBbox("indexed")))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(5l));
        assertThat(searchResponse.hits().hits().length, equalTo(5));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("4"), equalTo("5"), equalTo("6")));
        }

        // now with a PLANE type
        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceFilter("location").distance("3km").geoDistance(GeoDistance.PLANE).point(40.7143528, -74.0059731)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(5l));
        assertThat(searchResponse.hits().hits().length, equalTo(5));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("4"), equalTo("5"), equalTo("6")));
        }

        // factor type is really too small for this resolution

        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceFilter("location").distance("2km").point(40.7143528, -74.0059731)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(4l));
        assertThat(searchResponse.hits().hits().length, equalTo(4));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("4"), equalTo("5")));
        }
        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceFilter("location").distance("2km").point(40.7143528, -74.0059731).optimizeBbox("indexed")))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(4l));
        assertThat(searchResponse.hits().hits().length, equalTo(4));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("4"), equalTo("5")));
        }

        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceFilter("location").distance("1.242mi").point(40.7143528, -74.0059731)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(4l));
        assertThat(searchResponse.hits().hits().length, equalTo(4));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("4"), equalTo("5")));
        }
        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceFilter("location").distance("1.242mi").point(40.7143528, -74.0059731).optimizeBbox("indexed")))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(4l));
        assertThat(searchResponse.hits().hits().length, equalTo(4));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("4"), equalTo("5")));
        }

        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceRangeFilter("location").from("1.0km").to("2.0km").point(40.7143528, -74.0059731)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(2l));
        assertThat(searchResponse.hits().hits().length, equalTo(2));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("4"), equalTo("5")));
        }
        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceRangeFilter("location").from("1.0km").to("2.0km").point(40.7143528, -74.0059731).optimizeBbox("indexed")))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(2l));
        assertThat(searchResponse.hits().hits().length, equalTo(2));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(hit.id(), anyOf(equalTo("4"), equalTo("5")));
        }

        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceRangeFilter("location").to("2.0km").point(40.7143528, -74.0059731)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(4l));
        assertThat(searchResponse.hits().hits().length, equalTo(4));

        searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoDistanceRangeFilter("location").from("2.0km").point(40.7143528, -74.0059731)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(3l));
        assertThat(searchResponse.hits().hits().length, equalTo(3));

        // SORTING

        searchResponse = client.prepareSearch().setQuery(matchAllQuery())
                .addSort(SortBuilders.geoDistanceSort("location").point(40.7143528, -74.0059731).order(SortOrder.ASC))
                .execute().actionGet();

        assertThat(searchResponse.hits().getTotalHits(), equalTo(7l));
        assertThat(searchResponse.hits().hits().length, equalTo(7));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("1"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(5).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(6).id(), equalTo("7"));

        searchResponse = client.prepareSearch().setQuery(matchAllQuery())
                .addSort(SortBuilders.geoDistanceSort("location").point(40.7143528, -74.0059731).order(SortOrder.DESC))
                .execute().actionGet();

        assertThat(searchResponse.hits().getTotalHits(), equalTo(7l));
        assertThat(searchResponse.hits().hits().length, equalTo(7));
        assertThat(searchResponse.hits().getAt(6).id(), equalTo("1"));
        assertThat(searchResponse.hits().getAt(5).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("7"));
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project name="rangefor" default="build">
	<description>
	Range for-loop optimization transform compiler plugin.
	</description>

	<target name="build" depends="plugin.jar" description="Builds the plugin" />
	<target name="clean" depends="clean.build" description="Cleans the build directory" />
	<target name="test" depends="test.all" description="Tests the plugin" />

	<property name="src.dir" value="${basedir}/src"/>
	<property name="test.dir" value="${basedir}/test"/>

	<property name="scalac.args" value=""/>
	<property name="scala.comp.jar" value="/usr/share/java/scala-compiler.jar"/>

	<property name="build.dir" value="${basedir}/build"/>
	<property name="build-jar.dir" value="${basedir}/jar"/>

	<target name="init">
		<taskdef resource="scala/tools/ant/antlib.xml">
			<classpath>
				<pathelement location="${scala.comp.jar}"/>
			</classpath>
		</taskdef>
	</target>

	<target name="plugin.compile" depends="init">
		<mkdir dir="${build.dir}"/>
		<scalac srcdir="${src.dir}" destdir="${build.dir}">
			<include name="RangeFor.scala"/>
			<classpath>
				<pathelement location="/usr/share/java/scala-library.jar"/>
				<pathelement location="${scala.comp.jar}"/>
			</classpath>
		</scalac>
	</target>

	<target name="plugin.jar" depends="plugin.compile">
		<mkdir dir="${build-jar.dir}"/>
		<jar destfile="${build-jar.dir}/rangefor.jar" manifest="${basedir}/MANIFEST.MF">
			<fileset dir="${build.dir}" />
			<fileset file="${basedir}/scalac-plugin.xml" />
		</jar>
	</target>

	<target name="clean.build">
		<remove dir="${build.dir}" />
	</target>

	<target name="test.compile.plain" depends="plugin.jar">
		<mkdir dir="${build.dir}/test-plain"/>
		<scalac srcdir="${test.dir}" destdir="${build.dir}/test-plain">
			<include name="*.scala"/>
			<classpath>
				<pathelement location="/usr/share/java/scala-library.jar"/>
				<pathelement location="${scala.comp.jar}"/>
			</classpath>
		</scalac>
	</target>

	<target name="test.compile.plugin" depends="plugin.jar">
		<mkdir dir="${build.dir}/test-plugin"/>
		<scalac srcdir="${test.dir}" destdir="${build.dir}/test-plugin" addParams="-Xplugin:${build-jar.dir}/rangefor.jar">
			<include name="*.scala"/>
			<classpath>
				<pathelement location="/usr/share/java/scala-library.jar"/>
				<pathelement location="${scala.comp.jar}"/>
			</classpath>
		</scalac>
	</target>

	<target name="test.all" depends="test.compile.plain, test.compile.plugin"/>
</project>


text:
package org.apache.flink.streaming.api.operators;

import org.apache.flink.api.common.state.ValueStateDescriptor;
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.common.typeutils.base.IntSerializer;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.streaming.api.TimeDomain;
import org.apache.flink.streaming.api.functions.ProcessFunction;
import org.apache.flink.streaming.api.watermark.Watermark;
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
import org.apache.flink.streaming.runtime.tasks.OperatorStateHandles;
import org.apache.flink.streaming.util.KeyedOneInputStreamOperatorTestHarness;
import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
import org.apache.flink.streaming.util.TestHarnessUtil;
import org.apache.flink.util.Collector;
import org.apache.flink.util.TestLogger;

import org.junit.Test;

import java.util.concurrent.ConcurrentLinkedQueue;

import static org.junit.Assert.assertEquals;

/**
 * Tests {@link KeyedProcessOperator}.
 */
public class KeyedProcessOperatorTest extends TestLogger {

	@Test
	public void testTimestampAndWatermarkQuerying() throws Exception {

		KeyedProcessOperator<Integer, Integer, String> operator =
				new KeyedProcessOperator<>(new QueryingFlatMapFunction(TimeDomain.EVENT_TIME));

		OneInputStreamOperatorTestHarness<Integer, String> testHarness =
				new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.open();

		testHarness.processWatermark(new Watermark(17));
		testHarness.processElement(new StreamRecord<>(5, 12L));

		testHarness.processWatermark(new Watermark(42));
		testHarness.processElement(new StreamRecord<>(6, 13L));

		ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();

		expectedOutput.add(new Watermark(17L));
		expectedOutput.add(new StreamRecord<>("5TIME:17 TS:12", 12L));
		expectedOutput.add(new Watermark(42L));
		expectedOutput.add(new StreamRecord<>("6TIME:42 TS:13", 13L));

		TestHarnessUtil.assertOutputEquals("Output was not correct.", expectedOutput, testHarness.getOutput());

		testHarness.close();
	}

	@Test
	public void testTimestampAndProcessingTimeQuerying() throws Exception {

		KeyedProcessOperator<Integer, Integer, String> operator =
				new KeyedProcessOperator<>(new QueryingFlatMapFunction(TimeDomain.PROCESSING_TIME));

		OneInputStreamOperatorTestHarness<Integer, String> testHarness =
				new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.open();

		testHarness.setProcessingTime(17);
		testHarness.processElement(new StreamRecord<>(5));

		testHarness.setProcessingTime(42);
		testHarness.processElement(new StreamRecord<>(6));

		ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();

		expectedOutput.add(new StreamRecord<>("5TIME:17 TS:null"));
		expectedOutput.add(new StreamRecord<>("6TIME:42 TS:null"));

		TestHarnessUtil.assertOutputEquals("Output was not correct.", expectedOutput, testHarness.getOutput());

		testHarness.close();
	}

	@Test
	public void testEventTimeTimers() throws Exception {

		KeyedProcessOperator<Integer, Integer, Integer> operator =
				new KeyedProcessOperator<>(new TriggeringFlatMapFunction(TimeDomain.EVENT_TIME));

		OneInputStreamOperatorTestHarness<Integer, Integer> testHarness =
				new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.open();

		testHarness.processWatermark(new Watermark(0));

		testHarness.processElement(new StreamRecord<>(17, 42L));

		testHarness.processWatermark(new Watermark(5));

		ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();

		expectedOutput.add(new Watermark(0L));
		expectedOutput.add(new StreamRecord<>(17, 42L));
		expectedOutput.add(new StreamRecord<>(1777, 5L));
		expectedOutput.add(new Watermark(5L));

		TestHarnessUtil.assertOutputEquals("Output was not correct.", expectedOutput, testHarness.getOutput());

		testHarness.close();
	}

	@Test
	public void testProcessingTimeTimers() throws Exception {

		KeyedProcessOperator<Integer, Integer, Integer> operator =
				new KeyedProcessOperator<>(new TriggeringFlatMapFunction(TimeDomain.PROCESSING_TIME));

		OneInputStreamOperatorTestHarness<Integer, Integer> testHarness =
				new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.open();

		testHarness.processElement(new StreamRecord<>(17));

		testHarness.setProcessingTime(5);

		ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();

		expectedOutput.add(new StreamRecord<>(17));
		expectedOutput.add(new StreamRecord<>(1777, 5L));

		TestHarnessUtil.assertOutputEquals("Output was not correct.", expectedOutput, testHarness.getOutput());

		testHarness.close();
	}

	/**
	 * Verifies that we don't have leakage between different keys.
	 */
	@Test
	public void testEventTimeTimerWithState() throws Exception {

		KeyedProcessOperator<Integer, Integer, String> operator =
				new KeyedProcessOperator<>(new TriggeringStatefulFlatMapFunction(TimeDomain.EVENT_TIME));

		OneInputStreamOperatorTestHarness<Integer, String> testHarness =
				new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.open();

		testHarness.processWatermark(new Watermark(1));
		testHarness.processElement(new StreamRecord<>(17, 0L)); // should set timer for 6

		testHarness.processWatermark(new Watermark(2));
		testHarness.processElement(new StreamRecord<>(42, 1L)); // should set timer for 7

		testHarness.processWatermark(new Watermark(6));
		testHarness.processWatermark(new Watermark(7));

		ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();

		expectedOutput.add(new Watermark(1L));
		expectedOutput.add(new StreamRecord<>("INPUT:17", 0L));
		expectedOutput.add(new Watermark(2L));
		expectedOutput.add(new StreamRecord<>("INPUT:42", 1L));
		expectedOutput.add(new StreamRecord<>("STATE:17", 6L));
		expectedOutput.add(new Watermark(6L));
		expectedOutput.add(new StreamRecord<>("STATE:42", 7L));
		expectedOutput.add(new Watermark(7L));

		TestHarnessUtil.assertOutputEquals("Output was not correct.", expectedOutput, testHarness.getOutput());

		testHarness.close();
	}

	/**
	 * Verifies that we don't have leakage between different keys.
	 */
	@Test
	public void testProcessingTimeTimerWithState() throws Exception {

		KeyedProcessOperator<Integer, Integer, String> operator =
				new KeyedProcessOperator<>(new TriggeringStatefulFlatMapFunction(TimeDomain.PROCESSING_TIME));

		OneInputStreamOperatorTestHarness<Integer, String> testHarness =
				new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.open();

		testHarness.setProcessingTime(1);
		testHarness.processElement(new StreamRecord<>(17)); // should set timer for 6

		testHarness.setProcessingTime(2);
		testHarness.processElement(new StreamRecord<>(42)); // should set timer for 7

		testHarness.setProcessingTime(6);
		testHarness.setProcessingTime(7);

		ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();

		expectedOutput.add(new StreamRecord<>("INPUT:17"));
		expectedOutput.add(new StreamRecord<>("INPUT:42"));
		expectedOutput.add(new StreamRecord<>("STATE:17", 6L));
		expectedOutput.add(new StreamRecord<>("STATE:42", 7L));

		TestHarnessUtil.assertOutputEquals("Output was not correct.", expectedOutput, testHarness.getOutput());

		testHarness.close();
	}

	@Test
	public void testSnapshotAndRestore() throws Exception {

		KeyedProcessOperator<Integer, Integer, String> operator =
				new KeyedProcessOperator<>(new BothTriggeringFlatMapFunction());

		OneInputStreamOperatorTestHarness<Integer, String> testHarness =
				new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.open();

		testHarness.processElement(new StreamRecord<>(5, 12L));

		// snapshot and restore from scratch
		OperatorStateHandles snapshot = testHarness.snapshot(0, 0);

		testHarness.close();

		operator = new KeyedProcessOperator<>(new BothTriggeringFlatMapFunction());

		testHarness = new KeyedOneInputStreamOperatorTestHarness<>(operator, new IdentityKeySelector<Integer>(), BasicTypeInfo.INT_TYPE_INFO);

		testHarness.setup();
		testHarness.initializeState(snapshot);
		testHarness.open();

		testHarness.setProcessingTime(5);
		testHarness.processWatermark(new Watermark(6));

		ConcurrentLinkedQueue<Object> expectedOutput = new ConcurrentLinkedQueue<>();

		expectedOutput.add(new StreamRecord<>("PROC:1777", 5L));
		expectedOutput.add(new StreamRecord<>("EVENT:1777", 6L));
		expectedOutput.add(new Watermark(6));

		System.out.println("GOT: " + testHarness.getOutput());

		TestHarnessUtil.assertOutputEquals("Output was not correct.", expectedOutput, testHarness.getOutput());

		testHarness.close();
	}

	private static class IdentityKeySelector<T> implements KeySelector<T, T> {
		private static final long serialVersionUID = 1L;

		@Override
		public T getKey(T value) throws Exception {
			return value;
		}
	}

	private static class QueryingFlatMapFunction extends ProcessFunction<Integer, String> {

		private static final long serialVersionUID = 1L;

		private final TimeDomain timeDomain;

		public QueryingFlatMapFunction(TimeDomain timeDomain) {
			this.timeDomain = timeDomain;
		}

		@Override
		public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception {
			if (timeDomain.equals(TimeDomain.EVENT_TIME)) {
				out.collect(value + "TIME:" + ctx.timerService().currentWatermark() + " TS:" + ctx.timestamp());
			} else {
				out.collect(value + "TIME:" + ctx.timerService().currentProcessingTime() + " TS:" + ctx.timestamp());
			}
		}

		@Override
		public void onTimer(
				long timestamp,
				OnTimerContext ctx,
				Collector<String> out) throws Exception {
		}
	}

	private static class TriggeringFlatMapFunction extends ProcessFunction<Integer, Integer> {

		private static final long serialVersionUID = 1L;

		private final TimeDomain timeDomain;

		public TriggeringFlatMapFunction(TimeDomain timeDomain) {
			this.timeDomain = timeDomain;
		}

		@Override
		public void processElement(Integer value, Context ctx, Collector<Integer> out) throws Exception {
			out.collect(value);
			if (timeDomain.equals(TimeDomain.EVENT_TIME)) {
				ctx.timerService().registerEventTimeTimer(ctx.timerService().currentWatermark() + 5);
			} else {
				ctx.timerService().registerProcessingTimeTimer(ctx.timerService().currentProcessingTime() + 5);
			}
		}

		@Override
		public void onTimer(
				long timestamp,
				OnTimerContext ctx,
				Collector<Integer> out) throws Exception {

			assertEquals(this.timeDomain, ctx.timeDomain());
			out.collect(1777);
		}
	}

	private static class TriggeringStatefulFlatMapFunction extends ProcessFunction<Integer, String> {

		private static final long serialVersionUID = 1L;

		private final ValueStateDescriptor<Integer> state =
				new ValueStateDescriptor<>("seen-element", IntSerializer.INSTANCE);

		private final TimeDomain timeDomain;

		public TriggeringStatefulFlatMapFunction(TimeDomain timeDomain) {
			this.timeDomain = timeDomain;
		}

		@Override
		public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception {
			out.collect("INPUT:" + value);
			getRuntimeContext().getState(state).update(value);
			if (timeDomain.equals(TimeDomain.EVENT_TIME)) {
				ctx.timerService().registerEventTimeTimer(ctx.timerService().currentWatermark() + 5);
			} else {
				ctx.timerService().registerProcessingTimeTimer(ctx.timerService().currentProcessingTime() + 5);
			}
		}

		@Override
		public void onTimer(
				long timestamp,
				OnTimerContext ctx,
				Collector<String> out) throws Exception {
			assertEquals(this.timeDomain, ctx.timeDomain());
			out.collect("STATE:" + getRuntimeContext().getState(state).value());
		}
	}

	private static class BothTriggeringFlatMapFunction extends ProcessFunction<Integer, String> {

		private static final long serialVersionUID = 1L;

		@Override
		public void processElement(Integer value, Context ctx, Collector<String> out) throws Exception {
			ctx.timerService().registerProcessingTimeTimer(5);
			ctx.timerService().registerEventTimeTimer(6);
		}

		@Override
		public void onTimer(
				long timestamp,
				OnTimerContext ctx,
				Collector<String> out) throws Exception {
			if (TimeDomain.EVENT_TIME.equals(ctx.timeDomain())) {
				out.collect("EVENT:1777");
			} else {
				out.collect("PROC:1777");
			}
		}
	}

}


text:
#ifndef __ALT_LEGACY_IRQ_H__
#define __ALT_LEGACY_IRQ_H__

/*
 * This file provides prototypes and inline implementations of certain routines
 * used by the legacy interrupt API. Do not include this in your driver or
 * application source files, use "sys/alt_irq.h" instead to access the proper
 * public API.
 */

#include <errno.h>
#include "system.h"

#ifndef NIOS2_EIC_PRESENT

#include "nios2.h"
#include "alt_types.h"

#include "sys/alt_irq.h"

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

/*
 * alt_irq_register() can be used to register an interrupt handler. If the
 * function is succesful, then the requested interrupt will be enabled upon
 * return.
 */
extern int alt_irq_register (alt_u32 id,
                             void*   context,
                             alt_isr_func handler);

/*
 * alt_irq_disable() disables the individual interrupt indicated by "id".
 */
static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id)
{
  alt_irq_context  status;
  extern volatile alt_u32 alt_irq_active;

  status = alt_irq_disable_all ();

  alt_irq_active &= ~(1 << id);
  NIOS2_WRITE_IENABLE (alt_irq_active);

  alt_irq_enable_all(status);

  return 0;
}

/*
 * alt_irq_enable() enables the individual interrupt indicated by "id".
 */
static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id)
{
  alt_irq_context  status;
  extern volatile alt_u32 alt_irq_active;

  status = alt_irq_disable_all ();

  alt_irq_active |= (1 << id);
  NIOS2_WRITE_IENABLE (alt_irq_active);

  alt_irq_enable_all(status);

  return 0;
}

#ifndef ALT_EXCEPTION_STACK
/*
 * alt_irq_initerruptable() should only be called from within an ISR. It is used
 * to allow higer priority interrupts to interrupt the current ISR. The input
 * argument, "priority", is the priority, i.e. interrupt number of the current
 * interrupt.
 *
 * If this function is called, then the ISR is required to make a call to
 * alt_irq_non_interruptible() before returning. The input argument to
 * alt_irq_non_interruptible() is the return value from alt_irq_interruptible().
 *
 * Care should be taken when using this pair of functions, since they increasing
 * the system overhead associated with interrupt handling.
 *
 * If you are using an exception stack then nested interrupts won't work, so
 * these functions are not available in that case.
 */
static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority)
{
  extern volatile alt_u32 alt_priority_mask;
  extern volatile alt_u32 alt_irq_active;

  alt_u32 old_priority;

  old_priority      = alt_priority_mask;
  alt_priority_mask = (1 << priority) - 1;

  NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask);

  NIOS2_WRITE_STATUS (1);

  return old_priority;
}

/*
 * See Comments above for alt_irq_interruptible() for an explanation of the use of this
 * function.
 */
static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask)
{
  extern volatile alt_u32 alt_priority_mask;
  extern volatile alt_u32 alt_irq_active;

  NIOS2_WRITE_STATUS (0);

  alt_priority_mask = mask;

  NIOS2_WRITE_IENABLE (mask & alt_irq_active);
}
#endif /* ALT_EXCEPTION_STACK */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* NIOS2_EIC_PRESENT */

#endif /* __ALT_LEGACY_IRQ_H__ */


text:
<!DOCTYPE html>

<title>Canvas test: initial.reset.clip</title>

<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">

initial.reset.clip

Resetting the canvas state resets the current clip region

Actual output:

<canvas id="c" class="output" width="100" height="50">
FAIL (fallback content)
</canvas>

Expected output:


text:
namespace base {
class Version;
}

namespace content {

struct CONTENT_EXPORT WebPluginMimeType {
  WebPluginMimeType();
  // A constructor for the common case of a single file extension and an ASCII
  // description.
  WebPluginMimeType(const std::string& m,
                    const std::string& f,
                    const std::string& d);
  ~WebPluginMimeType();

  // The name of the mime type (e.g., "application/x-shockwave-flash").
  std::string mime_type;

  // A list of all the file extensions for this mime type.
  std::vector<std::string> file_extensions;

  // Description of the mime type.
  base::string16 description;

  // Extra parameters to include when instantiating the plugin.
  std::vector<base::string16> additional_param_names;
  std::vector<base::string16> additional_param_values;
};

// Describes an available NPAPI or Pepper plugin.
struct CONTENT_EXPORT WebPluginInfo {
  enum PluginType {
    PLUGIN_TYPE_NPAPI,
    PLUGIN_TYPE_PEPPER_IN_PROCESS,
    PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS,
    PLUGIN_TYPE_PEPPER_UNSANDBOXED,
    PLUGIN_TYPE_BROWSER_PLUGIN
  };

  WebPluginInfo();
  WebPluginInfo(const WebPluginInfo& rhs);
  ~WebPluginInfo();
  WebPluginInfo& operator=(const WebPluginInfo& rhs);

  // Special constructor only used during unit testing:
  WebPluginInfo(const base::string16& fake_name,
                const base::FilePath& fake_path,
                const base::string16& fake_version,
                const base::string16& fake_desc);

  bool is_pepper_plugin() const {
    return ((type == PLUGIN_TYPE_PEPPER_IN_PROCESS ) ||
          (type == PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) ||
          (type == PLUGIN_TYPE_PEPPER_UNSANDBOXED));
  }

  // Parse a version string as used by a plug-in. This method is more lenient
  // in accepting weird version strings than base::Version::GetFromString()
  static void CreateVersionFromString(const base::string16& version_string,
                                      base::Version* parsed_version);

  // The name of the plugin (i.e. Flash).
  base::string16 name;

  // The path to the plugin file (DLL/bundle/library).
  base::FilePath path;

  // The version number of the plugin file (may be OS-specific)
  base::string16 version;

  // A description of the plugin that we get from its version info.
  base::string16 desc;

  // A list of all the mime types that this plugin supports.
  std::vector<WebPluginMimeType> mime_types;

  // Plugin type. See the PluginType enum.
  int type;

  // When type is PLUGIN_TYPE_PEPPER_* this indicates the permission bits.
  int32 pepper_permissions;
};

}  // namespace content

#endif  // CONTENT_PUBLIC_COMMON_WEBPLUGININFO_H_


text:
package com.katas.refactoring.tdd.tripservice.model;

public class Trip {
}


text:
package edu.msu.nscl.olog;

import java.security.Principal;
import java.util.HashSet;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.util.Set;
import javax.annotation.Resource;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;

/**
 * Owner (group) membership management: LDAP connection and binding.
 *
 * @author Ralph Lange <Ralph.Lange@helmholtz-berlin.de>
 */
public class ADLDAPUserManager extends UserManager {
    private ThreadLocal<DirContext> ctx = new ThreadLocal<DirContext>();
    private static final String ldapResourceName = "OlogGroup";

    /**
     * LDAP field name for the member UID
     */
    @Resource(name="ldapGroupMemberField") protected String memberUidField = "sAMAccountName";

    /**
     * LDAP field name for the group name in group entries
     */
    @Resource(name="ldapGroupTargetField") protected String groupTargetField = "memberOf";

    private DirContext getJndiContext() {
        DirContext dirctx = this.ctx.get();
        if (dirctx == null) {
            try {
                Context initCtx = new InitialContext();
                dirctx = (DirContext) initCtx.lookup(ldapResourceName);
                this.ctx.set(dirctx);
            } catch (NamingException e ) {
                throw new IllegalStateException("Cannot find JNDI LDAP resource '"
                        + ldapResourceName + "'", e);
            }
        }
        return dirctx;
    }

    @Override
    protected Set<String> getGroups(Principal user) {
            try {
            Set<String> groups = new HashSet<String>();
            DirContext dirctx = getJndiContext();
            SearchControls ctrls = new SearchControls();
            ctrls.setSearchScope(SearchControls.SUBTREE_SCOPE);

            String searchfilter = "(&(objectClass=user)(" + memberUidField + "=" + user.getName() + "))";
            String[] attributesToReturn = { "sAMAccountName", "memberOf", "cn" };
            ctrls.setReturningAttributes(attributesToReturn);
            NamingEnumeration<SearchResult> result = dirctx.search("", searchfilter, ctrls);

            while (result.hasMore()) {
                Attribute att = result.next().getAttributes().get(groupTargetField);
                if (att != null) {
                    for (int i=0; i<att.size(); i++){
                        Matcher m = Pattern.compile("CN=(.*?),[A-Z]{2}=",Pattern.CASE_INSENSITIVE).matcher((String)att.get(i));
                        if (m.find())
                            groups.add(m.group(1));
                }
            }
        }
            return groups;
        } catch (NamingException e) {
                throw new IllegalStateException("Error while retrieving group information for user '"
                        + user.getName() + "'", e);
        }
        }
    }


text:
import argparse
import os
import shutil

import flask_reveal.config as config

class MkPresentation(argparse.ArgumentParser):
    info = ({
        'prog': 'mkpresentation',
        'description': 'create the presentation directory structure',
    })

    def __init__(self):
        super(MkPresentation, self).__init__(**self.info)

        self.path = 'my_presentation'
        self.add_argument('path', nargs='?', default=self.path)

    def parse_args(self, args=None, namespace=None):
        super(MkPresentation, self).parse_args(args, self)

    def run(self, args=None):
        self.parse_args(args)

        config_file = os.path.join(os.path.dirname(config.__file__),
                                   'config.py')

        if not os.path.exists(self.path):
            presentation_name = os.path.basename(self.path)

            os.mkdir(self.path)  # Presentation dir
            os.mkdir(os.path.join(self.path, 'img'))  # Images dir
            shutil.copy(config_file, self.path)  # Config file
            # First slide file
            with open(os.path.join(self.path, 'slides.md'), 'w') as f:
                f.write('# {0}\n\nStart from here!'.format(
                    presentation_name.replace('_', ' ').title()))
        else:
            self.error('{0} folder already exists'.format(self.path))

command = MkPresentation()


text:
.class Landroid/net/CaptivePortalTracker$NoActiveNetworkState;
.super Lcom/android/internal/util/State;
.source "CaptivePortalTracker.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/net/CaptivePortalTracker;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "NoActiveNetworkState"
.end annotation

# instance fields
.field final synthetic this$0:Landroid/net/CaptivePortalTracker;

# direct methods
.method private constructor <init>(Landroid/net/CaptivePortalTracker;)V
    .locals 0
    .parameter

    .prologue
    .line 159
    iput-object p1, p0, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;->this$0:Landroid/net/CaptivePortalTracker;

    invoke-direct {p0}, Lcom/android/internal/util/State;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Landroid/net/CaptivePortalTracker;Landroid/net/CaptivePortalTracker$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 159
    invoke-direct {p0, p1}, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;-><init>(Landroid/net/CaptivePortalTracker;)V

    return-void
.end method

# virtual methods
.method public enter()V
    .locals 2

    .prologue
    .line 163
    iget-object v0, p0, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;->this$0:Landroid/net/CaptivePortalTracker;

    const/4 v1, 0x0

    #setter for: Landroid/net/CaptivePortalTracker;->mNetworkInfo:Landroid/net/NetworkInfo;
    invoke-static {v0, v1}, Landroid/net/CaptivePortalTracker;->access$602(Landroid/net/CaptivePortalTracker;Landroid/net/NetworkInfo;)Landroid/net/NetworkInfo;

    .line 165
    iget-object v0, p0, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;->this$0:Landroid/net/CaptivePortalTracker;

    const/4 v1, 0x0

    #calls: Landroid/net/CaptivePortalTracker;->setNotificationVisible(Z)V
    invoke-static {v0, v1}, Landroid/net/CaptivePortalTracker;->access$700(Landroid/net/CaptivePortalTracker;Z)V

    .line 166
    return-void
.end method

.method public processMessage(Landroid/os/Message;)Z
    .locals 3
    .parameter "message"

    .prologue
    .line 173
    iget v1, p1, Landroid/os/Message;->what:I

    packed-switch v1, :pswitch_data_0

    .line 182
    const/4 v1, 0x0

    .line 184
    :goto_0
    return v1

    .line 175
    :pswitch_0
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Landroid/net/NetworkInfo;

    .line 176
    .local v0, info:Landroid/net/NetworkInfo;
    invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;->this$0:Landroid/net/CaptivePortalTracker;

    #calls: Landroid/net/CaptivePortalTracker;->isActiveNetwork(Landroid/net/NetworkInfo;)Z
    invoke-static {v1, v0}, Landroid/net/CaptivePortalTracker;->access$800(Landroid/net/CaptivePortalTracker;Landroid/net/NetworkInfo;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 177
    iget-object v1, p0, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;->this$0:Landroid/net/CaptivePortalTracker;

    #setter for: Landroid/net/CaptivePortalTracker;->mNetworkInfo:Landroid/net/NetworkInfo;
    invoke-static {v1, v0}, Landroid/net/CaptivePortalTracker;->access$602(Landroid/net/CaptivePortalTracker;Landroid/net/NetworkInfo;)Landroid/net/NetworkInfo;

    .line 178
    iget-object v1, p0, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;->this$0:Landroid/net/CaptivePortalTracker;

    iget-object v2, p0, Landroid/net/CaptivePortalTracker$NoActiveNetworkState;->this$0:Landroid/net/CaptivePortalTracker;

    #getter for: Landroid/net/CaptivePortalTracker;->mDelayedCaptiveCheckState:Lcom/android/internal/util/State;
    invoke-static {v2}, Landroid/net/CaptivePortalTracker;->access$900(Landroid/net/CaptivePortalTracker;)Lcom/android/internal/util/State;

    move-result-object v2

    #calls: Landroid/net/CaptivePortalTracker;->transitionTo(Lcom/android/internal/util/IState;)V
    invoke-static {v1, v2}, Landroid/net/CaptivePortalTracker;->access$1000(Landroid/net/CaptivePortalTracker;Lcom/android/internal/util/IState;)V

    .line 184
    :cond_0
    const/4 v1, 0x1

    goto :goto_0

    .line 173
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
    .end packed-switch
.end method


text:
package com.intellij.ui.tabs.impl;

import com.intellij.openapi.util.registry.Registry;
import org.jetbrains.annotations.NotNull;

import java.awt.*;

public abstract class TabLayout {

  public ShapeTransform createShapeTransform(Dimension dimension) {
    return createShapeTransform(new Rectangle(0, 0, dimension.width, dimension.height));
  }

  public ShapeTransform createShapeTransform(Rectangle rectangle) {
    return new ShapeTransform.Top(rectangle);
  }

  public boolean isDragOut(@NotNull TabLabel tabLabel, int deltaX, int deltaY) {
    return Math.abs(deltaY) > tabLabel.getSize().height * getDragOutMultiplier();
  }

  public boolean isSideComponentOnTabs() {
    return false;
  }

  public static double getDragOutMultiplier() {
    return Registry.doubleValue("ide.tabbedPane.dragOutMultiplier");
  }

  public abstract int getDropIndexFor(Point point);
}


text:
namespace base {
class FilePath;
}

namespace mojo {
namespace shell {

enum class NativeApplicationCleanup { DELETE, DONT_DELETE };

// ApplicationManager requires implementations of NativeRunner and
// NativeRunnerFactory to run native applications.
class NativeRunner {
 public:
  virtual ~NativeRunner() {}

  // Loads the app in the file at |app_path| and runs it on some other
  // thread/process. If |cleanup| is |DELETE|, this takes ownership of the file.
  // |app_completed_callback| is posted (to the thread on which |Start()| was
  // called) after |MojoMain()| completes.
  // TODO(vtl): |app_path| and |cleanup| should probably be moved to the
  // factory's Create(). Rationale: The factory may need information from the
  // file to decide what kind of NativeRunner to make.
  virtual void Start(const base::FilePath& app_path,
                     bool start_sandboxed,
                     NativeApplicationCleanup cleanup,
                     InterfaceRequest<Application> application_request,
                     const base::Closure& app_completed_callback) = 0;
};

class NativeRunnerFactory {
 public:
  // Options for running the native app. (This will contain, e.g., information
  // about the sandbox profile, etc.)
  struct Options {
    // Constructs with default options.
    Options() : force_in_process(false) {}

    bool force_in_process;
  };

  virtual ~NativeRunnerFactory() {}
  virtual scoped_ptr<NativeRunner> Create(const Options& options) = 0;
};

}  // namespace shell
}  // namespace mojo

#endif  // MOJO_SHELL_NATIVE_RUNNER_H_


text:
class CreateBanks < ActiveRecord::Migration
  def change
    create_table :banks do |t|
      t.string :bank_name
      t.string :account_type

      t.timestamps null: false
    end
  end
end


text:
using Engine.Exceptions;
using Engine.Model.Client;
using System;
using System.Collections.Generic;
using System.Security;
using ThirtyNineEighty.BinarySerializer;

namespace Engine.Api.Client.Messages
{
  public class ClientRemoveMessagesCommand :
    ClientCommand<ClientRemoveMessagesCommand.MessageContent>
  {
    public const long CommandId = (long)ClientCommandId.RemoveMessages;

    public override long Id
    {
      [SecuritySafeCritical]
      get { return CommandId; }
    }

    [SecuritySafeCritical]
    protected override void OnRun(MessageContent content, CommandArgs args)
    {
      if (string.IsNullOrEmpty(content.RoomName))
        throw new ArgumentException("room name is null or empty");

      using (var client = ClientModel.Get())
      {
        var room = client.Chat.TryGetRoom(content.RoomName);
        if (room == null)
          throw new ModelException(ErrorCode.RoomNotFound);

        room.RemoveMessages(content.Ids);
      }

      var removed = new HashSet<long>(content.Ids);
      ClientModel.Notifier.RoomRefreshed(new RoomRefreshedEventArgs(content.RoomName, null, removed));
    }

    [Serializable]
    [BinType("ClientRemoveMessages")]
    public class MessageContent
    {
      [BinField("r")]
      public string RoomName;

      [BinField("i")]
      public long[] Ids;
    }
  }
}


text:
package io.fabric8.kubernetes.client.handlers;

import com.squareup.okhttp.OkHttpClient;
import io.fabric8.kubernetes.api.model.Secret;
import io.fabric8.kubernetes.api.model.SecretBuilder;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.ResourceHandler;
import io.fabric8.kubernetes.client.dsl.internal.SecretOperationsImpl;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;

import java.util.TreeMap;

@Component
@Service
public class SecretHandler implements ResourceHandler<Secret, SecretBuilder> {
  @Override
  public String getKind() {
    return Secret.class.getSimpleName();
  }

  @Override
  public Secret create(OkHttpClient client, Config config, String namespace, Secret item) {
    return new SecretOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).create();
  }

  @Override
  public Secret replace(OkHttpClient client, Config config, String namespace, Secret item) {
    return new SecretOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).replace(item);
  }

  @Override
  public Secret reload(OkHttpClient client, Config config, String namespace, Secret item) {
    return new SecretOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).fromServer().get();
  }

  @Override
  public SecretBuilder edit(Secret item) {
    return new SecretBuilder(item);
  }

  @Override
  public Boolean delete(OkHttpClient client, Config config, String namespace, Secret item) {
    return new SecretOperationsImpl(client, config, null, namespace, null, true, item, null, false, -1, new TreeMap<String, String>(), new TreeMap<String, String>(), new TreeMap<String, String[]>(), new TreeMap<String, String[]>(), new TreeMap<String, String>()).delete(item);
  }
}


text:
/**
 * Created by x22a on 25.02.16.
 */
require('babel-core/register');
require.extensions['.gif'] = function() {};
require.extensions['.svg'] = function() {};
require.extensions['.png'] = function() {};
require.extensions['.jpg'] = function() {};
require.extensions['.jpeg'] = function() {};
require.extensions['.ico'] = function() {};
require.extensions['.css'] = function() {};
require('babel-polyfill');
require('css-modules-require-hook/preset');
require('./server.js');


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28602_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans19.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">#5 Energy Services

    <p class="styleSans14.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Surveyor Certification Form

    <p class="styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Survey Company: MS ENERGY SERVICES Surveyors Name: DUSTIN FOWLER
Survey Job Type: RATE GYRO
Customer: EOG RESOURCES, INC
Well: PARSHALL 154-1721H
API: 33-061-03144
Surveyed from: SURFACE TO A DEPTH OF 1946' MD
Survey Run Date: 7-18-14 Surface Location: MOUNTRAIL COUNTY, ND

    <p class="styleSans15.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">I certify that the data is true, correct, and complete and within the limitations
of the tool set forth by MS Energy Services; that I am authorized and qualified to make this report; and that l have reviewed this report and find that it conforms to the principies and procedures as set forth by MS Energy
Services.

    <p class="styleSans28.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Dustin

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Digitally signed by Dustin Fowler
DN: cn=Dustin Fowler, o=MS Energy Services, ou=MS OW e r Survey, email=dfow|er@msenergyservices.com, c=US
Date: 2013.01.02 15:27:29 ~06'00'

    <p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">us Directional

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">3335 Pollok Drive Conroe, Texas 77303

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">936.442.2500 (office) 936.442.2599 (fax) www.msenergyservioes.com

    <p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">
MS Guidance

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans4.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">
MS Survey

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">
MS Wireline

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syll. fung. (Abellini) 8: 450 (1889)

#### Original name
null

### Remarks
null


text:
package cern.accsoft.steering.aloha.plugin.api;

import cern.accsoft.steering.aloha.calc.solve.Solver;

import java.util.List;

public interface SolverProvider extends AlohaPlugin {

	public List<Solver> getSolvers();

}


text:
class RemoteClientUtils
{
public:
    static gtString GetPlatformMismatchMsg(const gtString& clientPlatform, const gtString& agentPlatform);
    static gtString GetVersionMismatchMsg(const gtString& clientVersion, const gtString& agentVersion);
};


text:
var DashboardsThreeController = function($scope) {
};

DashboardsThreeController.$inject = ['$scope'];
module.exports = DashboardsThreeController;


text:
namespace cc {

namespace proto {
class LayerNode;
}  // namespace proto

class CC_EXPORT HeadsUpDisplayLayer : public Layer {
 public:
  static scoped_refptr<HeadsUpDisplayLayer> Create(
      const LayerSettings& settings);

  void PrepareForCalculateDrawProperties(
      const gfx::Size& device_viewport, float device_scale_factor);

  scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;

  void SetTypeForProtoSerialization(proto::LayerNode* proto) const override;

  // Layer overrides.
  void PushPropertiesTo(LayerImpl* layer) override;

 protected:
  explicit HeadsUpDisplayLayer(const LayerSettings& settings);
  bool HasDrawableContent() const override;

 private:
  ~HeadsUpDisplayLayer() override;

  skia::RefPtr<SkTypeface> typeface_;

  DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayer);
};

}  // namespace cc

#endif  // CC_LAYERS_HEADS_UP_DISPLAY_LAYER_H_


text:
#include <stddef.h>
#include <stdint.h>
#include <ubirch/timer.h>
#include "ubirch/modem.h"
#include "sim800h_debug.h"

int modem_http_prepare(const char *url, uint32_t timeout) {
  timer_set_timeout(timeout * 1000);

  modem_send("AT+HTTPTERM");
  modem_expect_OK(timeout);

  modem_send("AT+HTTPINIT");
  if (!modem_expect_OK(uTimer_Remaining)) return 1000;

  modem_send("AT+HTTPPARA=\"CID\",1");
  if (!modem_expect_OK(uTimer_Remaining)) return 1101;

  modem_send("AT+HTTPPARA=\"UA\",\"" BOARD "\"");
  if (!modem_expect_OK(uTimer_Remaining)) return 1102;

  modem_send("AT+HTTPPARA=\"REDIR\",1");
  if (!modem_expect_OK(uTimer_Remaining)) return 1103;

  modem_send("AT+HTTPPARA=\"URL\",\"%s\"", url);
  if (!modem_expect_OK(uTimer_Remaining)) return 1110;

  return 0;
}

int modem_http(modem_http_method_t method, size_t *res_size, uint32_t timeout) {
  timer_set_timeout(timeout * 1000);
  int bearer, status;

  modem_send("AT+HTTPACTION=%d", method);
  if (!modem_expect_OK(uTimer_Remaining)) return 1004;

  modem_expect_scan("+HTTPACTION: %d,%d,%d", uTimer_Remaining, &bearer, &status, res_size);

  return status;
}

size_t modem_http_write(const uint8_t *buffer, size_t size, uint32_t timeout) {
  if(size <= 0) return 0;

  timer_set_timeout(timeout * 1000);

  modem_send("AT+HTTPDATA=%d,%d", size, timer_timeout_remaining()/1000);
  modem_expect("DOWNLOAD", uTimer_Remaining);

  CIODUMP(buffer, size);
  modem_write(buffer, size);

  if (!modem_expect_OK(uTimer_Remaining)) return 0;

  return size;
}

size_t modem_http_read(uint8_t *buffer, uint32_t start, size_t size, uint32_t timeout) {
  if(size <= 0) return 0;

  timer_set_timeout(timeout * 1000);
  size_t available;

  modem_send("AT+HTTPREAD=%d,%d", start, size);
  modem_expect_scan("+HTTPREAD: %lu", timeout, &available);

  size_t idx = modem_read_binary(buffer, available, uTimer_Remaining);
  if (!modem_expect_OK(uTimer_Remaining)) return 0;

  CIODUMP(buffer, idx);

  return idx;
}

int modem_http_get(const char *url, size_t *res_size, uint32_t timeout) {
  timer_set_timeout(timeout * 1000);

  int status = modem_http_prepare(url, timeout);
  if (status) return status;

  return modem_http(HTTP_GET, res_size, uTimer_Remaining);
}

int modem_http_post(const char *url, size_t *res_size, uint8_t *request, size_t req_size, uint32_t timeout) {
  timer_set_timeout(timeout * 1000);

  int status = modem_http_prepare(url, timeout);
  if(status) return status;

  modem_http_write(request, req_size, uTimer_Remaining);

  return modem_http(HTTP_POST, res_size, uTimer_Remaining);
}


text:
import { FILE_CHUNK_SIZE } from '@proton/shared/lib/drive/constants';
import { wait } from '@proton/shared/lib/helpers/promise';

import { asyncGeneratorToArray } from '../../../utils/test/generator';
import { MAX_DOWNLOADING_BLOCKS_LOAD, MAX_DOWNLOADING_FILES_LOAD } from '../constants';
import { DownloadCallbacks } from '../interface';
import ConcurrentIterator from './concurrentIterator';
import { NestedLinkDownload, StartedNestedLinkDownload } from './interface';

const mockDownloadLinkFile = jest.fn();
jest.mock('./downloadLinkFile', () => {
    return (...args: any[]) => {
        return mockDownloadLinkFile(...args);
    };
});

async function* generateLinks(count: number, size = 123) {
    for (let i = 0; i < count; i++) {
        yield {
            isFile: true,
            size,
        } as NestedLinkDownload;
    }
}

describe('ConcurrentIterator', () => {
    const mockStart = jest.fn();
    const mockCancel = jest.fn();

    beforeEach(() => {
        jest.clearAllMocks();

        mockDownloadLinkFile.mockReturnValue({
            start: mockStart,
            cancel: mockCancel,
        });
    });

    const checkPausingGeneratingLinks = async (
        generator: AsyncGenerator<StartedNestedLinkDownload>,
        callsBeforePause: number,
        totalCalls: number
    ) => {
        // Start consuming so we it can generate links and hit the pause.
        const linksPromise = asyncGeneratorToArray(generator);
        await wait(500); // 500ms should be enough to generate first batch.

        // Now its in waiting mode and it waits to finish ongoing downloads.
        expect(mockDownloadLinkFile).toBeCalledTimes(callsBeforePause);
        expect(mockStart).toBeCalledTimes(callsBeforePause);
        mockDownloadLinkFile.mock.calls.forEach(([link, { onProgress, onFinish }]) => {
            onProgress('linkId', link.size);
            onFinish();
        });

        // After finishing the previous batch, wait to generate the rest.
        // Now without pausing because we don't have more than "two pages".
        const links = await linksPromise;
        expect(links.length).toBe(totalCalls);
        expect(mockDownloadLinkFile).toBeCalledTimes(totalCalls);
        expect(mockStart).toBeCalledTimes(totalCalls);
    };

    it('pauses when reaching MAX_DOWNLOADING_FILES_LOAD', async () => {
        const c = new ConcurrentIterator();
        const g = c.iterate(generateLinks(MAX_DOWNLOADING_FILES_LOAD * 2), {} as DownloadCallbacks);
        await checkPausingGeneratingLinks(g, MAX_DOWNLOADING_FILES_LOAD, MAX_DOWNLOADING_FILES_LOAD * 2);
    });

    it('pauses when reaching MAX_DOWNLOADING_BLOCKS_LOAD', async () => {
        const bigFileSize = FILE_CHUNK_SIZE * MAX_DOWNLOADING_BLOCKS_LOAD * 2;
        const c = new ConcurrentIterator();
        const g = c.iterate(generateLinks(2, bigFileSize), {} as DownloadCallbacks);
        await checkPausingGeneratingLinks(g, 1, 2);
    });

    it('cancels from pause', async () => {
        const bigFileSize = FILE_CHUNK_SIZE * MAX_DOWNLOADING_BLOCKS_LOAD * 2;
        const c = new ConcurrentIterator();
        const g = c.iterate(generateLinks(5, bigFileSize), {} as DownloadCallbacks);

        // Start consuming so we it can generate links and hit the pause.
        const linksPromise = asyncGeneratorToArray(g);
        await wait(500); // 500ms should be enough to generate first batch.
        c.cancel();

        const links = await linksPromise;
        expect(links.length).toBe(1);
        expect(mockDownloadLinkFile).toBeCalledTimes(1);
        expect(mockStart).toBeCalledTimes(1);
        expect(mockCancel).toBeCalledTimes(1);
    });
});


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Attributes.Tests
{
    [TestClass]
    public class Tests
    {
        [TestMethod]
        public void TestMethod1()
        {
        }
    }
}


text:
layout: org
name: Baltimore Trans Ladies' Picnic
facebook: http://www.facebook.com/bmoretlp
email: transladiespicnic@bmoretransalliance.com
shortname: transladiespicnic
member_org: YES
person: evan
cloudinary_image: orgs/transladiespicnic.png
---

The Baltimore Trans Ladies' Picnic is a monthly potluck/picnic/get together for trans women (and transfeminine folks) in Baltimore.


text:
package io.cucumber.datatable;

import org.apiguardian.api.API;

import java.util.List;

/**
 * Transforms a single table row to an instance of {@code T}.
 *
 * @param <T> the target type
 */
@API(status = API.Status.STABLE)
@FunctionalInterface
public interface TableRowTransformer<T> {
    /**
     * Transforms a single table row to an instance of {@code T}.
     *
     * @param  row       the contents of a row. Never null.
     * @return           an instance of {@code T}
     * @throws Throwable when the transform fails for any reason
     */
    T transform(List<String> row) throws Throwable;
}


text:
var Promise = require('bluebird');
var Boilerpipe = require('boilerpipe');
var ERRORS = require('../enum/errors');

function getExtractor(extractorName) {
  'use strict';

  return new Promise(function(resolve, reject) {
    extractorName = extractorName.toLowerCase();

    var extractor = null;
    switch (extractorName) {
      case 'article':
        extractor = Boilerpipe.Extractor.Article;
        break;
      case 'keepeverything':
        extractor = Boilerpipe.Extractor.KeepEverything;
        break;
      case 'largestcontent':
        extractor = Boilerpipe.Extractor.LargestContent;
        break;
      case 'numwordsrules':
        extractor = Boilerpipe.Extractor.NumWordsRules;
        break;
      case 'canola':
        extractor = Boilerpipe.Extractor.Canola;
        break;
      case 'default':
        extractor = Boilerpipe.Extractor.Default;
        break;
    }

    if (extractor === null) {
      return reject(ERRORS.INVALID_EXTRACTOR);
    }

    return resolve(extractor);
  });
}

module.exports = getExtractor;


text:
using System;
using System.Linq.Expressions;

namespace Xamarin.Forms
{
	public static class BindableObjectExtensions
	{
		public static void SetBinding(this BindableObject self, BindableProperty targetProperty, string path, BindingMode mode = BindingMode.Default, IValueConverter converter = null,
									  string stringFormat = null)
		{
			if (self == null)
				throw new ArgumentNullException("self");
			if (targetProperty == null)
				throw new ArgumentNullException("targetProperty");

			var binding = new Binding(path, mode, converter, stringFormat: stringFormat);
			self.SetBinding(targetProperty, binding);
		}

		public static void SetBinding<TSource>(this BindableObject self, BindableProperty targetProperty, Expression<Func<TSource, object>> sourceProperty, BindingMode mode = BindingMode.Default,
											   IValueConverter converter = null, string stringFormat = null)
		{
			if (self == null)
				throw new ArgumentNullException("self");
			if (targetProperty == null)
				throw new ArgumentNullException("targetProperty");
			if (sourceProperty == null)
				throw new ArgumentNullException("sourceProperty");

			Binding binding = Binding.Create(sourceProperty, mode, converter, stringFormat: stringFormat);
			self.SetBinding(targetProperty, binding);
		}
	}
}


text:
package org.apache.juddi.validation.vsv;

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

/**
 * UDDI provides a mechanism that may be used by publishers to categorize
 * businessEntity and tModel elements according to any number of category
 * systems and by inquirers to discover entities so categorized. See Appendix F
 * Using Categorization for more information.
 *
 * This section defines a tModel used to categorize a businessEntity as
 * representing a UDDI node in the registry in which the businessEntity appears.
 * See Section 6.2.2.1 Normative Modeling of Node Business Entity.
 *
 * 11.1.3.2 Design Goals Each UDDI registry can be comprised of a number of
 * nodes. Each UDDI node has a special businessEntity associated with it, called
 * its Node Business Entity. The businessService elements in this businessEntity
 * represent Web services that relate to the node's role in the UDDI registry.
 *
 * The uddi-org:nodes category system is designed to allow reliable discovery of
 * the Node Business Entity structures for nodes in a UDDI registry so that UDDI
 * clients can locate the businessService structures associated with the
 * operation of the registry.
 *
 * Checking of references to this value set consists of ensuring that the
 * publisher is the UDDI node and the keyValue has the value "node". Each node
 * allows the use of uddi-org:nodes only by itself, only on its own Node
 * Business Entity, and only with the value of "node". This value is used in the
 * keyValue attributes of keyedReference elements that are contained in
 * categoryBag elements to locate the Node Business Entity elements in the
 * registry.
 *
 *
 * @author Alex O'Ree
 */
public class Uddiuddiorgcategorizationnodes extends AbstractSimpleValidator {

        @Override
        public List<String> getValidValues() {
                List<String> ret = new ArrayList<String>();
                ret.add("node");
                return ret;
        }

        @Override
        public String getMyKey() {
                return "uddi:uddi.org:categorization:nodes";
        }

}


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

@echo off
echo Creating Microsoft Visual Studio 2013 x64 files...

REM Following environment variables can customize build system:
REM USE_SDE_EMULATION -- Whether to use SDE emulation. Possible values: on, off  (lack of variable is equal to off)
REM RUN_ULTS_OFFLINE --  whether to separate ULTs execution from building process. Possible values: on, off (lack of variable is equal to off)
REM
REM Examples:
REM set RUN_ULTS_OFFLINE=on & create_msvc_mscc.sh

cmake -G"Visual Studio 12 2013 Win64" -B".\MSVC\Release" --no-warn-unused-cli -DRUN_ULTS_OFFLINE:BOOL=%RUN_ULTS_OFFLINE% -DUSE_SDE_EMULATION:BOOL=%USE_SDE_EMULATION% -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_CONFIGURATION_TYPES:STRING="Release" -DCMAKE_SUPPRESS_REGENERATION:BOOL=ON -H"."
cmake -G"Visual Studio 12 2013 Win64" -B".\MSVC\Debug" --no-warn-unused-cli -DRUN_ULTS_OFFLINE:BOOL=%RUN_ULTS_OFFLINE% -DUSE_SDE_EMULATION:BOOL=%USE_SDE_EMULATION% -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DCMAKE_SUPPRESS_REGENERATION:BOOL=ON -H"."
cmake -G"Visual Studio 12 2013 Win64" -B".\MSVC\DebugULT" --no-warn-unused-cli -DRUN_ULTS_OFFLINE:BOOL=%RUN_ULTS_OFFLINE% -DUSE_SDE_EMULATION:BOOL=%USE_SDE_EMULATION% -DCMAKE_BUILD_TYPE:STRING="DebugULT" -DCMAKE_CONFIGURATION_TYPES:STRING="DebugULT" -DCMAKE_SUPPRESS_REGENERATION:BOOL=ON -H"."

echo Done.
pause


text:
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { Message } from 'primeng/primeng';

type Severities = 'success' | 'info' | 'warn' | 'error';

@Injectable()
export class MessageGrowlService {

  constructor() { }

  notificationChange: Subject<Object> = new Subject<Object>();

  notify(severity: Severities, summary: string, detail: string) {
    this.notificationChange.next({ severity, summary, detail });
  }
}