text:
<?php return array (
  25 => '',
  'Invalid Password.' => '',
  'Unknown' => '',
  'The user\'s account has been activated and the user has been notified about it.' => '',
  'Pagekit Version' => 'Έκδοση Pagekit',
  'Database error: %error%' => '',
  'A new user signed up for %site% with the username %username%. Please click the button below to approve the account.' => '',
  'Marketplace' => '',
  '%d EB' => '',
  'Widget deleted.' => '',
  6 => '6',
  'Themes' => '',
  'New Password' => 'Νέος Κωδικός',
  'Path' => '',
  'Unable to enable "%name%".' => '',
  '%d  KB' => '',
  'Change password' => 'Αλλαγή κωδικού',
  'password' => 'κωδικός',
  'No account yet?' => '',
  'Unwritable' => '',
  'Enter your website details.' => '',
  'Removed selected.' => '',
  'Whoops, looks like something went wrong.' => '',
  'Enable' => 'Ενεργοποιημένο',
  'Add Page' => '',
  'Update' => 'Αναβάθμιση',
  'Next' => '',
  3 => '3',
  'Name required.' => '',
  'Host cannot be blank.' => '',
  'Test email!' => '',
  'Permission denied.' => '',
  '(Currently set to: %menu%)' => '',
  'Reset password for %site%.' => '',
  'We\'re really happy to have you, %name%! Just login with the username %username%.' => '',
  '%d TB' => '',
  20 => '',
  'Your Pagekit database is already up-to-date!' => '',
  '{1} %count% User selected|]1,Inf[ %count% Users selected' => '',
  'Invalid id.' => '',
  'User Settings' => '',
  'Password required.' => '',
  'Logout' => '',
  'Hostname' => '',
  'Unable to delete yourself.' => '',
  'Re-install' => 'Επανεγκατάσταση',
  'Invalid type.' => '',
  'Order saved.' => '',
  'User Agent' => '',
  'Email is invalid.' => '',
  'Access admin area' => '',
  'Unable to rename.' => '',
  'Unable to upload.' => '',
  '%d  GB' => '',
  'Value' => 'Τιμή',
  'Username' => 'Όνομα χρήστη',
  'Title' => 'Τίτλος',
  'Storage' => '',
  'No pages found.' => '',
  'Positions' => '',
  'You will be the site administrator.' => '',
  'Your user account has been created and is pending approval by the site administrator.' => '',
  'Login' => 'Είσοδος',
  'Password cannot be blank.' => '',
  'Remember Me' => '',
  'Page not found.' => '',
  'Activate your %site% account.' => '',
  'Reset Password' => '',
  'Info' => 'Πληροφορίες',
  'Permission' => '',
  'Database name cannot be blank.' => '',
  'Can\'t write config.' => '',
  'Retry' => '',
  7 => '7',
  'This permission has security implications. Give it trusted roles only.' => '',
  '"composer.json" file not valid.' => '',
  'User' => 'Χρήστης',
  'Unable to remove.' => '',
  'Manage media files' => '',
  'Unable to uninstall "%name%".' => '',
  'Submit' => '',
  'Your account has not been activated.' => '',
  'Unable to create directory.' => '',
  'Approve an account at %site%.' => '',
  'Blocked' => '',
  'Username is invalid.' => '',
  'Invalid path.' => '',
  'Hide' => 'Απόκρυψη',
  'No theme found.' => '',
  'Mail delivery failed!' => '',
  'Reset Confirm' => '',
  'Settings' => 'Ρυθμίσεις',
  'Enabled' => 'Ενεργοποιημένο',
  'Unable to find "%name%".' => '',
  'No extension found.' => '',
  'Verified email address' => '',
  'Manage widgets' => '',
  'No widgets found.' => '',
  'Disabled' => 'Απενεργοποιημένο',
  '%d Bytes' => '',
  'Unable to block yourself.' => '',
  'Request Password' => '',
  'Missing order data.' => '',
  'User not found.' => '',
  'You do not have access to the administration area of this site.' => '',
  'Renamed.' => '',
  'Driver' => '',
  10 => '10',
  'Edit' => 'Επεξεργασία',
  5 => '5',
  'Access system settings' => '',
  'No Pagekit %type%' => '',
  'Registration' => 'Εγγραφή',
  'Folder' => '',
  'Check your email for the confirmation link.' => '',
  'Add %type%' => '',
  'Your user account has been created. Complete your registration, by clicking the link provided in the mail that has been sent to you.' => '',
  'Approve Account' => '',
  'Add Menu' => '',
  'Hello!' => '',
  'Mail successfully sent!' => '',
  'Save' => 'Αποθήκευση',
  'Hidden' => '',
  'Status' => 'Κατάσταση',
  'User cannot be blank.' => '',
  'You are already logged in.' => '',
  'Activate' => 'Ενεργοποίηση',
  'Maintenance' => 'Συντήρηση',
  'Setup your site' => '',
  'Apply system updates' => '',
  'Extensions' => '',
  'Built On' => '',
  'Login Now' => '',
  'We\'ll be back soon.' => '',
  'Uploaded file invalid. (%s)' => '',
  'Pages' => '',
  'Menus' => '',
  'Forgot Password' => '',
  'View Details' => '',
  'Cancel' => 'Άκυρο',
  'Delete' => 'Διαγραφή',
  'You have the latest version of Pagekit.' => '',
  'Table Prefix' => '',
  'Public user registration is disabled.' => '',
  'User Registration' => '',
  'Node not found.' => '',
  'Invalid key.' => '',
  'Unable to activate "%name%".<br>A fatal error occured.' => '',
  'Invalid node type.' => '',
  'Roles' => '',
  'Manage themes' => '',
  'Last login' => '',
  'Choose language' => '',
  'We got a request to reset your %site% password for %username%. If you ignore this message, your password won\'t be changed.' => '',
  'Name cannot be blank.' => '',
  'Invalid slug.' => '',
  'Version' => 'Έκδοση',
  'No file uploaded.' => '',
  'Installation failed!' => '',
  'Connection not established! (%s)' => '',
  'Current Password' => 'Ισχύων Κωδικός',
  'n/a' => '',
  'Directory created.' => '',
  'Publish' => '',
  'Enter your database connection details.' => '',
  'Database' => 'Βάση Δεδομένων',
  'Update Pagekit' => 'Αναβάθμιση Pagekit',
  'Enter a email address.' => '',
  'Add Widget' => '',
  15 => '15',
  'Invalid token. Please try again.' => '',
  'Activate Account' => '',
  'Pagekit has been updated! Before we send you on your way, we have to update your database to the newest version.' => '',
  'Move' => '',
  'Connect database' => '',
  'Writable' => '',
  'Your password has been reset.' => '',
  'No database connection.' => '',
  'Your user account has been created.' => '',
  'Create your account' => '',
  'Invalid email address.' => '',
  'Warning: Give to trusted roles only; this permission has security implications.' => '',
  'Duplicate Menu Id.' => '',
  'Your Profile' => 'Το προφίλ σας',
  'Users' => 'Χρήστες',
  'Folder already exists.' => '',
  'Active' => '',
  'Registered since' => '',
  'Testemail' => '',
  'URL' => '',
  'Invalid name.' => '',
  'Your account has not been activated or is blocked.' => '',
  '%d PB' => '',
  'Manage menus' => '',
  'Access' => '',
  'View Permissions' => '',
  'Client' => '',
  'Add Role' => '',
  'Frontpage' => '',
  'Thank you for signing up for %site%. Just one more step! Please click the button below to activate your account.' => '',
  'Permissions' => '',
  'Visit Site' => '',
  'Your account has been activated.' => '',
  'Invalid file name.' => '',
  'Email not available.' => '',
  'Select your site language.' => '',
  '{1} %count% Widget selected|]1,Inf[ %count% Widgets selected' => '',
  'Field must be a valid email address.' => '',
  'PHP' => '',
  'Invalid password.' => '',
  'Download %version%' => '',
  'Edit %type%' => '',
  '"%name%" has not been loaded.' => '',
  'Set as frontpage' => '',
  'Enter password.' => '',
  4 => '4',
  'Handler' => '',
  'Username cannot be blank.' => '',
  'Type' => '',
  'Unassigned' => '',
  'Manage extensions' => '',
  'Profile' => '',
  'Insufficient User Rights.' => '',
  'Password' => 'Κωδικός',
  'Upload complete.' => '',
  'Manage user permissions' => '',
  8 => '8',
  'System' => 'Σύστημα',
  'Database connection failed!' => '',
  'Can\'t load json file from package.' => '',
  'Your Pagekit database has been updated successfully.' => '',
  'Site name cannot be blank.' => '',
  '_subset' => '',
  'Hi %name%!' => '',
  'Menu Positions' => '',
  100 => '',
  1 => '1',
  'Invalid Email.' => '',
  'Your account is blocked.' => '',
  'Email' => '',
  'Widgets' => '',
  'No files uploaded.' => '',
  'Database access denied!' => '',
  'Please update Pagekit to version %version%!' => '',
  'Widgets reordered.' => '',
  'Slow down a bit.' => '',
  'Forgot Password?' => 'Ξεχάσατε τον κωδικό;',
  'No user found.' => 'Δεν βρέθηκε χρήστης.',
  '%d ZB' => '',
  'There is an update available.' => '',
  'Manage users' => '',
  '%d  MB' => '',
  'Pagekit Installer' => '',
  '%d YB' => '',
  30 => '',
  'Mail delivery failed! (%s)' => '',
  'Error' => 'Σφάλμα',
  'Connection established!' => '',
  'You have the latest version of Pagekit. You do not need to update. However, if you want to re-install version %version%, you can do so automatically or download the package and re-install manually.' => '',
  'Email address is invalid.' => '',
  2 => '2',
  '{0} %count% Users|{1} %count% User|]1,Inf[ %count% Users' => '',
  9 => '9',
  'Use the site in maintenance mode' => '',
  'Verification' => 'Επαλήθευση',
  'Please enter your email address. You will receive a link to create a new password via email.' => '',
  40 => '',
  'Welcome to %site%!' => '',
  'Show' => '',
  'Unable to send verification link.' => '',
  'Sign up' => 'Εγγραφή',
  'Web Server' => '',
  'Unpublish' => '',
  'Copy' => 'Αντιγραφή',
  'Invalid username or password.' => '',
  'Require e-mail verification when a guest creates an account.' => '',
  'No Frontpage assigned.' => '',
  'Database Name' => '',
  'Sign up now' => '',
  'All' => 'Όλα',
  'Add User' => 'Προσθήκη χρήστη',
  'Enabled, but approval is required.' => '',
  'Description' => 'Περιγραφή',
  'Password Confirmation' => '',
  'Setting' => 'Ρυθμίσεις',
  'Hi %username%' => '',
  50 => '',
  33 => '',
  'Unable to send confirmation link.' => '',
  'Your email has been verified. Once an administrator approves your account, you will be notified by email.' => '',
  'Username not available.' => '',
  'Block' => 'Αποκλεισμός',
  'Verified Email Address' => '',
  'username' => 'όνομα χρήστη',
  'Edit User' => '',
  'Existing Pagekit installation detected. Choose different table prefix?' => '',
  'Role not found.' => '',
  'Edit Widget' => '',
  'Name' => 'Όνομα',
  'Reset' => '',
  'Dashboard' => '',
);


text:
package endpointer

import (
	"errors"
	"github.com/coreos/go-etcd/etcd"
	"time"
)

// AnnounceNamer is executed to get a unique name for the etcd key.
// The hostname is used as default.
type AnnounceNamer func() string

// AnnouncerConfig can be used to modify the etcd announce behaviour.
type AnnouncerConfig struct {
	// The etcd directory prefix
	WatchDirectoryPrefix string
	// The etcd key TTL in seconds
	TTL uint64
	// The etcd register interval in seconds
	Interval uint64
	// AnnounceName is executed to get a unique etcd key name
	AnnounceName AnnounceNamer
}

// Announcer registers the node into etcd.
// The key will be updated with the given interval and TTL.
type Announcer struct {
	watchDirectoryPrefix string
	etcdClient           *etcd.Client
	ttl                  uint64
	interval             uint64
	announceNamer        AnnounceNamer
}

// NewAnnouncer creates and starts the Announcer.
// The announcer will announce the instance into etcd.
func NewAnnouncer(etcdEndpoints []string, etcdDirName string, value string, config *AnnouncerConfig) (*Announcer, error) {
	// Check if etcdEndpoint is valid
	if etcdEndpoints == nil {
		return nil, errors.New("etcdEndpoint cannot be nil")
	}

	// Check if etcdWatchDir is valid
	if etcdDirName == "" {
		return nil, errors.New("etcdWatchDir cannot be empty")
	}

	// If config is nil, use DefaultEndpointerConfig
	if config == nil {
		config = DefaultAnnouncerConfig
	}

	// Check nil values, otherwise use defaults
	if config.WatchDirectoryPrefix == "" {
		config.WatchDirectoryPrefix = DefaultAnnouncerConfig.WatchDirectoryPrefix
	}
	if config.TTL == 0 {
		config.TTL = DefaultAnnouncerConfig.TTL
	}
	if config.Interval == 0 {
		config.Interval = DefaultAnnouncerConfig.Interval
	}
	if config.AnnounceName == nil {
		config.AnnounceName = DefaultAnnouncerConfig.AnnounceName
	}

	// Create Announcer instance
	announcer := &Announcer{
		watchDirectoryPrefix: config.WatchDirectoryPrefix,
		ttl:                  config.TTL,
		interval:             config.Interval,
		announceNamer:        config.AnnounceName,
	}

	announcer.etcdClient = etcd.NewClient(etcdEndpoints)

	name := announcer.announceNamer()

	go func() {
		for {
			if _, err := announcer.etcdClient.Set(announcer.watchDirectoryPrefix+etcdDirName+"/"+name, value, announcer.ttl); err != nil {
				Log.Error("error announcing node", "error", err)
			}
			time.Sleep(time.Duration(announcer.interval) * time.Second)
		}
	}()

	return announcer, nil
}

redpajama_set_name: RedPajamaGithub


text:
package com.tce.spring.oauth2.token.store;

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

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.common.OAuth2RefreshToken;
import org.springframework.security.oauth2.common.util.SerializationUtils;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.token.AuthenticationKeyGenerator;
import org.springframework.security.oauth2.provider.token.DefaultAuthenticationKeyGenerator;
import org.springframework.security.oauth2.provider.token.TokenStore;

import com.couchbase.client.protocol.views.ComplexKey;
import com.couchbase.client.protocol.views.Query;
import com.tce.spring.oauth2.domain.CouchbaseOAuth2AccessToken;
import com.tce.spring.oauth2.domain.CouchbaseOAuth2AuthenticationToAccessToken;
import com.tce.spring.oauth2.domain.CouchbaseOAuth2RefreshToken;
import com.tce.spring.oauth2.service.api.OAuth2AccessTokenService;
import com.tce.spring.oauth2.service.api.OAuth2AuthenticationToAccessTokenService;
import com.tce.spring.oauth2.service.api.OAuth2RefreshTokenService;

/**
 *
 * @author Titouan COMPIEGNE
 *
 */
public class SpringDataTokenStore implements TokenStore {

	private static final Log LOG = LogFactory.getLog(SpringDataTokenStore.class);

	@Autowired
	private OAuth2AccessTokenService oAuth2AccessTokenService;

	@Autowired
	private OAuth2RefreshTokenService oAuth2RefreshTokenService;

	@Autowired
	private OAuth2AuthenticationToAccessTokenService oAuth2AuthenticationToAccessTokenService;

	private AuthenticationKeyGenerator authenticationKeyGenerator = new DefaultAuthenticationKeyGenerator();

	public void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator) {
		this.authenticationKeyGenerator = authenticationKeyGenerator;
	}

	@Override
	public OAuth2Authentication readAuthentication(OAuth2AccessToken token) {
		return readAuthentication(token.getValue());
	}

	@Override
	public OAuth2Authentication readAuthentication(String token) {
		OAuth2Authentication authentication = null;
		try {
			CouchbaseOAuth2AccessToken accessToken = (CouchbaseOAuth2AccessToken) oAuth2AccessTokenService.findOne(token);
			if (accessToken != null) {
				authentication = deserializeAuthentication(Base64.decodeBase64(accessToken.getAuthentication()));
			} else {
				if (LOG.isInfoEnabled()) {
					LOG.info("Failed to find access token for token " + token);
				}
			}
		} catch (Exception e) {
			LOG.warn("Failed to read authentication for " + token, e);
			removeAccessToken(token);
		}
		return authentication;
	}

	@Override
	public void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication) {
		// Store access token
		CouchbaseOAuth2AccessToken accessToken = new CouchbaseOAuth2AccessToken(token);
		accessToken.setAuthentication(Base64.encodeBase64String(serializeAuthentication(authentication)));
		accessToken.setAuthenticationKey(authenticationKeyGenerator.extractKey(authentication));
		accessToken.setUserName(authentication.isClientOnly() ? null : authentication.getName());
		accessToken.setClientId(authentication.getOAuth2Request().getClientId());
		oAuth2AccessTokenService.save(accessToken);

		// Attach access token to authentication
		CouchbaseOAuth2AuthenticationToAccessToken authAccessToken = new CouchbaseOAuth2AuthenticationToAccessToken();
		authAccessToken.setAuthenticationId(accessToken.getAuthenticationKey());
		authAccessToken.setAccessTokenId(token.getValue());
		oAuth2AuthenticationToAccessTokenService.save(authAccessToken);
	}

	@Override
	public OAuth2AccessToken readAccessToken(String tokenValue) {
		OAuth2AccessToken accessToken = null;

		try {
			accessToken = oAuth2AccessTokenService.findOne(tokenValue);

			if (accessToken == null) {
				if (LOG.isInfoEnabled()) {
					LOG.info("Failed to find access token for token " + tokenValue);
				}
			}
		} catch (Exception e) {
			LOG.warn("Failed to read access token for " + tokenValue, e);
			removeAccessToken(tokenValue);
		}

		return accessToken;
	}

	@Override
	public void removeAccessToken(OAuth2AccessToken token) {
		// remove associate OAuth2AuthenticationToAccessToken Document
		removeAuthenticationToAccessToken(token);
		// then remove access token itself
		removeAccessToken(token.getValue());
	}

	private void removeAuthenticationToAccessToken(OAuth2AccessToken token) {
		if (token != null && token instanceof CouchbaseOAuth2AccessToken) {
			CouchbaseOAuth2AccessToken noSQLOAuth2AccessToken = (CouchbaseOAuth2AccessToken) token;
			try {
				oAuth2AuthenticationToAccessTokenService.delete(noSQLOAuth2AccessToken.getAuthenticationKey());
			} catch (Exception e) {
				LOG.error("Could not deletete AuthenticationToAccessToken " + noSQLOAuth2AccessToken, e);
			}
		}
	}

	public void removeAccessToken(String value) {
		oAuth2AccessTokenService.delete(value);
	}

	@Override
	public void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication) {
		CouchbaseOAuth2RefreshToken couchBaseRefreshToken = new CouchbaseOAuth2RefreshToken(refreshToken.getValue());
		couchBaseRefreshToken.setAuthentication(Base64.encodeBase64String(serializeAuthentication(authentication)));

		OAuth2AccessToken accessToken = getAccessToken(authentication);
		if (accessToken != null) {
			couchBaseRefreshToken.setAccessTokenId(accessToken.getValue());
		} else {
			if (LOG.isInfoEnabled()) {
				LOG.info("Failed to find access token for authentication while storing refresh token " + authentication);
			}
		}
		oAuth2RefreshTokenService.save(couchBaseRefreshToken);
	}

	@Override
	public OAuth2RefreshToken readRefreshToken(String token) {
		OAuth2RefreshToken refreshToken = null;
		try {
			refreshToken = oAuth2RefreshTokenService.findOne(token);
			if (refreshToken == null) {
				if (LOG.isInfoEnabled()) {
					LOG.info("Failed to find refresh token for token " + token);
				}
			}
		} catch (Exception e) {
			LOG.warn("Failed to read refresh token for token " + token, e);
			removeRefreshToken(token);
		}
		return refreshToken;
	}

	@Override
	public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token) {
		return readAuthenticationForRefreshToken(token.getValue());
	}

	public OAuth2Authentication readAuthenticationForRefreshToken(String value) {
		OAuth2Authentication authentication = null;

		try {
			CouchbaseOAuth2RefreshToken refreshToken = (CouchbaseOAuth2RefreshToken) oAuth2RefreshTokenService.findOne(value);
			if (refreshToken != null) {
				authentication = deserializeAuthentication(Base64.decodeBase64(refreshToken.getAuthentication()));
			} else {
				if (LOG.isInfoEnabled()) {
					LOG.info("Failed to find refresh token for token " + value);
				}
			}
		} catch (Exception e) {
			LOG.warn("Failed to read authentication for refresh token for " + value, e);
			removeRefreshToken(value);
		}
		return authentication;
	}

	@Override
	public void removeRefreshToken(OAuth2RefreshToken token) {
		removeRefreshToken(token.getValue());
	}

	public void removeRefreshToken(String token) {
		oAuth2RefreshTokenService.delete(token);
	}

	@Override
	public void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken) {
		removeAccessTokenUsingRefreshToken(refreshToken.getValue());
	}

	public void removeAccessTokenUsingRefreshToken(String refreshTokenValue) {
		CouchbaseOAuth2RefreshToken refreshToken = (CouchbaseOAuth2RefreshToken) oAuth2RefreshTokenService.findOne(refreshTokenValue);
		if (refreshToken != null) {
			oAuth2AccessTokenService.delete(refreshToken.getAccessTokenId());
		} else {
			LOG.warn("Failed to read refresh token while removing access token using refresh token " + refreshTokenValue);
			removeRefreshToken(refreshTokenValue);
		}
	}

	@Override
	public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication) {
		OAuth2AccessToken accessToken = null;
		String key = authenticationKeyGenerator.extractKey(authentication);
		CouchbaseOAuth2AuthenticationToAccessToken auth = oAuth2AuthenticationToAccessTokenService.findOne(key);

		try {
			if (auth != null) {
				accessToken = oAuth2AccessTokenService.findOne(auth.getAccessTokenId());
			} else {
				if (LOG.isInfoEnabled()) {
					LOG.debug("Failed to find access token for authentication " + authentication);
				}
			}
		} catch (Exception e) {
			LOG.error("Could not get access token for authentication " + authentication, e);
		}

		if (accessToken != null
				&& !key.equals(authenticationKeyGenerator.extractKey(readAuthentication(accessToken.getValue())))) {
			removeAccessToken(accessToken.getValue());
			// Keep the store consistent (maybe the same user is represented by this authentication but the details have
			// changed)
			storeAccessToken(accessToken, authentication);
		}
		return accessToken;
	}

	@Override
	public Collection<OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String userName) {
		List<OAuth2AccessToken> accessTokens = new ArrayList<OAuth2AccessToken>();
		Query query = new Query();
	    query.setKey(ComplexKey.of(clientId, userName));

	    accessTokens = oAuth2AccessTokenService.findByClientIdAndUserName(query);
	    if (accessTokens == null) {
	    	if (LOG.isInfoEnabled()) {
				LOG.info("Failed to find access token for userName " + userName);
			}
	    }

		return accessTokens;
	}

	@Override
	public Collection<OAuth2AccessToken> findTokensByClientId(String clientId) {
		List<OAuth2AccessToken> accessTokens = new ArrayList<OAuth2AccessToken>();
		Query query = new Query();
	    query.setKey(ComplexKey.of(clientId));

	    accessTokens = oAuth2AccessTokenService.findByClientId(query);
	    if (accessTokens == null) {
	    	if (LOG.isInfoEnabled()) {
				LOG.info("Failed to find access token for clientId " + clientId);
			}
	    }
		return accessTokens;
	}

	protected byte[] serializeAccessToken(OAuth2AccessToken token) {
		return SerializationUtils.serialize(token);
	}

	protected byte[] serializeRefreshToken(OAuth2RefreshToken token) {
		return SerializationUtils.serialize(token);
	}

	protected byte[] serializeAuthentication(OAuth2Authentication authentication) {
		return SerializationUtils.serialize(authentication);
	}

	protected OAuth2AccessToken deserializeAccessToken(byte[] token) {
		return SerializationUtils.deserialize(token);
	}

	protected OAuth2RefreshToken deserializeRefreshToken(byte[] token) {
		return SerializationUtils.deserialize(token);
	}

	protected OAuth2Authentication deserializeAuthentication(byte[] authentication) {
		return SerializationUtils.deserialize(authentication);
	}
}


text:
name: Bug report
about: Create a report to help us improve

---

## Prerequisites

Please answer the following questions for yourself before submitting an issue.

- [ ] I am running the latest version
- [ ] I checked the documentation and found no answer
- [ ] I checked to make sure that this issue has not already been filed
- [ ] I'm reporting the issue to the correct repository

## Expected Behavior

<!-- Please describe the behavior you are expecting -->

## Current Behavior

<!-- What is the current behavior? -->

## Failure Information

<!-- Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. -->

### Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

### Reproduce code snippet
```js
const broker = new ServiceBroker({
    logger: console,
    transporter: "NATS"
});

broker.createService({
    name: "test",
    actions: {
        empty(ctx) {
            return "Hello"
        }
    }
});
```

### Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Moleculer version:
* NodeJS version:
* Operating System:

### Failure Logs
```

```


text:
function ContractionRecorder
%CONTRACTION RECORDER
%   ContractionRecorder is written to record the contraction time and
%   interval for a parturient who is about to give birth. The regular
%   uterine contraction indicates the family should prepared to go to
%   hospital at any time when the contraction intervals meet the
%   requirement that you have to action.
%
%   Using the program is easy, just RUN and press ANY KEY while record the
%   start time and stop time of one contraction.

%   Written by dovecho at GMAIL dot COM
%   File name: ContractionRecorder.m
%   Revision Note: First publish of the program
%   $Version: 1.0.0.2 $	$Date: 2015-11-19 21:15:15 $

% Recording
recordFName = sprintf('REC_CONTRACTION_%s.txt', datestr(now, 'yyyy-mm-dd'));
diary(recordFName);

% set clean up function, to close diary while force excuting
% ref: http://cn.mathworks.com/help/matlab/ref/oncleanup.html
diaryclearnup = onCleanup(@() set(0,'Diary','off'));

strWait1 = 'Press ANY KEY when contraction STARTS... ';
strWait2 = 'Press ANY KEY when contraction STOPS... ';

% The program can be terminated by CTRL+C at any time, if needed. Just
% leave the MATLAB open, and the program can be runned again, and the
% contraction data are saved in the global varibles.
global iContractionRecorderCount;
global tContractionRecorder;

if isempty(iContractionRecorderCount)
%   For a fresh start of recording
    iContractionRecorderCount = 1;
    tContractionRecorder = 0;

    % Welcome message
    fprintf('Welcome to CONTRACTION RECORDER!\n');
    fprintf('======================================\n');
    fprintf('WARNING!!! Be prepared for delivery before using this program!!\n\n')
    fprintf('When contraction interval meets the requirement to go to the hospital,\n');
    fprintf('GO at ease, and good luck!\n\n');
    fprintf('NOTE1: Press CTRL+C to terminate the recording.\n');
    fprintf('NOTE2: You can run the program again to continue recording.\n');
    fprintf('NOTE3: Run CLEAR ALL to reset the recording.\n\n');
    fprintf('RECORDING STARTS AT: %s\n', datestr(now));
    fprintf('=======================================================\n');
end

% Display information while waiting a contraction starts
diary off;fprintf('%s\n', strWait1);pause;diary on;

% Start timing of contraction
tic;

% Main loop
while 1
    % Record the starting time of a contraction
    diary off;fprintf('\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b');diary on;
    strStartTime = datestr(now, 'HH:MM:SS');
    dt = toc+tContractionRecorder; % DT is the time interval between two contractions

    fprintf('No. %3d Starts at: %s, ', iContractionRecorderCount, strStartTime);
    if iContractionRecorderCount > 1
        fprintf('Interval: %02d:%02d, ', floor(dt/60), mod(round(dt),60));
    end

    % Wait for contraction ends
    tic;
    diary off;fprintf('\n%s', strWait2);diary on;
    pause;

    % Contraction ends
    diary off;fprintf('\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b');diary on;
    strEndTime =  datestr(now);
    tContractionRecorder = toc;
    fprintf('Last: %d sec.\n', round(tContractionRecorder));

    % Wait for next contraction starts
    tic;
    iContractionRecorderCount = iContractionRecorderCount + 1;

    diary off;fprintf('%s\n', strWait1);pause;diary on;
end

diary off;


text: <?php $dbh = new PDO('mysql:host=localhost;dbname=eve', 'eve', 'eve'); ?>


text:
@interface AMiOSApp ()

- (void)createIPAFromApp;

- (NSDictionary *)infoFromApp:(NSString *)path;

- (void)listDevicesInApp;

- (AMiOSApp *)initWithIPA:(NSString *)path;

- (NSString *)appCachePath;

- (void)getIconPath;

- (void)getFileSize;
@end

@implementation AMiOSApp
@synthesize appInfo, appPath, ipaPath, devices, iconPath, icon2xPath, fileSize, updatedAt;

// extract the IPA
- (AMiOSApp *)initWithIPA:(NSString *)path {
    self = [super init];
    if (self != nil) {
        ipaPath = [path copy];
        NSString *fileMD5 = [ipaPath getMD5String];
        NSString *cache = [self appCachePath];

        NSTask *task = [[NSTask alloc] init];
        [task setLaunchPath:@"/usr/bin/unzip"];
        [task setArguments:[NSArray arrayWithObjects:@"-o", ipaPath, @"-d", fileMD5, nil]];
        [task setCurrentDirectoryPath:cache];
        [task launch];
        [task waitUntilExit];
        int status = [task terminationStatus];
        [task release];

        DDLogVerbose(@"Result of shell: %d", status);
        if (status != 0) {
            NSException *exception = [NSException
                    exceptionWithName:@"FailToExtractIPAException"
                               reason:@"Failed to extract information from .ipa file."
                             userInfo:nil];
            @throw exception;
        }

        NSFileManager *fileMgr = [NSFileManager defaultManager];
        NSString *payloadPath = [NSString stringWithFormat:@"%@/%@/%@", cache, fileMD5, @"Payload"];

        NSArray *files = [fileMgr contentsOfDirectoryAtPath:payloadPath error:nil];
        for (NSString *fileName in files) {
            if ([fileName hasSuffix:@".app"]) {
                appPath = [[payloadPath stringByAppendingPathComponent:fileName] retain];
                appInfo = [[self infoFromApp:appPath] retain];

                [self listDevicesInApp];
                [self getIconPath];
                [self getFileSize];

                NSDictionary *attributes = [fileMgr attributesOfItemAtPath:ipaPath error:nil];
                updatedAt = [[attributes valueForKey:NSFileModificationDate] retain];

                break;
            }
        }
    }
    return self;
}

// check app info, if iOS app, create IPA
- (AMiOSApp *)initWithPath:(NSString *)path {
    if ([path hasSuffix:@".ipa"]) {
        return [self initWithIPA:path];
    } else {
        self = [super init];
        if (self != nil) {
            appPath = [path copy];
            appInfo = [[self infoFromApp:appPath] copy];

            [self createIPAFromApp];

            [self listDevicesInApp];
            [self getIconPath];
            [self getFileSize];

            NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:appPath error:nil];
            updatedAt = [[attributes valueForKey:NSFileModificationDate] retain];
        }
        return self;
    }
}

- (NSString *)appCachePath {
    NSString *myId = [[NSBundle mainBundle] bundleIdentifier];

    NSString *path = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    path = [path stringByAppendingPathComponent:myId];

    NSFileManager *fileMgr = [NSFileManager defaultManager];
    [fileMgr createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];

    return path;
}

- (void)createIPAFromApp {
    NSString *cache = [self appCachePath];
    cache = [cache stringByAppendingPathComponent:[appInfo valueForKey:@"CFBundleIdentifier"]];
    NSString *payload = [cache stringByAppendingPathComponent:@"Payload"];
    NSString *ipaFileName = [NSString stringWithFormat:@"%@.ipa", [appInfo valueForKey:@"CFBundleName"]];
    NSString *ipa = [cache stringByAppendingPathComponent:ipaFileName];

    NSFileManager *fileMgr = [NSFileManager defaultManager];
    if ([fileMgr isDeletableFileAtPath:payload]) {
        [fileMgr removeItemAtPath:cache error:nil];
    }
    [fileMgr createDirectoryAtPath:payload withIntermediateDirectories:YES attributes:nil error:nil];

    NSError *error = nil;
    NSString *dest = [payload stringByAppendingPathComponent:[appPath lastPathComponent]];
    [fileMgr copyItemAtPath:appPath toPath:dest error:&error];

    if (error) {
        DDLogError(@"failed to copy items from %@ to %@, %@", appPath, dest, error);
        return;
    }

    NSTask *task = [[NSTask alloc] init];
    [task setLaunchPath:@"/usr/bin/zip"];
    [task setArguments:[NSArray arrayWithObjects:@"-r", @"-y", ipa, @"Payload", nil]];
    [task setCurrentDirectoryPath:cache];
    [task launch];
    [task waitUntilExit];
    int status = [task terminationStatus];
    [task release];

    DDLogVerbose(@"Result of shell: %d", status);
    if (status != 0) {
        NSException *exception = [NSException
                exceptionWithName:@"FailToCreateIPAException"
                           reason:@"Failed to create .ipa file."
                         userInfo:nil];
        @throw exception;
    }

    ipaPath = [ipa copy];
}

- (NSDictionary *)infoFromApp:(NSString *)path {
    NSString *pathForPlist = [path stringByAppendingPathComponent:@"Info.plist"];
    NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:pathForPlist];

    if (nil == info) {
        DDLogError(@"Failed to get information from .app: %@", path);

        NSException *exception = [NSException
                exceptionWithName:@"App Info Error"
                           reason:@"Failed to get information from info.plist"
                         userInfo:nil];
        @throw exception;
    }

    if (![[info valueForKey:@"DTPlatformName"] isEqualToString:@"iphoneos"]) {
        @throw [NSException exceptionWithName:@"UnSupported Platform"
                                       reason:@"This binary is not build for iOS."
                                     userInfo:nil];
    }

    return info;
}

- (void)listDevicesInApp {
    NSString *f = [appPath stringByAppendingPathComponent:@"embedded.mobileprovision"];

    NSFileManager *fileMgr = [NSFileManager defaultManager];
    if (![fileMgr isReadableFileAtPath:f]) {
        @throw [NSException exceptionWithName:@"No Provisioning"
                                       reason:@"A provisioning profile is needed for install the app on iOS devices."
                                     userInfo:nil];
    }

    // todo: check if no provision
    NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:f];
    [fh seekToFileOffset:0x3c];
    NSData *lengthData = [fh readDataOfLength:2];
    Byte *b = (Byte *) [lengthData bytes];
    long length = b[0] * 256 + b[1];
    [fh seekToFileOffset:0x3e];
    NSData *plistData = [fh readDataOfLength:length];

    NSString *error = nil;
    NSDictionary *dict = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:0 format:nil errorDescription:&error];
    devices = [[dict valueForKey:@"ProvisionedDevices"] copy];
}

- (NSDictionary *)infoFromIPA:(NSString *)path {
    NSString *pathForPlist = [path stringByAppendingPathComponent:@"Info.plist"];
    NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:pathForPlist];
    return info;
}

- (void)getFileSize {
    NSFileManager *fileMgr = [NSFileManager defaultManager];
    if ([fileMgr isReadableFileAtPath:ipaPath]) {
        NSError *error;
        NSDictionary *attributes = [fileMgr attributesOfItemAtPath:ipaPath error:&error];
        fileSize = [[[attributes valueForKey:NSFileSize] readableSize] retain];
    }
}

- (void)getIconPath {
    if (nil == iconPath) {
        NSString *iconName = [appInfo valueForKey:@"CFBundleIconFile"];
        NSString *icon2xName = @"Icon@2x.png";
        if (nil == iconName) {
            NSArray *icons = [appInfo valueForKey:@"CFBundleIconFiles"];
            if ([icons count] == 1) {
                iconName = [icons objectAtIndex:0];
            }

            if ([icons count] == 2) {
                icon2xName = [icons objectAtIndex:1];
            }

            if (!icons || [icons count] == 0) {
                iconName = @"Icon.png";
            }
        }

        iconPath = [appPath stringByAppendingPathComponent:iconName];
        NSFileManager *fileMgr = [NSFileManager defaultManager];
        if ([fileMgr isReadableFileAtPath:iconPath]) {
            [iconPath retain];
        } else {
            iconPath = [[[NSBundle mainBundle] pathForImageResource:@"noicon.png"] copy];
        }

        icon2xPath = [appPath stringByAppendingPathComponent:icon2xName];
        if ([fileMgr isReadableFileAtPath:icon2xPath]) {
            [icon2xPath retain];
        } else {
            icon2xPath = [[[NSBundle mainBundle] pathForImageResource:@"noicon@2x.png"] copy];
        }
    }
}

- (void)dealloc {
    [iconPath release];
    [ipaPath release];
    [appPath release];
    [appInfo release];
    [devices release];
    [icon2xPath release];
    [fileSize release];
    [updatedAt release];
    [super dealloc];
}

@end


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
// Importar Injectable do Core do Angular
var core_1 = require('@angular/core');
var http_1 = require('@angular/http');
// RxJS possui extensões para o TS/JS, neste caso, importando extensão de "toPromise()".
require('rxjs/add/operator/toPromise');
// Injectable determina que este objeto/classe pode ser injetado em um outro componente.
var HeroService = (function () {
    // Criar serviço injetando referencia ao Http.
    function HeroService(http) {
        this.http = http;
        // Definir URL da API.
        this.heroesUrl = 'app/heroes';
    }
    HeroService.prototype.getHero = function (id) {
        // Utilizar método do serviço
        return this.getHeroes().then(function (heroes) {
            return heroes.filter(function (hero) { return hero.id == id; })[0];
        });
    };
    // Método para recuperar os Herois via API.
    // Possui um retorno "tipado".
    HeroService.prototype.getHeroes = function () {
        // Retornar uma promise com a listagem de hérois disponiveis.
        // return Promise.resolve(HEROES);
        // Retornar usando HTTP:
        // HTTP retorna um "Observable" porém por enquanto, iremos utilizar "Promises"
        // Para isso, utilizamos a extensão toPromise().
        return this.http.get(this.heroesUrl).toPromise()
            .then(function (response) { return response.json().data; })
            .catch(this.handleError);
    };
    // Método para adicionar um novo heroi via API.
    HeroService.prototype.post = function (hero) {
        // Definir Headers do POST.
        var headers = new http_1.Headers({
            'Content-Type': 'application/json'
        });
        // Retornar promise, passando para o método de post a URL, JSON do modelo e headers criados.
        // Em sucesso, retornar os dados informados pela API.
        // Em caso de erro, gerenciar este.
        return this.http
            .post(this.heroesUrl, JSON.stringify(hero), { headers: headers })
            .toPromise()
            .then(function (response) { return response.json().data; })
            .catch(this.handleError);
    };
    // Método para atualizar um heroi via API.
    HeroService.prototype.put = function (hero) {
        // Definir Headers do PUT.
        var headers = new http_1.Headers();
        headers.append('Content-Type', 'application/json');
        // URL do Put é um pouco diferente
        // Sendo URL + /ID
        var url = this.heroesUrl + "/" + hero.id;
        // Retornar promise, passando para o método de put a URL, JSON do modelo e headers criados.
        // Em sucesso, retornar o heroi que foi passado via parametro (pois este é o novo modelo).
        // Em caso de erro, gerenciar este.
        return this.http
            .put(url, JSON.stringify(hero), { headers: headers })
            .toPromise()
            .then(function () { return hero; })
            .catch(this.handleError);
    };
    // Método para deletar um heroi via API.
    HeroService.prototype.delete = function (hero) {
        // Definir Headers do delete.
        var headers = new http_1.Headers();
        headers.append('Content-Type', 'application/json');
        // URL do Delete é um pouco diferente
        // Sendo URL + /ID
        var url = this.heroesUrl + "/" + hero.id;
        // Retornar promise, passando para o método de delete a URL e headers criados.
        // Em caso de erro, gerenciar este.
        return this.http
            .delete(url, headers)
            .toPromise()
            .catch(this.handleError);
    };
    // Método para salvar a entidade
    // Como os métodos _post e _put são private, o Save irá realizar a regra de negócio para determinar qual chamar.
    HeroService.prototype.save = function (hero) {
        // Se possui ID, somente atualizar.
        if (hero.id) {
            return this.put(hero);
        }
        // Se não, criar.
        return this.post(hero);
    };
    // Método para gerenciamento de erro durante operações do service.
    HeroService.prototype.handleError = function (error) {
        console.error('An error occurred', error);
        // Retornar um "reject" para quem possui a promise.
        return Promise.reject(error.message || error);
    };
    HeroService = __decorate([
        core_1.Injectable(),
        __metadata('design:paramtypes', [http_1.Http])
    ], HeroService);
    return HeroService;
}());
exports.HeroService = HeroService;
//# sourceMappingURL=hero.service.js.map


text:
import { Link } from "react-router";
import { FormattedMessage } from "react-intl";

import { abilities } from "utils/datasetUtils";

export default function (input) {
  Object.assign(input.prototype, {
    // eslint-disable-line no-restricted-properties
    renderMoveLink() {
      const { entity, location } = this.props;
      const moveLink = {
        ...location,
        state: {
          modal: "UpdateDataset",
          item: entity,
          query: {
            mode: "move",
          },
        },
      };

      const { canMove } = abilities(entity, entity.get("entityType"));

      if (!canMove) {
        return null;
      }

      return (
        <Link to={moveLink} style={{ marginTop: 15, display: "block" }}>
          <FormattedMessage id="Common.Move" />
        </Link>
      );
    },
  });
}


text:
# -*- encoding : utf-8 -*-
require 'pry'
require 'rspec'
require 'pumper'
require 'rspec/its'
require 'active_support/all'

Dir['spec/support/**/*.rb'].each do |file|
  require File.join(File.dirname(__FILE__), '..', file)
end

RSpec.configure do |config|
  config.before(:each, stub_system: true) do
    $OUTPUT = []
    module Kernel
      def system(cmd)
        $OUTPUT << cmd
      end
    end
  end

  config.after(:each, stub_system: true) do
    $OUTPUT = []
  end
end


text:
package com.opengamma.strata.measure.index;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.opengamma.strata.basics.ReferenceData;
import com.opengamma.strata.basics.Resolvable;
import com.opengamma.strata.basics.currency.Currency;
import com.opengamma.strata.basics.index.OvernightIndex;
import com.opengamma.strata.calc.Measure;
import com.opengamma.strata.calc.runner.CalculationFunction;
import com.opengamma.strata.calc.runner.CalculationParameters;
import com.opengamma.strata.calc.runner.FunctionRequirements;
import com.opengamma.strata.collect.ArgChecker;
import com.opengamma.strata.collect.result.FailureReason;
import com.opengamma.strata.collect.result.Result;
import com.opengamma.strata.data.FieldName;
import com.opengamma.strata.data.MarketDataId;
import com.opengamma.strata.data.scenario.ScenarioMarketData;
import com.opengamma.strata.market.observable.QuoteId;
import com.opengamma.strata.measure.Measures;
import com.opengamma.strata.measure.rate.RatesMarketDataLookup;
import com.opengamma.strata.measure.rate.RatesScenarioMarketData;
import com.opengamma.strata.product.SecuritizedProductPortfolioItem;
import com.opengamma.strata.product.index.OvernightFuture;
import com.opengamma.strata.product.index.OvernightFuturePosition;
import com.opengamma.strata.product.index.OvernightFutureTrade;
import com.opengamma.strata.product.index.ResolvedOvernightFutureTrade;

/**
 * Perform calculations on a single {@code OvernightFutureTrade} for each of a set of scenarios.
 *

 * This uses the standard discounting calculation method.
 * An instance of {@link RatesMarketDataLookup} must be specified.
 * The supported built-in measures are:
 *

 *
{@linkplain Measures#PRESENT_VALUE Present value}
 *
{@linkplain Measures#PV01_CALIBRATED_SUM PV01 calibrated sum}
 *
{@linkplain Measures#PV01_CALIBRATED_BUCKETED PV01 calibrated bucketed}
 *
{@linkplain Measures#PV01_MARKET_QUOTE_SUM PV01 market quote sum}
 *
{@linkplain Measures#PV01_MARKET_QUOTE_BUCKETED PV01 market quote bucketed}
 *
{@linkplain Measures#UNIT_PRICE Unit price}
 *
{@linkplain Measures#PAR_SPREAD Par spread}
 *
{@linkplain Measures#RESOLVED_TARGET Resolved trade}
 *

 *
 *
Price

 * The price of an Overnight rate future is based on the interest rate of the underlying index.
 * It is defined as {@code (100 - percentRate)}.
 *

 * Strata uses decimal prices for Overnight rate futures in the trade model, pricers and market data.
 * The decimal price is based on the decimal rate equivalent to the percentage.
 * For example, a price of 99.32 implies an interest rate of 0.68% which is represented in Strata by 0.9932.
 *
 * @param <T> the trade or position type
 */
//CSOFF: LineLengthCheck
public class OvernightFutureTradeCalculationFunction<T extends SecuritizedProductPortfolioItem<OvernightFuture> & Resolvable<ResolvedOvernightFutureTrade>>
    implements CalculationFunction<T> {
//CSON: LineLengthCheck

  /**
   * The trade instance
   */
  public static final OvernightFutureTradeCalculationFunction<OvernightFutureTrade> TRADE =
      new OvernightFutureTradeCalculationFunction<>(OvernightFutureTrade.class);
  /**
   * The position instance
   */
  public static final OvernightFutureTradeCalculationFunction<OvernightFuturePosition> POSITION =
      new OvernightFutureTradeCalculationFunction<>(OvernightFuturePosition.class);

  /**
   * The calculations by measure.
   */
  private static final ImmutableMap<Measure, SingleMeasureCalculation> CALCULATORS =
      ImmutableMap.<Measure, SingleMeasureCalculation>builder()
          .put(Measures.PRESENT_VALUE, OvernightFutureMeasureCalculations.DEFAULT::presentValue)
          .put(Measures.PV01_CALIBRATED_SUM, OvernightFutureMeasureCalculations.DEFAULT::pv01CalibratedSum)
          .put(Measures.PV01_CALIBRATED_BUCKETED, OvernightFutureMeasureCalculations.DEFAULT::pv01CalibratedBucketed)
          .put(Measures.PV01_MARKET_QUOTE_SUM, OvernightFutureMeasureCalculations.DEFAULT::pv01MarketQuoteSum)
          .put(Measures.PV01_MARKET_QUOTE_BUCKETED,
              OvernightFutureMeasureCalculations.DEFAULT::pv01MarketQuoteBucketed)
          .put(Measures.UNIT_PRICE, OvernightFutureMeasureCalculations.DEFAULT::unitPrice)
          .put(Measures.PAR_SPREAD, OvernightFutureMeasureCalculations.DEFAULT::parSpread)
          .put(Measures.RESOLVED_TARGET, (rt, smd) -> rt)
          .build();

  private static final ImmutableSet<Measure> MEASURES = CALCULATORS.keySet();

  /**
   * The trade or position type.
   */
  private final Class<T> targetType;

  /**
   * Creates an instance.
   *
   * @param targetType  the trade or position type
   */
  public OvernightFutureTradeCalculationFunction(Class<T> targetType) {
    this.targetType = ArgChecker.notNull(targetType, "targetType");
  }

  //-------------------------------------------------------------------------
  @Override
  public Class<T> targetType() {
    return targetType;
  }

  @Override
  public Set<Measure> supportedMeasures() {
    return MEASURES;
  }

  @Override
  public Optional<String> identifier(T target) {
    return target.getInfo().getId().map(id -> id.toString());
  }

  @Override
  public Currency naturalCurrency(T target, ReferenceData refData) {
    return target.getProduct().getCurrency();
  }

  //-------------------------------------------------------------------------
  @Override
  public FunctionRequirements requirements(
      T target,
      Set<Measure> measures,
      CalculationParameters parameters,
      ReferenceData refData) {

    // extract data from product
    OvernightFuture product = target.getProduct();
    QuoteId quoteId = QuoteId.of(target.getProduct().getSecurityId().getStandardId(), FieldName.SETTLEMENT_PRICE);
    OvernightIndex index = product.getIndex();

    // use lookup to build requirements
    RatesMarketDataLookup ratesLookup = parameters.getParameter(RatesMarketDataLookup.class);
    FunctionRequirements ratesReqs = ratesLookup.requirements(ImmutableSet.of(), ImmutableSet.of(index));
    ImmutableSet<MarketDataId<?>> valueReqs = ImmutableSet.<MarketDataId<?>>builder()
        .add(quoteId)
        .addAll(ratesReqs.getValueRequirements())
        .build();
    return ratesReqs.toBuilder().valueRequirements(valueReqs).build();
  }

  //-------------------------------------------------------------------------
  @Override
  public Map<Measure, Result<?>> calculate(
      T target,
      Set<Measure> measures,
      CalculationParameters parameters,
      ScenarioMarketData scenarioMarketData,
      ReferenceData refData) {

    // resolve the trade once for all measures and all scenarios
    ResolvedOvernightFutureTrade resolved = target.resolve(refData);

    // use lookup to query market data
    RatesMarketDataLookup ratesLookup = parameters.getParameter(RatesMarketDataLookup.class);
    RatesScenarioMarketData marketData = ratesLookup.marketDataView(scenarioMarketData);

    // loop around measures, calculating all scenarios for one measure
    Map<Measure, Result<?>> results = new HashMap<>();
    for (Measure measure : measures) {
      results.put(measure, calculate(measure, resolved, marketData));
    }
    return results;
  }

  // calculate one measure
  private Result<?> calculate(
      Measure measure,
      ResolvedOvernightFutureTrade resolved,
      RatesScenarioMarketData marketData) {

    SingleMeasureCalculation calculator = CALCULATORS.get(measure);
    if (calculator == null) {
      return Result.failure(FailureReason.UNSUPPORTED, "Unsupported measure for OvernightFutureTrade: {}", measure);
    }
    return Result.of(() -> calculator.calculate(resolved, marketData));
  }

  //-------------------------------------------------------------------------
  @FunctionalInterface
  interface SingleMeasureCalculation {
    public abstract Object calculate(
        ResolvedOvernightFutureTrade resolved,
        RatesScenarioMarketData marketData);
  }

}


text:
	Utility library for detecting multiple clicks or taps. Not good UX, but good for opening up a debug
	menus.

	@class MultipleClickUtils
]=]

local require = require(script.Parent.loader).load(script)

local Signal = require("Signal")
local Maid = require("Maid")
local Observable = require("Observable")

local MultipleClickUtils = {}

local TIME_TO_CLICK_AGAIN = 0.5 -- Based upon windows default
local VALID_TYPES = {
	[Enum.UserInputType.MouseButton1] = true;
	[Enum.UserInputType.Touch] = true;
}

--[=[
	Observes a double click on the Gui
	@param gui GuiBase
	@return Observable<InputObject>
]=]
function MultipleClickUtils.observeDoubleClick(gui)
	return MultipleClickUtils.observeMultipleClicks(gui, 2)
end

--[=[
	Returns a signal that fires when the player clicks or taps on a Gui twice.

	@param maid Maid
	@param gui GuiBase
	@return Signal<InputObject>
]=]
function MultipleClickUtils.getDoubleClickSignal(maid, gui)
	return MultipleClickUtils.getDoubleClickSignal(maid, gui, 2)
end

--[=[
	Observes multiple clicks click on the Gui

	@param gui GuiBase
	@param requiredCount number
	@return Observable<InputObject>
]=]
function MultipleClickUtils.observeMultipleClicks(gui, requiredCount)
	assert(typeof(gui) == "Instance", "Bad gui")
	assert(type(requiredCount) == "number", "Bad requiredCount")

	return Observable.new(function(sub)
		local maid = Maid.new()

		maid:GiveTask(MultipleClickUtils.getMultipleClickSignal(maid, gui, requiredCount)
			:Connect(function(...)
				sub:Fire(...)
			end))

		return maid
	end)
end

--[=[
	For use in Blend. Observes multiple clicks.

	```lua
	Blend.New "TextButton" {
		[MultipleClickUtils.onMultipleClicks(3)] = function()
			print("Clicked")
		end;
	};
	```

	@param requiredCount number
	@return (gui: GuiBase) -> Observable<InputObject>
]=]
function MultipleClickUtils.onMultipleClicks(requiredCount)
	assert(type(requiredCount) == "number", "Bad requiredCount")

	return function(gui)
		return MultipleClickUtils.observeMultipleClicks(gui, requiredCount)
	end
end

--[=[
	Returns a signal that fires when the player clicks or taps on a Gui a certain amount
	of times.

	@param maid Maid
	@param gui GuiBase
	@param requiredCount number
	@return Signal<InputObject>
]=]
function MultipleClickUtils.getMultipleClickSignal(maid, gui, requiredCount)
	assert(Maid.isMaid(maid), "Bad maid")
	assert(typeof(gui) == "Instance", "Bad gui")
	assert(type(requiredCount) == "number", "Bad requiredCount")

	local signal = Signal.new()
	maid:GiveTask(signal)

	local lastInputTime = 0
	local lastInputObject = nil
	local inputCount = 0

	maid:GiveTask(gui.InputBegan:Connect(function(inputObject)
		if not VALID_TYPES[inputObject.UserInputType] then
			return
		end

		if lastInputObject
			and inputObject.UserInputType == lastInputObject.UserInputType
			and (tick() - lastInputTime) <= TIME_TO_CLICK_AGAIN then

			inputCount = inputCount + 1

			if inputCount >= requiredCount then
				inputCount = 0
				lastInputTime = 0
				lastInputObject = nil
				signal:Fire(lastInputObject)
			end
		else
			inputCount = 1
			lastInputTime = tick()
			lastInputObject = inputObject
		end
	end))

	return signal
end

return MultipleClickUtils


text:
import commands
import os
import random
import sys
import unittest

from nova.adminclient import NovaAdminClient
from nova.smoketests import flags

from nova import vendor
import paramiko

nova_admin = NovaAdminClient(access_key=flags.admin_access_key, secret_key=flags.admin_secret_key, clc_ip=host)

class NovaTestCase(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def connect_ssh(self, ip, key_name):
        # TODO(devcamcar): set a more reasonable connection timeout time
        key = paramiko.RSAKey.from_private_key_file('/tmp/%s.pem' % key_name)
        client = paramiko.SSHClient()
        client.load_system_host_keys()
        client.set_missing_host_key_policy(paramiko.WarningPolicy())
        client.connect(ip, username='root', pkey=key)
        stdin, stdout, stderr = client.exec_command('uptime')
        print 'uptime: ', stdout.read()
        return client

    def can_ping(self, ip):
        return commands.getstatusoutput('ping -c 1 %s' % ip)[0] == 0

    @property
    def admin(self):
        return nova_admin.connection_for('admin')

    def connection_for(self, username):
        return nova_admin.connection_for(username)

    def create_user(self, username):
        return nova_admin.create_user(username)

    def get_user(self, username):
        return nova_admin.get_user(username)

    def delete_user(self, username):
        return nova_admin.delete_user(username)

    def get_signed_zip(self, username):
        return nova_admin.get_zip(username)

    def create_key_pair(self, conn, key_name):
        try:
            os.remove('/tmp/%s.pem' % key_name)
        except:
            pass
        key = conn.create_key_pair(key_name)
        key.save('/tmp/')
        return key

    def delete_key_pair(self, conn, key_name):
        conn.delete_key_pair(key_name)
        try:
            os.remove('/tmp/%s.pem' % key_name)
        except:
            pass

    def bundle_image(self, image, kernel=False):
        cmd = 'euca-bundle-image -i %s' % image
        if kernel:
            cmd += ' --kernel true'
        status, output = commands.getstatusoutput(cmd)
        if status != 0:
            print '%s -> \n %s' % (cmd, output)
            raise Exception(output)
        return True

    def upload_image(self, bucket_name, image):
        cmd = 'euca-upload-bundle -b %s -m /tmp/%s.manifest.xml' % (bucket_name, image)
        status, output = commands.getstatusoutput(cmd)
        if status != 0:
            print '%s -> \n %s' % (cmd, output)
            raise Exception(output)
        return True

    def delete_bundle_bucket(self, bucket_name):
        cmd = 'euca-delete-bundle --clear -b %s' % (bucket_name)
        status, output = commands.getstatusoutput(cmd)
        if status != 0:
            print '%s -> \n%s' % (cmd, output)
            raise Exception(output)
        return True

    def register_image(self, bucket_name, manifest):
        conn = nova_admin.connection_for('admin')
        return conn.register_image("%s/%s.manifest.xml" % (bucket_name, manifest))

    def setUp_test_image(self, image, kernel=False):
        self.bundle_image(image, kernel=kernel)
        bucket = "auto_test_%s" % int(random.random() * 1000000)
        self.upload_image(bucket, image)
        return self.register_image(bucket, image)

    def tearDown_test_image(self, conn, image_id):
        conn.deregister_image(image_id)


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="a036c9c7-c7b1-4893-994d-169ef8c16209" name="Default" comment="" />
    <ignored path="bluemixpolls.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="bluemixpolls" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="index.jade" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/views/index.jade">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="486">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="item.html" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/public/partials/item.html">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="9.814815" vertical-offset="481" max-vertical-offset="1134">
              <caret line="12" column="16" selection-start-line="12" selection-start-column="16" selection-end-line="12" selection-end-column="16" />
              <folding>
                <element signature="n#style#0;n#table#0;n#td#1;n#tr#0;n#table#0;n#div#3;n#!!top" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="controllers.js" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/public/javascripts/controllers.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="26" max-vertical-offset="1674">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.js" pinned="false" current="true" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/routes/index.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.78698224" vertical-offset="1790" max-vertical-offset="2736">
              <caret line="129" column="77" selection-start-line="129" selection-start-column="76" selection-end-line="129" selection-end-column="77" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Poll.js" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/models/Poll.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="378">
              <caret line="8" column="17" selection-start-line="8" selection-start-column="17" selection-end-line="8" selection-end-column="17" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="services.js" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/public/javascripts/services.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="648">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="true" />
    </FindUsagesManager>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="changedFiles">
      <list>
        <option value="$PROJECT_DIR$/public/partials/item.html" />
        <option value="$PROJECT_DIR$/routes/index.js" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="65" />
    <option name="y" value="24" />
    <option name="width" value="1855" />
    <option name="height" value="1176" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="views" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="routes" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="public" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="public" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="partials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="public" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="javascripts" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="bluemixpolls" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="models" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="options.lastSelected" value="web-ide.project.structure" />
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="options.searchVisible" value="true" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="recentsLimit" value="5" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/app.js" />
    <property name="restartRequiresConfirmation" value="true" />
    <property name="FullScreen" value="false" />
  </component>
  <component name="RunManager" selected="Node.js.PollJS">
    <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="name" value="Dart" />
      <option name="saveOutputToFile" value="false" />
      <option name="showConsoleOnStdErr" value="false" />
      <option name="showConsoleOnStdOut" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="scope" value="ALL" />
      <option name="testName" />
      <method />
    </configuration>
    <configuration default="true" type="JSTestDriver:ConfigurationType" factoryName="JsTestDriver">
      <setting name="configLocationType" value="CONFIG_FILE" />
      <setting name="settingsFile" value="" />
      <setting name="serverType" value="INTERNAL" />
      <setting name="preferredDebugBrowser" value="Chrome" />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="CucumberJavaScriptRunConfigurationType" factoryName="Cucumber.js">
      <option name="cucumberJsArguments" />
      <option name="executablePath" />
      <option name="filePath" />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
      <method />
    </configuration>
    <configuration default="false" name="PollJS" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="/usr/local/bin/node" path-to-js-file="app.js" working-dir="$PROJECT_DIR$">
      <RunnerSettings RunnerId="NodeJS.debug" />
      <RunnerSettings RunnerId="NodeJS.run" />
      <ConfigurationWrapper RunnerId="NodeJS.debug" />
      <ConfigurationWrapper RunnerId="NodeJS.run" />
      <method />
    </configuration>
    <list size="1">
      <item index="0" class="java.lang.String" itemvalue="Node.js.PollJS" />
    </list>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="a036c9c7-c7b1-4893-994d-169ef8c16209" name="Default" comment="" />
      <created>1420790786078</created>
      <updated>1420790786078</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="65" y="24" width="1855" height="1176" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39981008" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32953465" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="myTodoPanelSettings">
      <TodoPanelSettings />
    </option>
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="7" />
    </breakpoint-manager>
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/views/index.jade">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="486">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/partials/item.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="49" max-vertical-offset="1134">
          <caret line="12" column="16" selection-start-line="12" selection-start-column="16" selection-end-line="12" selection-end-column="16" />
          <folding>
            <element signature="n#style#0;n#table#0;n#td#1;n#tr#0;n#table#0;n#div#3;n#!!top" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/javascripts/controllers.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="26" max-vertical-offset="1674">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/routes/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="1738" max-vertical-offset="2718">
          <caret line="99" column="26" selection-start-line="99" selection-start-column="26" selection-end-line="99" selection-end-column="26" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/javascripts/services.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="648">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/views/index.jade">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-0.0" vertical-offset="0" max-vertical-offset="486">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/javascripts/services.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="676">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/javascripts/controllers.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1674">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/models/Poll.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="378">
          <caret line="8" column="17" selection-start-line="8" selection-start-column="17" selection-end-line="8" selection-end-column="17" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/partials/item.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="9.814815" vertical-offset="481" max-vertical-offset="1134">
          <caret line="12" column="16" selection-start-line="12" selection-start-column="16" selection-end-line="12" selection-end-column="16" />
          <folding>
            <element signature="n#style#0;n#table#0;n#td#1;n#tr#0;n#table#0;n#div#3;n#!!top" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/routes/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.78698224" vertical-offset="1790" max-vertical-offset="2736">
          <caret line="129" column="77" selection-start-line="129" selection-start-column="76" selection-end-line="129" selection-end-column="77" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
#ifndef cascades_abstractdialog_h
#define cascades_abstractdialog_h
#include "gmock/gmock.h"
#include <bb/cascades/bbcascades_global.h>
#include <bb/cascades/core/uiobject.h>
namespace bb {
    namespace cascades {
    class AbstractDialogPrivate;
    class AbstractDialog : public UIObject {
public:
        virtual ~AbstractDialog();
        MOCK_METHOD0(open, void ());
        MOCK_METHOD0(close, void ());
        MOCK_CONST_METHOD0(isOpened, bool ());
        MOCK_METHOD1(openedChanged, void (bool opened));
        MOCK_METHOD0(opened, void ());
        MOCK_METHOD0(closed, void ());
        typedef AbstractDialog ThisClass;
        typedef UIObject BaseClass;
    public:
        template <typename BuilderType, typename BuiltType>
        class TBuilder : public BaseClass::TBuilder<BuilderType, BuiltType>
        {
        protected:
            TBuilder(BuiltType* node) : BaseClass::TBuilder<BuilderType, BuiltType>(node)
            {
            }
        public:
            BuilderType& open()
            {
                this->instance().open();
                return this->builder();
            }
            BuilderType& onOpened(const QObject* receiver, const char *method) {
                this->connect(SIGNAL(opened()), receiver, method);
                return this->builder();
            }
            BuilderType& onClosed(const QObject* receiver, const char *method) {
                this->connect(SIGNAL(closed()), receiver, method);
                return this->builder();
            }
        };
    };
}
}
#endif