text:
import * as express from 'express';
import * as qs from 'querystring';
import * as logger from 'morgan';
import * as jwt from 'jwt-simple';
import * as mongoose from 'mongoose';
import * as moment from 'moment';
import * as request from 'request';
import * as async from 'async';
import { User, IUser } from '../../../models/user';

import { config } from './config';
import * as tokencfg from '../config';

export class AuthTwitter {
   router: express.Router;

   constructor() {
      this.router = express.Router();
   }

   validate(
      req: express.Request,
      res: express.Response
   ): any {
      const requestTokenUrl = 'https://api.twitter.com/oauth/request_token';
      const accessTokenUrl = 'https://api.twitter.com/oauth/access_token';
      const profileUrl = 'https://api.twitter.com/1.1/users/show.json?screen_name=';

      // Part 1 of 2: Initial request from Satellizer.
      if (!req.body.oauth_token || !req.body.oauth_verifier) {
        const requestTokenOauth = {
          consumer_key: config.TWITTER_KEY,
          consumer_secret: config.TWITTER_SECRET,
          callback: req.body.redirectUri
        };

        // Step 1. Obtain request token for the authorization popup.
        request.post({ url: requestTokenUrl, oauth: requestTokenOauth }, (err, response, body) => {
          const oauthToken = qs.parse(body);

          // Step 2. Send OAuth token back to open the authorization screen.
          res.send(oauthToken);
        });
      } else {
        // Part 2 of 2: Second request after Authorize app is clicked.
        const accessTokenOauth = {
          consumer_key: config.TWITTER_KEY,
          consumer_secret: config.TWITTER_SECRET,
          token: req.body.oauth_token,
          verifier: req.body.oauth_verifier
        };

        // Step 3. Exchange oauth token and oauth verifier for access token.
        request.post({ url: accessTokenUrl, oauth: accessTokenOauth }, (err, response, accessToken) => {

          accessToken = qs.parse(accessToken);

          const profileOauth = {
            consumer_key: config.TWITTER_KEY,
            consumer_secret: config.TWITTER_SECRET,
            oauth_token: accessToken.oauth_token
          };

          // Step 4. Retrieve profile information about the current user.
          request.get({
            url: profileUrl + accessToken.screen_name,
            oauth: profileOauth,
            json: true
         }, (errx, responsex, profile) => {

            // Step 5a. Link user accounts.
            if (req.headers.authorization) {
              User.findOne({ username: profile.id_str , provider: 'twitter'}, (errz, existingUser) => {
                if (existingUser) {
                  return res.status(409).send({ message: 'There is already a Twitter account that belongs to you' });
                }

                const token = req.headers.authorization.split(' ')[1];
                const payload = jwt.decode(token, tokencfg.config.TOKEN_SECRET);
                User.findById(payload.sub, (errw, user) => {
                  if (!user) {
                    return res.status(400).send({ message: 'User not found' });
                  }

                  user.userid = profile.id_str;
                  user.provider = 'twitter';
                  user.displayName = user.displayName || profile.name;
                  user.save((erry) => {
                    res.send({ token: this.createJWT(user) });
                  });
                });
              });
            } else {
              // Step 5b. Create a new user account or return an existing one.
              User.findOne({ username: profile.id_str , provider: 'twitter'}, (errz, existingUser) => {
                if (existingUser) {
                  return res.send({ token: this.createJWT(existingUser) });
                }

                const user = new User();
                user.userid = profile.id_str;
                user.displayName = profile.name;
                user.provider = 'twitter';
                user.save(() => {
                  res.send({ token: this.createJWT(user) });
                });
              });
            }
          });
        });
      }   }

      private createJWT(user: IUser): string {
        const payload = {
          sub: user.userid,
          iat: moment().unix(),
          exp: moment().add(14, 'days').unix()
        };
        return jwt.encode(payload, tokencfg.config.TOKEN_SECRET);
      }

}


text:
@import url(custom-global.css);
@import url(custom-accordion.css);
@import url(custom-layout.css);

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Local Configuration Override
 *
 * This configuration override file is for overriding environment-specific and
 * security-sensitive configuration information. Copy this file without the
 * .dist extension at the end and populate values as needed.
 *
 * @NOTE: This file is ignored from Git by default with the .gitignore included
 * in ZendSkeletonApplication. This is a good practice, as it prevents sensitive
 * credentials from accidentally being committed into version control.
 */
return array(
		'service_manager' => array(
				'abstract_factories' => array(
						'Zend\\Db\\Adapter\\AdapterAbstractServiceFactory'
				),
				'factories' => array(
						'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory'
				)
		),
		'db' => array(
				'username' => 'devtmpad_apiuser',
				'password' => 'cary5were',
				'driver' => 'Pdo',
				'dsn' => 'mysql:dbname=devtmpad_apiuser;hostname=localhost',
				'driver_options' => array(
						PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
				)
		)
);


text:
#pragma once
#include <aws/networkmanager/NetworkManager_EXPORTS.h>
#include <aws/networkmanager/NetworkManagerRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace NetworkManager
{
namespace Model
{

  /**
   */
  class AWS_NETWORKMANAGER_API DeleteLinkRequest : public NetworkManagerRequest
  {
  public:
    DeleteLinkRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DeleteLink"; }

    Aws::String SerializePayload() const override;

    /**
     *
The ID of the global network.

     */
    inline const Aws::String& GetGlobalNetworkId() const{ return m_globalNetworkId; }

    /**
     *
The ID of the global network.

     */
    inline bool GlobalNetworkIdHasBeenSet() const { return m_globalNetworkIdHasBeenSet; }

    /**
     *
The ID of the global network.

     */
    inline void SetGlobalNetworkId(const Aws::String& value) { m_globalNetworkIdHasBeenSet = true; m_globalNetworkId = value; }

    /**
     *
The ID of the global network.

     */
    inline void SetGlobalNetworkId(Aws::String&& value) { m_globalNetworkIdHasBeenSet = true; m_globalNetworkId = std::move(value); }

    /**
     *
The ID of the global network.

     */
    inline void SetGlobalNetworkId(const char* value) { m_globalNetworkIdHasBeenSet = true; m_globalNetworkId.assign(value); }

    /**
     *
The ID of the global network.

     */
    inline DeleteLinkRequest& WithGlobalNetworkId(const Aws::String& value) { SetGlobalNetworkId(value); return *this;}

    /**
     *
The ID of the global network.

     */
    inline DeleteLinkRequest& WithGlobalNetworkId(Aws::String&& value) { SetGlobalNetworkId(std::move(value)); return *this;}

    /**
     *
The ID of the global network.

     */
    inline DeleteLinkRequest& WithGlobalNetworkId(const char* value) { SetGlobalNetworkId(value); return *this;}

    /**
     *
The ID of the link.

     */
    inline const Aws::String& GetLinkId() const{ return m_linkId; }

    /**
     *
The ID of the link.

     */
    inline bool LinkIdHasBeenSet() const { return m_linkIdHasBeenSet; }

    /**
     *
The ID of the link.

     */
    inline void SetLinkId(const Aws::String& value) { m_linkIdHasBeenSet = true; m_linkId = value; }

    /**
     *
The ID of the link.

     */
    inline void SetLinkId(Aws::String&& value) { m_linkIdHasBeenSet = true; m_linkId = std::move(value); }

    /**
     *
The ID of the link.

     */
    inline void SetLinkId(const char* value) { m_linkIdHasBeenSet = true; m_linkId.assign(value); }

    /**
     *
The ID of the link.

     */
    inline DeleteLinkRequest& WithLinkId(const Aws::String& value) { SetLinkId(value); return *this;}

    /**
     *
The ID of the link.

     */
    inline DeleteLinkRequest& WithLinkId(Aws::String&& value) { SetLinkId(std::move(value)); return *this;}

    /**
     *
The ID of the link.

     */
    inline DeleteLinkRequest& WithLinkId(const char* value) { SetLinkId(value); return *this;}

  private:

    Aws::String m_globalNetworkId;
    bool m_globalNetworkIdHasBeenSet;

    Aws::String m_linkId;
    bool m_linkIdHasBeenSet;
  };

} // namespace Model
} // namespace NetworkManager
} // namespace Aws


text:
import React, { Component } from 'react';

class RegisterSchoolForm extends Component {
  render() {
    const { nameSchool, addressSchool, domainNameSchool,
      updateNameSchool, updateAddressSchool, updateDomainEmailSchool
    } = this.props;

    const placeholder = (domainNameSchool !== null) ? domainNameSchool : 'myschooldomain.com';
    return (

          Name of School
          <input className='signup-form-input'
            onChange={updateNameSchool}
            placeholder={nameSchool}
          />

          Address School
          <input className='signup-form-input'
            onChange={updateAddressSchool}
            placeholder={addressSchool}
          />

          Domain name for email address school
          <input className='signup-form-input'
            onChange={updateDomainEmailSchool}
            placeholder={placeholder}
          />

    );
  }
}

export default RegisterSchoolForm;


text:
django-swiftbrowser
===================

[![Build Status](https://travis-ci.org/cschwede/django-swiftbrowser.png?branch=master)](https://travis-ci.org/cschwede/django-swiftbrowser)

Simple web app build with Django and Twitter Bootstrap to access Openstack Swift.

* No database needed
* Works with keystone, tempauth & swauth
* Support for public containers. ACL support in the works
* Minimal interface, usable on your desktop as well as on your smartphone
* Screenshots anyone? See below!

Quick Install
-------------

1) Install swiftbrowser:

    pip install django-swiftbrowser

2) Please make sure that "tempurl" and "formpost" middlewares are activated in your proxy server. Extract from /etc/swift/proxy-server.conf:

    [pipeline:main]
    pipeline = catch_errors gatekeeper healthcheck proxy-logging cache tempurl formpost tempauth proxy-logging proxy-server

    [filter:tempurl]
    use = egg:swift#tempurl

    [filter:formpost]
    use = egg:swift#formpost

3) Run development server:

    django-admin runserver --settings=swiftbrowser.settings

4) Open "http://127.0.0.1:8000/" in your browser and use 'account:username' to login (or tenant/project:username if using Keystone).

Running with Docker
-------------------

The included Dockerfile makes running django-swiftbrowser even easier. First
build the Docker container:

    docker build . -t swiftbrowser

Now run the container and point it to your Swift cluster, eg:

    docker run -d -p 8000:8000 \
        -e SECRET_KEY=CHANGE_THIS_TO_SOME_RANDOM_VALUE \
        -e SWIFT_AUTH_VERSION=1 \
        -e SWIFT_AUTH_URL=http://192.168.2.200:8080/auth/v1.0 \
        -e STORAGE_URL=http://192.168.2.200:8080/v1 \
        swiftbrowser

You can also run the tox test environment inside the container:

    docker run swiftbrowser tox

Screenshots
-----------

![Login screen](screenshots/00.png)
![Container view](screenshots/01.png)
![Object view](screenshots/02.png)


text:
<!DOCTYPE html>

        <meta charset="utf-8" />
        <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" type="text/css" href="{Saivi::RES}/car/css/reset.css" media="all" />
<link rel="stylesheet" type="text/css" href="{Saivi::RES}/car/css/common.css" media="all" />

<title>实用工具</title>

<volist name="utility" id="vo">
<if condition="($vo['url'] neq '') OR ($vo['name'] neq '')">

{Saivi:$vo['name']}

            </if>
            </volist>

        <include file="Car:menu"/>


text:
	var currentStep = 0;
	var lecture = true;
	var audio = true;
	var parentDocument = parent.document;
	var instruct = parentDocument.getElementById('instruct');
	var audioPlayer = parentDocument.getElementById('audio');

	function displayText(step) {
		if (!lecture) {
			currentStep = step;
		}
		if (audio) {
			audioPlayer.pause();
			playAudio(step);
		}

		instruct.innerHTML = text[step];

	}

	function setup() {
		for (step=1; step<= STEPS; step++) {
			d3.select('#step' + step)
				.style('cursor', 'pointer')
				.attr('visibility','hidden')
				.on('click', function(){displayText(this.id.replace("step",""))});
		}
	}

	function startReview(){
		document.getElementById("modeRev").style.fill="#3398FE";
		document.getElementById("modeLect").style.fill="#4c4c4c";
		beginReview();
	}

	function startLecture(){
		document.getElementById("modeLect").style.fill="#3398FE";
		document.getElementById("modeRev").style.fill="#4c4c4c";
		beginLecture();
	}

	function changeAudio() {
		if (audio) {
			audio = false;
			audioPlayer.pause();
			d3.select('#mute').attr('visibility','visible');
		} else {
			audio = true;
			d3.select('#mute').attr('visibility','hidden');
		}
	}

	function playAudio(step) {
		if (audioPlayer.canPlayType && audioPlayer.canPlayType("audio/ogg")) {
			audioPlayer.src = audioFiles[step] + ".ogg";
		} else if (audioPlayer.canPlayType && audioPlayer.canPlayType("audio/mpeg")) {
			audioPlayer.src = audioFiles[step] + ".mp3";
		} else if (audioPlayer.canPlayType && audioPlayer.canPlaytype("audio/x-wav")) {
			audioPlayer.src = audioFiles[step] + ".wav";
		} else {
			changeAudio();
		}
		audioPlayer.play();
	}

	function beginLecture() {
		lecture = true;
		currentStep = 0;
		for (i=1; i <= STEPS; i++) {
			d3.select('#step' + i).attr('visibility','hidden');
		}
		instruct.innerHTML = "";
	}

	function beginReview() {
		lecture = false;
		for (i=1; i <= STEPS; i++) {
			d3.select('#step' + i).attr('visibility','visible');
		}
		instruct.innerHTML = "";
	}

	function next(){
		if (currentStep < STEPS) {
			currentStep++;
			displayText(currentStep);
			if (lecture) {
				d3.select('#step' + currentStep).attr('visibility','visible');
			}
		}
	}

	function prev(){
		if (currentStep > 0) {
			if (lecture) {
				d3.select('#step' + currentStep).attr('visibility','hidden');
			}
			currentStep--;
			displayText(currentStep);
		}
	}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />

<link rel="shortcut icon" type="image/x-icon" href="../../../../../../favicon.ico" />
<title>GoogleMap | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../../../../assets/css/default.css" rel="stylesheet" type="text/css">

<link href="../../../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

          	Quicknav
			      Quicknav

                  Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../../../../')"
onkeyup="return search_changed(event, false, '../../../../../../')" />
      </form>

        close

Get Started

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Get the SDK

Google Services

Google Play

Publishing

Promoting

App Quality

Spotlight

Open Distribution

Results

Loading...

Training

API Guides

Reference

Tools

Google Services

to top

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  com.google.android.gms

  com.google.android.gms.ads

  com.google.android.gms.ads.doubleclick

  com.google.android.gms.ads.identifier

  com.google.android.gms.ads.mediation

  com.google.android.gms.ads.mediation.admob

  com.google.android.gms.ads.mediation.customevent

  com.google.android.gms.ads.search

  com.google.android.gms.appstate

  com.google.android.gms.auth

  com.google.android.gms.common

  com.google.android.gms.common.annotation

  com.google.android.gms.common.api

  com.google.android.gms.common.data

  com.google.android.gms.common.images

  com.google.android.gms.drive

  com.google.android.gms.drive.metadata

  com.google.android.gms.drive.query

  com.google.android.gms.drive.widget

  com.google.android.gms.games

  com.google.android.gms.games.achievement

  com.google.android.gms.games.leaderboard

  com.google.android.gms.games.multiplayer

  com.google.android.gms.games.multiplayer.realtime

  com.google.android.gms.games.multiplayer.turnbased

  com.google.android.gms.gcm

  com.google.android.gms.location

  com.google.android.gms.maps

  com.google.android.gms.maps.model

  com.google.android.gms.panorama

  com.google.android.gms.plus

  com.google.android.gms.plus.model.moments

  com.google.android.gms.plus.model.people

  com.google.android.gms.wallet

Interfaces

GoogleMap.CancelableCallback

GoogleMap.InfoWindowAdapter

GoogleMap.OnCameraChangeListener

GoogleMap.OnInfoWindowClickListener

GoogleMap.OnMapClickListener

GoogleMap.OnMapLoadedCallback

GoogleMap.OnMapLongClickListener

GoogleMap.OnMarkerClickListener

GoogleMap.OnMarkerDragListener

GoogleMap.OnMyLocationButtonClickListener

GoogleMap.OnMyLocationChangeListener

GoogleMap.SnapshotReadyCallback

LocationSource

LocationSource.OnLocationChangedListener

Classes

CameraUpdate

CameraUpdateFactory

GoogleMap

GoogleMapOptions

MapFragment

MapsInitializer

MapView

Projection

SupportMapFragment

UiSettings

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Nested Classes

  | Constants

  | Methods

  | Inherited Methods

| [Expand All]

    public

    final

    class

GoogleMap

    extends Object

        java.lang.Object

               ↳

        com.google.android.gms.maps.GoogleMap

Class Overview

This is the main class of the Google Maps Android API and is the entry point for all methods
 related to the map.  You cannot instantiate a GoogleMap object directly,
 rather, you must obtain one from the getMap() method on a MapFragment or
 MapView that you have added to your application.

 Note: Similar to a View object, a GoogleMap can only be read
 and modified from the main thread. Calling GoogleMap methods from another thread will
 result in an exception.

Developer Guide

 To get started, read the Google Maps Android API v2
 developer guide.

Summary

Nested Classes

      <nobr>

        interface</nobr>
      GoogleMap.CancelableCallback
      A callback interface for reporting when a task is complete or cancelled.

      <nobr>

        interface</nobr>
      GoogleMap.InfoWindowAdapter
      Provides views for customized rendering of info windows.

      <nobr>

        interface</nobr>
      GoogleMap.OnCameraChangeListener
      Defines signatures for methods that are called when the camera changes position.

      <nobr>

        interface</nobr>
      GoogleMap.OnInfoWindowClickListener
      Callback interface for click/tap events on a marker's info window.

      <nobr>

        interface</nobr>
      GoogleMap.OnMapClickListener
      Callback interface for when the user taps on the map.

      <nobr>

        interface</nobr>
      GoogleMap.OnMapLoadedCallback
      Callback interface for when the map has finished rendering.

      <nobr>

        interface</nobr>
      GoogleMap.OnMapLongClickListener
      Callback interface for when the user long presses on the map.

      <nobr>

        interface</nobr>
      GoogleMap.OnMarkerClickListener
      Defines signatures for methods that are called when a marker is clicked or tapped.

      <nobr>

        interface</nobr>
      GoogleMap.OnMarkerDragListener
      Callback interface for drag events on markers.

      <nobr>

        interface</nobr>
      GoogleMap.OnMyLocationButtonClickListener
      Callback interface for when the My Location button is clicked.

      <nobr>

        interface</nobr>
      GoogleMap.OnMyLocationChangeListener

      This interface is deprecated.
    use LocationClient instead.
 LocationClient provides improved location finding and power usage and is used by the
 "My Location" blue dot. See the MyLocationDemoActivity in the sample applications folder
 for example example code, or the

 Location Developer Guide.

      <nobr>

        interface</nobr>
      GoogleMap.SnapshotReadyCallback
      Callback interface to notify when the snapshot has been taken.

Constants

        int
        MAP_TYPE_HYBRID
        Satellite maps with a transparent layer of major streets.

        int
        MAP_TYPE_NONE
        No base map tiles.

        int
        MAP_TYPE_NORMAL
        Basic maps.

        int
        MAP_TYPE_SATELLITE
        Satellite maps with no labels.

        int
        MAP_TYPE_TERRAIN
        Terrain maps.

Public Methods

        <nobr>

            final

            Circle</nobr>

        <nobr>
        addCircle(CircleOptions options)</nobr>

Add a circle to this map.

        <nobr>

            final

            GroundOverlay</nobr>

        <nobr>
        addGroundOverlay(GroundOverlayOptions options)</nobr>

Adds an image to this map.

        <nobr>

            final

            Marker</nobr>

        <nobr>
        addMarker(MarkerOptions options)</nobr>

Adds a marker to this map.

        <nobr>

            final

            Polygon</nobr>

        <nobr>
        addPolygon(PolygonOptions options)</nobr>

Adds a polygon to this map.

        <nobr>

            final

            Polyline</nobr>

        <nobr>
        addPolyline(PolylineOptions options)</nobr>

Adds a polyline to this map.

        <nobr>

            final

            TileOverlay</nobr>

        <nobr>
        addTileOverlay(TileOverlayOptions options)</nobr>

Adds a tile overlay to this map.

        <nobr>

            final

            void</nobr>

        <nobr>
        animateCamera(CameraUpdate update, int durationMs, GoogleMap.CancelableCallback callback)</nobr>

Moves the map according to the update with an animation over a specified duration, and calls
 an optional callback on completion.

        <nobr>

            final

            void</nobr>

        <nobr>
        animateCamera(CameraUpdate update, GoogleMap.CancelableCallback callback)</nobr>

Animates the movement of the camera from the current position to the position defined in the
 update and calls an optional callback on completion.

        <nobr>

            final

            void</nobr>

        <nobr>
        animateCamera(CameraUpdate update)</nobr>

Animates the movement of the camera from the current position to the position defined in the
 update.

        <nobr>

            final

            void</nobr>

        <nobr>
        clear()</nobr>

Removes all markers, polylines, polygons, overlays, etc from the map.

        <nobr>

            final

            CameraPosition</nobr>

        <nobr>
        getCameraPosition()</nobr>

Gets the current position of the camera.

        <nobr>

            final

            int</nobr>

        <nobr>
        getMapType()</nobr>

Gets the type of map that's currently displayed.

        <nobr>

            final

            float</nobr>

        <nobr>
        getMaxZoomLevel()</nobr>

Returns the maximum zoom level for the current camera position.

        <nobr>

            final

            float</nobr>

        <nobr>
        getMinZoomLevel()</nobr>

Returns the minimum zoom level.

        <nobr>

            final

            Location</nobr>

        <nobr>
        getMyLocation()</nobr>

      This method is deprecated.
    use LocationClient instead.
 LocationClient provides improved location finding and power usage and is used by the
 "My Location" blue dot. See the MyLocationDemoActivity in the sample applications folder
 for example example code, or the

 Location Developer Guide.

        <nobr>

            final

            Projection</nobr>

        <nobr>
        getProjection()</nobr>

Returns a Projection object that you can use to convert between screen coordinates
 and latitude/longitude coordinates.

        <nobr>

            final

            UiSettings</nobr>

        <nobr>
        getUiSettings()</nobr>

Gets the user interface settings for the map.

        <nobr>

            final

            boolean</nobr>

        <nobr>
        isBuildingsEnabled()</nobr>

Returns whether 3D buildings are enabled.

        <nobr>

            final

            boolean</nobr>

        <nobr>
        isIndoorEnabled()</nobr>

Gets whether indoor maps are currently enabled.

        <nobr>

            final

            boolean</nobr>

        <nobr>
        isMyLocationEnabled()</nobr>

Gets the status of the my-location layer.

        <nobr>

            final

            boolean</nobr>

        <nobr>
        isTrafficEnabled()</nobr>

Checks whether the map is drawing traffic data.

        <nobr>

            final

            void</nobr>

        <nobr>
        moveCamera(CameraUpdate update)</nobr>

Repositions the camera according to the instructions defined in the update.

        <nobr>

            final

            void</nobr>

        <nobr>
        setBuildingsEnabled(boolean enabled)</nobr>

Turns the 3D buildings layer on or off.

        <nobr>

            final

            boolean</nobr>

        <nobr>
        setIndoorEnabled(boolean enabled)</nobr>

Sets whether indoor maps should be enabled.

        <nobr>

            final

            void</nobr>

        <nobr>
        setInfoWindowAdapter(GoogleMap.InfoWindowAdapter adapter)</nobr>

Sets a custom renderer for the contents of info windows.

        <nobr>

            final

            void</nobr>

        <nobr>
        setLocationSource(LocationSource source)</nobr>

Replaces the location source of the my-location layer.

        <nobr>

            final

            void</nobr>

        <nobr>
        setMapType(int type)</nobr>

Sets the type of map tiles that should be displayed.

        <nobr>

            final

            void</nobr>

        <nobr>
        setMyLocationEnabled(boolean enabled)</nobr>

Enables or disables the my-location layer.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnCameraChangeListener(GoogleMap.OnCameraChangeListener listener)</nobr>

Sets a callback that's invoked when the camera changes.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnInfoWindowClickListener(GoogleMap.OnInfoWindowClickListener listener)</nobr>

Sets a callback that's invoked when a marker info window is clicked.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnMapClickListener(GoogleMap.OnMapClickListener listener)</nobr>

Sets a callback that's invoked when the map is tapped.

        <nobr>

            void</nobr>

        <nobr>
        setOnMapLoadedCallback(GoogleMap.OnMapLoadedCallback callback)</nobr>

Sets a callback that is invoked when this map has finished rendering.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnMapLongClickListener(GoogleMap.OnMapLongClickListener listener)</nobr>

Sets a callback that's invoked when the map is long pressed.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnMarkerClickListener(GoogleMap.OnMarkerClickListener listener)</nobr>

Sets a callback that's invoked when a marker is clicked.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnMarkerDragListener(GoogleMap.OnMarkerDragListener listener)</nobr>

Sets a callback that's invoked when a marker is dragged.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnMyLocationButtonClickListener(GoogleMap.OnMyLocationButtonClickListener listener)</nobr>

Sets a callback that's invoked when the my location button is clicked.

        <nobr>

            final

            void</nobr>

        <nobr>
        setOnMyLocationChangeListener(GoogleMap.OnMyLocationChangeListener listener)</nobr>

      This method is deprecated.
    use LocationClient instead.
 LocationClient provides improved location finding and power usage and is used by the
 "My Location" blue dot. See the MyLocationDemoActivity in the sample applications folder
 for example example code, or the

 Location Developer Guide.

        <nobr>

            final

            void</nobr>

        <nobr>
        setPadding(int left, int top, int right, int bottom)</nobr>

Sets padding on the map.

        <nobr>

            final

            void</nobr>

        <nobr>
        setTrafficEnabled(boolean enabled)</nobr>

Turns the traffic layer on or off.

        <nobr>

            final

            void</nobr>

        <nobr>
        snapshot(GoogleMap.SnapshotReadyCallback callback, Bitmap bitmap)</nobr>

Takes a snapshot of the map.

        <nobr>

            final

            void</nobr>

        <nobr>
        snapshot(GoogleMap.SnapshotReadyCallback callback)</nobr>

Takes a snapshot of the map.

        <nobr>

            final

            void</nobr>

        <nobr>
        stopAnimation()</nobr>

Stops the camera animation if there is one in progress.

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object arg0)</nobr>

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0, int arg1)</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0)</nobr>

Constants

        public
        static
        final
        int

        MAP_TYPE_HYBRID

Satellite maps with a transparent layer of major streets.

        Constant Value:

                4
                (0x00000004)

        public
        static
        final
        int

        MAP_TYPE_NONE

No base map tiles.

        Constant Value:

                0
                (0x00000000)

        public
        static
        final
        int

        MAP_TYPE_NORMAL

Basic maps.

        Constant Value:

                1
                (0x00000001)

        public
        static
        final
        int

        MAP_TYPE_SATELLITE

Satellite maps with no labels.

        Constant Value:

                2
                (0x00000002)

        public
        static
        final
        int

        MAP_TYPE_TERRAIN

Terrain maps.

        Constant Value:

                3
                (0x00000003)

Public Methods

        public

        final

        Circle

      addCircle
      (CircleOptions options)

Add a circle to this map.

Parameters

          options
          A circle options object that defines how to render the Circle

Returns

The Circle object that is added to the map

        public

        final

        GroundOverlay

      addGroundOverlay
      (GroundOverlayOptions options)

Adds an image to this map.

Parameters

          options
          A ground-overlay options object that defines how to render the overlay.
            Options must have an image (AnchoredBitmap) and position specified.

Returns

The GroundOverlay that was added to the map.

Throws

            IllegalArgumentException
            if either the image or the position is unspecified in the
             options.

        public

        final

        Marker

      addMarker
      (MarkerOptions options)

Adds a marker to this map.

 The marker's icon is rendered on the map at the location Marker.position. Clicking the marker
 centers the camera on the marker. If Marker.title is defined, the map shows an info box with
 the marker's title and snippet. If the marker is draggable, long-clicking and then dragging
 the marker moves it.

Parameters

          options
          A marker options object that defines how to render the marker.

Returns

The Marker that was added to the map.

        public

        final

        Polygon

      addPolygon
      (PolygonOptions options)

Adds a polygon to this map.

Parameters

          options
          A polygon options object that defines how to render the Polygon.

Returns

The Polygon object that is added to the map.

        public

        final

        Polyline

      addPolyline
      (PolylineOptions options)

Adds a polyline to this map.

Parameters

          options
          A polyline options object that defines how to render the Polyline.

Returns

The Polyline object that was added to the map.

        public

        final

        TileOverlay

      addTileOverlay
      (TileOverlayOptions options)

Adds a tile overlay to this map. See TileOverlay for more information.

 Note that unlike other overlays, if the map is recreated, tile overlays are not automatically
 restored and must be re-added manually.

Parameters

          options
          A tile-overlay options object that defines how to render the overlay. Options
            must have a TileProvider
            specified, otherwise an IllegalArgumentException will be thrown.

Returns

The TileOverlay that was added to the map.

Throws

            IllegalArgumentException
            if the TileProvider is unspecified in the options.

        public

        final

        void

      animateCamera
      (CameraUpdate update, int durationMs, GoogleMap.CancelableCallback callback)

Moves the map according to the update with an animation over a specified duration, and calls
 an optional callback on completion. See CameraUpdateFactory for a set of updates.

 If getCameraPosition() is called during the animation, it will return the current
 location of the camera in flight.

Parameters

          durationMs
          The duration of the animation in milliseconds. This must be strictly
            positive, otherwise an IllegalArgumentException will be thrown.

          callback
          An optional callback to be notified from the main thread when the animation
            stops. If the animation stops due to its natural completion, the callback will be
            notified with onFinish(). If the animation stops due to
            interruption by a later camera movement or a user gesture,
            onCancel() will be called. The callback should not
            attempt to move or animate the camera in its cancellation method.

        public

        final

        void

      animateCamera
      (CameraUpdate update, GoogleMap.CancelableCallback callback)

Animates the movement of the camera from the current position to the position defined in the
 update and calls an optional callback on completion. See CameraUpdateFactory for a
 set of updates.

 During the animation, a call to getCameraPosition() returns an intermediate location
 of the camera.

Parameters

          update
          The change that should be applied to the camera.

          callback
          The callback to invoke from the main thread when the animation stops. If the
            animation completes normally, onFinish() is called;
            otherwise, onCancel() is called. Do not update or
            animate the camera from within onCancel().

        public

        final

        void

      animateCamera
      (CameraUpdate update)

Animates the movement of the camera from the current position to the position defined in the
 update. During the animation, a call to getCameraPosition() returns an intermediate
 location of the camera.

 See CameraUpdateFactory for a set of updates.

Parameters

          update
          The change that should be applied to the camera.

        public

        final

        void

      clear
      ()

Removes all markers, polylines, polygons, overlays, etc from the map.

        public

        final

        CameraPosition

      getCameraPosition
      ()

Gets the current position of the camera.

 The CameraPosition returned is a snapshot of the current position, and will not
 automatically update when the camera moves.

Returns

The current position of the Camera.

        public

        final

        int

      getMapType
      ()

Gets the type of map that's currently displayed. See MAP_TYPE_NORMAL,
 MAP_TYPE_SATELLITE, MAP_TYPE_TERRAIN for possible values.

Returns

The map type.

        public

        final

        float

      getMaxZoomLevel
      ()

Returns the maximum zoom level for the current camera position. This takes into account what
 map type is currently being used, e.g., satellite or terrain may have a lower max zoom level
 than the base map tiles.

Returns

The maximum zoom level available at the current camera position.

        public

        final

        float

      getMinZoomLevel
      ()

Returns the minimum zoom level. This is the same for every location (unlike the maximum zoom
 level) but may vary between devices and map sizes.

Returns

The minimum zoom level available.

        public

        final

        Location

      getMyLocation
      ()

      This method is deprecated.

    use LocationClient instead.
 LocationClient provides improved location finding and power usage and is used by the
 "My Location" blue dot. See the MyLocationDemoActivity in the sample applications folder
 for example example code, or the

 Location Developer Guide.

Returns the currently displayed user location, or null if there is no location data
 available.

Returns

The currently displayed user location.

Throws

            IllegalStateException
            if the my-location layer is not enabled.

        public

        final

        Projection

      getProjection
      ()

Returns a Projection object that you can use to convert between screen coordinates
 and latitude/longitude coordinates.

 The Projection returned is a snapshot of the current projection, and will not
 automatically update when the camera moves. As this operation is expensive, you should get
 the projection only once per screen. Google Maps uses the Mercator projection to create its
 maps from geographic data and convert points on the map into geographic coordinates.

Returns

The Projection of the map in its current state.

        public

        final

        UiSettings

      getUiSettings
      ()

Gets the user interface settings for the map.

Returns

The UiSettings for this map.

        public

        final

        boolean

      isBuildingsEnabled
      ()

Returns whether 3D buildings are enabled.

Returns

True if buildings are enabled, false otherwise.

        public

        final

        boolean

      isIndoorEnabled
      ()

Gets whether indoor maps are currently enabled.

Returns

true if indoor maps are enabled; false if indoor maps are disabled;

        public

        final

        boolean

      isMyLocationEnabled
      ()

Gets the status of the my-location layer.

Returns

True if the my-location layer is enabled, false otherwise.

        public

        final

        boolean

      isTrafficEnabled
      ()

Checks whether the map is drawing traffic data. This is subject to the availability of
 traffic data.

Returns

True if traffic data is enabled, false otherwise.

        public

        final

        void

      moveCamera
      (CameraUpdate update)

Repositions the camera according to the instructions defined in the update. The move is
 instantaneous, and a subsequent getCameraPosition() will reflect the new position.
 See CameraUpdateFactory for a set of updates.

Parameters

          update
          The change that should be applied to the camera.

        public

        final

        void

      setBuildingsEnabled
      (boolean enabled)

Turns the 3D buildings layer on or off.

        public

        final

        boolean

      setIndoorEnabled
      (boolean enabled)

Sets whether indoor maps should be enabled. Currently, indoor maps can only be shown on one
 map at a time and by default, this is the first map added to your application. To enable
 indoor maps on another map, you must first disable indoor maps on the original map. If you
 try to enable indoor maps when it is enabled on another map, nothing will happen and this
 will return false. When Indoor is not enabled for a map, all methods related to
 indoor will return null, or false.

Parameters

          enabled
          true to try to enable indoor maps; false to disable indoor
            maps.

Returns

whether it was possible to enable indoor maps.

        public

        final

        void

      setInfoWindowAdapter
      (GoogleMap.InfoWindowAdapter adapter)

Sets a custom renderer for the contents of info windows.

 Like the map's event listeners, this state is not serialized with the map. If the map gets
 re-created (e.g., due to a configuration change), you must ensure that you call this method
 again in order to preserve the customization.

Parameters

          adapter
          The adapter to use for info window contents, or null to use the
            default content rendering in info windows.

        public

        final

        void

      setLocationSource
      (LocationSource source)

Replaces the location source of the my-location layer.

Parameters

          source
          A location source to use in the my-location layer. Set to null to use
            the default location source.

        public

        final

        void

      setMapType
      (int type)

Sets the type of map tiles that should be displayed. The allowable values are:

MAP_TYPE_NORMAL: Basic map with roads.

MAP_TYPE_SATELLITE: Satellite view with roads.

MAP_TYPE_TERRAIN: Terrain view without roads.

Parameters

          type
          The type of map to display.

        public

        final

        void

      setMyLocationEnabled
      (boolean enabled)

Enables or disables the my-location layer.

 While enabled, the my-location layer continuously draws an indication of a user's current
 location and bearing, and displays UI controls that allow a user to interact with their
 location (for example, to enable or disable camera tracking of their location and bearing).

Parameters

          enabled
          True to enable; false to disable.

        public

        final

        void

      setOnCameraChangeListener
      (GoogleMap.OnCameraChangeListener listener)

Sets a callback that's invoked when the camera changes.

Parameters

          listener
          The callback that's invoked when the camera changes. To unset the callback,
            use null.

        public

        final

        void

      setOnInfoWindowClickListener
      (GoogleMap.OnInfoWindowClickListener listener)

Sets a callback that's invoked when a marker info window is clicked.

Parameters

          listener
          The callback that's invoked when a marker info window is clicked. To unset
            the callback, use null.

        public

        final

        void

      setOnMapClickListener
      (GoogleMap.OnMapClickListener listener)

Sets a callback that's invoked when the map is tapped.

Parameters

          listener
          The callback that's invoked when the map is tapped. To unset the callback,
            use null.

        public

        void

      setOnMapLoadedCallback
      (GoogleMap.OnMapLoadedCallback callback)

Sets a callback that is invoked when this map has finished rendering. The callback will only
 be invoked once.

 If this method is called when the map is fully rendered, the callback will be invoked
 immediately. This event will not fire if the map never loads due to connectivity issues, or
 if the map is continuously changing and never completes loading due to the user constantly
 interacting with the map.

Parameters

          callback
          The callback invoked when the map has finished rendering. To unset the
     callback, use null.

        public

        final

        void

      setOnMapLongClickListener
      (GoogleMap.OnMapLongClickListener listener)

Sets a callback that's invoked when the map is long pressed.

Parameters

          listener
          The callback that's invoked when the map is long pressed. To unset the
            callback, use null.

        public

        final

        void

      setOnMarkerClickListener
      (GoogleMap.OnMarkerClickListener listener)

Sets a callback that's invoked when a marker is clicked.

Parameters

          listener
          The callback that's invoked when a marker is clicked. To unset the callback,
            use null.

        public

        final

        void

      setOnMarkerDragListener
      (GoogleMap.OnMarkerDragListener listener)

Sets a callback that's invoked when a marker is dragged.

Parameters

          listener
          The callback that's invoked on marker drag events. To unset the callback, use
            null.

        public

        final

        void

      setOnMyLocationButtonClickListener
      (GoogleMap.OnMyLocationButtonClickListener listener)

Sets a callback that's invoked when the my location button is clicked.

If the listener returns true, the event is consumed and the default
 behavior will not occur. If it returns false, the default behavior will occur (i.e.
 The camera moves such that it is centered on the user's location).

Parameters

          listener
          The callback that's invoked when the My Location button is clicked.

        public

        final

        void

      setOnMyLocationChangeListener
      (GoogleMap.OnMyLocationChangeListener listener)

      This method is deprecated.

    use LocationClient instead.
 LocationClient provides improved location finding and power usage and is used by the
 "My Location" blue dot. See the MyLocationDemoActivity in the sample applications folder
 for example example code, or the

 Location Developer Guide.

Sets a callback that's invoked when the My Location dot changes location.

Parameters

          listener
          The callback that's invoked when the My Location dot changes.

        public

        final

        void

      setPadding
      (int left, int top, int right, int bottom)

Sets padding on the map.

This method allows you to define a visible region on the map, to signal to the map that
 portions of the map around the edges may be obscured, by setting padding on each of the four
 edges of the map. Map functions will be adapted to the padding. For example, the zoom
 controls, compass, copyright notices and Google logo will be moved to fit inside the defined
 region, camera movements will be relative to the center of the visible region, etc.

Parameters

          left
          the number of pixels of padding to be added on the left of the map.

          top
          the number of pixels of padding to be added on the top of the map.

          right
          the number of pixels of padding to be added on the right of the map.

          bottom
          the number of pixels of padding to be added on the bottom of the map.

        public

        final

        void

      setTrafficEnabled
      (boolean enabled)

Turns the traffic layer on or off.

        public

        final

        void

      snapshot
      (GoogleMap.SnapshotReadyCallback callback, Bitmap bitmap)

Takes a snapshot of the map.

This method is equivalent to snapshot(SnapshotReadyCallback) but lets you
 provide a preallocated Bitmap. If the bitmap does not match the current dimensions of
 the map, another bitmap will be allocated that fits the map's dimensions.

Although in most cases the object passed by the callback method is the same as the one
 given in the parameter to this method, in some cases the returned object can be different
 (e.g., if the view's dimensions have changed by the time the snapshot is actually taken).
 Thus, you should only trust the content of the bitmap passed by the callback method.

Parameters

          callback
          Callback method invoked when the snapshot is taken.

          bitmap
          A preallocated bitmap. If null, behaves like
     snapshot(SnapshotReadyCallback).

        public

        final

        void

      snapshot
      (GoogleMap.SnapshotReadyCallback callback)

Takes a snapshot of the map.

You can use snapshots within your application when an interactive
 map would be difficult, or impossible, to use. For example, images
 produced with the snapshot() method can be used to display a
 thumbnail of the map in your app, or a snapshot in the notification
 center.

Note: Images of the map must not be
 transmitted to your servers, or otherwise used outside of the
 application. If you need to send a map to another application or user,
 send data that allows them to reconstruct the map for the new user
 instead of a snapshot.

Parameters

          callback
          Callback method invoked when the snapshot is taken.

        public

        final

        void

      stopAnimation
      ()

Stops the camera animation if there is one in progress. When the method is called, the camera
 stops moving immediately and remains in that position.

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android  r —

    About Android  |
    Legal  |
    Support


text:
<?xml version="1.0" ?>
<!--
<copyright
 notice="cics-lm-source-program"
 pids="5655-Y04"
 years="2009,2014"
 crc="2814107617" >

 Licensed Materials - Property of IBM

 5655-Y04

 (C) Copyright IBM Corp. 2009, 2014 All Rights Reserved.

 US Government Users Restricted Rights - Use, duplication or
 disclosure restricted by GSA ADP Schedule Contract with
 IBM Corp.

 @{[**]copyright.years=2009, 2014}

 </copyright>
-->
<provider_pipeline xmlns="http://www.ibm.com/software/htp/cics/pipeline">
  <service>
    <terminal_handler>
      <cics_soap_1.1_handler/>
    </terminal_handler>
  </service>
  <apphandler>DFHPITP</apphandler>
</provider_pipeline>


text:
///////////////////////////////
// use to prevent duplicates //
///////////////////////////////

var murmur_util = require('./HashUtilities.js');
var SEED_CEILING = 9999999999;
var SEED_TAG = 'HASH_SEED';
var HIGH_WATER = 220;
var BATCH_WAIT_MS = 4;
var redis = require('redis');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var redisConnector = require('./RedisConnector.js');

/**
 * [Buffer creates a hash for a particular context]
 * EMITS READY OR ERROR EVENTS
 * IF READY, RETURNS 1 IF A NEW SEED WAS GENERATED, 0 IF AN EXISTING SEED WAS USED
 */
function UnionStream(EXP_SECONDS){
    var self = this;

    self.buffer = redis.createClient();
    self.connector = redisConnector;
    self.connector.maintainClient(self.buffer);
    self.pending_queue = [];
    self.prev_checkpoint_timestamp = new Date().getTime();
    self.EXP_SECONDS = EXP_SECONDS;
    self.message_volume = 0;
    self.volume_since_gc = 0;
    self.active_batch = false;
    self.active_overflow = false;

    initialize_seed(self);

    set_message_policies(self);
    set_batching_policies(self);
    set_drainage_policies(self);
}

//LOAD REDIS SEED
function initialize_seed(self){
    self.buffer.EXISTS(SEED_TAG, function(err, ok){
        if(err) self.emit('error', err);
        else if (ok === 0){
            generate_murmur_seed(self);
        } else if(ok === 1){
            retrieve_murmur_seed(self);
        } else{
            self.emit('error', new Error('Unknown Redis Response.'));
        }
    });
}

//GENERATE MURMUR SEED AND SET IN REDIS
function generate_murmur_seed(self){
    self.MURMUR_SEED = Math.floor(Math.random() * SEED_CEILING) + 1;
    self.buffer.SET(SEED_TAG, self.MURMUR_SEED, function(err, ok){
        if(err) self.emit('error', err);
        else self.emit('ready', 1);
    });
}

//RETRIEVE EXISTING SEED FROM REDIS
function retrieve_murmur_seed(self){
    self.buffer.GET(SEED_TAG, function(err, stored_tag){
        if(err) self.emit('error', err);
        else{
            self.MURMUR_SEED = stored_tag;
            self.emit('ready', 0);
        }
    });
}

function set_message_policies(self){
     self.on('input', function(msg){
        //ACTIVATE THE TIMER
        if(!self.active_batch){
            self.active_batch = true;
            self.emit('batch_active');
        }

        self.pending_queue.push(msg);

        //FAILSAFE. UNDER HEAVY CPU LOAD, setTimeout WON'T ENFORCE WATERMARK.
        if(HIGH_WATER < self.pending_queue.length){
            self.active_batch = false;
            process_batch(self);
        }
    });
}

function set_batching_policies(self){
    self.on('batch_active', function(){
        if(!self.active_overflow){
            setTimeout(function(){
                if(self.active_batch){
                    process_batch(self);
                }
                self.active_batch = false;

            }, BATCH_WAIT_MS);
        }
    });
}

function set_drainage_policies(self){
    //IN CASE USER DOESN'T ABIDE BY OVERFLOW POLICIES, OVERFLOW AND DRAIN ARE MANUALLY ENFORCED
    //THIS IS LESS EFFECTIVE THAN THE USER MANUALLY RATE-LIMITING INPUT
    //--> MAY LEAD TO SLOWER PROCESSING AND TEMPORARY SPIKES IN HEAP USAGE
    self.on('drained', function(){
        if(self.active_batch){
            self.emit('batch_active');
        }
    });
}

function process_batch(self){
    var instr_queue = [];
    var temp_queue = [];

    while(self.pending_queue.length > 0){
        var curr_instr = self.pending_queue.shift() + '';
        temp_queue.push(curr_instr);
        var key = murmur_util.generate_64bit_hex_key(curr_instr, self.MURMUR_SEED);
        instr_queue.push(['SETNX', key, '']);
        instr_queue.push(['EXPIRE', key, '' + self.EXP_SECONDS]);
        self.message_volume++;
    }

    enforce_volume_watermark(self);
    enforce_gc_watermark(self);

    var multi = self.buffer.batch(instr_queue);
    multi.exec(function(err, output){
        var filtered_output = [];
        for(var i = 0; i < temp_queue.length; i++){
            if(output[i*2] === 1)
                self.emit('output', temp_queue[i]);
        }
    });
}

//IF THE MOST RECENT 10000 MESSAGES HAVE COME THRU TOO QUICKLY, TEMPORARILY PAUSE PROCESSING
function enforce_volume_watermark(self){
    if(self.message_volume >= 10000){

        var elapsed_time = set_highwater_elapsed_time(self);
        console.log('ELAPSED TIME (MS): ' + elapsed_time);

        if(elapsed_time < 250){
            self.volume_since_gc = 0;
            console.log('OVERFLOW TRIGGERED');
            enforce_overflow(self);
            setTimeout(function(){
                console.log('THROTTLE LIFTED');
                conclude_overflow(self);
            }, 200);
        } else{
            self.volume_since_gc += self.message_volume;
        }

        reset_message_volume(self);
    }
}

//IF THE VOLUME WATERMARK HASN'T BEEN ENFORCED FOR A WHILE, CREATE A PAUSE FOR GC TO RUN
function enforce_gc_watermark(self){
    if(self.volume_since_gc > 50000){
        self.volume_since_gc = 0;
        console.log('GC FAILSAFE TRIGGERED');

        enforce_overflow(self);
        setTimeout(function(){
            console.log('GC FAILSAFE BLOCK LIFTED');
            conclude_overflow(self);
        }, 700);
    }
}

function set_highwater_elapsed_time(self){
    var checkpoint_timestamp = new Date().getTime();
    var elapsed_time = checkpoint_timestamp - self.prev_checkpoint_timestamp;
    self.prev_checkpoint_timestamp = checkpoint_timestamp;
    return elapsed_time;
}

function reset_message_volume(self){
    self.message_volume = 0;
}

function enforce_overflow(self){
    self.active_overflow = true;
    self.emit('overflow');
}

function conclude_overflow(self){
    self.active_overflow = false;
    self.emit('drained');
}

util.inherits(UnionStream, EventEmitter);

module.exports = UnionStream;


text:
package com.beanu.l4_clean.model;

import com.beanu.l3_common.model.HttpModel;
import com.beanu.l3_common.model.bean.GlobalConfig;
import com.beanu.l3_common.model.bean.User;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;

/**
 * Created by Jam on 16-5-17
 * Description:
 */
public interface APIService {

    /**
     * 登录
     *
     * @param key   登录方式(tel/email)
     * @param value 手机号
     * @param pwd   密码
     * @return
     */
    @FormUrlEncoded
    @POST("user/login")
    Observable<HttpModel<User>> login(@Field("key") String key, @Field("val") String value, @Field("pwd") String pwd);

    /**
     * 修改用户信息
     */
    @GET("init")
    Observable<HttpModel<GlobalConfig>> getConfig();

}


text:
<!DOCTYPE html >

    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />

    <title>An animated customised Pie chart</title>

    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="A Pie chart that has been animated using the RoundRobin effect" />

An animated and customised Pie chart

    <canvas id="cvs" width="480" height="250">[No canvas support]</canvas>

    This goes in the documents header (or you could place it just above the jQuery ready event code):

<script src="/mps/libs/jquery-1.11.3/jquery-1.11.3.js"></script>
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.tooltips.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.effects.js"></script>
<script src="RGraph.pie.js"></script>

    Put this where you want the chart to show up:

<canvas id="cvs" width="480" height="250">
    [No canvas support]
</canvas>

    This is the code that generates the chart. Because it's using the jQuery ready event you can put this at the
    bottom of the document:

<script>
    $(document).ready(function ()
    {
        var pie = new RGraph.Pie({
            id: 'cvs',
            data: [1750, 6250],
            options: {
                strokestyle: 'white',
                colors: ['#DDDF0D','#7798BF'],
                linewidth: 3,
                exploded: [15, ],
                textSize:16,
                shadowOffsetx: 0,
                shadowOffsety: 0,
                shadowBlur: 20,
                labels: ['Jerry'],
                labelsSticks: [true, false],
                labelsSticksLength: 20,
                clearto: 'white'
            }
        }).roundRobin();
    });
</script>

        « Back


text:
package com.guoxiaoxing.cloud.music.uitl.Comparator;

import com.guoxiaoxing.cloud.music.model.info.FolderInfo;

import java.util.Comparator;

public class FolderCountComparator implements Comparator<FolderInfo> {

    @Override
    public int compare(FolderInfo a1, FolderInfo a2) {
        Integer py1 = a1.folder_count;
        Integer py2 = a2.folder_count;
        return py2.compareTo(py1);
    }

    private boolean isEmpty(String str) {
        return "".equals(str.trim());
    }
}


text:
'use strict';

app.controller('mainController', [ '$rootScope', '$scope','$log', '$translate', '$location', '$q', '$filter', '$interval', '$routeParams', 'ModalService', 'popUpService', 'paisService', 'codarService', 'emergenciaService', 'CONSTANTES', 'LOADER', 'Fullscreen', function($rootScope, $scope, $log, $translate, $location, $q, $filter, $interval, $routeParams, modalService, popUpService, paisService, codarService, emergenciaService, CONSTANTES, LOADER, Fullscreen) {

	// Variaveis Gerais da Aplicação

	// Variaveis Locais
	$rootScope.loader = LOADER.LOADING_CLASS;

	$scope.host = $location.host();
	$scope.protocol = $location.protocol();

	$scope.headerMenuVisibility = true;
	$scope.alertasMenuVisibility = true;

	$scope.helpOpened = false;

	$scope.codares = [];

	$scope.eventosHoje = [];
	$scope.emergenciasHoje = [];

	$scope.eventosAmanha = [];
	$scope.emergenciasAmanha = [];

	$scope.eventosFuturos = [];
	$scope.emergenciasFuturas = [];

	$scope.tabSelected = 'hoje';//Inicialiar Tab
	$scope.emergenciasSelecionadas = [];

	// Map Config Variables
	$scope.mapCenterConfig = {"center":{"lat":-12.9,"lon":-59.5,"zoom":5}};
	$scope.mapCenterConfigOriginal = {};
	$scope.mapWmsConfig = {
			'wms' : {
				'source' : {
				'type' : 'ImageWMS',
				'url' : 'http://alert-as.inmet.gov.br:8080/geoserver/cvws/wms/',
				'params' : {
					'LAYERS' : 'cvws:32',
					'transparent' : true
				}
			}
		}
	};

	/**
	 * Inicializa serviços de dados
	 */
	$scope.initialize = function() {

		$rootScope.loader = LOADER.LOADING_CLASS;

			$q.all([
			    codarService.getCodares(),
				paisService.getMapCenterConfig(),
				paisService.getMapWmsConfig(),
                emergenciaService.getEmergenciasHoje(),
                emergenciaService.getEmergenciasAmanha(),
                emergenciaService.getEmergenciasFuturas()
            ]).then(function(result) {

            	$scope.setCodares(result[0].data);

            	$scope.setMapCenterConfig(result[1].data);
            	$scope.setMapWmsConfig(result[2].data);

                $scope.eventosHoje = result[3].data;
                $scope.emergenciasHoje = $scope.agruparEmergenciasPorLocal(angular.copy($scope.eventosHoje));

                $scope.eventosAmanha = result[4].data;
                $scope.emergenciasAmanha = $scope.agruparEmergenciasPorLocal(angular.copy($scope.eventosAmanha));

                $scope.eventosFuturos = result[5].data;
                $scope.emergenciasFuturas = $scope.agruparEmergenciasPorLocal(angular.copy($scope.eventosFuturos));

                $scope.setEmergenciasSelecionadas();

                // Verifica se o usuario quer ver emergencia id especifico
                if($routeParams.id){
                	emergenciaService.getEmergencia($routeParams.id).then(function(result){

                		$rootScope.loader = LOADER.LOADING_CLASS;
                		var emergencia = result.data;

                		popUpService.showSingletonModal({
                			  templateUrl: CONSTANTES.VIEW_FOLDER+'/views/modalAlert.html',
                			  controller: "ModalAlertController",
                			  inputs: {
                			        	'emergencia': emergencia
                			  }
                			},function(modal) {
                		        modal.close.then(function(result) {

                		        });
                		    },function(error){
                		    	$rootScope.loader = LOADER.LOADED_CLASS;
                		    }
                	 	);
                		$rootScope.loader = LOADER.LOADED_CLASS;
                	});
                }
                $rootScope.loader = LOADER.LOADED_CLASS;

        });
	}
	/**
	 * Set FullScreen na Pagina
	 */
	$scope.setFullScreen = function(){
		 if (Fullscreen.isEnabled()){
			 Fullscreen.cancel();
		 }else{
			 Fullscreen.all();
		 }
	}

	/**
	 *  Setar a Tab Selecionada
	 */
	$scope.setTabSelected = function(tabSelected){
		$scope.tabSelected = tabSelected;
		$scope.setEmergenciasSelecionadas();
	}
	/**
	 * Setar Configurações Iniciais do Mapa
	 */
	$scope.setMapCenterConfig = function(config){
		$scope.mapCenterConfig = config;
		$scope.mapCenterConfigOriginal = config;
	}
	/**
	 * Set Codares
	 */
	$scope.setCodares = function(codares){
		$scope.codares = codares;
	}

	/**
	 * Setar Configurações Iniciais do Mapa
	 */
	$scope.setMapWmsConfig = function(config){
		//$log.log(config);
		$scope.mapWmsConfig = config;
	}

	/**
	 * Set as configurações Iniciais do mapa (centro, wms)
	 */
	$scope.resetMap = function(){
		$scope.mapCenterConfig = $scope.mapCenterConfigOriginal;
	}

	/**
	 * Verificar se a lingua passada é a mesma setada na aplicação
	 */
	$scope.isLanguageSetted = function (key){
		if($translate.use() == key) return true;
		return false;
	}
	/**
	 * Modificar Lingua
	 */
	$scope.changeLanguage = function (key) {
	    $translate.use(key);
	};
	/**
	 * Abrir Modal de Alertas
	 */
	$scope.openModalAlert = function (emergencia){

		 popUpService.showSingletonModal({
			  templateUrl: CONSTANTES.VIEW_FOLDER+'/views/modalAlert.html',
			  controller: "ModalAlertController",
			  inputs: {
			        	'emergencia': emergencia
			  }
			},function(modal) {
		        modal.close.then(function(result) {

		        });
		    }
		);

	}

	/**
	 * Abrir Modal de About
	 */
	$scope.openModalAbout = function (){

		popUpService.showSingletonModal({
			  templateUrl: CONSTANTES.VIEW_FOLDER+'/views/modal-about/modalAbout_'+ $translate.use() +'.html',
			  controller: "ModalComumController",
			  inputs: {
				  'transfer':{}
			  }
			},function(modal) {
		        modal.close.then(function(result) {

		        });
		    }
		);

	}

	/**
	 * Abrir Modal de Terms
	 */
	$scope.openModalTerms = function (){

		popUpService.showSingletonModal({
			  templateUrl: CONSTANTES.VIEW_FOLDER+'/views/modal-terms/modalTerms_'+ $translate.use() +'.html',
			  controller: "ModalComumController",
			  inputs: {
				  'transfer':{}
			  }
			},function(modal) {
		        modal.close.then(function(result) {

		        });
		    }
		);

	}
	/**
	 * Abrir Modal de Contact
	 */
	$scope.openModalContact = function (){

		popUpService.showSingletonModal({
			  templateUrl: CONSTANTES.VIEW_FOLDER+'/views/modal-contact/modalContact_'+ $translate.use() +'.html',
			  controller: "ModalComumController",
			  inputs: {
				  'transfer':{}
			  }
			},function(modal) {
		        modal.close.then(function(result) {

		        });
		    }
		);

	}
	/**
	 * Abrir Modal de Cobrades
	 */
	$scope.openModalLegenda = function (){

		popUpService.showSingletonModal({
			  templateUrl: CONSTANTES.VIEW_FOLDER+'/views/modalLegenda.html',
			  controller: "ModalComumController",
			  inputs: {
					  'transfer':{
						  'codarService':codarService,
						  'codares':$scope.codares
					  },

			  }
			},function(modal) {
		        modal.close.then(function(result) {

		        });
		    }
		);

	}
	/**
	 * Aparecer Div Help
	 */
	$scope.openHelp = function(){
		$scope.helpClass = 'help-'+$translate.use();
	}
	/**
	 * Fechar Div Help
	 */
	$scope.closeHelp = function(){
		$scope.helpClass = '';

	}

	/**
	 * Seta Emergencias que serão apresentadas no mapa de acordo com tab selecionada ou a emergencia passada.
	 */
	$scope.setEmergenciasSelecionadas = function(emergencias){
		if(!emergencias){
			switch ($scope.tabSelected) {
			case 'hoje':
				$scope.emergenciasSelecionadas = angular.copy($scope.eventosHoje);
				break;
			case 'amanha':
				$scope.emergenciasSelecionadas = angular.copy($scope.eventosAmanha);
				break;
			case 'futuro':
				$scope.emergenciasSelecionadas = angular.copy($scope.eventosFuturos);
				break;
			}
		}else{
			$scope.emergenciasSelecionadas = emergencias;
		}
	}

	/**
	 * Agrupar Array de Emergencias Por Local
	 */
	$scope.agruparEmergenciasPorLocal = function(eventos){

		var existeKeyUf = function(arr, uf){
			for (var j = 0; j < arr.length; j++) {
				if(arr[j].uf == uf) return j;
			}
			return undefined;
		}

		var locais = [];
		for (i = 0; i < eventos.length; i++) {
			angular.forEach(eventos[i].ufsAtingidas, function(item, key) {
				var index = existeKeyUf(locais, item.uf);
				if(index !== undefined){
					locais[index].emergencias.push(eventos[i]);
				}else{
					var o = {'uf': item.uf, 'emergencias': [eventos[i]]};
					locais.push(o);
				}
			});
		}
		return $filter('orderBy')(locais, 'uf');
	}
	/**
	 * retorna tooltip options
	 */
	$scope.setTooltipOptions = function(title, position){
		return {'title': title, 'position': position};
	}

	/**
	 * Herdar Metodo de Manipulação de i18n em Emergencia - Filter
	 */
	$scope.emergenciaI18nFilter = angular.copy(emergenciaService.emergenciaI18nFilter);
	/**
	 * Verifica se o objeto é está vazio.
	 */
	$scope.isEmpty = function(object){
		if(angular.equals({}, object)) return true;
		else return false;

	}
	/**
	 * Verifica se o objeto é está vazio.
	 */
	$scope.isArrayEmpty = function(arr){
		if(arr.length == 0) return true;
		else return false;
	}

	/**
	 * Looping que recarrega os dados da app.
	 */
	$scope.fight = function() {
        /*var loop = $interval(function() {

        	$scope.initialize();

        }, 5000);*/
     };

	/**
	 *  LISTENERS DE EVENTOS SOLICITADOS POR CONTROLLERS FILHOS
	 * /

	/**
	 * Listener para mudar a visibilidade do Header
	 */
	$rootScope.$on('setHeaderMenuVisibility', function (event, args) {
		$scope.headerMenuVisibility = args.headerMenuVisibility;
	});

	/**
	 * Listener para mudar a visibilidade do Header
	 */
	$rootScope.$on('setAlertasMenuVisibility', function (event, args) {
		$scope.alertasMenuVisibility = args.alertasMenuVisibility;
	});

	/**
	 * Listener que recebe solicitação de Controller filho (modal-alert.js) para setar somente a emergencia passada no mapa
	 */
	$rootScope.$on('setEmergenciaOnMap', function (event, args) {
		 var emergencia = args.emergencia;
		 // Setar centro do mapa a partir da emergencia passada
		 $scope.mapCenterConfig = emergencia.configCenterMap;
		 // Setar somente a emergencia no mapa
		 $scope.setEmergenciasSelecionadas([emergencia]);
	});

	/**
	 * Listener que recebe solicitação de Controller filho (modal-alert.js) para setar o mapa na visao de todos os alertas a partir das tabs selecionadas.
	 */
	$rootScope.$on('removeEmergenciaOnMap', function (event, args) {
		 // Resetar Configuracoes de centro de mapa
		 $scope.mapCenterConfig = { "center": { "lat": -14.9, "lon": -54.5, "zoom": 4.30 } };
		 //$scope.resetMap();
		 // Setar somente as emergencias da tab selecionada
		 $scope.setEmergenciasSelecionadas();
	});

	/**
	 * Listener para eventos de Loader
	 */

	$rootScope.$on('loaderEvent', function (event, args) {
		$scope.loader = args.loader;
	});

} ]);


text:
package simpletest;

import java.util.concurrent.atomic.AtomicLong;

public class TwoThreadsCASCounter {
	static AtomicLong counter = new AtomicLong(0);

	public static void main(String[] args) {

		//Second thread
		Thread second = new Thread(() -> {
			while (counter.incrementAndGet() < 500000000) {}
		});

		long start = System.nanoTime();

		second.start();
		while (counter.incrementAndGet() < 500000000) {}

		long end = System.nanoTime();

		System.out.println((end - start) / 1000000d + " ms"); // around 12000ms
																// on my laptop
																//  quad core i7@2.2GHz
	}

}


text:
package bio.terra.common.configuration;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "it")
public class TestConfiguration {
  private static Logger logger = LoggerFactory.getLogger(TestConfiguration.class);
  private static final Pattern INT_SERVER_NUM_FINDER =
      Pattern.compile("https://jade-(\\d+).datarepo-integration.broadinstitute.org");

  private String jadeApiUrl;
  private String jadePemFileName;
  private String jadeEmail;
  private String ingestbucket;
  private List<User> users = new ArrayList<>();
  private String googleProjectId;
  private String googleBillingAccountId;
  private UUID targetTenantId;
  private UUID targetSubscriptionId;
  private String targetResourceGroupName;
  private String targetApplicationName;
  private String sourceStorageAccountName;
  private String ingestRequestContainer;

  public static class User {
    private String role;
    private String name;
    private String email;
    private String subjectId;

    public String getRole() {
      return role;
    }

    public void setRole(String role) {
      this.role = role;
    }

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }

    public String getEmail() {
      return email;
    }

    public void setEmail(String email) {
      this.email = email;
    }

    public String getSubjectId() {
      return subjectId;
    }

    public void setSubjectId(String subjectId) {
      this.subjectId = subjectId;
    }
  }

  public String getJadeApiUrl() {
    return jadeApiUrl;
  }

  public void setJadeApiUrl(String jadeApiUrl) {
    this.jadeApiUrl = jadeApiUrl;
  }

  public String getJadePemFileName() {
    return jadePemFileName;
  }

  public void setJadePemFileName(String jadePemFileName) {
    this.jadePemFileName = jadePemFileName;
  }

  public String getJadeEmail() {
    return jadeEmail;
  }

  public void setJadeEmail(String jadeSAEmail) {
    this.jadeEmail = jadeSAEmail;
  }

  public String getIngestbucket() {
    return ingestbucket;
  }

  public void setIngestbucket(String ingestbucket) {
    this.ingestbucket = ingestbucket;
  }

  public List<User> getUsers() {
    return users;
  }

  public void setUsers(List<User> users) {
    this.users = users;
  }

  public String getGoogleProjectId() {
    return googleProjectId;
  }

  public void setGoogleProjectId(String googleProjectId) {
    this.googleProjectId = googleProjectId;
  }

  public String getGoogleBillingAccountId() {
    return googleBillingAccountId;
  }

  public void setGoogleBillingAccountId(String googleBillingAccountId) {
    this.googleBillingAccountId = googleBillingAccountId;
  }

  public UUID getTargetTenantId() {
    return targetTenantId;
  }

  public void setTargetTenantId(UUID targetTenantId) {
    this.targetTenantId = targetTenantId;
  }

  public UUID getTargetSubscriptionId() {
    return targetSubscriptionId;
  }

  public void setTargetSubscriptionId(UUID targetSubscriptionId) {
    this.targetSubscriptionId = targetSubscriptionId;
  }

  public String getTargetResourceGroupName() {
    return targetResourceGroupName;
  }

  public void setTargetResourceGroupName(String targetResourceGroupName) {
    this.targetResourceGroupName = targetResourceGroupName;
  }

  public String getTargetApplicationName() {
    return targetApplicationName;
  }

  public void setTargetApplicationName(String targetApplicationName) {
    this.targetApplicationName = targetApplicationName;
  }

  public String getSourceStorageAccountName() {
    return sourceStorageAccountName;
  }

  public void setSourceStorageAccountName(String sourceStorageAccountName) {
    this.sourceStorageAccountName = sourceStorageAccountName;
  }

  public String getIngestRequestContainer() {
    return ingestRequestContainer;
  }

  public void setIngestRequestContainer(String ingestRequestContainer) {
    this.ingestRequestContainer = ingestRequestContainer;
  }

  /**
   * Returns the server number that the test is running on or null if the URL isn't in the expected
   * format
   */
  public Integer getIntegrationServerNumber() {
    Matcher matcher = INT_SERVER_NUM_FINDER.matcher(getJadeApiUrl());
    if (matcher.find()) {
      return Integer.getInteger(matcher.group());
    }
    logger.warn("Can't get integration server number from url {}", getJadeApiUrl());
    return null;
  }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Runtime;
using System.Reflection;
using System.Threading;

namespace LOHCompactAPI
{
    class Program
    {
        static int ListSize = 500;
        static List<byte[]> shortLivedList = new List<byte[]>(ListSize);
        static List<byte[]> LongLivedList = new List<byte[]>(ListSize);
        static volatile bool testDone = false;

        //There are several threads that allocate, and the main thread calls the compacting API
        //Verify that the compaction mode changes to default after a blocking GC happened, and does not change if a blocking GC did not happen.
        public static int Main(string[] args)
        {
            int retVal = 100;
            int iterations = 10;

            if (args.Length > 0)
                iterations = Int32.Parse(args[0]);
            Console.WriteLine("Running {0} iterations", iterations);

            testDone = false;

            Thread AllocatingThread = new Thread(Allocate);
            AllocatingThread.Start();
            int numThreads = 100;
            Thread[] threadArr = new Thread[numThreads];
            for (int i = 0; i < numThreads; i++)
            {
                threadArr[i] = new Thread(AllocateTempObjects);
                threadArr[i].Start();
            }

            for (int i = 0; i < iterations; i++)
            {
                if (!Test1())
                {
                    retVal = 1;
                    break;
                }
                Thread.Sleep(3);
            }
            Console.WriteLine("Test1 passed");

            for (int i = 0; i < iterations; i++)
            {
                if (!Test2())
                {
                    retVal = 1;
                    break;
                }
                Thread.Sleep(100);
            }
            Console.WriteLine("Test2 passed");

            testDone = true;
            AllocatingThread.Join();
            for (int i = 0; i < numThreads; i++)
            {
                threadArr[i].Join();
            }
            return retVal;
        }

        public static bool Test1()
        {

            Console.WriteLine("Setting GCLargeObjectHeapCompactionMode.CompactOnce");
            int GCCount = 0;
            int initialGCCount = GetBlockingGen2Count();
            GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
            GCCount = GetBlockingGen2Count();
            if (initialGCCount != GCCount)
            {
                Console.WriteLine("A GC happened while setting CompactOnce. Old count {0}, new Count {1}", initialGCCount, GCCount);
                //skip this run
                return true;
            }

            Thread.Sleep(100);
            int currentGCCount = GetBlockingGen2Count();
            GCLargeObjectHeapCompactionMode mode = GCSettings.LargeObjectHeapCompactionMode;
            GCCount = GetBlockingGen2Count();
            if (currentGCCount != GCCount)  //a GC happened in between these calls
            {
                Console.WriteLine("A GC happened while getting Compaction Mode. Old count {0}, new Count {1}", currentGCCount, GCCount);
                //skip this run
                return true;
            }

            Console.WriteLine("initial GC count: {0}; currentGCCount: {1}", initialGCCount, currentGCCount);
            Console.WriteLine(mode);
            if (currentGCCount == initialGCCount)
            {
                if (mode != GCLargeObjectHeapCompactionMode.CompactOnce)
                {
                    Console.WriteLine("GCLargeObjectHeapCompactionMode should be CompactOnce; instead it is " + mode);
                    return false;
                }
            }
            else
            {
                if (mode != GCLargeObjectHeapCompactionMode.Default)
                {
                    Console.WriteLine("GCLargeObjectHeapCompactionMode should be Default; instead it is " + mode);
                    return false;
                }
            }
            return true;

        }

        public static bool Test2()
        {

            Console.WriteLine("Setting GCLargeObjectHeapCompactionMode.CompactOnce");
            GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
            GC.Collect();
            GCLargeObjectHeapCompactionMode mode = GCSettings.LargeObjectHeapCompactionMode;
            Console.WriteLine(mode);
            if (mode != GCLargeObjectHeapCompactionMode.Default)
            {
                Console.WriteLine("GCLargeObjectHeapCompactionMode should be CompactOnce; instead it is " + mode);
                return false;
            }

            return true;
        }

        public static void AllocateTempObjects(object threadInfoObj)
        {
            int listSize2 = 1000;
            List<byte[]> tempList = new List<byte[]>();
            while (!testDone)
            {
                byte[] temp = new byte[20];
                for (int i = 0; i < listSize2; i++)
                {
                    tempList.Add(new byte[50]);
                }
                tempList.Clear();
            }

        }

        public static void Allocate(object threadInfoObj)
        {
            int ListSize = 300;
            System.Random rnd = new Random(1122);

            int listSize2 = 1000;
            List<byte[]> newList = new List<byte[]>(500 + 1000);

            while (!testDone)
            {
                for (int i = 0; i < ListSize; i++)
                {
                    newList.Add(new byte[85000]);
                    newList.Add(new byte[200]);
                    Thread.Sleep(10);
                }
                for (int i = 0; i < listSize2; i++)
                {
                    newList.Add(new byte[50]);
                }
                newList.Clear();
            }
        }

        //Only count the blocking gen2 GC's. Concurrent GC's should be subtracted from the total GC count.
        public static int GetBlockingGen2Count()
        {

            //Get the number of concurrent collections (can use this method only through reflection):
            MethodInfo collectionCountmethod = null;
            Type GCType = Type.GetType("System.GC");
            foreach(MethodInfo m in GCType.GetMethods(BindingFlags.Static | BindingFlags.NonPublic))
            {
                if (m.Name.Equals("_CollectionCount") && m.GetParameters().Length == 2) collectionCountmethod = m;
            }
            if (collectionCountmethod == null)
            {
                Console.WriteLine("collectionCount method is null");
                return 0;
            }
            if (collectionCountmethod == null)
            {
                Console.WriteLine("collectionCount method is null");
                return 0;
            }
            object[] parameters = new object[2];
            parameters[0] = 2;
            parameters[1] = 1; // special gc count
            int backgroundCollections = (int)collectionCountmethod.Invoke(null, parameters);
            int TotalCollections = GC.CollectionCount(2);
            Console.WriteLine("Total collections {0}, background {1}", TotalCollections, backgroundCollections);
            return (TotalCollections - backgroundCollections);
        }
    }
}


text:
#ifndef cmGeneratorTarget_h
#define cmGeneratorTarget_h

#include "cmStandardIncludes.h"

class cmCustomCommand;
class cmGlobalGenerator;
class cmLocalGenerator;
class cmMakefile;
class cmSourceFile;
class cmTarget;

class cmGeneratorTarget
{
public:
  cmGeneratorTarget(cmTarget*);

  int GetType() const;
  const char *GetName() const;
  const char *GetProperty(const char *prop) const;
  bool GetPropertyAsBool(const char *prop) const;
  void GetSourceFiles(std::vector<cmSourceFile*>& files) const;

  void GetObjectSources(std::vector<cmSourceFile*> &) const;
  const std::string& GetObjectName(cmSourceFile const* file);

  void AddObject(cmSourceFile *sf, std::string const&name);
  bool HasExplicitObjectName(cmSourceFile const* file) const;
  void AddExplicitObjectName(cmSourceFile* sf);

  void GetResxSources(std::vector<cmSourceFile*>&) const;
  void GetIDLSources(std::vector<cmSourceFile*>&) const;
  void GetExternalObjects(std::vector<cmSourceFile*>&) const;
  void GetHeaderSources(std::vector<cmSourceFile*>&) const;
  void GetExtraSources(std::vector<cmSourceFile*>&) const;
  void GetCustomCommands(std::vector<cmSourceFile*>&) const;
  void GetExpectedResxHeaders(std::set<std::string>&) const;

  cmTarget* Target;
  cmMakefile* Makefile;
  cmLocalGenerator* LocalGenerator;
  cmGlobalGenerator const* GlobalGenerator;

  std::string ModuleDefinitionFile;

  /** Full path with trailing slash to the top-level directory
      holding object files for this target.  Includes the build
      time config name placeholder if needed for the generator.  */
  std::string ObjectDirectory;

  void UseObjectLibraries(std::vector<std::string>& objs) const;

  void GetAppleArchs(const char* config,
                     std::vector<std::string>& archVec) const;

  ///! Return the rule variable used to create this type of target,
  //  need to add CMAKE_(LANG) for full name.
  const char* GetCreateRuleVariable() const;

  /** Get the include directories for this target.  */
  std::vector<std::string> GetIncludeDirectories(const char *config) const;

  bool IsSystemIncludeDirectory(const char *dir, const char *config) const;

  /** Add the target output files to the global generator manifest.  */
  void GenerateTargetManifest(const char* config) const;

  /**
   * Trace through the source files in this target and add al source files
   * that they depend on, used by all generators
   */
  void TraceDependencies();

  void ClassifySources();
  void LookupObjectLibraries();

  /** Get sources that must be built before the given source.  */
  std::vector<cmSourceFile*> const* GetSourceDepends(cmSourceFile* sf) const;

private:
  friend class cmTargetTraceDependencies;
  struct SourceEntry { std::vector<cmSourceFile*> Depends; };
  typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
  SourceEntriesType SourceEntries;

  std::vector<cmSourceFile*> CustomCommands;
  std::vector<cmSourceFile*> ExtraSources;
  std::vector<cmSourceFile*> HeaderSources;
  std::vector<cmSourceFile*> ExternalObjects;
  std::vector<cmSourceFile*> IDLSources;
  std::vector<cmSourceFile*> ResxSources;
  std::map<cmSourceFile const*, std::string> Objects;
  std::set<cmSourceFile const*> ExplicitObjectName;
  std::set<std::string> ExpectedResxHeaders;
  std::vector<cmSourceFile*> ObjectSources;
  std::vector<cmTarget*> ObjectLibraries;
  mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;

  cmGeneratorTarget(cmGeneratorTarget const&);
  void operator=(cmGeneratorTarget const&);
};

struct cmStrictTargetComparison {
  bool operator()(cmTarget const* t1, cmTarget const* t2) const;
};

typedef std::map<cmTarget const*,
                 cmGeneratorTarget*,
                 cmStrictTargetComparison> cmGeneratorTargetsType;

#endif


text:
using System;

namespace CryptoKnight.Library.Network.ProtocolMessages
{
    [Serializable]
    public enum MessageType
    {
        // client to server
        Login,
        RequestLicense,
        // server to client
        LoginResponse,
        RequestLicenseResponse,
        PluginResponse
    }
}


text:
package org.innovateuk.ifs.finance.builder;

import org.innovateuk.ifs.BaseBuilder;
import org.innovateuk.ifs.finance.resource.cost.LabourCost;

import java.math.BigDecimal;
import java.util.List;
import java.util.function.BiConsumer;

import static java.util.Collections.emptyList;
import static org.innovateuk.ifs.base.amend.BaseBuilderAmendFunctions.idBasedNames;
import static org.innovateuk.ifs.base.amend.BaseBuilderAmendFunctions.uniqueIds;

public class LabourCostBuilder extends BaseBuilder<LabourCost, LabourCostBuilder> {

    public static LabourCostBuilder newLabourCost() {
        return new LabourCostBuilder(emptyList()).with(uniqueIds());
    }

    public LabourCostBuilder withId(Long... value) {
        return withArraySetFieldByReflection("id", value);
    }

    public LabourCostBuilder withName(String... value) {
        return withArraySetFieldByReflection("name", value);
    }

    public LabourCostBuilder withDescription(String... value) {
        return withArraySetFieldByReflection("description", value);
    }

    public LabourCostBuilder withRole(String... value) {
        return withArraySetFieldByReflection("role", value);
    }

    public LabourCostBuilder withGrossEmployeeCost(BigDecimal... value) {
        return withArraySetFieldByReflection("grossEmployeeCost", value);
    }

    public LabourCostBuilder withLabourDays(Integer... value) {
        return withArraySetFieldByReflection("labourDays", value);
    }

    public LabourCostBuilder withRate(BigDecimal... value) {
        return withArraySetFieldByReflection("rate", value);
    }

    public LabourCostBuilder withTotal(BigDecimal... value) {
        return withArraySetFieldByReflection("total", value);
    }

    public LabourCostBuilder withThirdPartyOfgem(boolean... value) {
        return withArraySetFieldByReflection("thirdPartyOfgem", value);
    }

    private LabourCostBuilder(List<BiConsumer<Integer, LabourCost>> multiActions) {
        super(multiActions);
    }

    @Override
    protected LabourCostBuilder createNewBuilderWithActions(List<BiConsumer<Integer, LabourCost>> actions) {
        return new LabourCostBuilder(actions);
    }

    @Override
    protected LabourCost createInitial() {
        return newInstance(LabourCost.class);
    }
}


text:
using Antlr4.Runtime;
using Plang.Compiler.TypeChecker.Types;

namespace Plang.Compiler.TypeChecker.AST.Expressions
{
    public class ContainsExpr : IPExpr
    {
        public ContainsExpr(ParserRuleContext sourceLocation, IPExpr item, IPExpr collection)
        {
            SourceLocation = sourceLocation;
            Item = item;
            Collection = collection;
        }

        public IPExpr Item { get; }
        public IPExpr Collection { get; }

        public PLanguageType Type { get; } = PrimitiveType.Bool;
        public ParserRuleContext SourceLocation { get; }
    }
}


text:
class Task < ActiveRecord::Base
  include AASM

  belongs_to :user
  belongs_to :project
  has_many :dailies, dependent: :destroy
  default_scope -> { order('created_at DESC') }
  validates :content, presence: true, length: { maximum: 140 }
  validates :user_id, presence: true

  # Returns Tasks from the users being followed by the given user.
  def self.from_users_followed_by(user)
    followed_user_ids = "SELECT followed_id FROM relationships
                         WHERE follower_id = :user_id"
    where("user_id IN (#{followed_user_ids}) OR user_id = :user_id",
          user_id: user.id)
  end

  aasm column: :status do
    state :not_started, :initial => true
    state :working
    state :done

    event :start do
      transitions :from => :not_started, :to => :working
    end

    event :finish do
      transitions :from => :working, :to => :done
    end
  end
end


text:
require "maphilight-rails/version"

module Maphilight
  module Rails
    class Engine < ::Rails::Engine
  	end
  end
end