text:
Wait! There's some problems:

Email is required.

Email is invalid.

User name is required.

Password is required.

Passwords does not match.

		<form role="form" name="form" ng-submit="submit(user)">
			<fieldset>
				<legend>Register</legend>
				First Name

					<input type="text" name="firstname" class="form-control" placeholder="First name" ng-model="user.firstname" ng-disabled="isFormSubmiting()">

				Sur Name

					<input type="text" name="surname" class="form-control" placeholder="Sur name" ng-model="user.surname" ng-disabled="isFormSubmiting()">

				Email

					<input type="email" name="email" class="form-control" placeholder="Email" ng-model="user.email" required ng-disabled="isFormSubmiting()">

				Username

					<input type="text" name="username" class="form-control" placeholder="Username" ng-model="user.username" required ng-disabled="isFormSubmiting()">

				Password

					<input type="password" name="password" class="form-control" placeholder="Password" ng-model="user.password" required ng-disabled="isFormSubmiting()">

				Password

					<input type="password" name="password_confirmation" class="form-control" ng-model="user.password_confirmation" placeholder="Password confirmation" required ng-disabled="isFormSubmiting()">

				<button type="submit" class="btn btn-primary" ng-disabled="form.$invalid || isFormSubmiting()">
					 Submit</button>
			</fieldset>
		</form>

Success!

An e-mail has been sent to {{ user.email }}. Check the confirmation link on it.

You only can proceed to login if the confirmation has been completed.

redpajama_set_name: RedPajamaGithub


text:
```javascript
var fs = require("fs");
var Sprites = require("image-sprites");

var css = fs.readFileSync("src.css", "utf8");
var sprites = Sprites.fromCSS(css);

fs.writeFileSync("out.css", sprites.toCSS());
fs.writeFileSync("out.html", sprites.toMap());
fs.writeFileSync("out.json", sprites.toString());
```


text:
package no.jansoren.mymicroservice.qtest;

import no.jansoren.mymicroservice.qtest.services.MonitoringService;
import no.jansoren.mymicroservice.qtest.services.SomethingService;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

public class MonitoringTest {

    private MonitoringService service;

    @Before
    public void setUp() {
        service = new MonitoringService();
    }

    @Test
    public void testEventLog() {
        List eventLog = service.getEventLog();
        Assert.assertNotNull(eventLog);
    }
}


text:
/*
	Extern implementation of Nit module exec
*/
#ifndef CORE__EXEC_NIT_H
#define CORE__EXEC_NIT_H

#include <stdint.h>
#include "core__exec._nitni.h"
#line 29 "../lib/core/exec.nit"

	#include <sys/types.h>

	// FIXME this should be in the "C" block when bug on module blocks is fixed
	// or, even better, replace the C structure by a Nit object.
	typedef struct se_exec_data se_exec_data_t;
	struct se_exec_data {
		pid_t id;
		int running;
		int status;
		int in_fd;
		int out_fd;
		int err_fd;
	};
#include "core__math._ffi.h"
#include "core__time._ffi.h"
#include "core__file._ffi.h"
#endif


text:
public class CompositionDataElement {

    int position;
    float score;
    char aminoAcid;

    CompositionDataElement(int pos, float s, char aa) {
        position = pos;
        score = s;
        aminoAcid = aa;
    }

    public int getPosition() {
        return position;
    }

    public float getScore() {
        return score;
    }

    public char getAminoAcid() {
        return aminoAcid;
    }

}


text:
from tempest.api.network import base
from tempest.common.utils import data_utils

class ExternalNetworksTestJSON(base.BaseAdminNetworkTest):
    _interface = 'json'

    @classmethod
    def resource_setup(cls):
        super(ExternalNetworksTestJSON, cls).resource_setup()
        cls.network = cls.create_network()

    def _create_network(self, external=True):
        post_body = {'name': data_utils.rand_name('network-')}
        if external:
            post_body['router:external'] = external
        _, body = self.admin_client.create_network(**post_body)
        network = body['network']
        self.addCleanup(self.admin_client.delete_network, network['id'])
        return network

    def test_create_external_network(self):
        # Create a network as an admin user specifying the
        # external network extension attribute
        ext_network = self._create_network()
        # Verifies router:external parameter
        self.assertIsNotNone(ext_network['id'])
        self.assertTrue(ext_network['router:external'])

    def test_update_external_network(self):
        # Update a network as an admin user specifying the
        # external network extension attribute
        network = self._create_network(external=False)
        self.assertFalse(network.get('router:external', False))
        update_body = {'router:external': True}
        _, body = self.admin_client.update_network(network['id'],
                                                   **update_body)
        updated_network = body['network']
        # Verify that router:external parameter was updated
        self.assertTrue(updated_network['router:external'])

    def test_list_external_networks(self):
        # Create external_net
        external_network = self._create_network()
        # List networks as a normal user and confirm the external
        # network extension attribute is returned for those networks
        # that were created as external
        _, body = self.client.list_networks()
        networks_list = [net['id'] for net in body['networks']]
        self.assertIn(external_network['id'], networks_list)
        self.assertIn(self.network['id'], networks_list)
        for net in body['networks']:
            if net['id'] == self.network['id']:
                self.assertFalse(net['router:external'])
            elif net['id'] == external_network['id']:
                self.assertTrue(net['router:external'])

    def test_show_external_networks_attribute(self):
        # Create external_net
        external_network = self._create_network()
        # Show an external network as a normal user and confirm the
        # external network extension attribute is returned.
        _, body = self.client.show_network(external_network['id'])
        show_ext_net = body['network']
        self.assertEqual(external_network['name'], show_ext_net['name'])
        self.assertEqual(external_network['id'], show_ext_net['id'])
        self.assertTrue(show_ext_net['router:external'])
        _, body = self.client.show_network(self.network['id'])
        show_net = body['network']
        # Verify with show that router:external is False for network
        self.assertEqual(self.network['name'], show_net['name'])
        self.assertEqual(self.network['id'], show_net['id'])
        self.assertFalse(show_net['router:external'])

class ExternalNetworksTestXML(ExternalNetworksTestJSON):
    _interface = 'xml'


text:
@interface EstimoteCloudBeaconDetailsFactory : NSObject <BeaconContentFactory>

@end


text:
Page::Page(Profile *profile, Site *site, const QList<Site*> &sites, SearchQuery query, int page, int limit, const QStringList &postFiltering, bool smart, QObject *parent, int pool, const PageInformation &lastPageInformation)
	: QObject(parent), m_site(site), m_regexApi(-1), m_query(std::move(query)), m_errors(QStringList()), m_imagesPerPage(limit), m_smart(smart)
{
	m_website = m_site->url();
	m_imagesCount = -1;
	m_pagesCount = -1;

	// Add site-level automatically added tags
	if (m_query.gallery == nullptr) {
		m_query.tags += m_site->setting("added_tags").toString().split(" ", Qt::SkipEmptyParts);
	}

	if (!m_query.tags.isEmpty()) {
		// Replace shortcuts to increase compatibility
		QString text = " " + m_query.tags.join(' ') + " ";
		text.replace(" rating:s ", " rating:safe ", Qt::CaseInsensitive)
			.replace(" rating:g ", " rating:general ", Qt::CaseInsensitive)
			.replace(" rating:q ", " rating:questionable ", Qt::CaseInsensitive)
			.replace(" rating:e ", " rating:explicit ", Qt::CaseInsensitive)
			.replace(" -rating:s ", " -rating:safe ", Qt::CaseInsensitive)
			.replace(" -rating:g ", " -rating:general ", Qt::CaseInsensitive)
			.replace(" -rating:q ", " -rating:questionable ", Qt::CaseInsensitive)
			.replace(" -rating:e ", " -rating:explicit ", Qt::CaseInsensitive);
		QStringList tags = text.split(" ", Qt::SkipEmptyParts);

		// Get the list of all enabled modifiers
		QStringList modifiers = QStringList();
		for (Site *ste : sites) {
			modifiers.append(ste->getApis().first()->modifiers());
		}
		const QStringList mods = m_site->getApis().first()->modifiers();
		for (const QString &mod : mods) {
			modifiers.removeAll(mod);
		}

		// Remove modifiers from tags
		for (const QString &mod : modifiers) {
			if (tags.removeAll(mod) > 0) {
				log(QStringLiteral("[%1] Unsupported modifier removed from search: %2").arg(m_site->url(), mod), Logger::Warning);
			}
		}

		m_search = tags;
		m_query.tags = m_search;
	}

	// Generate pages
	PostFilter postFilter(postFiltering);
	m_siteApis = m_site->getLoggedInApis();
	m_pageApis.reserve(m_siteApis.count());
	for (Api *api : qAsConst(m_siteApis)) {
		auto *pageApi = new PageApi(this, profile, m_site, api, m_query, page, limit, postFilter, smart, parent, pool, lastPageInformation);
		if (m_pageApis.count() == 0) {
			connect(pageApi, &PageApi::httpsRedirect, this, &Page::httpsRedirectSlot);
		}
		m_pageApis.append(pageApi);
		if (api->getName() == QLatin1String("Html") && m_regexApi < 0) {
			m_regexApi = m_pageApis.count() - 1;
		}
	}
	m_currentApi = -1;

	// Set values
	m_page = page;
	m_pool = pool;
	fallback(false);
}
Page::~Page()
{
	qDeleteAll(m_pageApis);
}

void Page::fallback(bool loadIfPossible)
{
	m_errors.clear();

	if (m_currentApi >= m_siteApis.count() - 1) {
		log(QStringLiteral("[%1] No valid source of the site returned result.").arg(m_site->url()), Logger::Warning);
		m_errors.append(tr("No valid source of the site returned result."));
		emit failedLoading(this);
		return;
	}

	m_currentApi++;
	if (m_currentApi > 0) {
		log(QStringLiteral("[%1] Loading using %2 failed. Retry using %3.").arg(m_site->url(), m_siteApis[m_currentApi - 1]->getName(), m_siteApis[m_currentApi]->getName()), Logger::Warning);
	}

	if (loadIfPossible) {
		load();
	}
}

PageInformation Page::pageInformation() const
{
	return m_pageApis[m_currentApi]->pageInformation();
}

void Page::setLastPage(const PageInformation& info)
{
	for (PageApi *api : qAsConst(m_pageApis)) {
		api->setLastPage(info);
	}

	m_currentApi--;
	fallback(false);
}

void Page::load(bool rateLimit)
{
	if (m_currentApi < 0 || m_currentApi >= m_pageApis.count()) {
		log(QStringLiteral("[%1] No available API to perform the request").arg(m_site->url()), Logger::Error);
		m_errors.append(tr("No available API to perform the request."));
		emit failedLoading(this);
		return;
	}

	connect(m_pageApis[m_currentApi], &PageApi::finishedLoading, this, &Page::loadFinished);
	m_pageApis[m_currentApi]->load(rateLimit);
}
void Page::loadFinished(PageApi *api, PageApi::LoadResult status)
{
	if (api != m_pageApis[m_currentApi]) {
		return;
	}

	QString eventLabel = QStringLiteral("%1 (%2)").arg(m_site->url(), m_siteApis[m_currentApi]->getName());
	if (status == PageApi::LoadResult::Ok) {
		Analytics::getInstance().sendEvent("Page load", "Success", eventLabel);
		emit finishedLoading(this);
	} else {
		const QStringList &errors = api->errors();
		if (errors.isEmpty() || !errors.first().contains("impossible")) {
			Analytics::getInstance().sendEvent("Page load", "Error", eventLabel);
		}
		m_errors.append(errors);
		fallback();
	}
}
void Page::abort()
{
	if (m_currentApi < 0 || m_currentApi >= m_pageApis.count()) {
		return;
	}
	m_pageApis[m_currentApi]->abort();
}

void Page::loadTags()
{
	if (m_regexApi < 0) {
		return;
	}

	connect(m_pageApis[m_regexApi], &PageApi::finishedLoading, this, &Page::loadTagsFinished);
	m_pageApis[m_regexApi]->load();
}
void Page::loadTagsFinished(PageApi *api, PageApi::LoadResult status)
{
	Q_UNUSED(status);

	if (m_regexApi < 0 || api != m_pageApis[m_regexApi]) {
		return;
	}

	emit finishedLoadingTags(this);
}
void Page::abortTags()
{
	if (m_regexApi < 0) {
		return;
	}

	m_pageApis[m_regexApi]->abort();
}

void Page::httpsRedirectSlot()
{ emit httpsRedirect(this); }

void Page::clear()
{
	for (PageApi *pageApi : qAsConst(m_pageApis)) {
		pageApi->clear();
	}
}

Site *Page::site() const { return m_site; }
const QString &Page::website() const { return m_website; }
const QString &Page::wiki() const { return m_pageApis[m_regexApi < 0 ? m_currentApi : m_regexApi]->wiki(); }
const SearchQuery &Page::query() const { return m_query; }
const QStringList &Page::search() const { return m_search; }
const QStringList &Page::errors() const { return m_errors; }
int Page::imagesPerPage() const { return m_imagesPerPage; }
int Page::page() const { return m_page; }
int Page::pageImageCount() const { return m_pageApis[m_currentApi]->pageImageCount(); }
int Page::filteredImageCount() const { return m_pageApis[m_currentApi]->filteredImageCount(); }
const QList<QSharedPointer<Image>> &Page::images() const { return m_pageApis[m_currentApi]->images(); }
const QUrl &Page::url() const { return m_pageApis[m_currentApi]->url(); }
const QUrl &Page::friendlyUrl() const { return m_pageApis[m_regexApi < 0 ? m_currentApi : m_regexApi]->url(); }
const QList<Tag> &Page::tags() const { return m_pageApis[m_regexApi < 0 ? m_currentApi : m_regexApi]->tags(); }
int Page::highLimit() const { return m_pageApis[m_currentApi]->highLimit(); }
bool Page::hasNext() const { return m_pageApis[m_currentApi]->hasNext(); }
bool Page::isLoaded() const { return m_pageApis[m_currentApi]->isLoaded(); }
bool Page::isValid() const { return !m_pageApis.isEmpty(); }

QMap<QString, QUrl> Page::urls() const
{
	QMap<QString, QUrl> ret;
	for (int i = 0; i < m_siteApis.count(); ++i) {
		auto *siteApi = m_siteApis[i];
		auto *pageApi = m_pageApis[i];
		if (!pageApi->url().isEmpty()) {
			ret[siteApi->getName()] = pageApi->url();
		}
	}
	return ret;
}

bool Page::hasSource() const
{
	return std::any_of(
		m_pageApis.constBegin(),
		m_pageApis.constEnd(),
		[](PageApi *pageApi) {
		return !pageApi->source().isEmpty();
	}
	);
}

int Page::imagesCount(bool guess) const
{
	if (m_regexApi >= 0 && !m_pageApis[m_currentApi]->isImageCountSure()) {
		const int count = m_pageApis[m_regexApi]->imagesCount(guess);
		if (count >= 0) {
			return count;
		}
	}
	return m_pageApis[m_currentApi]->imagesCount(guess);
}
int Page::maxImagesCount() const
{
	if (m_regexApi >= 0 && !m_pageApis[m_currentApi]->isImageCountSure()) {
		const int count = m_pageApis[m_regexApi]->maxImagesCount();
		if (count >= 0) {
			return count;
		}
	}
	return m_pageApis[m_currentApi]->maxImagesCount();
}
int Page::pagesCount(bool guess) const
{
	if (m_regexApi >= 0 && !m_pageApis[m_currentApi]->isPageCountSure()) {
		const int count = m_pageApis[m_regexApi]->pagesCount(guess);
		if (count >= 0) {
			return count;
		}
	}
	return m_pageApis[m_currentApi]->pagesCount(guess);
}
int Page::maxPagesCount() const
{
	if (m_regexApi >= 0 && !m_pageApis[m_currentApi]->isPageCountSure()) {
		const int count = m_pageApis[m_regexApi]->maxPagesCount();
		if (count >= 0) {
			return count;
		}
	}
	return m_pageApis[m_currentApi]->maxPagesCount();
}


text:
Responsible for managing text displayed on the screen in line
with content on the canvas.

## Usage

### `labels = Labels(gl)`

Creates a new instance of `@unpm/labels`.

### `labels.tick()`

Should be called once per frame – responsible for updating
the state of the labels when necessary. Positions are cached to
avoid thrashing the DOM too much.

### `labels.addLabel(text, coord, [rotate?, [fontSize]])`

Creates a new label.

* `text` is the text content of the label.
* `coord` is an `[x, y, z]` vector specifying the position of the text in *world space*.
* `rotate` is an optional boolean, and if set to `true` it will rotate
the text 90 degrees.
* `fontSize` the font size to use, in pixels. Uses the CSS-specified size by default.

### `labels.refresh()`

Forces a recalculation of the label positions.

### `labels.reset()`

Removes all current labels from the screen, allowing you
to start anew.


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/html;charset=utf-8" />

    <title>Wasteland Recipes Step By Step - Billy Vs. SNAKEMAN Wiki</title>

    <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>

    <meta http-equiv="content-language" content="en"/>

    <link rel="shortcut icon" href="local--favicon/favicon.gif"/>
    <link rel="icon" type="image/gif" href="local--favicon/favicon.gif"/>

            <link rel="apple-touch-icon" href="common--images/apple-touch-icon-57x57.png" />
        <link rel="apple-touch-icon" sizes="72x72" href="common--images/apple-touch-icon-72x72.png" />
        <link rel="apple-touch-icon" sizes="114x114" href="common--images/apple-touch-icon-114x114.png" />

            <link rel="alternate" type="application/wiki" title="Edit this page" href="javascript:WIKIDOT.page.listeners.editClick()"/>

        <link rel="manifest" href="onesignal/manifest.html" />

Billy Vs. SNAKEMAN Wiki

Be the Ultimate Ninja.

    <form id="search-top-box-form" action="http://bvs.wikidot.com/dummy" class="input-append">
        <input id="search-top-box-input" class="text empty search-query" type="text" size="15" name="query" value="Search this site" onfocus="if(YAHOO.util.Dom.hasClass(this, 'empty')){YAHOO.util.Dom.removeClass(this,'empty'); this.value='';}"/><input class="button btn" type="submit" name="search" value="Search"/>
    </form>

Allies

Allies Untabbed

Burger Ninja

Reaper

Regular

R00t

Season 2+

Season 3+

Season 4+

The Trade

Wasteland

World Kaiju

Summons

Teams

Missions

Missions Untabbed

D-Rank

C-Rank

B-Rank

A-Rank

AA-Rank

S-Rank

BurgerNinja

Cave

Jungle

Monochrome

Outskirts

PizzaWitch

Reaper

Wasteland

Witching Hour

Quests

Mission Lady Alley

Items

Items Untabbed

Ally Drops and Other

Permanent Items

Potions/Crafting Items

Crafting

Ingredients

Potions

Wasteland Items

Sponsored Items

Village

BillyCon

Billy Idol

Cosplay

Dealer's Room

Events

Glowslinging

Rave

Squee

Video Game Tournament

Wander

BillyTV

Bingo'ing

Candyween

Festival Day

Bargltron

BillyMaze

Dance Party

ElevenSnax

Marksman

Raffle

RNGShack

TsukiRoll

Tunnel

Hidden HoClaus

Kaiju

Marketplace

PizzaWitch Garage

Robo Fighto

R00t

Fields

Keys

Phases

SCIENCE!

Upgrades

Zombjas

Party House

11DBHK's Lottery

AkaTsukiBall

Crane Game!

Darts!

Flower Wars

'Juice' Bar

Mahjong

Ninja Jackpot!

Over 11,000

Pachinko

Party Room

Pigeons

Prize Wheel

Roulette

Scratchy Tickets

SNAKEMAN

SUPERFAIL

Tip Line

The Big Board

The First Loser

Guides

BillyCon Guide

BurgerNinja Guide

Candyween Guide

Glossary

Glowslinging Strategy Guide

Hero's Quest

Looping Guide

Monochrome Guide

Overnight Bonuses

PizzaWitch Guide

Potions / Crafting

Crafting

Items

Materials

Potion Mixing

Mixed Ingredients

Potions

Reduction Laboratory

Potions and Ingredients

Wasteland Items

Impossible Mission Guide

Ranking Guide

Reaper Guide

Reaper's Game Guide

R00t Guide

Speed Content Guide

Speedlooping Guide

The Trade Guide

Wasteland Guide

Other

Arena

Billy Club

Boosters

Karma

Bloodlines

Jutsu

Bloodline Jutsu

Regular Jutsu

Special Jutsu

Mission Bonus

News Archive

Number One

Old News Archive

Perfect Poker Bosses

Pets

Retail

Ryo

Spar With Friends

Sponsored Items

Store

Themes

Trophies

Untabbed

Allies

Items

Jutsu

Missions

Potions / Crafting

World Kaiju

Utilities

Awesome Calculator

Item Checker

Mission Calculator

R00t Calculator

Success Calculator

Templates

Wiki Chat Box

Create account or Sign in

Play BvS Now!

Site members

Wiki Membership

Forum Main

Recent Posts

Recent changes

List all pages

Page Tags

Players

Villages

Other Resources

Notice: Do not send bug reports based on the information on this site. If this site is not matching up with what you're experiencing in game, that is a problem with this site, not with the game.

                            Wasteland Recipes Step By Step

FoldUnfold

Table of Contents

Introduction

Cloaks

Dustcloak of Sneaking

Wasteland Dustcloak

Weighted Dustcloak

Basic Dustcloak

Pistols

Pistol of Repeating

Wasteland Pistol

Average Pistol

Makeshift Pistol

Scythes

Scythe of Razing

Wasteland Scythe

Silver Scythe

Makeshift Scythe

Shades

Solid Shades

Desert Shades

Boots

Boots of Walking

Wasteland Boots

Quality Boots

Fur Lined Boots

Cowls

Cowl of the Second HoCage

Wasteland Cowl

Dark Cowl

Basic Cowl

Introduction

The following recipes for the wasteland equipment are all assuming base items. In other words, that all wasteland drops have been distilled and/or appraised. In other words, cracked gears instead of broken machinery, and wasteland dust as opposed to burnt scrolls and so on. Items in each category do not stack, and higher quality items are listed higher in each category than lower quality items. (Example: Wasteland Dustcloak > Weighted Dustcloak)

Cloaks

Dustcloak of Sneaking - No lost Stamina from Wasteland Disease, +1 Strength outside of Wasteland

Wasteland Dustcloak - 10 less Stamina lost from Wasteland Disease

Weighted Dustcloak - 8 less Stamina lost from Wasteland Disease, -2 Levels

Basic Dustcloak - 2 less Stamina lost from Wasteland Disease

Dustcloak of Sneaking

Dustcloak of Sneaking

Item Needed
Quantity

Ceramic Tile
1

Filtered Thread
2

Lightning Rune
1

Metal Scraps
2

Steel Tile
1

Dustcloak of Sneaking

1st Ingredient
2nd Ingredient
Result

Filtered Thread
Filtered Thread
Filter Wrappings

Metal Scraps
Metal Scraps
Metal Rivets

Steel Tile
Ceramic Tile
Reinforced Plating

Metal Rivets
Reinforced Plating
Wasteland Harness

Lightning Rune
Wasteland Harness
Magical Harness

Magical Harness
Filter Wrappings
Dustcloak of Sneaking

Wasteland Dustcloak

Wasteland Dustcloak

Item Needed
Quantity

Ceramic Tile
1

Filtered Thread
2

Metal Scraps
2

Steel Tile
1

Wasteland Dustcloak

1st Ingredient
2nd Ingredient
Result

Metal Scraps
Metal Scraps
Metal Rivets

Steel Tile
Ceramic Tile
Reinforced Plating

Metal Rivets
Reinforced Plating
Wasteland Harness

Filtered Thread
Filtered Thread
Filter Wrappings

Wasteland Harness
Filter Wrappings
Wasteland Dustcloak

Weighted Dustcloak

Weighted Dustcloak

Item Needed
Quantity

Filtered Thread
2

Metal Scraps
2

Steel Tile
2

Weighted Dustcloak

1st Ingredient
2nd Ingredient
Result

Steel Tile
Steel Tile
Steel Plating

Metal Scraps
Metal Scraps
Metal Rivets

Metal Rivets
Steel Plating
Weighted Harness

Filtered Thread
Filtered Thread
Filter Wrappings

Weighted Harness
Filter Wrappings
Weighted Dustcloak

Basic Dustcloak

Basic Dustcloak

Item Needed
Quantity

Filtered Thread
2

Metal Scraps
2

Wooden Tile1
2

Basic Dustcloak

1st Ingredient
2nd Ingredient
Result

Wooden Tile
Wooden Tile
Wooden Plating

Metal Scraps
Metal Scraps
Metal Rivets

Metal Rivets
Wooden Plating
Basic Harness

Filtered Thread
Filtered Thread
Filter Wrappings

Basic Harness
Filter Wrappings
Basic Dustcloak

Pistols

Pistol of Repeating - +4 Levels

Wasteland Pistol - +4 Levels on Bingos

Average Pistol - +3 Levels on Bingos

Makeshift Pistol - +2 Levels on Bingos

Pistol of Repeating

Pistol of Repeating

Item Needed
Quantity

Blackened Dust
1

Cobalt Shaft
1

Metal Scraps
2

Ocelot Rune
1

Silver Shaft
1

Pistol of Repeating

1st Ingredient
2nd Ingredient
Result

Metal Scraps
Metal Scraps
Metal Rivets

Silver Shaft
Metal Rivets
Reinforced Handle

Cobalt Shaft
Blackened Dust
Cobalt Firing Pin

Cobalt Firing Pin
Ocelot Rune
Magical Firing Pin

Magical Firing Pin
Reinforced Handle
Pistol of Repeating

Wasteland Pistol

Wasteland Pistol

Item Needed
Quantity

Blackened Dust
1

Cobalt Shaft
1

Metal Scraps
2

Silver Shaft
1

Wasteland Pistol

1st Ingredient
2nd Ingredient
Result

Metal Scraps
Metal Scraps
Metal Rivets

Silver Shaft
Metal Rivets
Reinforced Handle

Cobalt Shaft
Blackened Dust
Cobalt Firing Pin

Cobalt Firing Pin
Reinforced Handle
Wasteland Pistol

Average Pistol

Average Pistol

Item Needed
Quantity

Blackened Dust
1

Copper Shaft
1

Metal Scraps
2

Silver Shaft
1

Average Pistol

1st Ingredient
2nd Ingredient
Result

Metal Scraps
Metal Scraps
Metal Rivets

Silver Shaft
Metal Rivets
Reinforced Handle

Copper Shaft
Blackened Dust
Basic Firing Pin

Reinforced Handle
Basic Firing Pin
Average Pistol

Makeshift Pistol

Makeshift Pistol

Item Needed
Quantity

Blackened Dust
1

Copper Shaft
2

Metal Scraps
2

Makeshift Pistol

1st Ingredient
2nd Ingredient
Result

Copper Shaft
Blackened Dust
Basic Firing Pin

Metal Scraps
Metal Scraps
Metal Rivets

Metal Rivets
Copper Shaft
Basic Handle

Basic Firing Pin
Basic Handle
Makeshift Pistol

Scythes

Scythe of Razing - +3 Range and +3 Levels on Wasteland Missions, +2 Strength on Village Attacks

Wasteland Scythe - +1 Range and +3 Levels on Wasteland Missions

Silver Scythe - +1 Range and +2 Levels on Wasteland Missions

Makeshift Scythe - +1 Range on Wasteland Missions

The range is also only applied in the wasteland

Scythe of Razing

Scythe of Razing

Item Needed
Quantity

Acid Vial
1

Blackened Dust
2

Cobalt Shaft
2

Cracked Gear
1

Fox Rune
1

Glassed Sand
1

Sharpening Stone
1

Scythe of Razing

1st Ingredient
2nd Ingredient
Result

Cracked Gear
Blackened Dust
Average Gear

Average Gear
Blackened Dust
Perfect Gear

Cobalt Shaft
Cobalt Shaft
Cobalt Pole

Cobalt Pole
Perfect Gear
Excellent Polearm

Excellent Polearm
Fox Rune
Magical Polearm

Glassed Sand
Acid Vial
Crystal Slag

Crystal Slag
Sharpening Stone
Sharp Crystal

Magical Polearm
Sharp Crystal
Scythe of Razing

Wasteland Scythe

Wasteland Scythe

Item Needed
Quantity

Acid Vial
1

Blackened Dust
2

Cobalt Shaft
2

Cracked Gear
1

Glassed Sand2
1

Sharpening Stone
1

Wasteland Scythe

1st Ingredient
2nd Ingredient
Result

Cracked Gear
Blackened Dust
Average Gear

Average Gear
Blackened Dust
Perfect Gear

Cobalt Shaft
Cobalt Shaft
Cobalt Pole

Cobalt Pole
Perfect Gear
Excellent Polearm

Glassed Sand
Acid Vial
Crystal Slag

Crystal Slag
Sharpening Stone
Sharp Crystal

Excellent Polearm
Sharp Crystal
Wasteland Scythe

Silver Scythe

Silver Scythe

Item Needed
Quantity

Blackened Dust
1

Cracked Gear
1

Reflector Shard
1

Sharpening Stone
1

Silver Shaft3
2

Silver Scythe

1st Ingredient
2nd Ingredient
Result

Sharpening Stone
Reflector Shard
Curved Blade

Cracked Gear
Blackened Dust
Average Gear

Silver Shaft
Silver Shaft
Silver Pole

Silver Pole
Average Gear
Quality Polearm

Curved Blade
Quality Polearm
Silver Scythe

Makeshift Scythe

Makeshift Scythe

Item Needed
Quantity

Copper Shaft
2

Cracked Gear
1

Reflector Shard
1

Sharpening Stone
1

Makeshift Scythe

1st Ingredient
2nd Ingredient
Result

Copper Shaft
Copper Shaft
Copper Pole

Copper Pole
Cracked Gear
Basic Polearm

Sharpening Stone
Reflector Shard
Curved Blade

Basic Polearm
Curved Blade
Makeshift Scythe

Shades

Solid Shades - +2 Strength in Wasteland

Desert Shades - +1 Strength in Wasteland

Solid Shades

Solid Shades

Item Needed
Quantity

Brass Wiring
4

Crystal Lens
2

Wolf Rune
1

Solid Shades

1st Ingredient
2nd Ingredient
Result

Brass Wiring
Brass Wiring
Brass Framework

Brass Framework
Crystal Lens
Desert Monocle

Brass Framework
Crystal Lens
Desert Monocle

Desert Monocle
Wolf Rune
Solid Monocle

Solid Monocle
Desert Monocle
Solid Shades

Desert Shades

Desert Shades

Item Needed
Quantity

Brass Wiring
4

Crystal Lens
2

Desert Shades

1st Ingredient
2nd Ingredient
Result

Brass Wiring
Brass Wiring
Brass Framework

Brass Framework
Crystal Lens
Desert Monocle

Brass Framework
Crystal Lens
Desert Monocle

Desert Monocle
Desert Monocle
Desert Shades

Boots

Boots of Walking - +50 Chakra per mission, +1 Range

Wasteland Boots - +20 Chakra per mission

Quality Boots - +10 Chakra per mission

Fur Lined Boots - +5 Chakra per mission

Boots of Walking

Boots of Walking

Item Needed
Quantity

Acid Vial
1

Indestructible Thread
1

Mantis Rune
1

Rubber Bits
2

Wasteland Hide Piece
4

Boots of Walking

1st Ingredient
2nd Ingredient
Result

Rubber Bits
Rubber Bits
Rubber Pile

Rubber Pile
Acid Vial
Rubber Base

Wasteland Hide Piece
Wasteland Hide Piece
Two Wasteland Hides

Two Wasteland Hides
Wasteland Hide Piece
Three Wasteland Hides

Three Wasteland Hides
Wasteland Hide Piece
Four Wasteland Hides

Rubber Base
Four Wasteland Hides
Wasteland Boot Design

Wasteland Boot Design
Mantis Rune
Magical Boot Design

Magical Boot Design
Indestructible Thread
Boots of Walking

Wasteland Boots

Wasteland Boots

Item Needed
Quantity

Acid Vial
1

Indestructible Thread
1

Rubber Bits
2

Wasteland Hide Piece
4

Wasteland Boots

1st Ingredient
2nd Ingredient
Result

Rubber Bits
Rubber Bits
Rubber Pile

Rubber Pile
Acid Vial
Rubber Base

Wasteland Hide Piece
Wasteland Hide Piece
Two Wasteland Hides

Two Wasteland Hides
Wasteland Hide Piece
Three Wasteland Hides

Three Wasteland Hides
Wasteland Hide Piece
Four Wasteland Hides

Rubber Base
Four Wasteland Hides
Wasteland Boot Design

Wasteland Boot Design
Indestructible Thread
Wasteland Boots

Quality Boots

Quality Boots

Item Needed
Quantity

Acid Vial
1

Quality Fur Piece
4

Rubber Bits
2

Quality Boots

1st Ingredient
2nd Ingredient
Result

Rubber Bits
Rubber Bits
Rubber Pile

Rubber Pile
Acid Vial
Rubber Base

Quality Fur Piece
Quality Fur Piece
Two Quality Furs

Two Quality Furs
Quality Fur Piece
Three Quality Furs

Three Quality Furs
Quality Fur Piece
Four Quality Furs

Four Quality Furs
Rubber Base
Quality Boot Design

Quality Boot Design
Filtered Thread
Quality Boots

Fur Lined Boots

Fur Lined Boots

Item Needed
Quantity

Acid Vial
1

Filtered Thread
1

Regular Fur Piece
4

Rubber Bits
2

Fur Lined Boots

1st Ingredient
2nd Ingredient
Result

Rubber Bits
Rubber Bits
Rubber Pile

Rubber Pile
Acid Vial
Rubber Base

Regular Fur Piece
Regular Fur Piece
Two Regular Furs

Two Regular Furs
Regular Fur Piece
Three Regular Furs

Three Regular Furs
Regular Fur Piece
Four Regular Furs

Four Regular Furs
Rubber Base
Regular Boot Design

Regular Boot Design
Filtered Thread
Fur Lined Boots

Cowls

Cowl of the Second HoCage - +5 Sandstorm MPH per mission, +1 Range

Wasteland Cowl - +3 Sandstorm MPH per mission

Dark Cowl - +2 Sandstorm MPH per mission

Basic Cowl - +1 Sandstorm MPH per mission

Cowl of the Second HoCage

Cowl of the Second HoCage

Item Needed
Quantity

Indestructible Thread
1

Snake Rune
1

Wasteland Hide Piece
6

Cowl of the Second HoCage

1st Ingredient
2nd Ingredient
Result

Wasteland Hide Piece
Wasteland Hide Piece
Two Wasteland Hides

Two Wasteland Hides
Wasteland Hide Piece
Three Wasteland Hides

Three Wasteland Hides
Wasteland Hide Piece
Four Wasteland Hides

Four Wasteland Hides
Wasteland Hide Piece
Five Wasteland Hides

Five Wasteland Hides
Wasteland Hide Piece
Six Wasteland Hides

Six Wasteland Hides
Snake Rune
Magical Hide Pattern

Magical Hide Pattern
Indestructible Thread
Cowl of the Second HoCage

Wasteland Cowl

Wasteland Cowl

Item Needed
Quantity

Indestructible Thread
1

Wasteland Hide Piece
6

Wasteland Cowl

1st Ingredient
2nd Ingredient
Result

Wasteland Hide Piece
Wasteland Hide Piece
Two Wasteland Hides

Two Wasteland Hides
Wasteland Hide Piece
Three Wasteland Hides

Three Wasteland Hides
Wasteland Hide Piece
Four Wasteland Hides

Four Wasteland Hides
Wasteland Hide Piece
Five Wasteland Hides

Five Wasteland Hides
Wasteland Hide Piece
Six Wasteland Hides

Six Wasteland Hides
Indestructible Thread
Wasteland Cowl

Dark Cowl

Dark Cowl

Item Needed
Quantity

Filtered Thread
1

Quality Fur Piece
6

Dark Cowl

1st Ingredient
2nd Ingredient
Result

Quality Fur Piece
Quality Fur Piece
Two Quality Furs

Two Quality Furs
Quality Fur Piece
Three Quality Furs

Three Quality Furs
Quality Fur Piece
Four Quality Furs

Four Quality Furs
Quality Fur Piece
Five Quality Furs

Five Quality Furs
Quality Fur Piece
Six Quality Furs

Six Quality Furs
Filtered Thread
Dark Cowl

Basic Cowl

Basic Cowl

Item Needed
Quantity

Filtered Thread
1

Regular Fur Piece
6

Basic Cowl

1st Ingredient
2nd Ingredient
Result

Regular Fur Piece
Regular Fur Piece
Two Regular Furs

Two Regular Furs
Regular Fur Piece
Three Regular Furs

Three Regular Furs
Regular Fur Piece
Four Regular Furs

Four Regular Furs
Regular Fur Piece
Five Regular Furs

Five Regular Furs
Regular Fur Piece
Six Regular Furs

Six Regular Furs
Filtered Thread
Basic Cowl

Footnotes

1. 2 Ceramic Tiles can be substituted for the Wooden Tiles

2. A Crystal Lens can be substituted for the Glassed Sand

3. 2 Cobalt Shafts can be substituted for the Silver Shafts

                                guideswasteland

page revision: 28, last edited: 10 Feb 2010 14:25

            Edit
Tags
Discuss (3)
History
Files
Print
Site tools
+ Options

    Edit Sections
    Append
    Edit Meta
    Watchers
    Backlinks
    Page Source
    Parent
    Lock Page
    Rename
    Delete

    Help
     |
    Terms of Service
     |
    Privacy
     |
    Report a bug
     |
    Flag as objectionable

Powered by Wikidot.com

                    Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License

        Click here to edit contents of this page.

        Click here to toggle editing of individual sections of the page (if possible).         Watch headings for an "edit" link when available.

        Append content without editing the whole page source.

        Check out how this page has evolved in the past.

        If you want to discuss contents of this page - this is the easiest way to do it.

        View and manage file attachments for this page.

        A few useful tools to manage this Site.

        See pages that link to and include this page.

        Change the name (also URL address, possibly the category) of the page.

        View wiki source for this page without editing.

        View/set parent page (used for creating breadcrumbs and structured layout).

            Notify administrators if there is objectionable content in this page.

            Something does not work as expected? Find out what you can do.

            General Wikidot.com documentation and help section.

            Wikidot.com Terms of Service - what you can, what you should not etc.

            Wikidot.com Privacy Policy.


text:
@interface NSDictionary (JSONString)
-(NSString *)JSONString;
@end


text:
package org.jitsi.jirecon;

import java.text.*;
import java.util.*;

import net.java.sip.communicator.impl.protocol.jabber.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*;
import org.jitsi.jirecon.TaskManagerEvent.*;
import org.jitsi.jirecon.protocol.extension.*;
import org.jitsi.jirecon.utils.*;
import org.jitsi.service.configuration.*;
import org.jitsi.service.libjitsi.*;
import org.jitsi.util.*;
import org.jivesoftware.smack.*;
import org.jivesoftware.smack.provider.*;
import org.jivesoftware.smackx.*;

/**
 * The manager of <tt>Task</tt>s. Each <tt>Task</tt> represents a
 * recording task for a specific Jitsi Meet conference.
 *
 * @author lishunyang
 */
public class TaskManager
    implements JireconEventListener
{
    /**
     * The <tt>Logger</tt> used by the <tt>TaskManager</tt> class and its
     * instances to print debug information.
     */
    private static final Logger logger = Logger.getLogger(TaskManager.class);

    /**
     * List of <tt>EventListener</tt>.
     */
    private List<JireconEventListener> listeners =
        new ArrayList<JireconEventListener>();

    /**
     * The <tt>XMPPConnection</tt> used by this <tt>TaskManager</tt> (shared
     * between all <tt>JireconTask</tt>s).
     */
    private XMPPConnection connection;

    /**
     * Maps an ID of a Jitsi Meet conference (the JID of the MUC) to the
     * <tt>JireconTask</tt> for the conference.
     */
    private final Map<String, Task> tasks = new HashMap<String, Task>();

    /**
     * The base directory to save recording files. <tt>JireconImpl</tt> will
     * save each recording in its own subdirectory of the base directory.
     */
    private String baseOutputDir;

    /**
     * Indicates whether <tt>JireconImpl</tt> has been initialized.
     */
    private boolean isInitialized = false;

    /**
     * Initialize <tt>Jirecon</tt>.
     *

     * Once this method has been executed successfully, <tt>Jirecon</tt> should
     * be ready to start working.
     *
     * Start Libjitsi, load configuration file and create connection with XMPP
     * server.
     *
     * @param configurationPath is the configuration file path.
     * @throws Exception if failed to initialize Jirecon.
     *
     */
    synchronized public void init(String configurationPath)
        throws Exception
    {
        logger.info("Initialize.");

        if (isInitialized)
        {
            logger.warn("Already initialized: ", new Throwable());
            return;
        }

        initializePacketProviders();

        LibJitsi.start();

        System.setProperty(
                ConfigurationService.PNAME_CONFIGURATION_FILE_NAME,
                configurationPath);
        System.setProperty(
                ConfigurationService.PNAME_CONFIGURATION_FILE_IS_READ_ONLY,
                "true");
        final ConfigurationService cfg = LibJitsi.getConfigurationService();

        baseOutputDir =
            cfg.getString(ConfigurationKey.SAVING_DIR_KEY);
        if (StringUtils.isNullOrEmpty(baseOutputDir))
        {
            throw new Exception("Failed to initialize Jirecon: output "+
                                        "directory not set.");
        }

        // Remove the suffix '/'
        if (baseOutputDir.endsWith("/"))
        {
            baseOutputDir =
                baseOutputDir.substring(0, baseOutputDir.length() - 1);
        }

        final String xmppHost = cfg.getString(ConfigurationKey.XMPP_HOST_KEY);
        final int xmppPort = cfg.getInt(ConfigurationKey.XMPP_PORT_KEY, -1);
        final String xmppUser = cfg.getString(ConfigurationKey.XMPP_USER_KEY);
        final String xmppPass = cfg.getString(ConfigurationKey.XMPP_PASS_KEY);

        try
        {
            connect(xmppHost, xmppPort, xmppUser, xmppPass);
        }
        catch (XMPPException e)
        {
            logger.info("Failed to initialize Jirecon: " + e);
            uninit();
            throw e;
        }

        isInitialized = true;
    }

    /**
     * Uninitialize <tt>Jirecon</tt>, prepare for GC.
     *

     * Warning:</tt> If there are any residue <tt>JireconTask</tt>s,
     * </tt>Jirecon</tt> will stop them and notify <tt>JireconEventListener</tt>
     * s.
     *
     * Stop Libjitsi and close connection with XMPP server.
     *
     */
    synchronized public void uninit()
    {
        logger.info("Un-initialize");
        if (!isInitialized)
        {
            logger.warn("Not initialized: ", new Throwable());
            return;
        }

        synchronized (tasks)
        {
            for (Task task : tasks.values())
            {
                task.uninit(true);
            }
        }
        closeConnection();
        LibJitsi.stop();
    }

    /**
     * Create a new recording task for a specified Jitsi-meeting.
     *

     * Warning: This method is asynchronous, it will return
     * immediately regardless of whether the task has been started successfully.
     * Note that a return value of <tt>false</tt> means that the task has
     * failed to start, while a return value of <tt>true</tt> does not guarantee
     * success.
     *
     * @param mucJid indicates the Jitsi Meet conference to record.
     * @return <tt>true</tt> if the task was initiated asynchronously (and its
     * success is unknown), or <tt>false</tt> if the task failed to be initiated.
     */
    public boolean startJireconTask(String mucJid)
    {
        logger.info("Starting jirecon task: " + mucJid);

        Task task;
        synchronized (tasks)
        {
            if (tasks.containsKey(mucJid))
            {
                logger.info("Not starting duplicate task: " + mucJid);
                return false;
            }
            task = new Task();
            tasks.put(mucJid, task);
        }

        String outputDir =
            baseOutputDir + "/" + mucJid
                + new SimpleDateFormat("-yyMMdd-HHmmss").format(new Date());

        task.addEventListener(this);
        task.init(mucJid, connection, outputDir);

        task.start();
        return true;
    }

    /**
     * Stops a recording task for a specified Jitsi Meet conference.
     *
     * @param mucJid the MUC JID of the Jitsi Meet conference to stop.
     * @param keepData Whether to keep the output files or delete them.
     * @return <tt>true</tt> if the task was stopped successfully and
     * <tt>false</tt> otherwise.
     */
    public boolean stopJireconTask(String mucJid, boolean keepData)
    {
        logger.info("Stopping task: " + mucJid);

        Task task;
        synchronized (tasks)
        {
            task = tasks.remove(mucJid);
        }

        if (task == null)
        {
            logger.info("Failed to stop non-existent task: " + mucJid);
            return false;
        }
        else
        {
            task.stop();
            task.uninit(keepData);
        }
        return true;
    }

    /**
     * Creates {@link #connection} and connects to the XMPP server.
     *
     * @param xmppHost is the host name of XMPP server.
     * @param xmppPort is the port of XMPP server.
     * @param xmppUser the XMPP username to use (should NOT include the domain).
     * Use <tt>null</tt> to login anonymously.
     * @param xmppPass the XMPP password.
     * @throws XMPPException in case of failure to connect and login.
     */
    private void connect(String xmppHost, int xmppPort,
                         String xmppUser, String xmppPass)
        throws XMPPException
    {
        ConnectionConfiguration conf =
            new ConnectionConfiguration(xmppHost, xmppPort);
        connection = new XMPPConnection(conf);
        connection.connect();

        // Register Jingle Features.
        ServiceDiscoveryManager discoManager
            = ServiceDiscoveryManager.getInstanceFor(connection);
        if (discoManager != null)
        {
            discoManager.addFeature(
                ProtocolProviderServiceJabberImpl.URN_XMPP_JINGLE_RTP_VIDEO);
            discoManager.addFeature(
                ProtocolProviderServiceJabberImpl.URN_XMPP_JINGLE_RTP_AUDIO);
            discoManager.addFeature(
                ProtocolProviderServiceJabberImpl.URN_XMPP_JINGLE_ICE_UDP_1);

            // XXX(gp) I'm hard coding the dtls-sctp feature here because it is
            // not yet part of ProtocolProviderServiceJabberImpl. I'm unsure if
            // it should be.
            discoManager.addFeature("urn:xmpp:jingle:transports:dtls-sctp:1");
        }
        else
        {
            logger.warn("Failed to register disco#info features.");
        }

        // Login either anonymously or with a provided username & password.
        if (StringUtils.isNullOrEmpty(xmppUser)
            || StringUtils.isNullOrEmpty(xmppPass))
        {
            logger.info("Logging in as XMPP client anonymously.");
            connection.loginAnonymously();
        }
        else
        {
            logger.info("Logging in as XMPP client using: host=" + xmppHost
                        + "; port=" + xmppPort + "; user=" + xmppUser);
            connection.login(xmppUser, xmppPass);
        }
    }

    /**
     * Closes the XMPP connection.
     */
    private void closeConnection()
    {
        logger.info("Closing the XMPP connection.");
        if (connection != null && connection.isConnected())
            connection.disconnect();
    }

    /**
     * Register our <tt>PacketExtensionProvider</tt>s with Smack's
     * <tt>ProviderManager</tt>.
     */
    private void initializePacketProviders()
    {
        ProviderManager providerManager = ProviderManager.getInstance();

        providerManager.addIQProvider(
                JingleIQ.ELEMENT_NAME,
                JingleIQ.NAMESPACE,
                new JingleIQProvider());
        providerManager.addExtensionProvider(
                MediaExtension.ELEMENT_NAME,
                MediaExtension.NAMESPACE,
                new MediaExtensionProvider());
        providerManager.addExtensionProvider(
                SctpMapExtension.ELEMENT_NAME,
                SctpMapExtension.NAMESPACE,
                new SctpMapExtensionProvider());
    }

    /**
     * Adds a <tt>JireconEventListener</tt>.
     *
     * @param listener the <tt>JireconEventListener</tt> to add.
     */
    public void addEventListener(JireconEventListener listener)
    {
        logger.info("Adding JireconEventListener: " + listener);
        listeners.add(listener);
    }

    /**
     * Removes a <tt>JireconEventListener</tt>.
     *
     * @param listener the <tt>JireconEventListener</tt> to remove.
     */
    public void removeEventListener(JireconEventListener listener)
    {
        logger.info("Removing JireconEventListener: " + listener);
        listeners.remove(listener);
    }

    /**
     * {@inheritDoc}
     *
     * Implements {@link JireconEventListener#handleEvent(TaskManagerEvent)}.
     */
    @Override
    public void handleEvent(TaskManagerEvent evt)
    {
        String mucJid = evt.getMucJid();

        switch (evt.getType())
        {
        case TASK_ABORTED:
            stopJireconTask(mucJid, false);
            logger.info("Recording task of MUC " + mucJid + " failed.");
            fireEvent(evt);
            break;
        case TASK_FINISED:
            stopJireconTask(mucJid, true);
            logger.info("Recording task of MUC: " + mucJid
                + " finished successfully.");
            fireEvent(evt);
            break;
        case TASK_STARTED:
            logger.info("Recording task of MUC " + mucJid + " started.");
            fireEvent(evt);
            break;
        default:
            break;
        }
    }

    /**
     * Notifies the registered <tt>JireconEventListener</tt> of a
     * <tt>TaskManagerEvent</tt>.
     *
     * @param evt the event to send.
     */
    private void fireEvent(TaskManagerEvent evt)
    {
        for (JireconEventListener l : listeners)
        {
            l.handleEvent(evt);
        }
    }
}


text:
#pragma once

#include "../impl/Common.h"
#include "../Task.h"
#include "../util/ContextRef.h"
#include "../util/MoveOnCopy.h"
#include <boost/asio/async_result.hpp>
#include <boost/asio/handler_type.hpp>
#include <boost/system/system_error.hpp>

namespace ut { namespace asio {

template <class Context>
struct AsTask;

template <>
struct AsTask<std::shared_ptr<void>>
{
    std::shared_ptr<void> ctx;

    AsTask(std::shared_ptr<void> ctx) _ut_noexcept
        : ctx(std::move(ctx)) { }

    AsTask(AsTask&& other) _ut_noexcept
        : ctx(std::move(other.ctx)) { }

    AsTask& operator=(AsTask&& other) _ut_noexcept
    {
        ut_assert(this != &other);

        ctx = std::move(other.ctx);

        return *this;
    }
};

template <>
struct AsTask<Nothing>
{
    AsTask<std::shared_ptr<void>> operator[](
        std::shared_ptr<void> ctx) const _ut_noexcept
    {
        return AsTask<std::shared_ptr<void>>(std::move(ctx));
    }

    template <class U, class Alloc>
    AsTask<std::shared_ptr<void>> operator[](
        const ContextRef<U, Alloc>& ctx) const _ut_noexcept
    {
        return (*this)[ctx.ptr()];
    }
};

#if defined(_MSC_VER) && _MSC_VER < 1900
const AsTask<Nothing> asTask {};
#else
constexpr AsTask<Nothing> asTask {};
#endif

namespace detail
{
    template <class R>
    class AsTaskHandlerBase
    {
    public:
        void initialize(Promise<R>&& promise) _ut_noexcept
        {
            mPromise = makeUncheckedMoveOnCopy(std::move(promise));
        }

        template <class U>
        void operator()(const boost::system::error_code& ec, U&& result) _ut_noexcept
        {
            Promise<R> promise = mPromise.take();

            if (promise.isCompletable()) {
                if (ec)
                    promise.fail(boost::system::system_error(ec));
                else
                    promise.complete(std::forward<U>(result));
            }
        }

    protected:
        AsTaskHandlerBase() _ut_noexcept
            : mPromise(Promise<R>()) { }

    private:
        UncheckedMoveOnCopy<Promise<R>> mPromise;
    };

    template <>
    class AsTaskHandlerBase<void>
    {
    public:
        void initialize(Promise<void>&& promise) _ut_noexcept
        {
            mPromise = makeUncheckedMoveOnCopy(std::move(promise));
        }

        void operator()(const boost::system::error_code& ec) _ut_noexcept
        {
            Promise<void> promise = mPromise.take();

            if (promise.isCompletable()) {
                if (ec)
                    promise.fail(boost::system::system_error(ec));
                else
                    promise.complete();
            }
        }

    protected:
        AsTaskHandlerBase() _ut_noexcept
            : mPromise(Promise<void>()) { }

    private:
        UncheckedMoveOnCopy<Promise<void>> mPromise;
    };

    template <class R, class Context>
    class AsTaskHandler : public AsTaskHandlerBase<R>
    {
    public:
        explicit AsTaskHandler(AsTask<Context> /* tag */) _ut_noexcept { }
    };

    template <class R>
    class AsTaskHandler<R, std::shared_ptr<void>> : public AsTaskHandlerBase<R>
    {
    public:
        explicit AsTaskHandler(AsTask<std::shared_ptr<void>> tag) _ut_noexcept
            : mCtx(std::move(tag.ctx)) { }

    private:
        std::shared_ptr<void> mCtx;
    };
}

} } // ut::asio

namespace boost { namespace asio {

template <class R, class Context>
class async_result<ut::asio::detail::AsTaskHandler<R, Context>>
{
public:
    using type = ut::Task<R>;

    explicit async_result(ut::asio::detail::AsTaskHandler<R, Context>& handler) _ut_noexcept
    {
        handler.initialize(mTask.takePromise());
    }

    ut::Task<R> get() _ut_noexcept
    {
        return std::move(mTask);
    }

private:
    async_result(const async_result& other) = delete;
    async_result& operator=(const async_result& other) = delete;

    ut::Task<R> mTask;
};

template <class Context>
struct handler_type<ut::asio::AsTask<Context>, void(boost::system::error_code)>
{
    using type = ut::asio::detail::AsTaskHandler<void, Context>;
};

template <class R, class Context>
struct handler_type<ut::asio::AsTask<Context>, void(boost::system::error_code, R)>
{
    using type = ut::asio::detail::AsTaskHandler<R, Context>;
};

} } // boost::asio


text: The Blue Print for a Restaurant


text:
namespace Cedar.CommandHandling
{
    using System;
    using System.Net;
    using Cedar.CommandHandling.Http;
    using Shouldly;
    using Xunit;

    public class HttpProblemDetailsTests
    {
        [Fact]
        public void Can_create_exception_with_status_code()
        {
            var sut = new HttpProblemDetails { Status = (int)HttpStatusCode.BadRequest };

            sut.Status.ShouldBe((int)HttpStatusCode.BadRequest);
        }

        [Fact]
        public void When_setting_type_with_a_relative_uri_should_throw()
        {
            var sut = new HttpProblemDetails { Status = (int)HttpStatusCode.BadRequest };

            Action act = () => sut.Type = "/relative";

            act.ShouldThrow<InvalidOperationException>();
        }

        [Fact]
        public void When_setting_instance_with_a_relative_uri_should_throw()
        {
            var sut = new HttpProblemDetails { Status = (int)HttpStatusCode.BadRequest };

            Action act = () => sut.Instance = "/relative";

            act.ShouldThrow<InvalidOperationException>();
        }
    }
}


text:
import React, {PropTypes} from 'react';
import Radium, {Style} from 'radium';
import classNames from 'classnames';

import colors from '../colors';

@Radium
class MenuBtn extends React.Component {
  static propTypes = {
    isArrow: PropTypes.bool.isRequired
  };

  static contextTypes = {
    season: PropTypes.string
  };

  render () {
    return (


text:
import samePageCheckGenerator from 'kolibri.utils.samePageCheckGenerator';
import { ExamResource, ExamLogResource, FacilityUserResource } from 'kolibri.resources';
import { createTranslator } from 'kolibri.utils.i18n';
import router from 'kolibri.coreVue.router';
import { PageNames } from '../../constants';
import { _createExam, _examState } from '../shared/exams';

export function setExamsModal(store, modalName) {
  store.commit('SET_EXAMS_MODAL', modalName);
}

const snackbarTranslator = createTranslator('ExamReportSnackbarTexts', {
  changesToExamSaved: 'Changes to exam saved',
  copiedExamToClass: 'Copied exam to { className }',
  examDeleted: 'Exam deleted',
  examIsNowActive: 'Exam is now active',
  examIsNowInactive: 'Exam is now inactive',
});

function updateExamStatus(store, { examId, isActive }) {
  return ExamResource.saveModel({
    id: examId,
    data: { active: isActive },
  }).then(
    () => {
      store.commit('SET_EXAM_STATUS', { examId, isActive });
      store.dispatch('setExamsModal', false);
      store.dispatch(
        'createSnackbar',
        {
          text: snackbarTranslator.$tr(isActive ? 'examIsNowActive' : 'examIsNowInactive'),
          autoDismiss: true,
        },
        { root: true }
      );
    },
    error => store.dispatch('handleError', error, { root: true })
  );
}

export function activateExam(store, examId) {
  return updateExamStatus(store, { examId, isActive: true });
}

export function deactivateExam(store, examId) {
  return updateExamStatus(store, { examId, isActive: false });
}

export function copyExam(store, { exam, className }) {
  store.commit('CORE_SET_PAGE_LOADING', true, { root: true });
  _createExam(store, exam).then(
    () => {
      store.commit('CORE_SET_PAGE_LOADING', false, { root: true });
      store.dispatch('setExamsModal', false);
      store.dispatch(
        'createSnackbar',
        {
          text: snackbarTranslator.$tr('copiedExamToClass', { className }),
          autoDismiss: true,
        },
        { root: true }
      );
    },
    error => store.dispatch('handleApiError', error, { root: true })
  );
}

export function updateExamDetails(store, { examId, payload }) {
  store.commit('CORE_SET_PAGE_LOADING', true, { root: true });
  return new Promise((resolve, reject) => {
    ExamResource.saveModel({
      id: examId,
      data: payload,
    }).then(
      exam => {
        const exams = store.state.exams;
        const examIndex = exams.findIndex(exam => exam.id === examId);
        exams[examIndex] = _examState(exam);

        store.commit('SET_EXAMS', exams);
        store.dispatch('setExamsModal', false);
        store.dispatch(
          'createSnackbar',
          {
            text: snackbarTranslator.$tr('changesToExamSaved'),
            autoDismiss: true,
          },
          { root: true }
        );
        store.commit('CORE_SET_PAGE_LOADING', false, { root: true });
        resolve();
      },
      error => {
        store.commit('CORE_SET_PAGE_LOADING', false, { root: true });
        reject(error);
      }
    );
  });
}

export function deleteExam(store, examId) {
  return ExamResource.deleteModel({ id: examId }).then(
    () => {
      const exams = store.state.exams;
      const updatedExams = exams.filter(exam => exam.id !== examId);
      store.commit('SET_EXAMS', updatedExams);

      router.replace({ name: PageNames.EXAMS });
      store.dispatch(
        'createSnackbar',
        {
          text: snackbarTranslator.$tr('examDeleted'),
          autoDismiss: true,
        },
        { root: true }
      );
      store.dispatch('setExamsModal', false);
    },
    error => store.dispatch('handleError', error, { root: true })
  );
}

export function setTableData(store, params) {
  const { examId, classId } = params;
  const { learnerGroups } = store.state;
  const isSamePage = params.isSamePage || samePageCheckGenerator(store);
  const promises = [
    ExamLogResource.fetchCollection({
      getParams: { exam: examId, collection: classId },
      force: true,
    }),
    FacilityUserResource.fetchCollection({ getParams: { member_of: classId } }),
  ];
  return Promise.all(promises).then(([examLogs, facilityUsers]) => {
    const examReportData = facilityUsers.map(user => {
      const examTakenByUser = examLogs.find(examLog => String(examLog.user) === user.id) || {};
      const learnerGroup = learnerGroups.find(group => group.user_ids.indexOf(user.id) > -1) || {};
      return {
        id: user.id,
        name: user.full_name,
        group: learnerGroup,
        score: examTakenByUser.score,
        progress: examTakenByUser.progress,
        closed: examTakenByUser.closed,
      };
    });
    if (isSamePage()) {
      store.commit('SET_EXAM_REPORT_TABLE_DATA', examReportData);
    }
  });
}


text:
layout: null
---
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns:moz="http://www.mozilla.org/2006/browser/search/"
      xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>{{ site.title }}</ShortName>
  <Description>Search {{ site.title }}</Description>
  <InputEncoding>UTF-8</InputEncoding>
  <Image type="image/x-icon" width="16" height="16">{{ '/assets/img/favicon.ico' | relative_url }}</Image>
  <Url method="get" type="text/html"
      template="http://www.google.com/search?q={searchTerms}+site%3A{{ site.url | remove_first:'http://' | remove_first:'https://' | remove_first:'www.' }}&hl=en"/>
</OpenSearchDescription>


text:
/**
 * This code was generated by
 * \ / _    _  _|   _  _
 *  | (_)\/(_)(_|\/| |(/_  v1.0.0
 *       /       /
 */

import Page = require('../../../../base/Page');
import Response = require('../../../../http/response');
import V1 = require('../../V1');
import { SerializableClass } from '../../../../interfaces';

/**
 * Initialize the TrustProductsEntityAssignmentsList
 *
 * @param version - Version of the resource
 * @param trustProductSid - The unique string that identifies the TrustProduct resource.
 */
declare function TrustProductsEntityAssignmentsList(version: V1, trustProductSid: string): TrustProductsEntityAssignmentsListInstance;

interface TrustProductsEntityAssignmentsListInstance {
  /**
   * @param sid - sid of instance
   */
  (sid: string): TrustProductsEntityAssignmentsContext;
  /**
   * create a TrustProductsEntityAssignmentsInstance
   *
   * @param opts - Options for request
   * @param callback - Callback to handle processed record
   */
  create(opts: TrustProductsEntityAssignmentsListInstanceCreateOptions, callback?: (error: Error | null, item: TrustProductsEntityAssignmentsInstance) => any): Promise<TrustProductsEntityAssignmentsInstance>;
  /**
   * Streams TrustProductsEntityAssignmentsInstance records from the API.
   *
   * This operation lazily loads records as efficiently as possible until the limit
   * is reached.
   *
   * The results are passed into the callback function, so this operation is memory
   * efficient.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Function to process each record
   */
  each(callback?: (item: TrustProductsEntityAssignmentsInstance, done: (err?: Error) => void) => void): void;
  /**
   * Streams TrustProductsEntityAssignmentsInstance records from the API.
   *
   * This operation lazily loads records as efficiently as possible until the limit
   * is reached.
   *
   * The results are passed into the callback function, so this operation is memory
   * efficient.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param opts - Options for request
   * @param callback - Function to process each record
   */
  each(opts?: TrustProductsEntityAssignmentsListInstanceEachOptions, callback?: (item: TrustProductsEntityAssignmentsInstance, done: (err?: Error) => void) => void): void;
  /**
   * Constructs a trust_products_entity_assignments
   *
   * @param sid - The unique string that identifies the resource
   */
  get(sid: string): TrustProductsEntityAssignmentsContext;
  /**
   * Retrieve a single target page of TrustProductsEntityAssignmentsInstance records
   * from the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Callback to handle list of records
   */
  getPage(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsPage) => any): Promise<TrustProductsEntityAssignmentsPage>;
  /**
   * Retrieve a single target page of TrustProductsEntityAssignmentsInstance records
   * from the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param targetUrl - API-generated URL for the requested results page
   * @param callback - Callback to handle list of records
   */
  getPage(targetUrl?: string, callback?: (error: Error | null, items: TrustProductsEntityAssignmentsPage) => any): Promise<TrustProductsEntityAssignmentsPage>;
  /**
   * Lists TrustProductsEntityAssignmentsInstance records from the API as a list.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Callback to handle list of records
   */
  list(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance[]) => any): Promise<TrustProductsEntityAssignmentsInstance[]>;
  /**
   * Lists TrustProductsEntityAssignmentsInstance records from the API as a list.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param opts - Options for request
   * @param callback - Callback to handle list of records
   */
  list(opts?: TrustProductsEntityAssignmentsListInstanceOptions, callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance[]) => any): Promise<TrustProductsEntityAssignmentsInstance[]>;
  /**
   * Retrieve a single page of TrustProductsEntityAssignmentsInstance records from
   * the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Callback to handle list of records
   */
  page(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsPage) => any): Promise<TrustProductsEntityAssignmentsPage>;
  /**
   * Retrieve a single page of TrustProductsEntityAssignmentsInstance records from
   * the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param opts - Options for request
   * @param callback - Callback to handle list of records
   */
  page(opts?: TrustProductsEntityAssignmentsListInstancePageOptions, callback?: (error: Error | null, items: TrustProductsEntityAssignmentsPage) => any): Promise<TrustProductsEntityAssignmentsPage>;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

/**
 * Options to pass to create
 *
 * @property objectSid - The sid of an object bag
 */
interface TrustProductsEntityAssignmentsListInstanceCreateOptions {
  objectSid: string;
}

/**
 * Options to pass to each
 *
 * @property callback -
 *                         Function to process each record. If this and a positional
 *                         callback are passed, this one will be used
 * @property done - Function to be called upon completion of streaming
 * @property limit -
 *                         Upper limit for the number of records to return.
 *                         each() guarantees never to return more than limit.
 *                         Default is no limit
 * @property pageSize -
 *                         Number of records to fetch per request,
 *                         when not set will use the default value of 50 records.
 *                         If no pageSize is defined but a limit is defined,
 *                         each() will attempt to read the limit with the most efficient
 *                         page size, i.e. min(limit, 1000)
 */
interface TrustProductsEntityAssignmentsListInstanceEachOptions {
  callback?: (item: TrustProductsEntityAssignmentsInstance, done: (err?: Error) => void) => void;
  done?: Function;
  limit?: number;
  pageSize?: number;
}

/**
 * Options to pass to list
 *
 * @property limit -
 *                         Upper limit for the number of records to return.
 *                         list() guarantees never to return more than limit.
 *                         Default is no limit
 * @property pageSize -
 *                         Number of records to fetch per request,
 *                         when not set will use the default value of 50 records.
 *                         If no page_size is defined but a limit is defined,
 *                         list() will attempt to read the limit with the most
 *                         efficient page size, i.e. min(limit, 1000)
 */
interface TrustProductsEntityAssignmentsListInstanceOptions {
  limit?: number;
  pageSize?: number;
}

/**
 * Options to pass to page
 *
 * @property pageNumber - Page Number, this value is simply for client state
 * @property pageSize - Number of records to return, defaults to 50
 * @property pageToken - PageToken provided by the API
 */
interface TrustProductsEntityAssignmentsListInstancePageOptions {
  pageNumber?: number;
  pageSize?: number;
  pageToken?: string;
}

interface TrustProductsEntityAssignmentsPayload extends TrustProductsEntityAssignmentsResource, Page.TwilioResponsePayload {
}

interface TrustProductsEntityAssignmentsResource {
  account_sid: string;
  date_created: Date;
  object_sid: string;
  sid: string;
  trust_product_sid: string;
  url: string;
}

interface TrustProductsEntityAssignmentsSolution {
  trustProductSid?: string;
}

declare class TrustProductsEntityAssignmentsContext {
  /**
   * Initialize the TrustProductsEntityAssignmentsContext
   *
   * @param version - Version of the resource
   * @param trustProductSid - The unique string that identifies the resource.
   * @param sid - The unique string that identifies the resource
   */
  constructor(version: V1, trustProductSid: string, sid: string);

  /**
   * fetch a TrustProductsEntityAssignmentsInstance
   *
   * @param callback - Callback to handle processed record
   */
  fetch(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance) => any): Promise<TrustProductsEntityAssignmentsInstance>;
  /**
   * remove a TrustProductsEntityAssignmentsInstance
   *
   * @param callback - Callback to handle processed record
   */
  remove(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance) => any): Promise<boolean>;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

declare class TrustProductsEntityAssignmentsInstance extends SerializableClass {
  /**
   * Initialize the TrustProductsEntityAssignmentsContext
   *
   * @param version - Version of the resource
   * @param payload - The instance payload
   * @param trustProductSid - The unique string that identifies the TrustProduct resource.
   * @param sid - The unique string that identifies the resource
   */
  constructor(version: V1, payload: TrustProductsEntityAssignmentsPayload, trustProductSid: string, sid: string);

  private _proxy: TrustProductsEntityAssignmentsContext;
  accountSid: string;
  dateCreated: Date;
  /**
   * fetch a TrustProductsEntityAssignmentsInstance
   *
   * @param callback - Callback to handle processed record
   */
  fetch(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance) => any): Promise<TrustProductsEntityAssignmentsInstance>;
  objectSid: string;
  /**
   * remove a TrustProductsEntityAssignmentsInstance
   *
   * @param callback - Callback to handle processed record
   */
  remove(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance) => any): Promise<boolean>;
  sid: string;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
  trustProductSid: string;
  url: string;
}

declare class TrustProductsEntityAssignmentsPage extends Page<V1, TrustProductsEntityAssignmentsPayload, TrustProductsEntityAssignmentsResource, TrustProductsEntityAssignmentsInstance> {
  /**
   * Initialize the TrustProductsEntityAssignmentsPage
   *
   * @param version - Version of the resource
   * @param response - Response from the API
   * @param solution - Path solution
   */
  constructor(version: V1, response: Response<string>, solution: TrustProductsEntityAssignmentsSolution);

  /**
   * Build an instance of TrustProductsEntityAssignmentsInstance
   *
   * @param payload - Payload response from the API
   */
  getInstance(payload: TrustProductsEntityAssignmentsPayload): TrustProductsEntityAssignmentsInstance;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

export { TrustProductsEntityAssignmentsContext, TrustProductsEntityAssignmentsInstance, TrustProductsEntityAssignmentsList, TrustProductsEntityAssignmentsListInstance, TrustProductsEntityAssignmentsListInstanceCreateOptions, TrustProductsEntityAssignmentsListInstanceEachOptions, TrustProductsEntityAssignmentsListInstanceOptions, TrustProductsEntityAssignmentsListInstancePageOptions, TrustProductsEntityAssignmentsPage, TrustProductsEntityAssignmentsPayload, TrustProductsEntityAssignmentsResource, TrustProductsEntityAssignmentsSolution }


text: valgrind --tool=memcheck --leak-check=yes -v ./json -b -m 10


text:
package bond;

import bond.reconcile.ReconcileType;
import com.google.common.base.Optional;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

import java.io.File;
import java.lang.reflect.Type;

/**
 *
A JUnit rule used to take care of setup and cleanup when using Bond with JUnit.
 * Instantiating a {@code BondTestRule} as a field and marking it with
 * {@link org.junit.Rule @Rule} will automatically handle all test setup/cleanup;
 * all that needs to be done besides that is to make observations using {@link Bond#spy()}.

 *
 *
For example:

 *

 *   class MyTestClass {
 *    {@literal @Rule}
 *     BondTestRule btr = new BondTestRule()
 *
 *    {@literal @Test}
 *     public void testMyMethod() {
 *       Bond.obs(...).spy();
 *     }
 *   }
 *

 */
public class BondTestRule implements TestRule {

  private Optional<File> _observationDirectory = Optional.absent();
  private Optional<ReconcileType> _reconciliationMethod = Optional.absent();
  private Serializer _serializer = new Serializer()
                                       .withFloatPrecision(Bond.DEFAULT_FLOAT_DOUBLE_PRECISION)
                                       .withDoublePrecision(Bond.DEFAULT_FLOAT_DOUBLE_PRECISION);

  /**
   * Set the observation directory to be used for this test. If not set, the environment
   * variable {@code BOND_OBSERVATION_DIR} will be used instead. If that is also not set, an
   * Exception will be thrown.
   *
   * @param observationDirectory Directory to store test observations in
   * @return This object to facilitate a builder-style pattern
   */
  public BondTestRule withObservationDirectory(File observationDirectory) {
    _observationDirectory = Optional.fromNullable(observationDirectory);
    return this;
  }

  /**
   * Set the reconciliation method to be used for this test. If not set, the environment
   * variable {@code BOND_RECONCILE} will be used instead. If that is also not set, a
   * default of {@code ABORT} will be used.
   *
   * @param reconcileType Reconciliation method to use
   * @return This object to facilitate a builder-style pattern
   */
  public BondTestRule withReconciliationMethod(ReconcileType reconcileType) {
    _reconciliationMethod = Optional.fromNullable(reconcileType);
    return this;
  }

  /**
   * Set a custom serialization method for type.
   * See {@link com.google.gson.GsonBuilder#registerTypeAdapter(Type, Object)}.
   *
   * @param type The type for this adapter to apply to
   * @param typeAdapter The adapter with custom serialization logic
   * @return This object to facilitate a builder-style pattern
   */
  public BondTestRule withTypeAdapter(Type type, Object typeAdapter) {
    _serializer = _serializer.withTypeAdapter(type, typeAdapter);
    return this;
  }

  /**
   * Set a custom serialization method for baseType and its subtypes.
   * See {@link com.google.gson.GsonBuilder#registerTypeHierarchyAdapter(Class, Object)}.
   *
   * @param baseType The baseType for this adapter to apply to
   * @param typeAdapter The adapter with custom serialization logic
   * @return This object to facilitate a builder-style pattern
   */
  public BondTestRule withTypeHierarchyAdapter(Class<?> baseType, Object typeAdapter) {
    _serializer = _serializer.withTypeHierarchyAdapter(baseType, typeAdapter);
    return this;
  }

  /**
   * Specify that for objects of type clazz, simply call toString() on the object
   * to serialize it instead of doing a full JSON serialization.
   *
   * @param clazz Type for this to apply to
   * @param <T> Same as clazz
   * @return This object to facilitate a builder-style pattern
   */
  public <T> BondTestRule withToStringSerialization(Class<T> clazz) {
    _serializer = _serializer.withToStringSerialization(clazz);
    return this;
  }

  /**
   * Set the amount of precision to be used when serializing floats and doubles.
   *
   * @param places Number of places after the decimal to keep in serialized form
   * @return This object to facilitate a builder-style pattern
   */
  public BondTestRule withFloatDoublePrecision(final int places) {
    _serializer = _serializer.withFloatPrecision(places).withDoublePrecision(places);
    return this;
  }

  /**
   * Set the amount of precision to be used when serializing doubles.
   *
   * @param places Number of places after the decimal to keep in serialized form
   * @return This object to facilitate a builder-style pattern
   */
  public BondTestRule withDoublePrecision(final int places) {
    _serializer = _serializer.withDoublePrecision(places);
    return this;
  }

  /**
   * Set the amount of precision to be used when serializing floats.
   *
   * @param places Number of places after the decimal to keep in serialized form
   * @return This object to facilitate a builder-style pattern
   */
  public BondTestRule withFloatPrecision(final int places) {
    _serializer = _serializer.withFloatPrecision(places);
    return this;
  }

  @Override
  public Statement apply(final Statement statement, Description description) {
    final String testName = String.format("%s.%s", description.getTestClass().getCanonicalName(),
        description.getMethodName());
    return new Statement() {
      @Override
      public void evaluate() throws Throwable {
        Bond.startTest(testName, _serializer);
        if (_observationDirectory.isPresent()) {
          Bond.setObservationDirectory(_observationDirectory.get());
        }
        if (_reconciliationMethod.isPresent()) {
          Bond.setReconciliationMethod(_reconciliationMethod.get());
        }
        try {
          statement.evaluate();
        } catch (Throwable e) {
          Bond.finishTest(e);
          throw e;
        }
        if (!Bond.finishTest()) {
          org.junit.Assert.fail("BOND_FAIL. Pass BOND_RECONCILE=[kdiff3|console|accept] " +
              "environment variable to reconcile the observations.");
        }
      }
    };
  }

}


text:
/*=========================================================================================
    File Name: line-multi-axis.js
    Description: Chartjs multi axis line chart
    ----------------------------------------------------------------------------------------
    Item Name: Stack - Responsive Admin Theme
    Version: 1.1
    Author: PIXINVENT
    Author URL: http://www.themeforest.net/user/pixinvent
==========================================================================================*/

// Line multi axis chart
// ------------------------------
$(window).on("load", function(){

    //Get the context of the Chart canvas element we want to select
    var ctx = $("#line-multi-axis");

    var chartOptions = {
        responsive: true,
        maintainAspectRatio: false,
        hoverMode: 'label',
        stacked: false,
        title:{
            display:true,
            text:'Chart.js Line Chart - Multi Axis'
        },
        scales: {
            xAxes: [{
                display: true,
                gridLines: {
                    offsetGridLines: false,
                    color: "#f3f3f3",
                    drawTicks: false,
                },
                scaleLabel: {
                    display: true,
                    // labelString: 'x axis'
                }
            }],
            yAxes: [{
                type: "linear", // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
                display: true,
                gridLines: {
                    color: "#f3f3f3",
                    drawTicks: false,
                },
                position: "left",
                id: "y-axis-1",
            }, {
                type: "linear", // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
                display: true,
                position: "right",
                id: "y-axis-2",

                // grid line settings
                gridLines: {
                    drawOnChartArea: false, // only want the grid lines for one axis to show up
                    color: "#f3f3f3",
                    drawTicks: false,
                },
            }],
        }
    };

    var chartData = {
        labels: ["January", "February", "March", "April", "May", "June", "July"],
        datasets: [{
            label: "My First dataset",
            data: [15, 45, -17, -42, 55, -24, 18],
            yAxisID: "y-axis-1",
            backgroundColor: "rgba(209,212,219,.4)",
            borderColor: "transparent",
            pointBorderColor: "#D1D4DB",
            pointBackgroundColor: "#FFF",
            pointBorderWidth: 2,
            pointHoverBorderWidth: 2,
            pointRadius: 4,
        }, {
            label: "My Second dataset",
            data: [-26, 44, 16, 42, -38, -9, 46],
            yAxisID: "y-axis-2",
            backgroundColor: "rgba(81,117,224,.7)",
            borderColor: "transparent",
            pointBorderColor: "#5175E0",
            pointBackgroundColor: "#FFF",
            pointBorderWidth: 2,
            pointHoverBorderWidth: 2,
            pointRadius: 4,
        }]
    };

    var config = {
        type: 'line',

        // Chart Options
        options: chartOptions,

        // Chart Data
        data : chartData
    };

    // Create the chart
    var multiAxisChart = new Chart(ctx, config);
});


text:
        <meta charset="UTF-8">

        <title></title>

Dynamic Table
 Actions:
        <button ng-click="addUser()">Add User</button>
        <button  ng-click="orderBy()">OrderBy Name</button>


text:
<?php

class ModelController extends Fenix_ModelController {

}


text:
(function() {
    'use strict';

    angular.module('app').
    directive('titleContent', function() {
        return {
            restrict: "E",
            replace: true,
            templateUrl: 'app/components/creativity/cards/titleContent.html',
            scope: {
                bar: '=bar',
                content: '=data'
            },
            controller: function($scope, $sce) {
                $scope.content.items.text = $sce.trustAsHtml($scope.content.items.text);
                $scope.content.title = $sce.trustAsHtml($scope.content.title);
            }
        };
    });

})();


text:
A toolkit for creating metro-style WPF applications. Lots of goodness out-of-the box.

[![Gitter](https://img.shields.io/badge/Gitter-Join%20Chat-green.svg?style=flat-square)](https://gitter.im/MahApps/MahApps.Metro)

[![Build status](https://img.shields.io/appveyor/ci/flagbug/mahapps-metro/master.svg?style=flat-square)](https://ci.appveyor.com/project/flagbug/mahapps-metro/branch/master)
[![Release](https://img.shields.io/github/release/MahApps/MahApps.Metro.svg?style=flat-square)](https://github.com/MahApps/MahApps.Metro/releases/latest)
[![Downloads](https://img.shields.io/nuget/dt/MahApps.Metro.svg?style=flat-square)](http://www.nuget.org/packages/MahApps.Metro/)
[![Issues](https://img.shields.io/github/issues/MahApps/MahApps.Metro.svg?style=flat-square)](https://github.com/MahApps/MahApps.Metro/issues)

![main demo window](https://raw.githubusercontent.com/MahApps/MahApps.Metro/master/docs/main_demo_window.png)

![main demo window animated](https://raw.githubusercontent.com/MahApps/MahApps.Metro/master/docs/main_demo_window.gif)

## Documentation

Read it here: [http://mahapps.com](http://mahapps.com)

You can help keep the documentation up to date by submitting a pull request on the  [mahapps.github.com](https://github.com/MahApps/mahapps.github.com) repository. If you're unfamiliar with GitHub Pages, the help guides [here](https://help.github.com/pages/) are a good place to start.

## Release Notes

- upcoming [v1.2.0](./docs/release-notes/1.2.0.md)
- current [v1.1.2](./docs/release-notes/1.1.2.md)
- all [other](./docs/release-notes/)

## Icons

MahApps.Metro has also an icon package used from [WindowsIcons](https://github.com/Templarian/WindowsIcons) by [Templarian](https://github.com/Templarian)

You can download the Nuget package [here](https://www.nuget.org/packages/MahApps.Metro.Resources)

## Styles

`CheckBox` and `RadioButton` styles adapted from styles created by [Brian Lagunas of Infragistics](http://brianlagunas.com/free-metro-light-and-dark-themes-for-wpf-and-silverlight-microsoft-controls/).

## Contributing to this project

Did you stumble upon a bug? Before reporting it to us, please check out the [FAQ](https://github.com/MahApps/MahApps.Metro/wiki/FAQ) to see if it is actually a bug. If you can not find anything related to your issue, feel free to report it to us in the issue tracker.

If you've improved MahApps.Metro and think that other people would enjoy it, submit a pull request. Anyone and everyone is welcome to contribute. Please take a moment to review the [guidelines for contributing](CONTRIBUTING.md).

* [Bug reports](CONTRIBUTING.md#bugs)
* [Feature requests](CONTRIBUTING.md#features)
* [Pull requests](CONTRIBUTING.md#pull-requests)

## Missing a control?

If you're looking for a control that we don't have, we have some friends who have made MA.M compatible controls. Check them out:

- [Loading indicators](https://github.com/100GPing100/LoadingIndicators.WPF) by [@100GPing100](https://github.com/100GPing100)
- [MahApps.Metro.SimpleChildWindow](https://github.com/punker76/MahApps.Metro.SimpleChildWindow) A simple child window for MahApps.Metro
- [Dragablz](https://github.com/ButchersBoy/Dragablz) Tearable tab control for WPF, which includes docking, tool windows and MDI. [http://dragablz.net](http://dragablz.net)
- [MaterialDesignInXamlToolkit](https://github.com/ButchersBoy/MaterialDesignInXamlToolkit) Google Material Design in XAML & WPF, for C# & VB.Net [http://materialdesigninxaml.net](http://materialdesigninxaml.net)

## A short How To

Or, how to create a simple `MahApps.Metro` Application and a Window...

```XML
<Application x:Class="WpfApplication.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Application.Resources>
</Application>
```

```XML
<controls:MetroWindow x:Class="WpfApplication.MainWindow"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
                      Title="MainWindow"
                      Height="600"
                      Width="800">
  <Grid>
    <!-- now your content -->

  </Grid>
</controls:MetroWindow>
```

```csharp
namespace WpfApplication
{
  public partial class MainWindow : MetroWindow
  {
    public MainWindow()
    {
      InitializeComponent();
    }
  }
}
```

## Visual Studio Templates

MahApps.Metro have 4 simple templates to start with the awesome MahApps.Metro library.

* WPF MahApps.Metro Application (.NET4)
* WPF MahApps.Metro Application (.NET45)
* Visual Basic WPF MahApps.Metro Application (.NET45)
* Window MahApps.Metro (WPF)

Download this [Templates.zip](https://github.com/MahApps/MahApps.Metro/raw/master/Visual%20Studio%20Templates/Templates.zip) (templates are created with VS 2013) and extract it to your user template folder:

```
c:\Users\<USER>\Documents\Visual Studio 2013\
```

Now you can choose the templates at the `New Project` dialog.

![](./docs/new_project_dialog.png)

## Breaking Changes

* For version [0.11.3.1](https://github.com/MahApps/MahApps.Metro/wiki/Breaking-Changes-or-WTF-is-happening-with-the-ALPHA-version)
* For version [0.14 to 1.0.0](https://github.com/MahApps/MahApps.Metro/blob/master/docs/v1.0-Migration-Guide.md)

## Licence

Microsoft Public License (Ms-PL)

This license governs use of the accompanying software. If you use the software, you
accept this license. If you do not accept the license, do not use the software.

1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the
same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.

2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.

3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.


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

#ifndef ONE_UNIT_TEST_H_
#define ONE_UNIT_TEST_H_

#include <string>
#include <iostream>
#include <stdlib.h>
#include <getopt.h>

#include <TestFixture.h>
#include <TestAssert.h>
#include <TestSuite.h>
#include <TestCaller.h>
#include <ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/XmlOutputter.h>
#include <unistd.h>

#include "SqlDB.h"
#include "SqliteDB.h"
#include "MySqlDB.h"

using namespace std;

/* ************************************************************************* */
/* ************************************************************************* */

class OneUnitTest : public CppUnit::TestFixture
{
protected:
    // Global flag to use either Sqlite or MySQL
    static bool mysql;

    static SqlDB * db;
    static string db_name;
    static string xml_name;

public:

    void create_db()
    {
        if (mysql)
        {
            db = new MySqlDB(  "localhost",0,
                                "oneadmin","oneadmin",db_name);

            ostringstream   oss1;
            oss1 << "DROP DATABASE IF EXISTS " << db_name;
            db->exec(oss1);

            ostringstream   oss;
            oss << "CREATE DATABASE " << db_name;
            db->exec(oss);

            ostringstream   oss2;
            oss2 << "use " << db_name;
            db->exec(oss2);
        }
        else
        {
            unlink(db_name.c_str());

            db = new SqliteDB(db_name);
        }
    };

    void delete_db()
    {
        if (mysql)
        {
            ostringstream   oss;
            oss << "DROP DATABASE IF EXISTS " << db_name;
            db->exec(oss);
        }
        else
        {
            unlink(db_name.c_str());
        }

        if ( db != 0 )
        {
            delete db;
        }
    };

    static SqlDB * get_db()
    {
        return db;
    }

    static void set_one_auth(string path = "../../test/one_auth")
    {
        // The UserPool constructor checks if the DB contains at least
        // one user, and adds one automatically from the ONE_AUTH file.
        // So the ONE_AUTH environment is forced to point to a test one_auth
        // file.
        ostringstream oss;

        oss << getenv("PWD") << "/" << path;
        setenv("ONE_AUTH", oss.str().c_str(), 1);
    }

// *****************************************************************************
// *****************************************************************************

    static void show_options ()
    {
        cout << "Options:\n";
        cout << "    -h  --help         Show this help\n"
                "    -s  --sqlite       Run Sqlite tests (default)\n"
                "    -m  --mysql        Run MySQL tests\n"
                "    -l  --log          Keep the log file, test.log\n"
                "    -x  --xml          Create xml output files, for Hudson\n";
    }

    /*
     * Not a true main, but a static method that can be called from the
     * child classes' true main.
     * Options:
     *     s: run sqlite tests
     *     m: run mysql tests
     */
    static int main(int argc,
                    char ** argv,
                    CPPUNIT_NS::TestSuite* suite,
                    string xml_name = "output.xml")
    {

        // Option flags
        bool sqlite_flag = true;
        bool log_flag    = false;
        bool xml_flag    = false;

        // Long options
        const struct option long_opt[] =
        {
            { "sqlite", 0,  NULL,   's'},
            { "mysql",  0,  NULL,   'm'},
            { "log",    0,  NULL,   'l'},
            { "help",   0,  NULL,   'h'},
            { "xml",    0,  NULL,   'x'}
        };

        int c;
        while ((c = getopt_long (argc, argv, "smlhx", long_opt, NULL)) != -1)
            switch (c)
            {
                case 'm':
                    sqlite_flag = false;
                    break;
                case 'l':
                    log_flag = true;
                    break;
                case 'x':
                    xml_flag = true;
                    break;
                case 'h':
                    show_options();
                    return 0;
            }

        // When a DB query fails, it tries to log the error.
        // We need to set the log file, otherwise it will end in a dead-lock
        NebulaLog::init_log_system(NebulaLog::FILE, Log::DEBUG, "test.log");
        NebulaLog::log("Test", Log::INFO, "Test started");

        // Set the opennebula install location to be the current dir.
        // This will prevent some of the tests from writing the individual
        // VM log files in an existing OpenNebula installation
        setenv("ONE_LOCATION", ".", 1);

        CppUnit::TextUi::TestRunner runner;
        ofstream                    outputFile;

        if( xml_flag )
        {
            outputFile.open(xml_name.c_str());
            CppUnit::XmlOutputter* outputter =
                    new CppUnit::XmlOutputter(&runner.result(), outputFile);

            runner.setOutputter(outputter);
        }

        runner.addTest( suite );

        if (sqlite_flag)
        {
            OneUnitTest::mysql = false;
            NebulaLog::log("Test", Log::INFO, "Running Sqlite tests...");
            cout << "\nRunning Sqlite tests...\n";
        }
        else
        {
            OneUnitTest::mysql = true;
            NebulaLog::log("Test", Log::INFO, "Running MySQL tests...");
            cout << "\nRunning MySQL tests...\n";
        }

        runner.run();

        if( xml_flag )
        {
            outputFile.close();
        }

        if (!log_flag)
            remove("test.log");

        NebulaLog::finalize_log_system();

        return 0;
    }
};

/* -----------------------------------------------------------------------------

int main(int argc, char ** argv)
{
    return OneUnitTest::main(argc, argv, TestClass::suite());
}

----------------------------------------------------------------------------- */

#endif // ONE_UNIT_TEST_H_


text:
package eu.chargetime.ocpp;

import eu.chargetime.ocpp.feature.Feature;
import eu.chargetime.ocpp.model.Confirmation;
import eu.chargetime.ocpp.model.Request;
import java.util.concurrent.CompletionStage;

public interface IClientAPI {
  void addFeature(Feature feature);

  void connect(String url, ClientEvents clientEvents);

  CompletionStage<Confirmation> send(Request request)
      throws OccurenceConstraintException, UnsupportedFeatureException;

  void disconnect();

  boolean isClosed();
}


text:
package com.mitchellbosecke.benchmark;

import com.mitchellbosecke.benchmark.model.Stock;
import freemarker.template.TemplateException;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Setup;

import java.io.IOException;
import java.util.List;

/**
 * Benchmark for Rocker template engine by Fizzed.
 *
 * https://github.com/fizzed/rocker
 *
 * @author joelauer
 */
public class Rocker extends BaseBenchmark {

    private List<Stock> items;

    @Setup
    public void setup() throws IOException {
        // no config needed, replicate stocks from context
        this.items = Stock.dummyItems();
    }

    @Benchmark
    public String benchmark() throws TemplateException, IOException {
        return templates.stocks
                .template(this.items)
                .render()
                .toString();
    }

}