text:
SystemTrayWidget::SystemTrayWidget(QObject *parent) :
		QObject(parent),
		m_action_refresh(QIcon::fromTheme("view-refresh"), tr("&Refresh"), parent),
		m_action_preferences(QIcon::fromTheme("document-properties"), tr("&Preferences"), parent),
		m_action_about(QIcon::fromTheme("help-about"), tr("&About"), parent),
		m_action_quit(QIcon::fromTheme("application-exit"), tr("&Quit"), parent) {

	// assembly widget's context menu
	m_tray_icon.setContextMenu(&m_context_menu);
	m_context_menu.addAction(&m_action_refresh);
	m_context_menu.addAction(&m_action_preferences);
	m_context_menu.addAction(&m_action_about);
	m_context_menu.addSeparator();
	m_context_menu.addAction(&m_action_quit);

	connect(&m_tray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
			this, SLOT(dispatchIconActivation(QSystemTrayIcon::ActivationReason)));

	connect(&m_action_refresh, SIGNAL(triggered()), SLOT(dispatchMenuAction()));
	connect(&m_action_preferences, SIGNAL(triggered()), SLOT(dispatchMenuAction()));
	connect(&m_action_about, SIGNAL(triggered()), SLOT(dispatchMenuAction()));
	connect(&m_action_quit, SIGNAL(triggered()), SLOT(dispatchMenuAction()));

	// initialize tray icon to the default value
	m_conditions.icon = WeatherConditions::WeatherIcon::Clear;
	updateIcon();

	m_tray_icon.setToolTip(tr("Windy - Minimalistic weather indicator"));
	m_tray_icon.show();

}

void SystemTrayWidget::setWeatherConditions(const WeatherConditions &conditions) {

	dumpWeatherConditions(conditions);

	// If the location name is not set, it will most likely mean, that the request
	// has failed - it might be a temporary network connection failure, or a 3rd
	// party service malfunction. In such a case do not update our widget.
	if (!conditions.locationName.isEmpty()) {

		// update our internal weather conditions structure
		m_conditions = conditions;

		updateIcon();
		updateToolTip();

	}

}

void SystemTrayWidget::updateIcon() {

	QStringList icons;
	QString fallback;

	switch (m_conditions.icon) {
	case WeatherConditions::WeatherIcon::Clear:
		fallback = ":/icons/weather-clear";
		icons << "weather-clear-symbolic";
		icons << "weather-clear";
		break;
	case WeatherConditions::WeatherIcon::ClearNight:
		fallback = ":/icons/weather-clear-night";
		icons << "weather-clear-night-symbolic";
		icons << "weather-night-clear";
		break;
	case WeatherConditions::WeatherIcon::FewClouds:
		fallback = ":/icons/weather-few-clouds";
		icons << "weather-few-clouds-symbolic";
		icons << "weather-few-clouds";
		break;
	case WeatherConditions::WeatherIcon::FewCloudsNight:
		fallback = ":/icons/weather-few-clouds-night";
		icons << "weather-few-clouds-night-symbolic";
		icons << "weather-few-clouds-night";
		break;
	case WeatherConditions::WeatherIcon::Overcast:
		fallback = ":/icons/weather-overcast";
		icons << "weather-overcast-symbolic";
		icons << "weather-overcast";
		break;
	case WeatherConditions::WeatherIcon::Showers:
		fallback = ":/icons/weather-showers";
		icons << "weather-showers-symbolic";
		icons << "weather-showers";
		break;
	case WeatherConditions::WeatherIcon::ShowersScattered:
		fallback = ":/icons/weather-showers";
		icons << "weather-showers-scattered-symbolic";
		icons << "weather-showers-scattered";
		break;
	case WeatherConditions::WeatherIcon::Fog:
		fallback = ":/icons/weather-fog";
		icons << "weather-fog-symbolic";
		icons << "weather-fog";
		break;
	case WeatherConditions::WeatherIcon::Snow:
		fallback = ":/icons/weather-snow";
		icons << "weather-snow-symbolic";
		icons << "weather-snow";
		break;
	case WeatherConditions::WeatherIcon::Storm:
		fallback = ":/icons/weather-storm";
		icons << "weather-storm-symbolic";
		icons << "weather-storm";
		break;
	case WeatherConditions::WeatherIcon::SevereAlert:
		fallback = ":/icons/weather-severe-alert";
		icons << "weather-severe-alert-symbolic";
		icons << "weather-severe-alert";
		break;
	}

// By default, only X11 supports themed icons, and we are not going to
// install our theme on the user's operating system. However, we will
// ship bundled resources for systems other than Linux.
#ifdef Q_OS_LINUX

	// iterate over icon candidates and set the first one which is available
	for (QStringList::ConstIterator it = icons.begin(); it != icons.end(); it++) {
		QIcon icon(QIcon::fromTheme(*it));
		if (!icon.isNull()) {
			m_tray_icon.setIcon(icon);
			return;
		}
	}

	qWarning() << "Weather status icon not found:" << icons;

#endif // Q_OS_LINUX

	// NOTE: If themed icon was not found and windy was build without bundled
	//       icon pack, we might end up with a "blank" tray icon. Such a case
	//       should be treated as a misconfiguration, not a bug.
	m_tray_icon.setIcon(QIcon(fallback));
}

void SystemTrayWidget::updateToolTip() {

	Settings *settings = Settings::settings();

	QString temperature(getLabelNotAvailable());
	QString pressure(getLabelNotAvailable());
	QString windSpeed(getLabelNotAvailable());
	QString windGustSpeed(getLabelNotAvailable());
	QString windDirection(getLabelNotAvailable());
	QString windChill(getLabelNotAvailable());
	QString humidity(getLabelNotAvailable());
	QString dewPoint(getLabelNotAvailable());
	QString visibility(getLabelNotAvailable());

	if (m_conditions.windDirection != -1)
		windDirection = getLabelWindDirection(m_conditions.windDirection);
	if (m_conditions.humidity != -1)
		humidity.setNum(m_conditions.humidity, 'f', 0);

	switch (settings->getUnitTemperature()) {
	case Settings::UnitTemperature::Celsius:
		if (m_conditions.temperature != -1)
			temperature.setNum(m_conditions.temperature - 273.15, 'f', 1);
		if (m_conditions.windChill != -1)
			windChill.setNum(m_conditions.windChill - 273.15, 'f', 1);
		if (m_conditions.dewPoint != -1)
			dewPoint.setNum(m_conditions.dewPoint - 273.15, 'f', 1);
		break;
	case Settings::UnitTemperature::Fahrenheit:
		if (m_conditions.temperature != -1)
			temperature.setNum((m_conditions.temperature - 273.15) * 1.8 + 32, 'f', 1);
		if (m_conditions.windChill != -1)
			windChill.setNum((m_conditions.windChill - 273.15) * 1.8 + 32, 'f', 1);
		if (m_conditions.dewPoint != -1)
			dewPoint.setNum((m_conditions.dewPoint - 273.15) * 1.8 + 32, 'f', 1);
		break;
	case Settings::UnitTemperature::Kelvin:
		if (m_conditions.temperature != -1)
			temperature.setNum(m_conditions.temperature, 'f', 1);
		if (m_conditions.windChill != -1)
			windChill.setNum(m_conditions.windChill, 'f', 1);
		if (m_conditions.dewPoint != -1)
			dewPoint.setNum(m_conditions.dewPoint, 'f', 1);
		break;
	}

	switch (settings->getUnitPressure()) {
	case Settings::UnitPressure::Hectopascal:
		if (m_conditions.pressure != -1)
			pressure.setNum(m_conditions.pressure / 100, 'f', 0);
		break;
	case Settings::UnitPressure::PoundPerSquareInch:
		if (m_conditions.pressure != -1)
			pressure.setNum(m_conditions.pressure / 6894.75729, 'f', 1);
		break;
	case Settings::UnitPressure::MillimeterOfMercury:
		if (m_conditions.pressure != -1)
			pressure.setNum(m_conditions.pressure / 133.3224, 'f', 0);
		break;
	}

	switch (settings->getUnitWindSpeed()) {
	case Settings::UnitWindSpeed::KilometerPerHour:
		if (m_conditions.windSpeed != -1)
			windSpeed.setNum(m_conditions.windSpeed * 3.6, 'f', 0);
		if (m_conditions.windGustSpeed != -1)
			windGustSpeed.setNum(m_conditions.windGustSpeed * 3.6, 'f', 0);
		if (m_conditions.visibility != -1)
			visibility.setNum(m_conditions.visibility / 1000, 'f', 1);
		break;
	case Settings::UnitWindSpeed::MilePerHour:
		if (m_conditions.windSpeed != -1)
			windSpeed.setNum(m_conditions.windSpeed / 0.44704, 'f', 0);
		if (m_conditions.windGustSpeed != -1)
			windGustSpeed.setNum(m_conditions.windGustSpeed / 0.44704, 'f', 0);
		if (m_conditions.visibility != -1)
			visibility.setNum(m_conditions.visibility / 1609.3472, 'f', 1);
		break;
	case Settings::UnitWindSpeed::MeterPerSecond:
		if (m_conditions.windSpeed != -1)
			windSpeed.setNum(m_conditions.windSpeed, 'f', 1);
		if (m_conditions.windGustSpeed != -1)
			windGustSpeed.setNum(m_conditions.windGustSpeed, 'f', 1);
		if (m_conditions.visibility != -1)
			visibility.setNum(m_conditions.visibility, 'f', 0);
		break;
	}

	// trim location name if it exceeds 30 characters (prevent wrapping)
	QString locationName(m_conditions.locationName);
	if (locationName.length() > 30) {

		// strip all non-alphanumerical characters from the trimmed end
		auto i = locationName.constBegin() + 28;
		for (; i != locationName.constBegin() - 1; i--)
			if ((*i).isLetterOrNumber())
				break;

		locationName = locationName.left(i - locationName.constBegin() + 1);
		if (locationName.isEmpty())
			// it has turned out that we've exterminated all characters from
			// the location name string, so restore the original text
			locationName = m_conditions.locationName;
		else
			locationName += "...";

	}

	QString messageTemplate(tr("{NAME}"));
	if (settings->getShowTemperature()) {
		if (settings->getShowWindChill())
			messageTemplate += tr("
Temperature: {TEMP} ({CHILL}) {T}");
		else
			messageTemplate += tr("
Temperature: {TEMP} {T}");
	}
	if (settings->getShowWindSpeed()) {
		if (settings->getShowWindGustSpeed())
			messageTemplate += tr("
Wind: {WIND} ({GUST}) {S}");
		else
			messageTemplate += tr("
Wind: {WIND} {S}");
		if (m_conditions.windDirection != -1)
			messageTemplate += tr(" {WDIR}");
	}
	if (settings->getShowVisibility())
		messageTemplate += tr("
Visibility: {VISIB} {D}");
	if (settings->getShowPressure())
		messageTemplate += tr("
Pressure: {PRES} {P}");

// Rich formated text support is available in the X11-like environments only.
// On other platforms, tooltips are displayed using native widgets which lack
// such a functionality.
#ifndef Q_OS_LINUX
	messageTemplate.replace("
", "\n");
	messageTemplate.remove(QRegExp("<[^>]*>"));
	messageTemplate = messageTemplate.trimmed();
#endif // Q_OS_LINUX

#ifdef Q_OS_LINUX
	if (settings->getShowTooltipIcon()) {
		QByteArray img;
		QBuffer buffer(&img);
		QString tableTemplate(tr("

{IMG}	{MSG}

"));

		m_tray_icon.icon().pixmap(32, 32).save(&buffer, "PNG");
		messageTemplate = tableTemplate
			.replace("{IMG}", QString("").arg(img.toBase64().data()))
			.replace("{MSG}", messageTemplate);
	}
#endif // Q_OS_LINUX

	m_tray_icon.setToolTip(messageTemplate
			.replace("{T}", getUnitTemperature())
			.replace("{P}", getUnitPressure())
			.replace("{D}", getUnitDistance())
			.replace("{S}", getUnitSpeed())
			.replace("{NAME}", locationName)
			.replace("{TEMP}", temperature)
			.replace("{PRES}", pressure)
			.replace("{WIND}", windSpeed)
			.replace("{GUST}", windGustSpeed)
			.replace("{WDIR}", windDirection)
			.replace("{CHILL}", windChill)
			.replace("{HUMID}", humidity)
			.replace("{DEWPT}", dewPoint)
			.replace("{VISIB}", visibility));

}

void SystemTrayWidget::dispatchIconActivation(QSystemTrayIcon::ActivationReason reason) {
	// NOTE: Icon activation dispatcher handles left and middle click only. Other
	//       actions are handled internally by this widget, so there is no reason
	//       for them to be exposed.
	if (reason == QSystemTrayIcon::Trigger || reason == QSystemTrayIcon::MiddleClick)
		emit iconActivated(reason);
}

void SystemTrayWidget::dispatchMenuAction() {

	QAction *action = qobject_cast<QAction *>(sender());

	if (action == &m_action_refresh)
		emit menuActionTriggered(MenuAction::Refresh);
	else if (action == &m_action_preferences)
		emit menuActionTriggered(MenuAction::Preferences);
	else if (action == &m_action_about)
		emit menuActionTriggered(MenuAction::About);
	else if (action == &m_action_quit)
		emit menuActionTriggered(MenuAction::Quit);

}

QString SystemTrayWidget::getLabelWindDirection(float direction) const {

	QStringList labels({
			tr("N"), tr("NW"), tr("W"), tr("SW"),
			tr("S"), tr("SE"), tr("E"), tr("NE"),
	});

	// NOTE: This algorithm will not work correctly for directions with negative
	//       value. Such a restriction is not a problem for us, though.
	return labels[(qRound(direction + 180.0 / labels.size()) * labels.size() / 360) % labels.size()];
}

QString SystemTrayWidget::getUnitDistance() const {

	QString unit;

	switch (Settings::settings()->getUnitWindSpeed()) {
	case Settings::UnitWindSpeed::KilometerPerHour:
		unit = trUtf8("km");
		break;
	case Settings::UnitWindSpeed::MilePerHour:
		unit = trUtf8("mi.");
		break;
	case Settings::UnitWindSpeed::MeterPerSecond:
		unit = trUtf8("m");
		break;
	}

	return unit;
}

QString SystemTrayWidget::getUnitPressure() const {

	QString unit;

	switch (Settings::settings()->getUnitPressure()) {
	case Settings::UnitPressure::Hectopascal:
		unit = trUtf8("hPa");
		break;
	case Settings::UnitPressure::PoundPerSquareInch:
		unit = trUtf8("psi");
		break;
	case Settings::UnitPressure::MillimeterOfMercury:
		unit = trUtf8("mmHg");
		break;
	}

	return unit;
}

QString SystemTrayWidget::getUnitSpeed() const {

	QString unit;

	switch (Settings::settings()->getUnitWindSpeed()) {
	case Settings::UnitWindSpeed::KilometerPerHour:
		unit = trUtf8("km/h");
		break;
	case Settings::UnitWindSpeed::MilePerHour:
		unit = trUtf8("MpH");
		break;
	case Settings::UnitWindSpeed::MeterPerSecond:
		unit = trUtf8("m/s");
		break;
	}

	return unit;
}

QString SystemTrayWidget::getUnitTemperature() const {

	QString unit;

	switch (Settings::settings()->getUnitTemperature()) {
	case Settings::UnitTemperature::Celsius:
		unit = trUtf8("°C");
		break;
	case Settings::UnitTemperature::Fahrenheit:
		unit = trUtf8("°F");
		break;
	case Settings::UnitTemperature::Kelvin:
		unit = trUtf8("K");
		break;
	}

	return unit;
}


text:
var UserModel = require('./user_dao'),
    ProjectModel = require('./project_dao'),
    TrackModel = require('./track_dao'),
    get = require('./mongodb_adapter').get,
    fork = require('./mongodb_adapter').fork,
    add = require('./mongodb_adapter').add,
    addTrackToProject = require('./mongodb_adapter').addTrackToProject,
    removeTrackFromProject = require('./mongodb_adapter').removeTrackFromProject,
    query = require('./mongodb_adapter').query;

// map path to db query, model, & criteria
module.exports = function (path, options, callback) {
  var err,
      a = path.split('/');

  switch (a[1]) {
    case 'projectList':
      callback(err, query, ProjectModel, {});
      return;

    case 'users':
      if (a.length === 2) {
        callback(err, query, UserModel, {});
        return;
      }
      else if (a.length === 3) {
        callback(err, get, UserModel, { 'id': a[2] });
        return;
      }
      else if (a.length === 4 && a[3] === 'projects') {
        callback(err, query, ProjectModel, { 'owner': a[2] });
        return;
      }
      break;

    case 'projects':
      if (a.length === 4) {
        callback(err, get, ProjectModel, { 'owner': a[2], 'id': a[3] });
        return;
      } else if (a.length === 5) {
        if (a[2] === 'addTrack') {
          callback(err, addTrackToProject, ProjectModel, { 'owner': a[3], 'id': a[4], 'track': options});
          return;
        }
      }
      break;

    case 'tracks':
      if (a.length === 3) {
        if (a[2] === 'add') {
          callback(err, add, TrackModel, options);
          return;
        } else {
          callback(err, get, TrackModel, { 'owner.login': a[2], 'name': a[3] });
          return;
        }
      }
      break;

    case 'fork':
      if (a.length === 2) {
        callback(err, fork, ProjectModel, options);
        return;
      }
      break;

    case 'removeTrackFromProject':
      if (a.length === 2) {
        callback(err, removeTrackFromProject, ProjectModel, options);
        return;
      }
      break;
  }
  err = new Error('Cannot map ' + path + ' to db query');
  err.status = 500;
  err.body = path;
  callback(err);
};

redpajama_set_name: RedPajamaGithub


text:
package test

import (
	"math"
	"math/rand"
)

func MustFloat64(value float64, err error) float64 {
	if err != nil {
		panic(err)
	}
	return value
}

func RandomFloat64() float64 {
	return RandomFloat64FromRange(RandomFloat64Minimum(), RandomFloat64Maximum())
}

func RandomFloat64FromArray(array []float64) float64 {
	if len(array) == 0 {
		panic("RandomFloat64FromArray: array is empty")
	}
	return array[rand.Intn(len(array))]
}

func RandomFloat64FromRange(minimum float64, maximum float64) float64 {
	if maximum < minimum {
		panic("RandomFloat64FromRange: maximum is not greater than or equal to minimum")
	}
	if minimum < RandomFloat64Minimum() {
		minimum = RandomFloat64Minimum()
	}
	if maximum > RandomFloat64Maximum() {
		maximum = RandomFloat64Maximum()
	}
	return minimum + (maximum-minimum+math.SmallestNonzeroFloat64)*rand.Float64()
}

func RandomFloat64Maximum() float64 {
	return math.MaxFloat32
}

func RandomFloat64Minimum() float64 {
	return -math.MaxFloat32
}

func NewObjectFromFloat64(value float64, objectFormat ObjectFormat) interface{} {
	return value
}


text:
import { Component, OnInit, Input } from '@angular/core';

import { UserService } from 'app/services';
import {CategoryService } from 'app/services/category.service';

@Component({
  selector: 'category-item',
  templateUrl: './category-item.component.html',
  styleUrls: ['./category-item.component.scss'],
  providers : [UserService]
})
export class CategoryItemComponent implements OnInit {

    @Input() item : Object;

    edit_enabled = false;

    constructor(private user : UserService,
    		   private category : CategoryService) { }

    ngOnInit() {
    }

    deleteCategory(id : Number) {
		this.category.delete(this.item["id"]).subscribe(
			data => {
				this.item["hidden"] = true;
			},
			error => {
				console.log(error);
			}
		);
    }

}


text:
#ifndef unwind_i_h
#define unwind_i_h

#include <stdint.h>

#include <libunwind-x86.h>

#include "libunwind_i.h"

/* DWARF column numbers: */
#define EAX     0
#define ECX     1
#define EDX     2
#define EBX     3
#define ESP     4
#define EBP     5
#define ESI     6
#define EDI     7
#define EIP     8
#define EFLAGS  9
#define TRAPNO  10
#define ST0     11

#define x86_lock                        UNW_OBJ(lock)
#define x86_local_resume                UNW_OBJ(local_resume)
#define x86_local_addr_space_init       UNW_OBJ(local_addr_space_init)
#define x86_scratch_loc                 UNW_OBJ(scratch_loc)
#define x86_get_scratch_loc             UNW_OBJ(get_scratch_loc)
#define x86_r_uc_addr                   UNW_OBJ(r_uc_addr)
#define x86_sigreturn                   UNW_OBJ(sigreturn)

extern void x86_local_addr_space_init (void);
extern int x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor,
                             void *arg);
extern dwarf_loc_t x86_scratch_loc (struct cursor *c, unw_regnum_t reg);
extern dwarf_loc_t x86_get_scratch_loc (struct cursor *c, unw_regnum_t reg);
extern void *x86_r_uc_addr (ucontext_t *uc, int reg);

extern void x86_sigreturn (unw_cursor_t *cursor);
#define x86_handle_signal_frame UNW_OBJ(handle_signal_frame)
extern int x86_handle_signal_frame(unw_cursor_t *cursor);

#endif /* unwind_i_h */


text:
BreezeStyleSheets
=================

Breeze and BreezeDark-like stylesheets for Qt Applications.

C++ Installation
================

Copy `breeze.qrc`, `dark.qss`, `light.qss` and the `dark` and `light` folders into your project directory and add the qrc file to your project file.

For example:

```qmake
TARGET = app
SOURCES = main.cpp
RESOURCES = breeze.qrc
```

To load the stylesheet in C++, load the file using QFile and read the data. For example, to load BreezeDark, run:

```cpp

#include <QApplication>
#include <QFile>
#include <QTextStream>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    // set stylesheet
    QFile file(":/dark.qss");
    file.open(QFile::ReadOnly | QFile::Text);
    QTextStream stream(&file);
    app.setStyleSheet(stream.readAll());

    // code goes here

    return app.exec();
}
```

PyQt5 Installation
==================

To compile the stylesheet for use with PyQt5, compile with the following command `pyrcc5 breeze.qrc -o breeze_resources.py`, and import the stylesheets. Afterwards, to load the stylesheet in Python, load the file using QFile and read the data. For example, to load BreezeDark, run:

```python

from PyQt5 import QtWidgets
from PyQt5.QtCore import QFile, QTextStream
import breeze_resources

def main():
    app = QtWidgets.QApplication(sys.argv)

    # set stylesheet
    file = QFile(":/dark.qss")
    file.open(QFile.ReadOnly | QFile.Text)
    stream = QTextStream(file)
    app.setStyleSheet(stream.readAll())

    # code goes here

    app.exec_()
}
```

License
=======

MIT, see [license](/LICENSE.md).

Example
=======

**Breeze/BreezeDark**

Example user interface using the Breeze and BreezeDark stylesheets side-by-side.

![BreezeDark](/assets/Breeze.gif)

Acknowledgements
================

BreezeStyleSheets is a fork of [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet).

Contact
=======

Email: ahuszagh@gmail.com
Twitter: KardOnIce


text:
<!DOCTYPE html>

<title>OffscreenCanvas test: 2d.fillRect.transform</title>

2d.fillRect.transform

fillRect is affected by transforms


text:
Screeps Autocomplete
====================
The purpose of this is to add screeps autocomplete to IDEs by creating a definition from the documents. People can then
add this project as a library in their IDE, and their IDE should be able to start autocompleting their code. Tested
somewhat in JetBrain's WebStorm

## How to Install

#### Webstorm (Or Other Jetbrains IDE's)
This can be done by quite simply copying the `ScreepsAutocomplete` folder in their project, and Webstorm should automatically
detect it and add it to the autocompletion
###### Adding it as a library
Instead of copying the `ScreepsAutocomplete` folder to each and every project folder, you can add it as a global library.

* Create a new project in Webstorm if you don't already have one and open it.
* In the menu bar at the top of the screen, navigate to `File` -> `Settings` -> `Languages & Frameworks` -> `JavaScript` -> `Libraries`
* Click `Add`.
* Name the Library whatever you want.
* Set `Framework type` to custom, if it is not already so. `Version` can be left blank.
* Change `Visibility` to `Global`.
* Click the green plus sign to the right of the listbox below `Visibility`, then choose "Attach Directories...".
* Navigate to the ScreepsAutocomplete folder, select the folder itself and click `OK`.
* Click `OK` at the bottom of the "Edit Library" dialog.
* Click the `Enabled` checkbox on the library you just created, make sure it's checked before continuing.
* Click `OK` at the bottom of the "Settings" dialog.

Webstorm should automatically detect the library and add it to the autocompletion.

#### Visual Studio
Copy the `ScreepsAutcompete` folder in to your project, then create a file called `_references.js`. Right click your newly
created and empty file, and then select `Update JavaScript References`. The file should now be populated autocomplete should
be available.

#### Sublime Text
There are two ways to enable Autocomplete in Sublime Text, both of them require installing a plugin through
[`Package Control`](https://packagecontrol.io/installation), and copying `ScreepsAutocomplete` in to your project.

 * `TernJS` - Install `TernJS` through `Package Control`, restart Sublime Text and try `var room = new Room(); room.lookAt(x, y)`
 to see if Autocomplete is working. If not, try the next options

 * `SublimeCodeIntel` - Install `SublimeCodeIntel` through `Package Control`. Go to `Preferences > Package Settings > SublimeCodeIntel > Settings -- User`
 and copy the contents of `ScreepsAutocomplete/config/SublimeCodeIntel.json` in to the file that opens. Save and restart Sublime
 Text. After waiting for CodeIntel to process JavaScript, Autocomplete should be working

#### Atom
Integration with Atom is done through use of the [`atom-ternjs`](https://github.com/tststs/atom-ternjs) package. Here's the steps

 * Copy `ScreepsAutocomplete` in to your project folder
 * Install the `atom-ternjs` package
 * Put the following in your `.tern-project` file
```json
{
  "ecmaVersion": 6,
  "libs": [],
  "loadEagerly": [
    "ScreepsAutocomplete/**/*.js"
  ]
}
```
 * Restart and Enjoy


text:
#import <Foundation/Foundation.h>

/*!
 @brief An error domain for 3D Secure errors

 @see BTThreeDSecure
*/
extern NSString * const BTThreeDSecureErrorDomain;
extern NSString * const BTThreeDSecureInfoKey;
extern NSString * const BTThreeDSecureValidationErrorsKey;

/*!
 @brief Error codes that describe errors that occur during 3D Secure
*/
typedef NS_ENUM(NSInteger, BTThreeDSecureErrorType){

    BTThreeDSecureErrorTypeUnknown = 0,

    /// 3D Secure failed during the backend card lookup phase; please retry
    BTThreeDSecureErrorTypeFailedLookup,

    /// 3D Secure failed during the user-facing authentication phase; please retry
    BTThreeDSecureErrorTypeFailedAuthentication,

    /// Braintree SDK is integrated incorrectly
    BTThreeDSecureErrorTypeIntegration,
};


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Boost.Locale: Running Examples under Microsoft Windows</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Boost.Locale

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Examples

Running Examples under Microsoft Windows

All of the examples that come with Boost.Locale are designed for UTF-8 and it is the default encoding used by Boost.Locale.

However, the default narrow encoding under Microsoft Windows is not UTF-8 and the output of the applications would not be displayed correctly in the console.

So in order to use UTF-8 encoding under the Windows console and see the output correctly, do the following:

Open a cmd window

Change the default font to a TrueType font: go to properties->font (right click on title-bar->properties->font) and change the font to a TrueType font like Lucida Console

Change the default codepage to 65001 (UTF-8) by running chcp 65001

Now all of the examples should display UTF-8 characters correctly (if the font supports them).

Note for Visual Studio users: Microsoft Visual Studio assumes that all source files are encoded using an "ANSI" codepage like 1252. However all examples use UTF-8 encoding by default, so wide character examples would not work under MSVC as-is. In order to force it to treat source files as UTF-8 you need to convert the files to UTF-8 with BOM, which can be done easily by re-saving them from Notepad, which adds a BOM to UTF-8 files by default.

© Copyright 2009-2012 Artyom Beilis,  Distributed under the Boost Software License, Version 1.0.


text:
package org.glowroot.microbenchmarks.support;

import org.glowroot.agent.plugin.api.Agent;
import org.glowroot.agent.plugin.api.MessageSupplier;
import org.glowroot.agent.plugin.api.ThreadContext;
import org.glowroot.agent.plugin.api.TimerName;
import org.glowroot.agent.plugin.api.TraceEntry;
import org.glowroot.agent.plugin.api.weaving.BindThrowable;
import org.glowroot.agent.plugin.api.weaving.BindTraveler;
import org.glowroot.agent.plugin.api.weaving.OnAfter;
import org.glowroot.agent.plugin.api.weaving.OnBefore;
import org.glowroot.agent.plugin.api.weaving.OnThrow;
import org.glowroot.agent.plugin.api.weaving.Pointcut;

public class TraceEntryWorthyAspect {

    @Pointcut(className = "org.glowroot.microbenchmarks.core.support.TraceEntryWorthy",
            methodName = "doSomethingTraceEntryWorthy", methodParameterTypes = {},
            timerName = "trace entry worthy")
    public static class TraceEntryWorthyAdvice {

        private static final TimerName timerName = Agent.getTimerName(TraceEntryWorthyAdvice.class);

        @OnBefore
        public static TraceEntry onBefore(ThreadContext context) {
            return context.startTraceEntry(MessageSupplier.create("trace entry worthy"), timerName);
        }

        @OnThrow
        public static void onThrow(@BindThrowable Throwable t,
                @BindTraveler TraceEntry traceEntry) {
            traceEntry.endWithError(t);
        }

        @OnAfter
        public static void onReturn(@BindTraveler TraceEntry traceEntry) {
            traceEntry.end();
        }
    }
}


text:
package com.phloc.commons.microdom.utils;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import javax.annotation.Nonnull;

import org.junit.Test;

import com.phloc.commons.hierarchy.DefaultHierarchyWalkerCallback;
import com.phloc.commons.io.resource.ClassPathResource;
import com.phloc.commons.microdom.IMicroDocument;
import com.phloc.commons.microdom.IMicroNode;
import com.phloc.commons.microdom.serialize.MicroReader;
import com.phloc.commons.mutable.MutableInt;

/**
 * Test class for class {@link MicroWalker}.
 *
 * @author Philip Helger
 */
public final class MicroWalkerTest
{
  @Test
  public void testWalkNode ()
  {
    // Read file with processing instruction
    final IMicroDocument doc = MicroReader.readMicroXML (new ClassPathResource ("xml/xml-processing-instruction.xml"));
    assertNotNull (doc);

    // Count processing instruction
    final MutableInt aInt = new MutableInt (0);
    MicroWalker.walkNode (doc, new DefaultHierarchyWalkerCallback <IMicroNode> ()
    {
      @Override
      public void onItemBeforeChildren (final IMicroNode aItem)
      {
        if (aItem.isProcessingInstruction ())
          aInt.inc ();
      }
    });
    assertEquals (3, aInt.intValue ());

    // Start from the root document -> only 1 left
    aInt.set (0);
    MicroWalker.walkNode (doc.getDocumentElement (), new DefaultHierarchyWalkerCallback <IMicroNode> ()
    {
      @Override
      public void onItemBeforeChildren (@Nonnull final IMicroNode aItem)
      {
        if (aItem.isProcessingInstruction ())
          aInt.inc ();
      }
    });
    assertEquals (1, aInt.intValue ());

    try
    {
      MicroWalker.walkNode (null, new DefaultHierarchyWalkerCallback <IMicroNode> ());
      fail ();
    }
    catch (final NullPointerException ex)
    {}
    try
    {
      MicroWalker.walkNode (doc, null);
      fail ();
    }
    catch (final NullPointerException ex)
    {}
  }
}


text:
All Notable changes to `darktec\http` will be documented in this file

### Added
- Nothing

### Deprecated
- Nothing

### Fixed
- Nothing

### Removed
- ANothing

### Security
- Nothing


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>graphhopper-nav</artifactId>
    <version>7.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>GraphHopper Navigation</name>

    <parent>
        <groupId>com.graphhopper</groupId>
        <artifactId>graphhopper-parent</artifactId>
        <version>7.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>com.graphhopper</groupId>
            <artifactId>graphhopper-web-api</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.graphhopper</groupId>
            <artifactId>graphhopper-core</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-core</artifactId>
        </dependency>
    </dependencies>

</project>


text:
<?php
/**
 * Created by PhpStorm.
 * User: Mztli
 * Date: 2016/10/31
 * Time: 15:50
 */

namespace Service\Struct;

interface IStruct
{
    public function GetParams();
}


text:
package com.flipkart.poseidon.serviceclients.generator;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.flipkart.poseidon.handlers.http.multipart.FileFormField;
import com.flipkart.poseidon.model.annotations.Description;
import com.flipkart.poseidon.model.annotations.Name;
import com.flipkart.poseidon.model.annotations.Version;
import com.flipkart.poseidon.serviceclients.AbstractServiceClient;
import com.flipkart.poseidon.handlers.http.multipart.FormField;
import com.flipkart.poseidon.serviceclients.FutureTaskResultToDomainObjectPromiseWrapper;
import com.flipkart.poseidon.serviceclients.ServiceExecutePropertiesBuilder;
import com.flipkart.poseidon.serviceclients.idl.pojo.EndPoint;
import com.flipkart.poseidon.serviceclients.idl.pojo.Parameter;
import com.flipkart.poseidon.serviceclients.idl.pojo.ServiceIDL;
import com.google.common.base.Joiner;
import com.sun.codemodel.*;
import flipkart.lego.api.entities.ServiceClient;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;

import javax.validation.constraints.NotNull;
import java.beans.Introspector;
import java.io.File;
import java.io.PrintStream;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static com.flipkart.poseidon.helper.CallableNameHelper.canonicalName;

/**
 * Created by mohan.pandian on 20/02/15.
 *
 * Uses sun's codemodel to generate service clients java interfaces and default implementations.
 * This is where the core business logic of service client generator lies
 */
public class ServiceGenerator {
    private static final ServiceGenerator SERVICE_GENERATOR = new ServiceGenerator();
    private static final Pattern PARAMETERS_PATTERN = Pattern.compile("\\{parameters\\.(.*?)\\}");
    private static final String REQUEST_OBJECT_VAR_NAME = "requestObject";
    private static final String REQUEST_OBJECT_LOOP_VAR_NAME = "requestObject1";
    private static final String META_INFO_PARAMETER_NAME = "_metaInfo";
    private static final String META_INFO_COMMAND_NAME_VAR_NAME = "_metaInfoCommandName";

    private ServiceGenerator() {}

    public static ServiceGenerator getInstance() {
        return SERVICE_GENERATOR;
    }

    private String getInterfaceName(ServiceIDL serviceIdl) {
        return serviceIdl.getService().getName() + "Client";
    }

    private String getFullInterfaceName(ServiceIDL serviceIdl) {
        return serviceIdl.getService().getPackageName() + "." + getInterfaceName(serviceIdl);
    }

    private String getImplName(ServiceIDL serviceIdl) {
        return serviceIdl.getService().getName() + "ClientImpl";
    }

    private String getFullImplName(ServiceIDL serviceIdl) {
        return serviceIdl.getService().getPackageName() + "." + getImplName(serviceIdl);
    }

    private JType getJType(JCodeModel jCodeModel, String name) {
        if (name == null || name.length() == 0) {
            name = "void";
        }
        try {
            return jCodeModel.parseType(name);
        } catch(ClassNotFoundException e) {
            return jCodeModel.directClass(name);
        }
    }

    private Map<String, String> getAllHeaders(ServiceIDL serviceIdl, EndPoint endPoint) {
        Map<String, String> headersMap = new HashMap<>();
        if (serviceIdl.getService().getHeaders() != null)
            headersMap.putAll(serviceIdl.getService().getHeaders());
        if (endPoint.getHeaders() != null)
            headersMap.putAll(endPoint.getHeaders());
        return headersMap;
    }

    private void generateMethodParam(ServiceIDL serviceIdl, JCodeModel jCodeModel, JMethod method, JDocComment methodComment, String paramName) {
        Parameter parameter = serviceIdl.getParameters().get(paramName);
        JType jType = getJType(jCodeModel, parameter.getType());
        if (!parameter.getOptional()) {
            method.param(jType.boxify(), paramName).annotate(NotNull.class);
        } else {
            method.param(jType.boxify(), paramName);
        }
        if(Parameter.Type.FILE.equals(parameter.getFormFieldType())) {
            //Additional parameter of file name also will be needed to be processed by http MultipartEntity
            JVar var = method.param(jCodeModel.ref("String"), paramName + "FileName");
            if(!parameter.getOptional()) {
                var.annotate(NotNull.class);
            }
        }
        JCommentPart paramComment = methodComment.addParam(paramName);
        if (parameter.getDescription() != null) {
            for (String description : parameter.getDescription()) {
                paramComment.append(description);
            }
        }
    }

    public void generateMetaInfo(ServiceIDL serviceIdl) throws Exception{
        for (Map.Entry<String, EndPoint> entry : serviceIdl.getEndPoints().entrySet()) {
            if (entry.getValue().isIncludeMetaInfo()) {
                addMetaInfoAsParameter(serviceIdl);
                break;
            }
        }
    }

    private void addMetaInfoAsParameter(ServiceIDL serviceIDL) throws Exception{
        for (String parameterName : serviceIDL.getParameters().keySet()) {
            if (META_INFO_PARAMETER_NAME.equals(parameterName)) {
                throw new Exception("_metaInfo as parameter name is restricted for internal usage of poseidon.");
            }
        }

        Parameter metaInfoParameter = new Parameter();
        metaInfoParameter.setType("java.util.Map<String,Object>");
        metaInfoParameter.setDescription(new String[] { "Map which has all meta info for a method overrides" });

        serviceIDL.getParameters().put(META_INFO_PARAMETER_NAME, metaInfoParameter);
    }

    private void addClassComments(ServiceIDL serviceIdl, JDefinedClass jDefinedClass) {
        JDocComment docComment = jDefinedClass.javadoc();
        docComment.addAll(Arrays.asList(serviceIdl.getService().getDescription()));
    }

    private void addAnnotations(JCodeModel jCodeModel, JDefinedClass jDefinedClass) {
        JAnnotationUse annotationUse = jDefinedClass.annotate(jCodeModel.ref("javax.annotation.Generated"));
        annotationUse.param("value", getClass().getName());
        annotationUse.param("date", new Date().toString());
        annotationUse.param("comments", "EDIT THIS IF YOU ARE ****");
    }

    private void addNameAnnotations(JDefinedClass jDefinedClass, String name) {
        JAnnotationUse nameAnnotation = jDefinedClass.annotate(Name.class);
        nameAnnotation.param("value", name);
    }

    private void addDescriptionAnnotations(JDefinedClass jDefinedClass, String shortDescription, String verboseDescription) {
        JAnnotationUse descriptionAnnotation = jDefinedClass.annotate(Description.class);
        descriptionAnnotation.param("value", shortDescription);
        descriptionAnnotation.param("verbose", verboseDescription);
    }

    private void addVersionAnnotations(JDefinedClass jDefinedClass, int major, int minor, int patch) {
        JAnnotationUse versionAnnotation = jDefinedClass.annotate(Version.class);
        versionAnnotation.param("major", major);
        versionAnnotation.param("minor", minor);
        versionAnnotation.param("patch", patch);
    }

    private void addExtends(JCodeModel jCodeModel, JDefinedClass jDefinedClass) {
        jDefinedClass._extends(jCodeModel.ref(ServiceClient.class));
    }

    private void addInterfaceFields(ServiceIDL serviceIdl, JCodeModel jCodeModel, JDefinedClass jDefinedClass) {
        if (serviceIdl.getService().getObjectMapperClass() != null) {
            int fieldModifier = JMod.PUBLIC | JMod.FINAL;
            JClass objectMapper = jCodeModel.ref(serviceIdl.getService().getObjectMapperClass());
            jDefinedClass.field(fieldModifier, objectMapper, "customObjectMapper", JExpr._new(objectMapper));
        }
    }

    private void addExtendsImplements(ServiceIDL serviceIdl, JCodeModel jCodeModel, JDefinedClass jDefinedClass) {
        jDefinedClass._extends(jCodeModel.ref(AbstractServiceClient.class));
        jDefinedClass._implements(jCodeModel.ref(getInterfaceName(serviceIdl)));
    }

    private void addConstructor(ServiceIDL serviceIdl, JDefinedClass jDefinedClass) {
        JFieldRef arg2;
        JMethod constructor = jDefinedClass.constructor(JMod.PRIVATE);
        JBlock block = constructor.body();
        if (serviceIdl.getExceptions() != null && serviceIdl.getExceptions().size() > 0 ) {
            for (Integer serviceResponseCode : serviceIdl.getExceptions().keySet()) {
                arg2 = JExpr.ref(JExpr.ref(serviceIdl.getExceptions().get(serviceResponseCode) + "Exception"), "class");
                block.invoke(JExpr.ref("exceptions"), "put").arg(serviceResponseCode.toString()).arg(arg2);
            }
        }
        // add default exception
        arg2 = JExpr.ref(JExpr.ref(serviceIdl.getService().getName() + "Exception"), "class");
        block.invoke(JExpr.ref("exceptions"), "put").arg("default").arg(arg2);
    }

    private void addMethods(ServiceIDL serviceIdl, JCodeModel jCodeModel, JDefinedClass jDefinedClass, boolean isImpl) {
        for(Map.Entry<String, EndPoint> entry: serviceIdl.getEndPoints().entrySet()) {
            String methodName = entry.getKey();
            EndPoint endPoint = entry.getValue();

            JType methodReturnType = getJType(jCodeModel, endPoint.getResponseObject());
            JType methodFullReturnType = jCodeModel.ref(FutureTaskResultToDomainObjectPromiseWrapper.class).narrow(methodReturnType);
            JMethod method = jDefinedClass.method(JMod.PUBLIC, methodFullReturnType, methodName);
            if (isImpl)
                method.annotate(jCodeModel.ref("Override"));
            JDocComment methodComment = method.javadoc();
            methodComment.addAll(Arrays.asList(endPoint.getDescription()));

            String[] parameters = endPoint.getParameters();
            if (parameters == null)
                parameters = new String[]{};
            for (String paramName : parameters) {
                generateMethodParam(serviceIdl, jCodeModel, method, methodComment, paramName);
            }

            if (endPoint.isIncludeMetaInfo()) {
                generateMethodParam(serviceIdl, jCodeModel, method, methodComment, META_INFO_PARAMETER_NAME);
            }

            Map<String, String> headersMap = getAllHeaders(serviceIdl, endPoint);
            for (Map.Entry<String, String> headerMapEntry: headersMap.entrySet()) {
                String value = headerMapEntry.getValue();
                Matcher matcher = PARAMETERS_PATTERN.matcher(value);
                if (matcher.find()) {
                    String paramName = matcher.group(1);
                    generateMethodParam(serviceIdl, jCodeModel, method, methodComment, paramName);
                }
            }
            if (endPoint.getRequestObject() != null) {
                method.param(getJType(jCodeModel, endPoint.getRequestObject()), REQUEST_OBJECT_VAR_NAME);
                methodComment.addParam(REQUEST_OBJECT_VAR_NAME);
            }
            if (endPoint.getResponseObject() != null && !endPoint.getResponseObject().isEmpty()) {
                JCommentPart returnComment = methodComment.addReturn();
                returnComment.append(methodFullReturnType);
            }
            method._throws(jCodeModel.directClass("Exception"));
            if (isImpl) {
                addMethodBody(serviceIdl, jCodeModel, endPoint, method.body());
            }
        }
    }

    private void addMethodBody(ServiceIDL serviceIdl, JCodeModel jCodeModel, EndPoint endPoint, JBlock block) {

        if (endPoint.getRequestSplitterClass() != null) {
            JClass requestSplitter = jCodeModel.ref(endPoint.getRequestSplitterClass());
            block.decl(requestSplitter, "requestSplitter", JExpr._new(requestSplitter));

            JClass responseMerger = jCodeModel.ref(endPoint.getResponseMergerClass());
            block.decl(responseMerger, "responseMerger", JExpr._new(responseMerger));

            JClass wrapper = jCodeModel.ref(FutureTaskResultToDomainObjectPromiseWrapper.class);
            block.decl(wrapper, "wrapper", JExpr._new(wrapper).arg(JExpr.ref("responseMerger")));
            if (endPoint.getRequestParamWithLimit() != null) {
                Matcher matcher = PARAMETERS_PATTERN.matcher(endPoint.getRequestParamWithLimit());
                if (matcher.matches()) {
                    Parameter parameter = serviceIdl.getParameters().get(matcher.group(1));
                    JClass listClass = jCodeModel.ref(parameter.getType());
                    String listClassVar = matcher.group(1) + "List";
                    String listElement = listClassVar + "Element";
                    block.decl(jCodeModel.ref(List.class).narrow(listClass), listClassVar, JExpr.ref("requestSplitter").invoke("split").arg(JExpr.ref(matcher.group(1))));
                    JForEach forEach = new JForEach(listClass, listElement, JExpr.ref(listClassVar));
                    JInvocation invocation = createRequest(serviceIdl, jCodeModel, endPoint, forEach.body(),matcher.group(1), listElement);
                    forEach.body().add(JExpr.ref("wrapper").invoke("addFutureForTask").arg(invocation.invoke("getFutureList")));
                    block.add(forEach);
                    block._return(JExpr.ref("wrapper"));
                    return;
                }
            } else if (endPoint.getRequestSplitterClass() != null) {
                JInvocation invocation = createRequest(serviceIdl, jCodeModel, endPoint, block, null, null);
                JType returnType = jCodeModel.ref(List.class).narrow(getJType(jCodeModel, endPoint.getRequestObject()));
                block.decl(returnType, "requestObjects", JExpr.ref("requestSplitter").invoke("split").arg(JExpr.ref(REQUEST_OBJECT_VAR_NAME)));
                JForEach forEach = new JForEach(getJType(jCodeModel, endPoint.getRequestObject()), REQUEST_OBJECT_LOOP_VAR_NAME, JExpr.ref("requestObjects"));
                forEach.body().add(JExpr.ref("wrapper").invoke("addFutureForTask").arg(invocation.invoke("getFutureList")));
                block.add(forEach);
                block._return(JExpr.ref("wrapper"));
                return;
            }
        }
        JInvocation invocation = createRequest(serviceIdl, jCodeModel, endPoint, block, null, null);
        block._return(invocation);
    }

    private JInvocation createRequest(ServiceIDL serviceIdl, JCodeModel jCodeModel, EndPoint endPoint, JBlock block,String requestParamWithLimit, String listElementVarName) {
        String baseUri = serviceIdl.getService().getBaseUri();
        String endPointUri = endPoint.getUri();
        String uri = (baseUri + endPointUri).replaceAll("//", "/");
        Set<String> argsList = new LinkedHashSet<>();
        Set<String> argsListQueryParams = new LinkedHashSet<>();
        Set<String> formFields = new LinkedHashSet<>();

        Matcher matcher = PARAMETERS_PATTERN.matcher(uri);
        while (matcher.find()) {
            uri = matcher.replaceFirst("%s");
            argsList.add(matcher.group(1));
            matcher.reset(uri);
        }
        if (argsList.isEmpty()) {
            block.decl(jCodeModel.ref("String"), "uri", JExpr.lit(uri));
        } else {
            JInvocation invocation = JExpr.ref("String").invoke("format").arg(uri);
            for (String arg : argsList) {
                Parameter parameter = serviceIdl.getParameters().get(arg);
                if (endPoint.getRequestParamWithLimit() != null && requestParamWithLimit.equals(arg)) {
                    arg = listElementVarName;
                }
                if (parameter.getType().equals("String")) {
                    invocation.arg(JExpr.invoke("encodeUrl").arg(JExpr.ref(arg)));
                } else if (parameter.getType().endsWith("[]")) {
                    JExpression joinerExpression = jCodeModel.ref(Joiner.class).staticInvoke("on").arg(JExpr.lit(',')).invoke("join").arg(JExpr.ref(arg));
                    invocation.arg(JExpr.invoke("encodeUrl").arg(joinerExpression));
                } else if (parameter.getType().startsWith("java.util.List")) {
                    invocation.arg(jCodeModel.ref(StringUtils.class).staticInvoke("join").arg(JExpr.ref(arg)).arg(","));
                } else {
                    invocation.arg(JExpr.ref(arg));
                }
            }
            block.decl(jCodeModel.ref("String"), "uri", invocation);
        }

        if (endPoint.getParameters() != null) {
            for (String paramName : endPoint.getParameters()) {
                Parameter parameter = serviceIdl.getParameters().get(paramName);
                if (!parameter.getOptional()) {
                    if (parameter.getType().equalsIgnoreCase("string")) {
                        block.add(jCodeModel.ref(Validate.class).staticInvoke("notEmpty").arg(JExpr.ref(paramName)).arg(paramName + " can not be null/empty"));
                    } else if (parameter.getType().endsWith("[]")) {
                        JInvocation isNotEmpty = jCodeModel.ref(ArrayUtils.class).staticInvoke("isNotEmpty").arg(JExpr.ref(paramName));
                        block.add(jCodeModel.ref(Validate.class).staticInvoke("isTrue").arg(isNotEmpty).arg(paramName + " can not be null/empty"));
                    } else {
                        block.add(jCodeModel.ref(Validate.class).staticInvoke("notNull").arg(JExpr.ref(paramName)).arg(paramName + " can not be null"));
                    }
                }

                if (argsList.contains(paramName))
                    continue;
                if(parameter.getFormFieldType() != null) {
                    formFields.add(paramName);
                } else {
                    argsListQueryParams.add(paramName);
                }
            }
        }

        if (endPoint.isIncludeMetaInfo() && endPoint.getMetaInfo() != null) {
            if (endPoint.getMetaInfo().isDynamicCommandName()) {
                JInvocation invocation = jCodeModel.ref("String").staticInvoke("valueOf").arg(JExpr.ref(META_INFO_PARAMETER_NAME).invoke("get").arg("commandName"));
                block.decl(jCodeModel.ref("String"), META_INFO_COMMAND_NAME_VAR_NAME, invocation);
                block.add(jCodeModel.ref(Validate.class).staticInvoke("notNull").arg(JExpr.ref(META_INFO_COMMAND_NAME_VAR_NAME)).arg(META_INFO_COMMAND_NAME_VAR_NAME + " can not be null"));
            }
        }

        if (!formFields.isEmpty()) {
            JInvocation invocation = jCodeModel.ref(Arrays.class).staticInvoke("asList");
            for (String paramName : formFields) {
                Parameter parameter = serviceIdl.getParameters().get(paramName);
                JExpression contentType = jCodeModel.ref(ContentType.class).staticInvoke("parse").arg(parameter.getFormFieldContentType());
                if(parameter.getFormFieldType().equals(Parameter.Type.TEXT)) {
                    JClass formFieldClass = jCodeModel.ref(FormField.class);
                    invocation.arg(JExpr._new(formFieldClass).arg(paramName).arg(contentType).arg(JExpr.ref(paramName)));
                } else if(parameter.getFormFieldType().equals(Parameter.Type.FILE)) {
                    JClass fileFormFieldClass = jCodeModel.ref(FileFormField.class);
                    invocation.arg(JExpr._new(fileFormFieldClass).arg(paramName).arg(contentType).arg(JExpr.ref(paramName)).arg(JExpr.ref(paramName + "FileName")));
                }
            }
            JClass formFieldListClass = jCodeModel.ref(List.class).narrow(FormField.class);
            block.decl(formFieldListClass, "formFields", invocation);
        }

        if (!argsListQueryParams.isEmpty()) {
            JInvocation invocation = jCodeModel.ref(Arrays.class).staticInvoke("asList");
            for (String arg : argsListQueryParams) {
                Parameter parameter = serviceIdl.getParameters().get(arg);
                String argRef = arg;
                if (endPoint.getRequestParamWithLimit() != null && requestParamWithLimit.equals(arg)) {
                    argRef = listElementVarName;
                }
                String paramName = Optional.ofNullable(parameter.getName()).orElse(arg);
                if (!parameter.getOptional()) {
                    if (parameter.isMultiValue()) {
                        invocation.arg(JExpr.invoke("getMultiValueParamURI").arg(paramName).arg(JExpr.ref(argRef)));
                    } else if (parameter.getType().equals("String")) {
                        invocation.arg(JExpr.lit(paramName + "=").plus(JExpr.invoke("encodeUrl").arg(JExpr.ref(argRef))));
                    } else if (parameter.getType().endsWith("[]")) {
                        JExpression joinerExpression = jCodeModel.ref(Joiner.class).staticInvoke("on").arg(JExpr.lit(',')).invoke("join").arg(JExpr.ref(argRef));
                        invocation.arg(JExpr.lit(paramName + "=").plus(JExpr.invoke("encodeUrl").arg(joinerExpression)));
                    } else if (parameter.getType().startsWith("java.util.List")) {
                        JExpression joinerExpression = jCodeModel.ref(StringUtils.class).staticInvoke("join").arg(JExpr.ref(argRef)).arg(",");
                        invocation.arg(JExpr.lit(paramName + "=").plus(JExpr.invoke("encodeUrl").arg(joinerExpression)));
                    } else {
                        invocation.arg(JExpr.lit(paramName + "=" ).plus(JExpr.ref(argRef)));
                    }
                } else {
                    if (parameter.isMultiValue()) {
                        invocation.arg(JExpr.invoke("getMultiValueParamURI").arg(paramName).arg(JExpr.ref(argRef)));
                    } else {
                        invocation.arg(JExpr.invoke("getOptURI").arg(paramName).arg(JExpr.ref(argRef)));
                    }
                }
            }
            block.assign(JExpr.ref("uri"), JExpr.ref("uri").plus(JExpr.invoke("getQueryURI").arg(invocation)));
        }

        Map<String, String> headersMap = getAllHeaders(serviceIdl, endPoint);
        if (headersMap.size() > 0) {
            JClass mapClass = jCodeModel.ref(Map.class).narrow(jCodeModel.ref("String"), jCodeModel.ref("String"));
            JClass hashMapClass = jCodeModel.ref(HashMap.class).narrow(jCodeModel.ref("String"), jCodeModel.ref("String"));
            block.decl(mapClass, "headersMap", JExpr._new(hashMapClass));
            for (Map.Entry<String, String> headerMapEntry : headersMap.entrySet()) {
                String key = headerMapEntry.getKey();
                String value = headerMapEntry.getValue();
                JInvocation invocation = JExpr.invoke(JExpr.ref("headersMap"), "put").arg(key);
                matcher = PARAMETERS_PATTERN.matcher(value);
                if (matcher.find()) {
                    String paramName = matcher.group(1);
                    invocation.arg(jCodeModel.ref("String").staticInvoke("valueOf").arg(JExpr.ref(paramName)));
                    Parameter parameter = serviceIdl.getParameters().get(paramName);
                    if (parameter.getOptional()) {
                        block._if(JExpr.ref(paramName).ne(JExpr._null()))._then().add(invocation);
                    } else {
                        block.add(invocation);
                    }
                } else {
                    invocation.arg(value);
                    block.add(invocation);
                }
            }
        }

        if (endPoint.getResponseObject() != null && !endPoint.getResponseObject().isEmpty()) {
            // If responseObject contains generic types, use TypeReference. Else use Class of the responseObject.
            // http://wiki.fasterxml.com/JacksonDataBinding
            // For uniformity, TypeReference or Class is then converted to a JavaType to deserialize service response.
            // For generic types, creating an anonymous inner class for every service call would have overhead which is
            // compensated by the type safety it ensures at compilation time as well as easy code generation
            JInvocation invocation = JExpr.invoke("execute");
            JType definedClass = jCodeModel._ref(ServiceExecutePropertiesBuilder.class);
            JInvocation nestedInvocation = JExpr.invoke("getJavaType");
            if (!endPoint.getResponseObject().contains("<")) {
                if (endPoint.getResponseObject().contains(".")) {
                    JInvocation classDecl = jCodeModel.ref(Class.class).staticInvoke("forName").arg(endPoint.getResponseObject());
                    nestedInvocation.arg(classDecl);
                } else {
                    JFieldRef ref = JExpr.ref(JExpr.ref(endPoint.getResponseObject()), "class");
                    nestedInvocation.arg(ref);
                }
            } else {
                JClass typeReferenceClass = jCodeModel.ref(TypeReference.class).narrow(getJType(jCodeModel, endPoint.getResponseObject()));
                nestedInvocation.arg(JExpr._new(jCodeModel.anonymousClass(typeReferenceClass)));
            }
            JInvocation builderInvocation = JExpr.invoke(JExpr._new(definedClass), "setJavaType").arg(nestedInvocation);
            if (endPoint.getErrorResponseObject() != null && !endPoint.getErrorResponseObject().isEmpty()) {
                JInvocation nestedErrorInvocation = JExpr.invoke("getErrorType");
                if (!endPoint.getErrorResponseObject().contains("<")) {
                    if (endPoint.getErrorResponseObject().contains(".")) {
                        JInvocation classDecl = jCodeModel.ref(Class.class).staticInvoke("forName").arg(endPoint.getErrorResponseObject());
                        nestedErrorInvocation.arg(classDecl);
                    } else {
                        JFieldRef ref = JExpr.ref(JExpr.ref(endPoint.getErrorResponseObject()), "class");
                        nestedErrorInvocation.arg(ref);
                    }
                } else {
                    JClass typeReferenceClass = jCodeModel.ref(TypeReference.class).narrow(getJType(jCodeModel, endPoint.getErrorResponseObject()));
                    nestedErrorInvocation.arg(JExpr._new(jCodeModel.anonymousClass(typeReferenceClass)));
                }
                builderInvocation = builderInvocation.invoke("setErrorType").arg(nestedErrorInvocation);
            }
            builderInvocation = builderInvocation.invoke("setUri").arg(JExpr.ref("uri"));
            builderInvocation = builderInvocation.invoke("setHttpMethod").arg(endPoint.getHttpMethod());

            if (headersMap.size() > 0) {
                builderInvocation = builderInvocation.invoke("setHeadersMap").arg(JExpr.ref("headersMap"));
            }

            if (endPoint.getRequestObject() != null && !endPoint.getRequestObject().isEmpty()) {
                String requestObjectName;
                if (endPoint.getRequestSplitterClass() != null && endPoint.getRequestParamWithLimit() == null) {
                    requestObjectName = REQUEST_OBJECT_LOOP_VAR_NAME;
                } else {
                    requestObjectName = REQUEST_OBJECT_VAR_NAME;
                }
                builderInvocation = builderInvocation.invoke("setRequestObject").arg(JExpr.ref(requestObjectName));
            }

            if (endPoint.isIncludeMetaInfo() && endPoint.getMetaInfo() != null && endPoint.getMetaInfo().isDynamicCommandName()) {
                builderInvocation = builderInvocation.invoke("setCommandName").arg(JExpr.ref(META_INFO_COMMAND_NAME_VAR_NAME));
            } else if (endPoint.getCommandName() != null && !endPoint.getCommandName().isEmpty()) {
                builderInvocation = builderInvocation.invoke("setCommandName").arg(endPoint.getCommandName());
            }

            if (endPoint.isRequestCachingEnabled()) {
                builderInvocation = builderInvocation.invoke("setRequestCachingEnabled").arg(JExpr.lit(true));
            }

            if(formFields.size() > 0) {
                builderInvocation = builderInvocation.invoke("setFormFields").arg(JExpr.ref("formFields"));
            }

            builderInvocation = builderInvocation.invoke("build");
            return invocation.arg(builderInvocation);
        }
        return null;
    }

    private void addSimpleMethod(JCodeModel jCodeModel, JDefinedClass jDefinedClass,
                                 String methodName, String returnStr) {
        addSimpleMethod(jCodeModel, jDefinedClass, methodName, returnStr, null);
    }

    private void addSimpleMethod(JCodeModel jCodeModel, JDefinedClass jDefinedClass,
                                    String methodName, String returnStr, String exception) {
        JType methodReturnType = jCodeModel.ref("String");
        JMethod method = jDefinedClass.method(JMod.PUBLIC, methodReturnType, methodName);
        method.annotate(jCodeModel.ref("Override"));
        method.javadoc().addReturn().append(methodReturnType);
        if (exception != null)
            method._throws(jCodeModel.directClass(exception));
        method.body()._return(JExpr.lit(returnStr));
    }

    private void addImplMethods(ServiceIDL serviceIdl, JCodeModel jCodeModel, JDefinedClass jDefinedClass) {
        String commandName = serviceIdl.getService().getCommandName();
        if(commandName == null || commandName.isEmpty()) {
            commandName = Introspector.decapitalize(serviceIdl.getService().getName() + "HttpRequest");
        }
        addSimpleMethod(jCodeModel, jDefinedClass, "getCommandName", commandName);

        if (serviceIdl.getService().getObjectMapperClass() != null) {
            JType methodReturnType = jCodeModel.ref(ObjectMapper.class);
            JMethod method = jDefinedClass.method(JMod.PROTECTED, methodReturnType, "getObjectMapper");
            method.annotate(jCodeModel.ref("Override"));
            method.javadoc().addReturn().append(methodReturnType);
            method.body()._return(JExpr.ref("customObjectMapper").invoke("getObjectMapper"));
        }
    }

    public void generateInterface(ServiceIDL serviceIdl, JCodeModel jCodeModel, String destinationFolder) throws Exception {
        JDefinedClass serviceInterface = jCodeModel._class(getFullInterfaceName(serviceIdl), ClassType.INTERFACE);

        addClassComments(serviceIdl, serviceInterface);

        addAnnotations(jCodeModel, serviceInterface);

        addExtends(jCodeModel, serviceInterface);

        addInterfaceFields(serviceIdl, jCodeModel, serviceInterface);

        addMethods(serviceIdl, jCodeModel, serviceInterface, false);

        jCodeModel.build(new File(destinationFolder), (PrintStream) null);
    }

    public void generateImpl(ServiceIDL serviceIdl, JCodeModel jCodeModel, String destinationFolder) throws Exception {
        JDefinedClass serviceImpl = jCodeModel._class(getFullImplName(serviceIdl), ClassType.CLASS);

        addClassComments(serviceIdl, serviceImpl);

        addAnnotations(jCodeModel, serviceImpl);

        addExtendsImplements(serviceIdl, jCodeModel, serviceImpl);

        addConstructor(serviceIdl, serviceImpl);

        addMethods(serviceIdl, jCodeModel, serviceImpl, true);

        addImplMethods(serviceIdl, jCodeModel, serviceImpl);

        addMetaAnnotations(serviceIdl, jCodeModel, serviceImpl);

        jCodeModel.build(new File(destinationFolder), (PrintStream) null);
    }

    private void addMetaAnnotations(ServiceIDL serviceIdl, JCodeModel jCodeModel, JDefinedClass serviceImpl) {
        String serviceName = canonicalName(getInterfaceName(serviceIdl), "ServiceClient", "SC");
        addNameAnnotations(serviceImpl, serviceName);

        addVersionAnnotations(serviceImpl, serviceIdl.getVersion().getMajor(), serviceIdl.getVersion().getMinor(), serviceIdl.getVersion().getPatch());

        String[] description = serviceIdl.getService().getDescription();
        String shortDescription = description.length > 0 ? description[0] : getInterfaceName(serviceIdl);
        String fullDescription = description.length > 0 ? String.join(" ", description) : getInterfaceName(serviceIdl);

        addDescriptionAnnotations(serviceImpl, shortDescription, fullDescription);
    }
}


text:
#ifndef BOOST_ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP
#define BOOST_ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include <boost/asio/detail/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/asio/handler_invoke_hook.hpp>

#include <boost/asio/detail/push_options.hpp>

// Calls to asio_handler_invoke must be made from a namespace that does not
// contain overloads of this function. The boost_asio_handler_invoke_helpers
// namespace is defined here for that purpose.
namespace boost_asio_handler_invoke_helpers {

template <typename Function, typename Context>
inline void invoke(const Function& function, Context& context)
{
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
  || BOOST_WORKAROUND(__GNUC__, < 3)
  Function tmp(function);
  tmp();
#else
  using namespace boost::asio;
  asio_handler_invoke(function, boost::addressof(context));
#endif
}

} // namespace boost_asio_handler_invoke_helpers

#include <boost/asio/detail/pop_options.hpp>

#endif // BOOST_ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

cr.define('options', function() {

  var OptionsPage = options.OptionsPage;
  var UserImagesGrid = options.UserImagesGrid;
  var ButtonImages = UserImagesGrid.ButtonImages;

  /**
   * Array of button URLs used on this page.
   * @type {Array.<string>}
   * @const
   */
  var ButtonImageUrls = [
    ButtonImages.TAKE_PHOTO,
    ButtonImages.CHOOSE_FILE
  ];

  /////////////////////////////////////////////////////////////////////////////
  // ChangePictureOptions class:

  /**
   * Encapsulated handling of ChromeOS change picture options page.
   * @constructor
   */
  function ChangePictureOptions() {
    OptionsPage.call(
        this,
        'changePicture',
        loadTimeData.getString('changePicturePage'),
        'change-picture-page');
  }

  cr.addSingletonGetter(ChangePictureOptions);

  ChangePictureOptions.prototype = {
    // Inherit ChangePictureOptions from OptionsPage.
    __proto__: options.OptionsPage.prototype,

    /**
     * Initializes ChangePictureOptions page.
     */
    initializePage: function() {
      // Call base class implementation to start preferences initialization.
      OptionsPage.prototype.initializePage.call(this);

      var imageGrid = $('user-image-grid');
      UserImagesGrid.decorate(imageGrid);

      // Preview image will track the selected item's URL.
      var previewElement = $('user-image-preview');
      imageGrid.previewElement = previewElement;
      imageGrid.selectionType = 'default';

      imageGrid.addEventListener('select',
                                 this.handleImageSelected_.bind(this));
      imageGrid.addEventListener('activate',
                                 this.handleImageActivated_.bind(this));
      imageGrid.addEventListener('phototaken',
                                 this.handlePhotoTaken_.bind(this));
      imageGrid.addEventListener('photoupdated',
                                 this.handlePhotoTaken_.bind(this));

      // Set the title for "Take Photo" button.
      imageGrid.cameraTitle = loadTimeData.getString('takePhoto');

      // Add the "Choose file" button.
      imageGrid.addItem(ButtonImages.CHOOSE_FILE,
                        loadTimeData.getString('chooseFile'),
                        this.handleChooseFile_.bind(this)).type = 'file';

      // Profile image data.
      this.profileImage_ = imageGrid.addItem(
          ButtonImages.PROFILE_PICTURE,
          loadTimeData.getString('profilePhotoLoading'));
      this.profileImage_.type = 'profile';

      $('take-photo').addEventListener(
          'click', this.handleTakePhoto_.bind(this));
      $('discard-photo').addEventListener(
          'click', imageGrid.discardPhoto.bind(imageGrid));

      // Toggle 'animation' class for the duration of WebKit transition.
      $('flip-photo').addEventListener(
          'click', function(e) {
            previewElement.classList.add('animation');
            imageGrid.flipPhoto = !imageGrid.flipPhoto;
          });
      $('user-image-stream-crop').addEventListener(
          'webkitTransitionEnd', function(e) {
            previewElement.classList.remove('animation');
          });
      $('user-image-preview-img').addEventListener(
          'webkitTransitionEnd', function(e) {
            previewElement.classList.remove('animation');
          });

      // Old user image data (if present).
      this.oldImage_ = null;

      $('change-picture-overlay-confirm').addEventListener(
          'click', this.closePage_.bind(this));

      chrome.send('onChangePicturePageInitialized');
    },

    /**
     * Called right after the page has been shown to user.
     */
    didShowPage: function() {
      var imageGrid = $('user-image-grid');
      // Reset camera element.
      imageGrid.cameraImage = null;
      imageGrid.updateAndFocus();
      chrome.send('onChangePicturePageShown');
    },

    /**
     * Called right before the page is hidden.
     */
    willHidePage: function() {
      var imageGrid = $('user-image-grid');
      imageGrid.blur();  // Make sure the image grid is not active.
      imageGrid.stopCamera();
      if (this.oldImage_) {
        imageGrid.removeItem(this.oldImage_);
        this.oldImage_ = null;
      }
    },

    /**
     * Called right after the page has been hidden.
     */
    // TODO(ivankr): both callbacks are required as only one of them is called
    // depending on the way the page was closed, see http://crbug.com/118923.
    didClosePage: function() {
      this.willHidePage();
    },

    /**
     * Closes current page, returning back to Personal Stuff page.
     * @private
     */
    closePage_: function() {
      OptionsPage.closeOverlay();
    },

    /**
     * Handles "Take photo" button click.
     * @private
     */
    handleTakePhoto_: function() {
      $('user-image-grid').takePhoto();
    },

    /**
     * Handle photo captured event.
     * @param {cr.Event} e Event with 'dataURL' property containing a data URL.
     */
    handlePhotoTaken_: function(e) {
      chrome.send('photoTaken', [e.dataURL]);
    },

    /**
     * Handles "Choose a file" button activation.
     * @private
     */
    handleChooseFile_: function() {
      chrome.send('chooseFile');
      this.closePage_();
    },

    /**
     * Handles image selection change.
     * @param {Event} e Selection change Event.
     * @private
     */
    handleImageSelected_: function(e) {
      var imageGrid = $('user-image-grid');
      var url = imageGrid.selectedItemUrl;
      // Ignore selection change caused by program itself and selection of one
      // of the action buttons.
      if (!imageGrid.inProgramSelection &&
          url != ButtonImages.TAKE_PHOTO && url != ButtonImages.CHOOSE_FILE) {
        chrome.send('selectImage', [url, imageGrid.selectionType]);
      }
      // Start/stop camera on (de)selection.
      if (!imageGrid.inProgramSelection &&
          imageGrid.selectionType != e.oldSelectionType) {
        if (imageGrid.selectionType == 'camera') {
          imageGrid.startCamera(
              function() {
                // Start capture if camera is still the selected item.
                return imageGrid.selectedItem == imageGrid.cameraImage;
              });
        } else {
          imageGrid.stopCamera();
        }
      }
      // Update image attribution text.
      var image = imageGrid.selectedItem;
      $('user-image-author-name').textContent = image.author;
      $('user-image-author-website').textContent = image.website;
      $('user-image-author-website').href = image.website;
      $('user-image-attribution').style.visibility =
          (image.author || image.website) ? 'visible' : 'hidden';
    },

    /**
     * Handles image activation (by pressing Enter).
     * @private
     */
    handleImageActivated_: function() {
      switch ($('user-image-grid').selectedItemUrl) {
        case ButtonImages.TAKE_PHOTO:
          this.handleTakePhoto_();
          break;
        case ButtonImages.CHOOSE_FILE:
          this.handleChooseFile_();
          break;
        default:
          this.closePage_();
          break;
      }
    },

    /**
     * Adds or updates old user image taken from file/camera (neither a profile
     * image nor a default one).
     * @param {string} imageUrl Old user image, as data or internal URL.
     * @private
     */
    setOldImage_: function(imageUrl) {
      var imageGrid = $('user-image-grid');
      if (this.oldImage_) {
        this.oldImage_ = imageGrid.updateItem(this.oldImage_, imageUrl);
      } else {
        // Insert next to the profile image.
        var pos = imageGrid.indexOf(this.profileImage_) + 1;
        this.oldImage_ = imageGrid.addItem(imageUrl, undefined, undefined, pos);
        this.oldImage_.type = 'old';
        imageGrid.selectedItem = this.oldImage_;
      }
    },

    /**
     * Updates user's profile image.
     * @param {string} imageUrl Profile image, encoded as data URL.
     * @param {boolean} select If true, profile image should be selected.
     * @private
     */
    setProfileImage_: function(imageUrl, select) {
      var imageGrid = $('user-image-grid');
      this.profileImage_ = imageGrid.updateItem(
          this.profileImage_, imageUrl, loadTimeData.getString('profilePhoto'));
      if (select)
        imageGrid.selectedItem = this.profileImage_;
    },

    /**
     * Selects user image with the given URL.
     * @param {string} url URL of the image to select.
     * @private
     */
    setSelectedImage_: function(url) {
      $('user-image-grid').selectedItemUrl = url;
    },

    /**
     * @param {boolean} present Whether camera is detected.
     */
    setCameraPresent_: function(present) {
      $('user-image-grid').cameraPresent = present;
    },

    /**
     * Appends default images to the image grid. Should only be called once.
     * @param {Array.<{url: string, author: string, website: string}>}
     *   imagesData An array of default images data, including URL, author and
     *   website.
     * @private
     */
    setDefaultImages_: function(imagesData) {
      var imageGrid = $('user-image-grid');
      for (var i = 0, data; data = imagesData[i]; i++) {
        var item = imageGrid.addItem(data.url);
        item.type = 'default';
        item.author = data.author || '';
        item.website = data.website || '';
      }
    },
  };

  // Forward public APIs to private implementations.
  [
    'setCameraPresent',
    'setDefaultImages',
    'setOldImage',
    'setProfileImage',
    'setSelectedImage',
  ].forEach(function(name) {
    ChangePictureOptions[name] = function() {
      var instance = ChangePictureOptions.getInstance();
      return instance[name + '_'].apply(instance, arguments);
    };
  });

  // Export
  return {
    ChangePictureOptions: ChangePictureOptions
  };

});


text:
package com.zx.abnormal.user.massage.entity;

import java.util.List;

import com.zx.modules.trade.service.AbnormalUrlService;

public abstract class AbsUserMassage {
    public void execute(AbnormalUrlService abnormalUrlService) {
        List<String> urList = selectUrl(abnormalUrlService);
        getUserMassage(urList);
    }

    abstract public List<String> selectUrl(AbnormalUrlService abnormalUrlService);

    abstract public void getUserMassage(List<String> urList);

}


text:
enable_language(C)

set(CMAKE_LINK_SEARCH_START_STATIC ON)
add_executable(LinkSearchStartStaticInit1 LinkStatic.c)
get_target_property(LSSS LinkSearchStartStaticInit1
  LINK_SEARCH_START_STATIC)
if(NOT LSSS)
  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_START_STATIC")
endif()
unset(CMAKE_LINK_SEARCH_START_STATIC)

add_executable(LinkSearchStartStaticSet1 LinkStatic.c)
set_target_properties(LinkSearchStartStaticSet1 PROPERTIES
  LINK_SEARCH_START_STATIC ON)
get_target_property(LSSS LinkSearchStartStaticSet1
  LINK_SEARCH_START_STATIC)
if(NOT LSSS)
  message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_START_STATIC")
endif()

set(CMAKE_LINK_SEARCH_START_STATIC OFF)
add_executable(LinkSearchStartStaticInit2 LinkStatic.c)
get_target_property(LSSS LinkSearchStartStaticInit2
  LINK_SEARCH_START_STATIC)
if(LSSS)
  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_START_STATIC")
endif()
unset(CMAKE_LINK_SEARCH_START_STATIC)

add_executable(LinkSearchStartStaticSet2 LinkStatic.c)
set_target_properties(LinkSearchStartStaticSet2 PROPERTIES
  LINK_SEARCH_START_STATIC OFF)
get_target_property(LSSS LinkSearchStartStaticSet2
  LINK_SEARCH_START_STATIC)
if(LSSS)
  message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_START_STATIC")
endif()

set(CMAKE_LINK_SEARCH_END_STATIC ON)
add_executable(LinkSearchEndStaticInit1 LinkStatic.c)
get_target_property(LSES LinkSearchEndStaticInit1
  LINK_SEARCH_END_STATIC)
if(NOT LSES)
  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_END_STATIC")
endif()
unset(CMAKE_LINK_SEARCH_END_STATIC)

add_executable(LinkSearchEndStaticSet1 LinkStatic.c)
set_target_properties(LinkSearchEndStaticSet1 PROPERTIES
  LINK_SEARCH_END_STATIC ON)
get_target_property(LSSS LinkSearchEndStaticSet1
  LINK_SEARCH_END_STATIC)
if(NOT LSSS)
  message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_END_STATIC")
endif()

set(CMAKE_LINK_SEARCH_END_STATIC OFF)
add_executable(LinkSearchEndStaticInit2 LinkStatic.c)
get_target_property(LSES LinkSearchEndStaticInit2
  LINK_SEARCH_END_STATIC)
if(LSES)
  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_END_STATIC")
endif()
unset(CMAKE_LINK_SEARCH_END_STATIC)

add_executable(LinkSearchEndStaticSet2 LinkStatic.c)
set_target_properties(LinkSearchEndStaticSet2 PROPERTIES
  LINK_SEARCH_END_STATIC ON)
get_target_property(LSSS LinkSearchEndStaticSet2
  LINK_SEARCH_END_STATIC)
if(NOT LSSS)
  message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_END_STATIC")
endif()