text:
var AD = require('AppDev');
var $ = require('jquery');

module.exports = $.Window('AppDev.UI.ViewContactWindow', {
    dependencies: ['AddContactWindow', 'DatePickerWindow', 'Checkbox'],

    // Return a deferred object that will resolve to a formatted string respresentation of the user's current location
    getStepCompletionLocation: function() {
        var locationDfd = $.Deferred();
        if (AD.Config.stepLocationEnabled()) {
            AD.Location.getCurrentLocation('stepCompletionLocation', Ti.Geolocation.ACCURACY_LOW).done(function(locationResults) {
                var coordinates = locationResults.coords;
                locationDfd.resolve(parseFloat(coordinates.latitude).toFixed(5) + ',' + parseFloat(coordinates.longitude).toFixed(5));
            }).fail(function(result) {
                locationDfd.resolve(null);
                if (result.message) {
                    alert(result.message);
                }
            });
        }
        else {
            // Step completion location tracking is disabled by the user
            locationDfd.resolve(null);
        }
        return locationDfd.promise();
    },

    rowHeight: AD.UI.buttonHeight,

    contactMethods: [
        {label: 'contact_call', callback: 'callContact', field: 'contact_phone'},
        {label: 'contact_SMS', callback: 'SMSContact', field: 'contact_phone'},
        {label: 'contact_email', callback: 'emailContact', field: 'contact_email'}
    ],
    actions: [{
        title: 'del',
        callback: function() {
            AD.UI.yesNoAlert('contactDeleteConfirmation').done(this.proxy(function() {
                // The user chose "Yes", so close the window and delete the contact
                this.dfd.reject();
                this.contact.destroy();
            }));
        },
        platform: 'Android',
        showAsAction: true,
        icon: '/images/ic_action_discard.png'
    }, {
        title: 'edit',
        callback: function() {
            // Open the EditContact window
            var _this = this;
            var campus_uuidOld = this.contact.attr('campus_uuid');
            var $winEditContact = this.createWindow('AddContactWindow', {
                operation: 'edit',
                existingContact: this.contact
            });
            $winEditContact.getDeferred().done(function() {
                // Update the contact UI
                _this.update();
                if (_this.contact.attr('campus_uuid') !== campus_uuidOld) {
                    // The contact campus changed, so update the steps view
                    _this.updateSteps();
                }
            });
        },
        rightNavButton: true,
        showAsAction: true,
        icon: '/images/ic_action_edit.png'
    }]
}, {
    init: function(options) {
        this.contact = this.options.contact;

        this.stepRows = {};

        // Initialize the base $.Window object
        this._super({
            title: 'viewContact',
            autoOpen: true,
            createParams: {
                layout: 'vertical'
            }
        });
    },

    // Create the child views
    create: function() {
        var contact = this.contact;

        // Create a container to hold the label and optional image
        var headerView = this.add(Ti.UI.createView({
            left: AD.UI.padding,
            top: AD.UI.padding,
            width: AD.UI.useableScreenWidth,
            height: Ti.UI.SIZE
        }));

        // Show the contact's image if it exists
        var localContact = contact.contact_recordId === null ? null : Ti.Contacts.getPersonByID(contact.contact_recordId);
        var contactImage = localContact && localContact.getImage();
        var hasImage = contactImage ? true : false;
        if (hasImage) {
            var dimensions = AD.UI.getImageScaledDimensions(contactImage, AD.UI.contactImageSize);
            headerView.add(Ti.UI.createImageView({
                left: 0,
                width: dimensions.width,
                height: dimensions.height,
                image: contactImage
            }));
        }

        // Create the contact label
        headerView.add(this.record('nameLabel', Ti.UI.createLabel({
            left: hasImage ? AD.UI.contactImageSize.width : 0,
            top: 0,
            text: null,
            textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,
            width: Ti.UI.FILL,
            font: AD.UI.Fonts.header
        })));

        // Create the contact button bar which allows the user to call, SMS, or e-mail the contact
        if (AD.Platform.isiOS) {
            // Create a button bar under iOS
            this.contactBBLabels = this.constructor.contactMethods.map(function(method) {
                return $.extend({
                    title: AD.Localize(method.label)
                }, method);
            });
            var contactBB = this.add('contactBB', Ti.UI.createButtonBar({
                left: AD.UI.padding,
                top: AD.UI.padding * 2,
                width: AD.UI.useableScreenWidth,
                height: AD.UI.buttonHeight,
                style: Ti.UI.iPhone.SystemButtonStyle.BAR,
                labels: this.contactBBLabels
            }));
            contactBB.addEventListener('click', this.proxy(function(event) {
                var callbackName = this.constructor.contactMethods[event.index].callback;
                // callbackName will be undefined if event.index is null
                // because the user clicked the button bar, but not a button
                if (typeof callbackName !== 'undefined') {
                    // Determine the proper callback to use and call it
                    var callback = $.isFunction(callback) ? callback : this[callbackName];
                    callback.call(this);
                }
            }));
        }
        else {
            // Create multiple buttons under any other platform

            // The buttons are spaced evenly and horizontally with AD.UI.padding units of padding between them
            var buttonCount = this.constructor.contactMethods.length;
            var buttonWidth = (AD.UI.useableScreenWidth - (buttonCount - 1) * AD.UI.padding) / buttonCount;
            var contactButtonView = this.add(Ti.UI.createView({
                left: AD.UI.padding,
                top: AD.UI.padding * 2,
                width: AD.UI.useableScreenWidth,
                height: AD.UI.buttonHeight
            }));
            this.constructor.contactMethods.forEach(function(method, index) {
                var buttonParams = $.extend({
                    left: (buttonWidth + AD.UI.padding) * index,
                    width: buttonWidth,
                    height: AD.UI.buttonHeight,
                    titleid: method.label
                }, method);
                var button = this.record(method.label, Ti.UI.createButton(buttonParams));
                contactButtonView.add(button);
                button.addEventListener('click', this.proxy(method.callback));
            }, this);
        }

        // Create the tags row
        var _this = this;
        var tagsRow = this.add('tags', Ti.UI.createView({
            left: 0,
            top: 0,
            height: this.constructor.rowHeight
        }));
        tagsRow.top = AD.UI.padding;
        tagsRow.add(Ti.UI.createImageView({
            left: AD.UI.padding,
            width: Ti.UI.SIZE,
            height: Ti.UI.SIZE,
            image: '/images/tags.png'
        }));
        var tagsLabel = Ti.UI.createLabel({
            left: AD.UI.padding * 2 + 25,
            right: AD.UI.padding,
            top: 0,
            height: Ti.UI.FILL,
            font: AD.UI.Fonts.mediumSmall
        });
        var updateTagLabel = function() {
            // Get an array of the lab
            var tagLabels = contact.getTags().map(function(tag) { return tag.attr('tag_label'); });
            tagsLabel.text = (tagLabels.join(', ') || AD.Localize('none'));
        };
        updateTagLabel();
        tagsRow.add(tagsLabel);
        tagsRow.addEventListener('click', function() {
            _this.createWindow('ChooseOptionsWindow', {
                groupName: 'tag',
                Model: 'Tag',
                initial: contact.getTags().map(function(tag) { return tag.attr('tag_uuid'); }),
                editable: true
            }).getDeferred().done(function(options) {
                contact.setTags(options);
                updateTagLabel();
            });
        });

        // Create the campus steps view
        var scrollableStepsView = Ti.UI.createScrollView({
            left: 0,
            top: 0,
            layout: 'vertical',
            scrollType: 'vertical',
            contentHeight: 'auto',
            showVerticalScrollIndicator: true
        });
        this.add(scrollableStepsView);

        var $campusStepsView = this.record('campusSteps', $.View.create(Ti.UI.createView({
            left: 0,
            top: 0,
            width: Ti.UI.FILL,
            height: Ti.UI.SIZE,
            layout: 'vertical'
        })));
        scrollableStepsView.add($campusStepsView.getView());

        var personalStepsHeaderRow = Ti.UI.createView({
            left: 0,
            top: 0,
            width: Ti.UI.FILL,
            height: Ti.UI.SIZE,
            backgroundColor: 'lightgray'
        });
        personalStepsHeaderRow.add(Ti.UI.createLabel({
            left: AD.UI.padding,
            top: AD.UI.padding,
            bottom: AD.UI.padding,
            width: Ti.UI.SIZE,
            height: Ti.UI.SIZE,
            textid: 'personalSteps'
        }));
        personalStepsHeaderRow.addEventListener('click', function() {
            _this.addPersonalSteps();
        });
        scrollableStepsView.add(personalStepsHeaderRow);

        // Create the personal steps view
        var $personalStepsView = this.record('personalSteps', $.View.create(Ti.UI.createView({
            left: 0,
            top: 0,
            width: Ti.UI.FILL,
            height: Ti.UI.SIZE,
            layout: 'vertical'
        })));
        scrollableStepsView.add($personalStepsView.getView());
    },

    // Initialize the child views
    initialize: function() {
        this.update();
        this.updateSteps();
    },

    // Update the contact UI (name label and contact buttons)
    update: function() {
        this.getChild('nameLabel').text = this.contact.getLabel();

        // Update the enabled status of each of the contact buttons

        // Extract the button array
        var buttons = AD.Platform.isiOS ? this.contactBBLabels : this.constructor.contactMethods.map(function(method) {
            return this.getChild(method.label);
        }, this);
        buttons.forEach(function(button) {
            button.enabled = this.contact.attr(button.field) ? true : false;
        }, this);
        if (AD.Platform.isiOS) {
            // Force the button bar to recognize the new button states
            this.getChild('contactBB').labels = buttons;
        }
    },

    // Create and return a basic UI element representing a row
    createRow: function() {
        return Ti.UI.createView({
            left: 0,
            top: 0,
            height: this.constructor.rowHeight,
            borderWidth: 1,
            borderColor: 'black'
        });
    },

    // Update the steps UI
    updateSteps: function() {
        // Remove the steps view in order to replace it
        var $campusStepsView = this.get$Child('campusSteps');
        var $personalStepsView = this.get$Child('personalSteps');

        $campusStepsView.removeAllChildren();
        $personalStepsView.removeAllChildren();

        // Display all the steps associated with this contact's campus
        // and all the completed steps, regardless of their campus
        var steps = this.contact.getSteps();
        var stepsLength = steps.length;
        steps.forEach(function(contactStep) {
            var $stepView = this.getStepRow(contactStep);
            var step = AD.Models.Step.cache.getById(contactStep.attr('step_uuid'));
            if (step.attr('campus_uuid')) {
                $campusStepsView.add($stepView);
            }
            else {
                $personalStepsView.add($stepView);
            }
        }, this);
    },

    // Return the UI row associated with the contactStep, creating it if necessary
    getStepRow: function(contactStep) {
        var contactstep_uuid = contactStep.getId();
        if (this.stepRows[contactstep_uuid]) {
            return this.stepRows[contactstep_uuid];
        }
        return this.stepRows[contactstep_uuid] = this.createStepRow(contactStep);
    },

    // Create and return a $.View UI element for the given contact step
    createStepRow: function(contactStep) {
        var _this = this;
        var $newRow = $.View.create(this.createRow());

        // Create the step title
        var stepLabel = $newRow.add(Ti.UI.createLabel({
            left: AD.UI.padding,
            right: AD.UI.padding,
            top: 0,
            height: Ti.UI.FILL,
            text: contactStep.getLabel(),
            font: AD.UI.Fonts.mediumSmall
        }));

        var stepCompletedDate = contactStep.attr('step_date');
        var stepCompleted = stepCompletedDate !== null;

        // Create the switch to toggle the step's completion status
        var $completedCheckbox = new AD.UI.Checkbox({
            createParams: {
                right: AD.UI.padding
            },
            value: stepCompleted
        });
        var completedCheckbox = $completedCheckbox.getView();
        completedCheckbox.addEventListener('change', function(event) {
            // The step's completion state has been changed
            stepCompleted = event.value;
            stepCompletedDate = stepCompleted ? $.today() : null;
            contactStep.attr('step_date', stepCompletedDate);
            updateRow();

            // If the step is being "uncompleted", the step completion location will be set to null
            var locationDfd = stepCompleted ? _this.constructor.getStepCompletionLocation() : null;
            $.when(locationDfd).done(function(location) {
                contactStep.attr('step_location', location).save();
            });
        });
        $newRow.add($completedCheckbox);

        // Create the button to set the step completion date
        var dateButton = Ti.UI.createButton({
            right: AD.UI.Checkbox.defaultSize + AD.UI.padding * 2,
            width: AD.Platform.isiOS ? 90 : 120,
            height: AD.UI.buttonHeight,
            title: ''
        });
        dateButton.addEventListener('click', function() {
            // Set the completion date of the step
            _this.createWindow('DatePickerWindow', {
                minDate: new Date(2012, 0, 1), // January 1, 2012
                maxDate: $.today(),
                initialDate: stepCompletedDate
            }).getDeferred().done(function(completedDate) {
                stepCompletedDate = completedDate;
                contactStep.attr('step_date', stepCompletedDate).save();
                updateRow();
            });
        });
        $newRow.add(dateButton);

        // Update the checkbox image and the title and visibility of the dateButton
        var updateRow = function() {
            if (stepCompleted) {
                dateButton.visible = true;
                dateButton.title = $.formatDate(stepCompletedDate);
            }
            else {
                dateButton.visible = false;
            }
            stepLabel.right = AD.UI.padding + (dateButton.visible ? (dateButton.right + dateButton.width) : (completedCheckbox.right + completedCheckbox.width));
        };
        updateRow();

        return $newRow;
    },

    // Helper functions that allow the user to contact the contact via telephone, SMS, or e-mail
    callContact: function() {
        // Remove all non-numeric numbers from the phone number
        var strippedPhoneNumber = this.contact.contact_phone.replace(/\D/g, '');
        Ti.Platform.openURL('tel:'+strippedPhoneNumber); // tel:xxxxxxxx format
        if (AD.Platform.isiOS) {
            Ti.App.iOS.registerBackgroundService({ url: 'Return.js' });
        }
    },
    SMSContact: function() {
        // Remove all non-numeric numbers from the phone number
        var strippedPhoneNumber = this.contact.contact_phone.replace(/\D/g, '');
        Ti.Platform.openURL('sms:'+strippedPhoneNumber); // sms:xxxxxxxx format
    },
    emailContact: function() {
        // Display the email dialog
        var emailDialog = Ti.UI.createEmailDialog({
            toRecipients: [this.contact.contact_email]
        });
        emailDialog.open();
    },

    // Display a window allowing the user to create personal steps and apply them to the current contact
    addPersonalSteps: function() {
        var contact = this.contact;
        var _this = this;
        this.createWindow('ChooseOptionsWindow', {
            groupName: 'personalStep',
            Model: 'Step',
            filter: { campus_uuid: null },
            initial: contact.getPersonalSteps().map(function(step) { return step.attr('step_uuid'); }),
            editable: true
        }).getDeferred().done(function(options) {
            contact.setPersonalSteps(options);
            _this.updateSteps();
        });
    }
});


text:
package ru.job4j.musicvenue.dao;

import ru.job4j.musicvenue.models.MusicType;

/**
 * @author Dmitry Belokursky
 * @since 13.05.18.
 */
public interface MusicTypeDao extends GenericDao<MusicType> {
}

redpajama_set_name: RedPajamaGithub


text:
@interface BRMenuOrderItemTests : XCTestCase

@end

@implementation BRMenuOrderItemTests

- (void)testTakeAwayFlag {
	BRMenuOrderItemAttributes *attr;
	BRMenuOrderItem *item = [BRMenuOrderItem new];
	XCTAssertNil([item attributesAtIndex:0], @"attributes initial value");
	XCTAssertEqual(NO, item.takeAway, @"initial takeAway flag value");

	item.takeAway = YES;
	XCTAssertEqual(YES, item.takeAway, @"takeAway flag set to YES");
	attr = [item attributesAtIndex:0];
	XCTAssertNotNil(attr, @"attributes present");
	XCTAssertEqual(YES, attr.takeAway, @"attribute takeAway flag");

	item.takeAway = NO;
	XCTAssertEqual(NO, item.takeAway, @"takeAway flag set to NO");
	XCTAssertEqual(NO, attr.takeAway, @"attribute takeAway flag");
}

- (void)testEquals {
	BRMenu *menu = [BRMenu new];
	BRMenuItem *pizzaItem = [BRMenuItem new];
	pizzaItem.title = @"Pizza";
	pizzaItem.itemId = 1;
	pizzaItem.menu = menu;

	BRMenuItem *pizzaPlusItem = [BRMenuItem new];
	pizzaPlusItem.title = @"Pizza+";
	pizzaPlusItem.itemId = 2;
	pizzaPlusItem.menu = menu;

	BRMenuItemComponent *traditionalDough = [BRMenuItemComponent new];
	traditionalDough.componentId = 1;
	traditionalDough.title = @"Traditional";

	BRMenuItemComponent *wholeWheatDough = [BRMenuItemComponent new];
	wholeWheatDough.componentId = 2;
	wholeWheatDough.title = @"Whole Wheat";

	BRMenuOrderItem *pizzaOrderItem = [[BRMenuOrderItem alloc] initWithMenuItem:pizzaItem];
	BRMenuOrderItem *pizzaOrderItem2 = [[BRMenuOrderItem alloc] initWithMenuItem:pizzaItem];
	BRMenuOrderItem *pizzaPlusOrderItem = [[BRMenuOrderItem alloc] initWithMenuItem:pizzaPlusItem];
	XCTAssertEqual(YES, [pizzaOrderItem isEqual:pizzaOrderItem2], @"equal items");
	XCTAssertEqual(NO, [pizzaOrderItem isEqual:pizzaPlusOrderItem], @"not equal items");

	// add components to item, now items should differ as components differ
	[pizzaOrderItem addComponent:[[BRMenuOrderItemComponent alloc] initWithComponent:traditionalDough]];
	XCTAssertEqual(NO, [pizzaOrderItem isEqual:pizzaOrderItem2], @"not equal from components");

	// but add component to other item and they should be equal again
	[pizzaOrderItem2 addComponent:[[BRMenuOrderItemComponent alloc] initWithComponent:traditionalDough]];
	XCTAssertEqual(YES, [pizzaOrderItem isEqual:pizzaOrderItem2], @"equal with components");
}

- (void)testGroupKeyNoGroup {
	BRMenuItem *item = [BRMenuItem new];
	BRMenuOrderItem *orderItem = [[BRMenuOrderItem alloc] initWithMenuItem:item];
	assertThat([orderItem orderGroupKey:nil], equalTo(BRMenuOrderItemDefaultGroupKey));
}

- (void)testGroupKeyNoGroupKey {
	BRMenuItem *item = [BRMenuItem new];
	BRMenuItemGroup *group = [BRMenuItemGroup new];
	item.group = group;
	BRMenuOrderItem *orderItem = [[BRMenuOrderItem alloc] initWithMenuItem:item];
	assertThat([orderItem orderGroupKey:nil], equalTo(BRMenuOrderItemDefaultGroupKey));
}

- (void)testGroupKeyDirect {
	BRMenuItem *item = [BRMenuItem new];
	BRMenuItemGroup *group = [BRMenuItemGroup new];
	group.key = @"test-direct";
	item.group = group;
	BRMenuOrderItem *orderItem = [[BRMenuOrderItem alloc] initWithMenuItem:item];
	assertThat([orderItem orderGroupKey:nil], equalTo(group.key));
}

- (void)testGroupKeyDirectMapped {
	BRMenuItem *item = [BRMenuItem new];
	BRMenuItemGroup *group = [BRMenuItemGroup new];
	group.key = @"test-direct";
	item.group = group;
	BRMenuOrderItem *orderItem = [[BRMenuOrderItem alloc] initWithMenuItem:item];
	assertThat([orderItem orderGroupKey:@{@"test-direct" : @"direct"}], equalTo(@"direct"));
}

- (void)testGroupKeyNested {
	BRMenuItem *item = [BRMenuItem new];
	BRMenuItemGroup *group = [BRMenuItemGroup new];
	group.key = @"test-direct";
	item.group = group;
	BRMenuItemGroup *grandparentGroup = [BRMenuItemGroup new];
	grandparentGroup.key = @"test-nested";
	group.parentGroup = grandparentGroup;
	BRMenuOrderItem *orderItem = [[BRMenuOrderItem alloc] initWithMenuItem:item];
	assertThat([orderItem orderGroupKey:nil], equalTo(grandparentGroup.key));
}

- (void)testGroupKeyNestedMapped {
	BRMenuItem *item = [BRMenuItem new];
	BRMenuItemGroup *group = [BRMenuItemGroup new];
	group.key = @"test-direct";
	item.group = group;
	BRMenuItemGroup *grandparentGroup = [BRMenuItemGroup new];
	grandparentGroup.key = @"test-nested";
	group.parentGroup = grandparentGroup;
	BRMenuOrderItem *orderItem = [[BRMenuOrderItem alloc] initWithMenuItem:item];
	assertThat([orderItem orderGroupKey:@{@"test-nested" : @"nested"}], equalTo(@"nested"));
}

@end


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="robots" content="noindex">

	<title>Page not found</title>

	<link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e">

		Overview

Namespaces

						App

						ApiModule

						Presenters

						Console

						Model

						Presenters

						WebModule

						Presenters

Classes

App\ApiModule\Presenters\ActionsPresenter

App\ApiModule\Presenters\BaseApiPresenter

App\ApiModule\Presenters\CurrenciesPresenter

App\ApiModule\Presenters\DebtsPresenter

App\ApiModule\Presenters\UserPresenter

App\Console\ReoccurringDebtsCommand

App\Model\Action

App\Model\ActionMessage

App\Model\ActionsMapper

App\Model\ActionsMessagesMapper

App\Model\ActionsMessagesRepository

App\Model\ActionsRepository

App\Model\CurrenciesMapper

App\Model\CurrenciesRepository

App\Model\Currency

App\Model\Debt

App\Model\DebtsMapper

App\Model\DebtsRepository

App\Model\Friendship

App\Model\FriendshipsMapper

App\Model\FriendshipsRepository

App\Model\Orm

App\Model\ReoccurringDebtsModel

App\Model\User

App\Model\UserModel

App\Model\UsersMapper

App\Model\UsersRepository

App\Presenters\Error4xxPresenter

App\Presenters\ErrorPresenter

App\RouterFactory

App\WebModule\Presenters\BasePresenter

App\WebModule\Presenters\HomepagePresenter

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

				Overview

Namespace

Class

Page not found

The requested page could not be found.

You have probably clicked on a link that is outdated and points to a page that does not exist any more or you have made an typing error in the address.

To continue please try to find requested page in the menu, or use search field on the top.

		 API documentation generated by ApiGen


text:
class RenderViewHost;
class StatusBubbleGtk;
class TabContents;

typedef struct _GtkFloatingContainer GtkFloatingContainer;

class TabContentsContainerGtk : public NotificationObserver {
 public:
  explicit TabContentsContainerGtk(StatusBubbleGtk* status_bubble);
  ~TabContentsContainerGtk();

  void Init();

  // Inserts our GtkWidget* hierarchy into a GtkBox managed by our owner.
  void AddContainerToBox(GtkWidget* widget);

  // Make the specified tab visible.
  void SetTabContents(TabContents* tab_contents);
  TabContents* GetTabContents() const { return tab_contents_; }

  // Remove the tab from the hierarchy.
  void DetachTabContents(TabContents* tab_contents);

  // NotificationObserver implementation.
  virtual void Observe(NotificationType type,
                       const NotificationSource& source,
                       const NotificationDetails& details);

 private:
  // Add or remove observers for events that we care about.
  void AddObservers();
  void RemoveObservers();

  // Called when the RenderViewHost of the hosted TabContents has changed, e.g.
  // to show an interstitial page.
  void RenderViewHostChanged(RenderViewHost* old_host,
                             RenderViewHost* new_host);

  // Called when a TabContents is destroyed. This gives us a chance to clean
  // up our internal state if the TabContents is somehow destroyed before we
  // get notified.
  void TabContentsDestroyed(TabContents* contents);

  // Implements our hack around a GtkFixed. The entire size of the GtkFixed is
  // allocated to normal tab contents views, while the status bubble is
  // informed of its parent and its parent's allocation (it makes a decision
  // about layout later.)
  static void OnFixedSizeAllocate(
      GtkWidget* fixed,
      GtkAllocation* allocation,
      TabContentsContainerGtk* container);

  // Handler for |floating_|'s "set-floating-position" signal. During this
  // callback, we manually set the position of the status bubble.
  static void OnSetFloatingPosition(
      GtkFloatingContainer* container, GtkAllocation* allocation,
      TabContentsContainerGtk* tab_contents_container);

  NotificationRegistrar registrar_;

  // The currently visible TabContents.
  TabContents* tab_contents_;

  // The status bubble manager.  Always non-NULL.
  StatusBubbleGtk* status_bubble_;

  // Top of the TabContentsContainerGtk widget hierarchy. A cross between a
  // GtkBin and a GtkFixed, |floating_| has |fixed_| as its one "real" child,
  // and the various things that hang off the bottom (status bubble, etc) have
  // their positions manually set in OnSetFloatingPosition.
  OwnedWidgetGtk floating_;

  // We insert and remove TabContents GtkWidgets into this fixed_. This should
  // not be a GtkVBox since there were errors with timing where the vbox was
  // horizontally split with the top half displaying the current TabContents
  // and bottom half displaying the loading page.
  GtkWidget* fixed_;

  DISALLOW_COPY_AND_ASSIGN(TabContentsContainerGtk);
};

#endif  // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_


text:
function debug(obj) {
	if(typeof obj != "string")
		obj = JSON.stringify(obj);
	else {
		obj = arguments.join(' ')
	}

	alert(obj)
}

function $(obj) {
	if(typeof obj == "string") return document.querySelector(obj);
	else return obj;
}

function $$(obj) {
	if(typeof obj == "string") return document.querySelectorAll(obj);
	else return new NodeList(obj);
}

Object.getOwnPropertyNames(Array.prototype).forEach(function(methodName) {
    NodeList.prototype[methodName] = Array.prototype[methodName];
});

Node.prototype.hasClass = function(cls) {
	return this.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
};

Node.prototype.addClass = function(cls) {
	if (!this.hasClass(cls)) this.className += " " + cls;
};

Node.prototype.removeClass = function(cls) {
	if (this.hasClass(cls)) {
		var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
		this.className = this.className.replace(reg,' ');
	}
};

var __entityMap = {
    "&": "&",
    "<": "<",
    ">": ">"
};

String.prototype.escapeHTML = function() {
    return String(this).replace(/[&<>]/g, function (s) {
        return __entityMap[s];
    });
}

String.prototype.htmlDecode = function() {
	var e = document.createElement('div');
	e.innerHTML = this;
	return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
}

String.prototype.stripHTML = function() {
	return this.replace(/(<([^>]+)>)/ig, "");
}

String.prototype.capitalize = function() {
    return this.charAt(0).toUpperCase() + this.slice(1);
}

if(!window.app) window.app = new App();


text:
package com.github.btrekkie.reductions.mario;

import com.github.btrekkie.reductions.planar.I3SatPlanarGadgetFactory;
import com.github.btrekkie.reductions.planar.IPlanarGadget;

/** A I3SatPlanarGadgetFactory implementation for MarioProblem. */
/* The major gadgets are taken from https://arxiv.org/pdf/1203.1895.pdf (Aloupis, Demaine, Guo, Viglietta (2012):
 * Classic Nintendo Games are (Computationally) Hard).
 */
public class Mario3SatPlanarGadgetFactory implements I3SatPlanarGadgetFactory {
    /** The singleton instance of Mario3SatPlanarGadgetFactory. */
    public static final Mario3SatPlanarGadgetFactory instance = new Mario3SatPlanarGadgetFactory();

    private Mario3SatPlanarGadgetFactory() {

    }

    @Override
    public IPlanarGadget createVariable() {
        return new MarioVariableGadget();
    }

    @Override
    public IPlanarGadget createClause() {
        return new MarioClauseGadget();
    }

    @Override
    public IPlanarGadget createCrossover(boolean isClockwise) {
        return new MarioCrossoverGadget(isClockwise);
    }

    @Override
    public IPlanarGadget createJunction() {
        return new MarioJunctionGadget();
    }

    @Override
    public int minVariableEntryPort() {
        return MarioVariableGadget.MIN_ENTRY_PORT;
    }

    @Override
    public int maxVariableEntryPort() {
        return MarioVariableGadget.MAX_ENTRY_PORT;
    }

    @Override
    public int minVariableExitPort() {
        return MarioVariableGadget.MIN_EXIT_PORT;
    }

    @Override
    public int maxVariableExitPort() {
        return MarioVariableGadget.MAX_EXIT_PORT;
    }

    @Override
    public int minClausePort() {
        return MarioClauseGadget.MIN_CLAUSE_PORT;
    }

    @Override
    public int maxClausePort() {
        return MarioClauseGadget.MAX_CLAUSE_PORT;
    }

    @Override
    public int clauseEntryPort() {
        return MarioClauseGadget.ENTRY_PORT;
    }

    @Override
    public int clauseExitPort() {
        return MarioClauseGadget.EXIT_PORT;
    }

    @Override
    public int firstCrossoverEntryPort(IPlanarGadget gadget, boolean isClockwise) {
        return ((MarioCrossoverGadget)gadget).firstEntryPort();
    }

    @Override
    public int firstCrossoverExitPort(IPlanarGadget gadget, boolean isClockwise) {
        return ((MarioCrossoverGadget)gadget).firstExitPort();
    }

    @Override
    public int secondCrossoverEntryPort(IPlanarGadget gadget, boolean isClockwise) {
        return ((MarioCrossoverGadget)gadget).secondEntryPort();
    }

    @Override
    public int secondCrossoverExitPort(IPlanarGadget gadget, boolean isClockwise) {
        return ((MarioCrossoverGadget)gadget).secondExitPort();
    }
}


text:
/**
 * Worker to fetch MMR and Dota Plus data for players
 * */
const utility = require('../util/utility');
const queue = require('../store/queue');
const db = require('../store/db');
const { insertPlayer, insertPlayerRating } = require('../store/queries');
const config = require('../config');

const { getData, getRetrieverArr } = utility;
const retrieverArr = getRetrieverArr();

function processMmr(job, cb) {
  // Don't always do the job
  if (Math.random() < 0) {
    return cb();
  }
  const accountId = job.account_id;
  const urls = retrieverArr
    .map(r => `http://${r}?key=${config.RETRIEVER_SECRET}&account_id=${accountId}`);
  return getData({ url: urls }, (err, data) => {
    if (err) {
      return cb(err);
    }
    const player = {
      account_id: job.account_id || null,
      plus: Boolean(data.is_plus_subscriber),
    };
    return insertPlayer(db, player, false, () => {
      if (data.solo_competitive_rank || data.competitive_rank || data.rank_tier || data.leaderboard_rank) {
        data.account_id = job.account_id || null;
        data.match_id = job.match_id || null;
        data.solo_competitive_rank = data.solo_competitive_rank || null; // 0 MMR is not a valid value
        data.competitive_rank = data.competitive_rank || null;
        data.time = new Date();
        return insertPlayerRating(db, data, cb);
      }
      return cb();
    });
  });
}

queue.runQueue('mmrQueue', config.MMR_PARALLELISM * retrieverArr.length, processMmr);


text:
package org.apache.hadoop.hbase.tmpl.master;

// 35, 1
import java.util.*;
// 36, 1
import org.apache.hadoop.util.StringUtils;
// 37, 1
import org.apache.hadoop.hbase.util.Bytes;
// 38, 1
import org.apache.hadoop.hbase.util.JvmVersion;
// 39, 1
import org.apache.hadoop.hbase.util.FSUtils;
// 40, 1
import org.apache.hadoop.hbase.master.HMaster;
// 41, 1
import org.apache.hadoop.hbase.master.AssignmentManager;
// 42, 1
import org.apache.hadoop.hbase.master.ServerManager;
// 43, 1
import org.apache.hadoop.hbase.HConstants;
// 44, 1
import org.apache.hadoop.hbase.HServerLoad;
// 45, 1
import org.apache.hadoop.hbase.ServerName;
// 46, 1
import org.apache.hadoop.hbase.client.HBaseAdmin;
// 47, 1
import org.apache.hadoop.hbase.client.HConnectionManager;
// 48, 1
import org.apache.hadoop.hbase.HTableDescriptor;
// 49, 1
import org.apache.hadoop.hbase.HBaseConfiguration;
// 50, 1
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;

public class MasterStatusTmplImpl
  extends org.jamon.AbstractTemplateImpl
  implements org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.Intf

{
  private final HMaster master;
  private final HBaseAdmin admin;
  private final Map<String,Integer> frags;
  private final String format;
  private final boolean showAppendWarning;
  private final AssignmentManager assignmentManager;
  private final Set<ServerName> deadServers;
  private final ServerManager serverManager;
  private final List<ServerName> servers;
  private final ServerName metaLocation;
  private final String filter;
  private final ServerName rootLocation;
  protected static org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.ImplData p_implData)
  {
    if(! p_implData.getFrags__IsNotDefault())
    {
      p_implData.setFrags(null);
    }
    if(! p_implData.getFormat__IsNotDefault())
    {
      p_implData.setFormat("html");
    }
    if(! p_implData.getShowAppendWarning__IsNotDefault())
    {
      p_implData.setShowAppendWarning(false);
    }
    if(! p_implData.getAssignmentManager__IsNotDefault())
    {
      p_implData.setAssignmentManager(null);
    }
    if(! p_implData.getDeadServers__IsNotDefault())
    {
      p_implData.setDeadServers(null);
    }
    if(! p_implData.getServerManager__IsNotDefault())
    {
      p_implData.setServerManager(null);
    }
    if(! p_implData.getServers__IsNotDefault())
    {
      p_implData.setServers(null);
    }
    if(! p_implData.getMetaLocation__IsNotDefault())
    {
      p_implData.setMetaLocation(null);
    }
    if(! p_implData.getFilter__IsNotDefault())
    {
      p_implData.setFilter("general");
    }
    if(! p_implData.getRootLocation__IsNotDefault())
    {
      p_implData.setRootLocation(null);
    }
    return p_implData;
  }
  public MasterStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.master.MasterStatusTmpl.ImplData p_implData)
  {
    super(p_templateManager, __jamon_setOptionalArguments(p_implData));
    master = p_implData.getMaster();
    admin = p_implData.getAdmin();
    frags = p_implData.getFrags();
    format = p_implData.getFormat();
    showAppendWarning = p_implData.getShowAppendWarning();
    assignmentManager = p_implData.getAssignmentManager();
    deadServers = p_implData.getDeadServers();
    serverManager = p_implData.getServerManager();
    servers = p_implData.getServers();
    metaLocation = p_implData.getMetaLocation();
    filter = p_implData.getFilter();
    rootLocation = p_implData.getRootLocation();
  }

  public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 52, 1
    if (format.equals("json") )
    {
      // 52, 30
      jamonWriter.write("\n  ");
      // 53, 3
      {
        org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_2 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
        __jamon__var_2.setFilter(filter);
        __jamon__var_2.setFormat("json" );
        __jamon__var_2.renderNoFlush(jamonWriter);
      }
      // 53, 68
      jamonWriter.write("\n  ");
      // 54, 3
      return;
    }
    // 55, 7
    jamonWriter.write("\n");
    // 56, 1

ServerManager serverManager = master.getServerManager();
AssignmentManager assignmentManager = master.getAssignmentManager();

    // 61, 1
    jamonWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n\n\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/>\n<title>HBase Master: ");
    // 69, 22
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerName()), jamonWriter);
    // 69, 50
    jamonWriter.write("</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/hbase.css\" />\n\n\n\n
Master: ");
    // 74, 29
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerName().getHostname()), jamonWriter);
    // 74, 71
    jamonWriter.write(":");
    // 74, 72
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerName().getPort()), jamonWriter);
    // 74, 110
    jamonWriter.write("
\n
\n  Local logs,\n  Thread Dump,\n  Log Level,\n  Debug dump,\n");
    // 80, 1
    if (HBaseConfiguration.isShowConfInServlet())
    {
      // 80, 48
      jamonWriter.write("\n  HBase Configuration\n");
    }
    // 82, 7
    jamonWriter.write("\n
\n\n\n");
    // 86, 1
    if (JvmVersion.isBadJvmVersion() )
    {
      // 86, 37
      jamonWriter.write("\n
\n  Your current JVM version ");
      // 88, 28
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(System.getProperty("java.version")), jamonWriter);
      // 88, 68
      jamonWriter.write(" is known to be\n  unstable with HBase. Please see the\n  HBase wiki\n  for details.\n
\n");
    }
    // 93, 7
    jamonWriter.write("\n");
    // 94, 1
    if (showAppendWarning )
    {
      // 94, 26
      jamonWriter.write(" \n
\n  You are currently running the HMaster without HDFS append support enabled.\n  This may result in data loss.\n  Please see the HBase wiki\n  for details.\n
\n");
    }
    // 101, 7
    jamonWriter.write("\n\n
\n
Attributes
\n
\n
Attribute Name	Value	Description
\n
HBase Version	");
    // 107, 31
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getVersion()), jamonWriter);
    // 107, 90
    jamonWriter.write(", r");
    // 107, 93
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getRevision()), jamonWriter);
    // 107, 153
    jamonWriter.write("	HBase version and revision
\n
HBase Compiled	");
    // 108, 32
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getDate()), jamonWriter);
    // 108, 88
    jamonWriter.write(", ");
    // 108, 90
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.hbase.util.VersionInfo.getUser()), jamonWriter);
    // 108, 146
    jamonWriter.write("	When HBase version was compiled and by whom
\n
Hadoop Version	");
    // 109, 32
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getVersion()), jamonWriter);
    // 109, 85
    jamonWriter.write(", r");
    // 109, 88
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getRevision()), jamonWriter);
    // 109, 142
    jamonWriter.write("	Hadoop version and revision
\n
Hadoop Compiled	");
    // 110, 33
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getDate()), jamonWriter);
    // 110, 83
    jamonWriter.write(", ");
    // 110, 85
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(org.apache.hadoop.util.VersionInfo.getUser()), jamonWriter);
    // 110, 135
    jamonWriter.write("	When Hadoop version was compiled and by whom
\n
HBase Root Directory	");
    // 111, 38
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(FSUtils.getRootDir(master.getConfiguration()).toString()), jamonWriter);
    // 111, 100
    jamonWriter.write("	Location of HBase home directory
\n
Zookeeper Quorum	");
    // 112, 34
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getZooKeeperWatcher().getQuorum()), jamonWriter);
    // 112, 80
    jamonWriter.write("	Addresses of all registered ZK servers. For more, see zk dump.
\n
HMaster Start Time	");
    // 113, 36
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(master.getMasterStartTime())), jamonWriter);
    // 113, 79
    jamonWriter.write("	Date stamp of when this HMaster was started
\n\n");
    // 115, 1
    if (master.isActiveMaster() )
    {
      // 115, 32
      jamonWriter.write("\n
HMaster Active Time	");
      // 116, 39
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(master.getMasterActiveTime())), jamonWriter);
      // 116, 83
      jamonWriter.write("	Date stamp of when this HMaster became active
\n
Load average	");
      // 117, 32
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.limitDecimalTo2((serverManager != null) ? serverManager.getAverageLoad() : 0)), jamonWriter);
      // 117, 127
      jamonWriter.write("	Average number of regions per regionserver. Naive computation.
\n
HBase Cluster ID	");
      // 118, 36
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getClusterId() != null ? master.getClusterId() : "Not set"), jamonWriter);
      // 118, 107
      jamonWriter.write("Unique identifier generated for each HBase cluster
\n  ");
      // 119, 3
      if (frags != null )
      {
        // 119, 24
        jamonWriter.write("\n
Fragmentation	");
        // 120, 41
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(frags.get("-TOTAL-") != null ? frags.get("-TOTAL-").intValue() + "%" : "n/a"), jamonWriter);
        // 120, 123
        jamonWriter.write("	Overall fragmentation of all tables, including .META. and -ROOT-.
\n  ");
      }
      // 121, 9
      jamonWriter.write("\n
\n    \n     Coprocessors	");
      // 124, 27
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(java.util.Arrays.toString(master.getCoprocessors())), jamonWriter);
      // 124, 84
      jamonWriter.write("\n    	\n    Coprocessors currently loaded loaded by the master	\n
\n");
    }
    // 128, 7
    jamonWriter.write("\n
\n\n");
    // 131, 1
    {
      org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_3 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
      __jamon__var_3.setFilter(filter );
      __jamon__var_3.renderNoFlush(jamonWriter);
    }
    // 131, 49
    jamonWriter.write("\n\n");
    // 133, 1
    if ((rootLocation != null) )
    {
      // 133, 31
      jamonWriter.write("\n");
      // 134, 1
      {
        // 134, 1
        __jamon_innerUnit__catalogTables(jamonWriter);
      }
      // 134, 20
      jamonWriter.write("\n");
    }
    // 135, 7
    jamonWriter.write("\n");
    // 136, 1
    if ((metaLocation != null) )
    {
      // 136, 31
      jamonWriter.write("\n");
      // 137, 1
      {
        // 137, 1
        __jamon_innerUnit__userTables(jamonWriter);
      }
      // 137, 17
      jamonWriter.write("\n");
    }
    // 138, 7
    jamonWriter.write("\n");
    // 139, 1
    {
      // 139, 1
      __jamon_innerUnit__userSnapshots(jamonWriter);
    }
    // 139, 20
    jamonWriter.write("\n");
    // 140, 1
    if ((servers != null) )
    {
      // 140, 26
      jamonWriter.write("\n");
      // 141, 1
      {
        // 141, 1
        __jamon_innerUnit__regionServers(jamonWriter);
      }
      // 141, 20
      jamonWriter.write("\n");
    }
    // 142, 7
    jamonWriter.write("\n");
    // 143, 1
    if ((deadServers != null) )
    {
      // 143, 30
      jamonWriter.write("\n");
      // 144, 1
      {
        // 144, 1
        __jamon_innerUnit__deadRegionServers(jamonWriter);
      }
      // 144, 24
      jamonWriter.write("\n");
    }
    // 145, 7
    jamonWriter.write("\n");
    // 146, 1
    if ((assignmentManager != null) )
    {
      // 146, 36
      jamonWriter.write("\n");
      // 147, 1
      {
        org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl __jamon__var_4 = new org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl(this.getTemplateManager());
        __jamon__var_4.renderNoFlush(jamonWriter, assignmentManager);
      }
      // 147, 70
      jamonWriter.write("\n");
    }
    // 148, 7
    jamonWriter.write("\n");
    // 149, 1
    if ((master != null) )
    {
      // 149, 25
      jamonWriter.write("\n    ");
      // 150, 5
      {
        org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl __jamon__var_5 = new org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl(this.getTemplateManager());
        __jamon__var_5.renderNoFlush(jamonWriter, master );
      }
      // 150, 50
      jamonWriter.write("\n");
    }
    // 151, 7
    jamonWriter.write("\n\n\n\n\n");
    // 300, 1

   HConnectionManager.deleteConnection(admin.getConfiguration(), false);

  }

  // 216, 1
  private void __jamon_innerUnit__userSnapshots(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 217, 1

   List<SnapshotDescription> snapshots = admin.listSnapshots();

    // 220, 1
    if ((snapshots != null && snapshots.size() > 0))
    {
      // 220, 51
      jamonWriter.write("\n
\n
\n    Snapshot	\n    Table	\n    Creation Time	\n    Type	\n
\n");
      // 228, 1
      for (SnapshotDescription snapshotDesc : snapshots)
      {
        // 228, 53
        jamonWriter.write("\n
\n    ");
        // 230, 66
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getName()), jamonWriter);
        // 230, 94
        jamonWriter.write("	\n    ");
        // 231, 64
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getTable()), jamonWriter);
        // 231, 93
        jamonWriter.write("	\n    ");
        // 232, 9
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(snapshotDesc.getCreationTime())), jamonWriter);
        // 232, 55
        jamonWriter.write("	\n    ");
        // 233, 9
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(snapshotDesc.getType()), jamonWriter);
        // 233, 37
        jamonWriter.write("	\n
\n");
      }
      // 235, 8
      jamonWriter.write("\n\n
 ");
      // 237, 5
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(snapshots.size()), jamonWriter);
      // 237, 27
      jamonWriter.write(" snapshot(s) in set.
\n
\n");
    }
    // 239, 7
    jamonWriter.write("\n");
  }

  // 156, 1
  private void __jamon_innerUnit__catalogTables(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 157, 1
    jamonWriter.write("
Tables
\n
\n
\n    Catalog Table	\n    ");
    // 161, 5
    if ((frags != null) )
    {
      // 161, 28
      jamonWriter.write("\n        Frag.	\n    ");
    }
    // 163, 11
    jamonWriter.write("\n    Description	\n
\n
\n    ");
    // 167, 83
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(Bytes.toString(HConstants.ROOT_TABLE_NAME)), jamonWriter);
    // 167, 131
    jamonWriter.write("	\n  ");
    // 168, 3
    if ((frags != null))
    {
      // 168, 25
      jamonWriter.write("\n        ");
      // 169, 28
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(frags.get("-ROOT-") != null ? frags.get("-ROOT-").intValue() + "%" : "n/a"), jamonWriter);
      // 169, 108
      jamonWriter.write("	\n  ");
    }
    // 170, 9
    jamonWriter.write("\n    The -ROOT- table holds references to all .META. regions.	\n
\n  ");
    // 173, 3
    if ((metaLocation != null) )
    {
      // 173, 33
      jamonWriter.write("\n
\n    ");
      // 175, 83
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(Bytes.toString(HConstants.META_TABLE_NAME)), jamonWriter);
      // 175, 131
      jamonWriter.write("	\n    ");
      // 176, 5
      if ((frags != null))
      {
        // 176, 27
        jamonWriter.write("\n        ");
        // 177, 28
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(frags.get(".META.") != null ? frags.get(".META.").intValue() + "%" : "n/a"), jamonWriter);
        // 177, 108
        jamonWriter.write("	\n    ");
      }
      // 178, 11
      jamonWriter.write("\n    The .META. table holds references to all User Table regions	\n
\n  \n  ");
    }
    // 182, 9
    jamonWriter.write("\n
\n");
  }

  // 186, 1
  private void __jamon_innerUnit__userTables(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 187, 1

   HTableDescriptor[] tables = admin.listTables();

    // 190, 1
    if ((tables != null && tables.length > 0))
    {
      // 190, 45
      jamonWriter.write("\n
\n
\n    User Table	\n");
      // 194, 1
      if ((frags != null) )
      {
        // 194, 24
        jamonWriter.write("\n        Frag.	\n");
      }
      // 196, 7
      jamonWriter.write("\n    Online Regions	\n    Description	\n
\n");
      // 200, 1
      for (HTableDescriptor htDesc : tables)
      {
        // 200, 41
        jamonWriter.write("\n
\n    ");
        // 202, 63
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.getNameAsString()), jamonWriter);
        // 202, 93
        jamonWriter.write(" 	\n    ");
        // 203, 5
        if ((frags != null) )
        {
          // 203, 28
          jamonWriter.write("\n        ");
          // 204, 28
          org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(frags.get(htDesc.getNameAsString()) != null ? frags.get(htDesc.getNameAsString()).intValue() + "%" : "n/a"), jamonWriter);
          // 204, 140
          jamonWriter.write("	\n    ");
        }
        // 205, 11
        jamonWriter.write("\n    ");
        // 206, 9
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getAssignmentManager().getRegionsOfTable(htDesc.getName()).size()), jamonWriter);
        // 206, 87
        jamonWriter.write("\n    ");
        // 207, 9
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(htDesc.toStringCustomizedValues()), jamonWriter);
        // 207, 48
        jamonWriter.write("	\n
\n");
      }
      // 209, 8
      jamonWriter.write("\n\n
 ");
      // 211, 5
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(tables.length), jamonWriter);
      // 211, 24
      jamonWriter.write(" table(s) in set. [Details]
\n
\n");
    }
    // 213, 7
    jamonWriter.write("\n");
  }

  // 242, 1
  private void __jamon_innerUnit__regionServers(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 243, 1
    jamonWriter.write("
Region Servers
\n");
    // 244, 1
    if ((servers != null && servers.size() > 0))
    {
      // 244, 47
      jamonWriter.write("\n");
      // 245, 1

     int totalRegions = 0;
     int totalRequests = 0;

      // 250, 1
      jamonWriter.write("
\n
	ServerName	Start time	Load
\n");
      // 252, 1

   ServerName [] serverNames = servers.toArray(new ServerName[servers.size()]);
     Arrays.sort(serverNames);
     for (ServerName serverName: serverNames) {
       // TODO: this is incorrect since this conf might differ from RS to RS
       // or be set to 0 to get ephemeral ports
       int infoPort = master.getConfiguration().getInt("hbase.regionserver.info.port", 60030);
       String url = "http://" + serverName.getHostname() + ":" + infoPort + "/";
       HServerLoad hsl = master.getServerManager().getLoad(serverName);
       String loadStr = hsl == null? "-": hsl.toString();
       if (hsl != null) {
         totalRegions += hsl.getNumberOfRegions();
         totalRequests += hsl.getNumberOfRequests();
       }
       long startcode = serverName.getStartcode();

      // 268, 1
      jamonWriter.write("
");
      // 268, 29
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName), jamonWriter);
      // 268, 45
      jamonWriter.write("	");
      // 268, 58
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(startcode)), jamonWriter);
      // 268, 83
      jamonWriter.write("	");
      // 268, 92
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(loadStr), jamonWriter);
      // 268, 105
      jamonWriter.write("
\n");
      // 269, 1

    }

      // 272, 1
      jamonWriter.write("
Total: 	servers: ");
      // 272, 34
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(servers.size()), jamonWriter);
      // 272, 54
      jamonWriter.write("		requestsPerSecond=");
      // 272, 90
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(totalRequests), jamonWriter);
      // 272, 109
      jamonWriter.write(", numberOfOnlineRegions=");
      // 272, 133
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(totalRegions), jamonWriter);
      // 272, 151
      jamonWriter.write("
\n
\n\n
Load is requests per second and count of regions loaded
\n");
    }
    // 276, 7
    jamonWriter.write("\n");
  }

  // 279, 1
  private void __jamon_innerUnit__deadRegionServers(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 280, 1
    jamonWriter.write("
Dead Region Servers
\n");
    // 281, 1
    if ((deadServers != null && deadServers.size() > 0))
    {
      // 281, 55
      jamonWriter.write("\n\n
\n
	ServerName
\n");
      // 285, 1

   ServerName [] deadServerNames = deadServers.toArray(new ServerName[deadServers.size()]);
     Arrays.sort(deadServerNames);
     for (ServerName deadServerName: deadServerNames) {
       int infoPort = master.getConfiguration().getInt("hbase.regionserver.info.port", 60030);

      // 291, 1
      jamonWriter.write("
");
      // 291, 9
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(deadServerName), jamonWriter);
      // 291, 29
      jamonWriter.write("
\n");
      // 292, 1

    }

      // 295, 1
      jamonWriter.write("
Total: 	servers: ");
      // 295, 34
      org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(deadServers.size()), jamonWriter);
      // 295, 58
      jamonWriter.write("
\n
\n");
    }
    // 297, 7
    jamonWriter.write("\n");
  }

}


text:
'use strict';

describe('Controller Tests', function() {

    describe('EntryConversationMap Management Detail Controller', function() {
        var $scope, $rootScope;
        var MockEntity, MockEntryConversationMap, MockConversation, MockKbdEntry;
        var createController;

        beforeEach(inject(function($injector) {
            $rootScope = $injector.get('$rootScope');
            $scope = $rootScope.$new();
            MockEntity = jasmine.createSpy('MockEntity');
            MockEntryConversationMap = jasmine.createSpy('MockEntryConversationMap');
            MockConversation = jasmine.createSpy('MockConversation');
            MockKbdEntry = jasmine.createSpy('MockKbdEntry');

            var locals = {
                '$scope': $scope,
                '$rootScope': $rootScope,
                'entity': MockEntity ,
                'EntryConversationMap': MockEntryConversationMap,
                'Conversation': MockConversation,
                'KbdEntry': MockKbdEntry
            };
            createController = function() {
                $injector.get('$controller')("EntryConversationMapDetailController", locals);
            };
        }));

        describe('Root Scope Listening', function() {
            it('Unregisters root scope listener upon scope destruction', function() {
                var eventType = 'noodleApp:entryConversationMapUpdate';

                createController();
                expect($rootScope.$$listenerCount[eventType]).toEqual(1);

                $scope.$destroy();
                expect($rootScope.$$listenerCount[eventType]).toBeUndefined();
            });
        });
    });

});


text:
package org.zy.yuancheng.weibo;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;

import com.sina.weibo.sdk.api.ImageObject;
import com.sina.weibo.sdk.api.WebpageObject;
import com.sina.weibo.sdk.api.WeiboMessage;
import com.sina.weibo.sdk.api.WeiboMultiMessage;
import com.sina.weibo.sdk.api.share.BaseRequest;
import com.sina.weibo.sdk.api.share.IWeiboShareAPI;
import com.sina.weibo.sdk.api.share.SendMessageToWeiboRequest;
import com.sina.weibo.sdk.api.share.SendMultiMessageToWeiboRequest;
import com.sina.weibo.sdk.api.share.WeiboShareSDK;
import com.sina.weibo.sdk.auth.AuthInfo;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.sina.weibo.sdk.auth.WeiboAuthListener;
import com.sina.weibo.sdk.auth.sso.SsoHandler;
import com.sina.weibo.sdk.exception.WeiboException;
import com.sina.weibo.sdk.utils.Base64;
import com.sina.weibo.sdk.utils.Utility;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

public class YCWeibo extends CordovaPlugin {

	public static final String SCOPE = "email,direct_messages_read,direct_messages_write,"
			+ "friendships_groups_read,friendships_groups_write,statuses_to_me_read,"
			+ "follow_app_official_microblog," + "invitation_write";
	public static final String WEBIO_APP_ID = "weibo_app_id";
	public static final String WEBIO_REDIRECT_URL = "redirecturi";
	public static final String DEFUALT_URL = "https://api.weibo.com/oauth2/default.html";
	public static final String CANCEL_BY_USER = "cancel by user";
	public static final String UNKNOW_ERROR = "unknow error";
	public static final String WEIBO_EXCEPTION = "weibo exception";
	public static final String ONLY_GET_CODE = "only get code";
	public static final String ERROR_IMAGE_URL = "share image url is incorrect";
	public static final String WEIBO_CLIENT_NOT_INSTALLEDL = "weibo client is not installed";
	public static final String DEFAULT_WEBPAGE_ICON = "http://www.sinaimg.cn/blog/developer/wiki/LOGO_64x64.png";
	public static CallbackContext currentCallbackContext;
	public static String APP_KEY;
	public static IWeiboShareAPI mWeiboShareAPI = null;
	private Oauth2AccessToken mAccessToken;
	private String REDIRECT_URL;
	private SsoHandler mSsoHandler;
	private String callbackId = "";

	@Override
	protected void pluginInitialize() {
		// TODO Auto-generated method stub
		super.pluginInitialize();
		APP_KEY = webView.getPreferences().getString(WEBIO_APP_ID, "");
		REDIRECT_URL = webView.getPreferences().getString(WEBIO_REDIRECT_URL, DEFUALT_URL);
	}

	@Override
	public boolean execute(String action, final JSONArray args,
			final CallbackContext callbackContext) throws JSONException {
		// TODO Auto-generated method stub
		if (action.equalsIgnoreCase("ssoLogin")) {
			return ssoLogin(callbackContext);
		} else if (action.equalsIgnoreCase("logout")) {
			return logout(callbackContext);
		} else if (action.equalsIgnoreCase("shareToWeibo")) {
			return shareToWeibo(callbackContext, args);
		}else if(action.equalsIgnoreCase("checkClientInstalled")){
			return checkClientInstalled(callbackContext);
		}
		return super.execute(action, args, callbackContext);
	}

	/**
	 * 组装JSON
	 *
	 * @param access_token
	 * @param userid
	 * @return
	 */
	private JSONObject makeJson(String access_token, String userid) {
		String json = "{\"access_token\": \"" + access_token
				+ "\",  \"userid\": \"" + userid + "\"}";
		JSONObject jo = null;
		try {
			jo = new JSONObject(json);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return jo;
	}

	/**
	 * weibo sso 登录
	 *
	 * @param callbackContext
	 * @return
	 */
	private boolean ssoLogin(CallbackContext callbackContext) {
		callbackId = callbackContext.getCallbackId();
		AuthInfo mAuthInfo = new AuthInfo(YCWeibo.this.cordova.getActivity(),
				APP_KEY, REDIRECT_URL, SCOPE);
		mSsoHandler = new SsoHandler(YCWeibo.this.cordova.getActivity(),
				mAuthInfo);
		mAccessToken = AccessTokenKeeper.readAccessToken(YCWeibo.this.cordova
				.getActivity());
		if (mAccessToken.isSessionValid()) {
			JSONObject jo = makeJson(mAccessToken.getToken(),
					mAccessToken.getUid());
			this.webView.sendPluginResult(new PluginResult(
					PluginResult.Status.OK, jo), callbackContext
					.getCallbackId());
		} else {
			Runnable runnable = new Runnable() {
				public void run() {
					if (mSsoHandler != null) {
						mSsoHandler.authorize(new AuthListener(YCWeibo.this));
					}
				};
			};
			this.cordova.setActivityResultCallback(this);
			this.cordova.getActivity().runOnUiThread(runnable);
		}
		return true;
	}

	/**
	 *  检查微博客户端是否安装
	 * @param callbackContext
	 * @return
	 */
	private boolean checkClientInstalled(CallbackContext callbackContext){
		AuthInfo mAuthInfo = new AuthInfo(YCWeibo.this.cordova.getActivity(),
				APP_KEY, REDIRECT_URL, SCOPE);
		if (mSsoHandler == null){
			mSsoHandler = new SsoHandler(YCWeibo.this.cordova.getActivity(),
					mAuthInfo);
		}
		Boolean installed = mSsoHandler.isWeiboAppInstalled();
		if(installed){
			callbackContext.success();
		}else{
			callbackContext.error(WEIBO_CLIENT_NOT_INSTALLEDL);
		}
		return true;
	}
	/**
	 * 微博登出
	 *
	 * @param callbackContext
	 * @return
	 */
	private boolean logout(CallbackContext callbackContext) {
		AccessTokenKeeper.clear(this.cordova.getActivity());
		callbackContext.success();
		return true;
	}

	/**
	 * 微博分享
	 *
	 * @param callbackContext
	 * @param args
	 * @return
	 */
	private boolean shareToWeibo(CallbackContext callbackContext,
			final JSONArray args) {
		currentCallbackContext = callbackContext;
		mWeiboShareAPI = WeiboShareSDK.createWeiboAPI(
				this.cordova.getActivity(), APP_KEY);
		mWeiboShareAPI.registerApp();
		cordova.getThreadPool().execute(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
				try {
					sendSingleMessage(args.getJSONObject(0));
				} catch (JSONException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
		return true;
	}

	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent intent) {
		// TODO Auto-generated method stub
		// super.onActivityResult(requestCode, resultCode, intent);
		if (mSsoHandler != null) {
			mSsoHandler.authorizeCallBack(requestCode, resultCode, intent);
		}

	}

	/**
	 * 生成微博要分享出去的网页对象
	 *
	 * @param params
	 * @return
	 * @throws JSONException
	 */
	private WebpageObject getWebpageObj(JSONObject params) throws JSONException {
		WebpageObject mediaObject = new WebpageObject();
		mediaObject.identify = Utility.generateGUID();
		mediaObject.title = params.getString("title");
		mediaObject.description = params.getString("description");
		if (params.getString("imageUrl") != null
				&& !params.getString("imageUrl").equalsIgnoreCase("")) {
			try {
				if (params.getString("imageUrl").startsWith("http://")
						|| params.getString("imageUrl").startsWith("https://")) {
					Bitmap thumb = BitmapFactory.decodeStream(new URL(params
							.getString("imageUrl")).openConnection()
							.getInputStream());
					mediaObject.setThumbImage(thumb);
				} else {
					currentCallbackContext.error(ERROR_IMAGE_URL);
				}

			} catch (MalformedURLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} else {
			try {
				Bitmap thumb = BitmapFactory
						.decodeStream(new URL(DEFAULT_WEBPAGE_ICON)
								.openConnection().getInputStream());
				mediaObject.setThumbImage(thumb);
			} catch (MalformedURLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		mediaObject.actionUrl = params.getString("url");
		mediaObject.defaultText = params.getString("defaultText");
		return mediaObject;
	}

	private ImageObject getImageObject(JSONObject param) {
		ImageObject imageObject = null;
		try {
			String data = (String)param.get("data");
			if (data != null) {
				byte[] dataBytes = data.getBytes();
				Base64.decode(dataBytes);
				imageObject = new ImageObject();
				Bitmap bitmap = BitmapFactory.decodeByteArray(dataBytes, 0, dataBytes.length);
				imageObject.setImageObject(bitmap);
			}
		} catch (JSONException e) {
			e.printStackTrace();
			return null;
		}

		return imageObject;
	}

	/**
	 * 发送微博单条消息请求
	 *
	 * @param params
	 */
	private void sendSingleMessage(JSONObject params) {
		//WeiboMultiMessage weiboMultiMessage = new WeiboMultiMessage();
        WeiboMessage weiboMessage = new WeiboMessage();
		BaseRequest request = null;
		try {
			if (params.has("data")) {
				ImageObject imageObject = getImageObject(params);
				if (imageObject == null) {
					currentCallbackContext.error("image cannot be sent.");
					return;
				}

				//weiboMultiMessage.imageObject = imageObject;
                weiboMessage.mediaObject = imageObject;
				//SendMultiMessageToWeiboRequest sendMultiMessageToWeiboRequest = new SendMultiMessageToWeiboRequest();
                //sendMultiMessageToWeiboRequest.transaction = String.valueOf(System.currentTimeMillis());
				//sendMultiMessageToWeiboRequest.multiMessage = weiboMultiMessage;
				//request = sendMultiMessageToWeiboRequest;
                SendMessageToWeiboRequest sendMessageToWeiboRequest = new SendMessageToWeiboRequest();
                sendMessageToWeiboRequest.transaction = String.valueOf(System.currentTimeMillis());
                sendMessageToWeiboRequest.message = weiboMessage;
                request = sendMessageToWeiboRequest;
			}
			else {
				weiboMessage.mediaObject = getWebpageObj(params);
				SendMessageToWeiboRequest sendMessageToWeiboRequest = new SendMessageToWeiboRequest();
				sendMessageToWeiboRequest.transaction = String.valueOf(System.currentTimeMillis());
				sendMessageToWeiboRequest.message = weiboMessage;
				request = sendMessageToWeiboRequest;
			}

		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		if (mWeiboShareAPI.isWeiboAppInstalled()) {
			if (mWeiboShareAPI.isWeiboAppSupportAPI()) {
				mWeiboShareAPI.sendRequest(this.cordova.getActivity(), request);
			} else {
				currentCallbackContext.error(UNKNOW_ERROR);
			}
		} else {
			if (request instanceof SendMessageToWeiboRequest) {
				sendSingleMsgWithOutClient((SendMessageToWeiboRequest)request);
			}
		}
	}

	/**
	 * 在没有客户端的情况下分享消息到微博
	 *
	 * @param request
	 */
	private void sendSingleMsgWithOutClient(SendMessageToWeiboRequest request) {
		AuthInfo mAuthInfo = new AuthInfo(YCWeibo.this.cordova.getActivity(),
				APP_KEY, REDIRECT_URL, SCOPE);
		Oauth2AccessToken accessToken = AccessTokenKeeper
				.readAccessToken(this.cordova.getActivity()
						.getApplicationContext());
		String token = "";
		if (accessToken != null) {
			token = accessToken.getToken();
		}
		mWeiboShareAPI.sendRequest(this.cordova.getActivity(), request,
				mAuthInfo, token, new WeiboAuthListener() {

					@Override
					public void onWeiboException(WeiboException arg0) {
						currentCallbackContext.error(WEIBO_EXCEPTION);
					}

					@Override
					public void onComplete(Bundle bundle) {
						// TODO Auto-generated method stub
						Oauth2AccessToken newToken = Oauth2AccessToken
								.parseAccessToken(bundle);
						AccessTokenKeeper.writeAccessToken(YCWeibo.this.cordova
								.getActivity().getApplicationContext(),
								newToken);
					}

					@Override
					public void onCancel() {
						currentCallbackContext.error(CANCEL_BY_USER);
					}
				});
	}

	class AuthListener implements WeiboAuthListener {
		final YCWeibo mWeibo;

		public AuthListener(YCWeibo weibo) {
			super();
			this.mWeibo = weibo;
		}

		@Override
		public void onComplete(Bundle values) {
			mAccessToken = Oauth2AccessToken.parseAccessToken(values);
			if (mAccessToken.isSessionValid()) {
				AccessTokenKeeper.writeAccessToken(
						YCWeibo.this.cordova.getActivity(), mAccessToken);
				JSONObject jo = makeJson(mAccessToken.getToken(),
						mAccessToken.getUid());
				this.mWeibo.webView.sendPluginResult(new PluginResult(
						PluginResult.Status.OK, jo), this.mWeibo.callbackId);
			} else {
				// 以下几种情况,您会收到 Code:
				// 1. 当您未在平台上注册的应用程序的包名与签名时;
				// 2. 当您注册的应用程序包名与签名不正确时;
				// 3. 当您在平台上注册的包名和签名与您当前测试的应用的包名和签名不匹配时。
				// String code = values.getString("code");
				this.mWeibo.webView.sendPluginResult(new PluginResult(
						PluginResult.Status.ERROR, ONLY_GET_CODE),
						this.mWeibo.callbackId);

			}
		}

		@Override
		public void onCancel() {
			this.mWeibo.webView.sendPluginResult(new PluginResult(
					PluginResult.Status.ERROR, CANCEL_BY_USER),
					this.mWeibo.callbackId);
		}

		@Override
		public void onWeiboException(WeiboException e) {
			this.mWeibo.webView.sendPluginResult(new PluginResult(
					PluginResult.Status.ERROR, WEIBO_EXCEPTION),
					this.mWeibo.callbackId);
		}
	}
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package arraybag;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author etcharn1
 */
public class ArrayBagTest {

    public ArrayBagTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void testGetCurrentSize() {
        System.out.println("getCurrentSize");
        ArrayBag<Integer> instance = new ArrayBag<Integer>();
        int expResult = 0;
        int result = instance.getCurrentSize();
        assertEquals(expResult, result);
    }

    @Test
    public void testIsEmptyWhenEmpty() {
        System.out.println("isEmpty");
        ArrayBag<Integer> instance = new ArrayBag<Integer>();
        boolean expResult = true;
        boolean result = instance.isEmpty();
        assertEquals(expResult, result);
    }

    @Test
    public void testIsEmptyWhenNotEmpty() {
        System.out.println("isEmpty");
        ArrayBag<Integer> instance = new ArrayBag<Integer>();
        instance.add(new Integer(42));
        boolean expResult = false;
        boolean result = instance.isEmpty();
        assertEquals(expResult, result);
    }

    @Test
    public void testAddWhenNotFull() {
        System.out.println("add");
        Object item = null;
        ArrayBag<Integer> instance = new ArrayBag<Integer>();

        boolean expResult = true;
        boolean result = instance.add(new Integer(42));
        assertEquals(expResult, result);
    }

    @Test
    public void testAddWhenFull() {
        System.out.println("add");
        Object item = null;
        ArrayBag<Integer> instance = new ArrayBag<Integer>(1);

        boolean result = instance.add(new Integer(42));
        assertEquals(true, result);

        result = instance.add(new Integer(42));
        assertEquals(false, result);
    }

    @Test
    public void testRemove_0args_whenNotEmpty() {
        System.out.println("remove");
        ArrayBag<Integer> instance = new ArrayBag<Integer>(1);
        instance.add(new Integer(42));
        Integer expResult = new Integer(42);
        Integer result = instance.remove();
        assertEquals(expResult, result);
    }

    @Test
    public void testRemove_0args_whenEmpty() {
        System.out.println("remove");
        ArrayBag<Integer> instance = new ArrayBag<Integer>(1);
        Integer expResult = null;
        Integer result = instance.remove();
        assertEquals(expResult, result);
    }

    @Test
    public void testRemove_GenericType_WhenNotInBag() {
        System.out.println("remove");
        Integer item = new Integer(42);
        ArrayBag<Integer> instance = new ArrayBag<Integer>(1);
        boolean expResult = false;
        boolean result = instance.remove(item);
        assertEquals(expResult, result);
    }

    @Test
    public void testRemove_GenericType_WhenInBag() {
        System.out.println("remove");
        Integer item = new Integer(42);
        ArrayBag<Integer> instance = new ArrayBag<Integer>(1);
        instance.add(item);
        boolean expResult = true;
        boolean result = instance.remove(item);
        assertEquals(expResult, result);
    }

    @Test
    public void testGetFrequencyOf_notPresent() {
        System.out.println("getFrequencyOf");
        String item = "something";
        ArrayBag<String> instance = new ArrayBag<String>();
        int expResult = 0;

        int result = instance.getFrequencyOf(item);

        assertEquals(expResult, result);
    }

    @Test
    public void testGetFrequencyOf_isPresent() {
        System.out.println("getFrequencyOf");
        String item = "something";
        ArrayBag<String> instance = new ArrayBag<String>();
        instance.add(item);
        instance.add(item);
        int expResult = 2;

        int result = instance.getFrequencyOf(item);

        assertEquals(expResult, result);
    }

    @Test
    public void testContains_doesNotContain() {
        System.out.println("contains");
        String item = "contains";
        boolean expResult = false;

        ArrayBag<String> instance = new ArrayBag<String>();
        boolean result = instance.contains(item);

        assertEquals(expResult, result);
    }

    @Test
    public void testContains_doesContain() {
        System.out.println("contains");
        String item = "contains";
        boolean expResult = true;

        ArrayBag<String> instance = new ArrayBag<String>();
        instance.add(item);
        boolean result = instance.contains(item);

        assertEquals(expResult, result);
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <runtime name="genuitec-cordova-2.2.0-public"/>
  <fixed facet="wst.jsdt.web"/>
  <fixed facet="emt.html5app"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
  <installed facet="emt.html5app" version="1.0"/>
  <installed facet="emt.html5app.android" version="1.0"/>
  <installed facet="emt.html5app.ios" version="1.0"/>
</faceted-project>


text:
<?php

use Lechimp\Formlets\Internal\Formlet as F;
use Lechimp\Formlets\Internal\Formlet;
use Lechimp\Formlets\Internal\NameSource;
use Lechimp\Formlets\Internal\RenderDict;
use Lechimp\Formlets\Internal\Values as V;

// Acoording to haskells typeclassopedia.
class FormletIsApplicativeTest extends PHPUnit_Framework_TestCase {
    /**
     * Tests first functor law: map id = id
     * When one maps id, it is as if nothing happened.
     * @dataProvider formlets_and_values
     */
    public function testFunctorLaw1( $formlet, $fn1, $fn2, $value
                                   , $contains_applicable) {
        $mapped = $formlet->map(F::id());
        $this->assertFormletsEqual($formlet, $mapped, $value, $contains_applicable);
    }

    /**
     * Tests second functor law: map (q . h) = (map q) . (map h)
     * When i map the composition of two functions it is as if if mapped the
     * functions one after another.
     * @dataProvider formlets_and_values
     */
    public function testFunctorLaw2( $formlet, $fn1, $fn2, $value
                                   , $contains_applicable) {
        $mapped_l = $formlet->map($fn1->composeWith($fn2));
        $mapped_r = $formlet->map($fn1)->map($fn2);
        return $this->assertFormletsEqual( $mapped_l, $mapped_r, $value
                                         , $contains_applicable);
    }

    /**
     * Tests first applicative law: pure id <*> v = v
     * Pure has no effects when id is used as content.
     * @dataProvider formlets_and_values
     */
    public function testApplicativeIdentityLaw( $formlet, $fn1, $fn2, $value
                                              , $contains_applicable) {
        if ($contains_applicable)
            return;
        $left = F::pure(F::id())->cmb($formlet);
        $this->assertFormletsEqual($left, $formlet, $value, $contains_applicable);
    }

    /**
     * Tests second applicative law: pure f <*> pure x  = pure (f x)
     * Structure is preserved between functor space and function space.
     * That is most propably misformulated.
     * @dataProvider formlets_and_values
     */
    public function testApplicativeHomomorphism( $formlet, $fn1, $fn2, $value
                                               , $contains_applicable) {
        $left1 = F::pure($fn1)->cmb(F::pure($value));
        $right1 = F::pure($fn1->apply($value));
        $this->assertFormletsEqual($left1, $right1, $value, false);
    }

    /**
     * Tests third applicative law: u <*> pure y = pure ($ y) <*> u
     * Applicative can be reversed when function application is reversed
     * two.
     * @dataProvider formlets_and_values
     */
    public function testApplicativeInterchange( $formlet, $fn1, $fn2, $value
                                              , $contains_applicable) {
        if (!$contains_applicable)
            return;
        $left = $formlet->cmb(F::pure($value));
        $right = F::pure(V::application_to($value))->cmb($formlet);
        $this->assertFormletsEqual($left, $right, $value, false);
    }

    /**
     * Tests fourth applicative law: u <*> (v <*> w) = pure (.) <*> u <*> v <*> w
     * @dataProvider formlets_and_values
     */
    public function testApplicativeComposition( $formlet, $fn1, $fn2, $value
                                              , $contains_applicable) {

        if (!$contains_applicable) {
            $left = F::pure($fn1)
                        ->cmb(F::pure($fn2)->cmb($formlet));
            $right = F::pure(V::composition())
                        ->cmb(F::pure($fn1))
                        ->cmb(F::pure($fn2))
                        ->cmb($formlet)
                        ;
            $this->assertFormletsEqual($left, $right, $value, false);
        }
        else {
            $left = F::pure($fn1)
                        ->cmb( $formlet->cmb(F::pure($value)) );
            $right = F::pure(V::composition())
                        ->cmb(F::pure($fn1))
                        ->cmb($formlet)
                        ->cmb(F::pure($value))
                        ;
            $this->assertFormletsEqual($left, $right, $value, false);
        }

    }

    public function formlets_and_values() {
        $data = array();
        $pure_val = F::pure(V::val(42));
        $pure_fn = F::pure(F::id());
        $formlets = array
            ( array($pure_val, false)
            , array($pure_fn, true)
            , array(F::text("TEXT")->cmb($pure_val), false)
            , array(F::text("TEXT")->cmb($pure_fn), true)
            , array($pure_val->cmb(F::text("TEXT")), false)
            , array($pure_fn->cmb(F::text("TEXT")), true)
            , array($pure_fn->cmb(F::input("text")), false)
            , array($pure_fn->cmb(F::textarea_raw()), false)
            , array($pure_fn->cmb(F::text_input()), false)
            , array($pure_fn->cmb(F::textarea()), false)
            , array($pure_fn->cmb(F::checkbox()), false)
            , array(F::submit("SUBMIT")->cmb($pure_val), false)
            , array(F::submit("SUBMIT")->cmb($pure_fn), true)
            , array($pure_val->cmb(F::submit("SUBMIT")), false)
            , array($pure_fn->cmb(F::submit("SUBMIT")), true)
            , array(F::email("foo@bar.com"), false)
            , array(F::hidden("foo"), false)
            , array(F::number(1, 0, 1000, 1, array(), "no int"
                             , "not in range", "step_length")
                   ,false)
            , array(F::password("foo"), false)
            , array(F::radio(array("100" => "100"), "100"), false)
            , array(F::search("foo"), false)
            , array(F::url("foo"), false)
            , array(F::select(array("100" => "100")), false)
            );
        $functions = array
            ( F::id()
            );
        $values = array(0,1,2);

        foreach ($formlets as $formlet) {
            foreach ($functions as $fn1) {
                foreach ($functions as $fn2) {
                    foreach ($values as $value) {
                        $data[] = array( $formlet[0], $fn1, $fn2
                                       , V::val($value), $formlet[1]
                                       );
                    }
                }
            }
        }
        return $data;
    }

    protected function assertFormletsEqual(Formlet $a, Formlet $b, $value
                                          , $contains_applicable) {
        // Two formlets are considered equal, when their observable output
        // is equal (that is like extensional equality?)
        $ns_a = NameSource::instantiate("test");
        $ns_b = NameSource::instantiate("test");
        $ns = NameSource::instantiate("test");
        $repr_a = $a->instantiate($ns_a);
        $repr_b = $b->instantiate($ns_b);

        $name_and_ns = $ns->getNameAndNext();
        $inp = array($name_and_ns["name"] => "100");

        $val_a = $repr_a["collector"]->collect($inp);
        $val_b = $repr_b["collector"]->collect($inp);
        // This will only work if equal works as expected on the result, that
        // is the thing checked really is equality and not identity.
        if (!$contains_applicable) {
            if ($val_a->isError()) {
                print_r($val_a->toDict());
            }
            $this->assertEquals( $val_a->get()
                               , $val_b->get()
                               );
        }
        else {
            $this->assertEquals( $val_a->apply($value)->get()
                               , $val_b->apply($value)->get()
                               );
        }

        $dict_a = new RenderDict($inp, $val_a);
        $dict_b = new RenderDict($inp, $val_b);

        $rendered_a = $repr_a["builder"]->build()->render();
        $rendered_b = $repr_b["builder"]->build()->render();
        $this->assertEquals($rendered_a, $rendered_b);

        $rendered_a2 = $repr_a["builder"]->buildWithDict($dict_a)->render();
        $rendered_b2 = $repr_b["builder"]->buildWithDict($dict_b)->render();
        $this->assertEquals($rendered_a2, $rendered_b2);
    }
}

?>


text:
package org.compass.core.test.spellcheck.properties;

import org.compass.core.config.CompassSettings;
import org.compass.core.lucene.LuceneEnvironment;
import org.compass.core.mapping.SpellCheck;

/**
 * @author kimchy
 */
public class GlobalExcludeProeprtiesSpellCheckTests extends AbstractGlobalPropertiesSpellCheckTests {

    protected void addSettings(CompassSettings settings) {
        super.addSettings(settings);
        settings.setSetting(LuceneEnvironment.SpellCheck.GLOBAL_EXCLUDE_PROPERTY, "value3");
        settings.setSetting(LuceneEnvironment.SpellCheck.DEFAULT_MODE, SpellCheck.INCLUDE.toString());
    }

}


text:
title: THE RIVETER on The Cold Song
book: en/books/the-cold-song.md
type: blurb
date: 2004-01-05 00:00:00 -0500
attribution: THE RIVETER
file: ''
featured: false
weight: ''

---
\[Ullmann\] flits back and forth from character to character with cinematic ease…The Cold Song's palpability chilled and captivated me in a way no blood splatter could. I didn't blink.


text:
"""b3j0f.sync package."""

__all__ = ['AccessorRegistry']

from ..record import Record

class AccessorRegistry(dict):
    """In charge of register accessors.

    Accessors are registered related to record type such as python class or
    record name (a collection name for example)."""

    def __init__(self, accessors=None, *args, **kwargs):

        super(AccessorRegistry, self).__init__(*args, **kwargs)

        if accessors is not None:
            self.register(accessors=accessors)

    def register(self, accessors):
        """Register accessors.

        :param list accessors: accessors to register.
        """

        for accessor in accessors:
            for rtype in accessor.__rtypes__:
                self[rtype] = accessor

    def unregister(self, rtypes=None, accessors=None):
        """Unregister accessors or rtypes.

        :param list rtypes: record types to unregister.
        :param list accessors: accessors to unregister.
        """

        if rtypes is not None:
            for rtype in rtypes:
                del self[rtype]

        if accessors is not None:
            for accessor in accessors:
                for rtype in accessor.__rtypes__:
                    if rtype in self:
                        del self[rtype]


text:
class DumpTruck
  module Mysql
    class Client
      def initialize(connection_config, schema_config)
        @ssh_user = connection_config.ssh_user
        @ssh_hostname = connection_config.ssh_hostname
        @schema = schema_config.name

        write_defaults_file(connection_config)
      end

      def tables_dump
        IO.popen(tables_dump_command, &Proc.new)
      end

      def data_dump(table_config, table)
        IO.popen(data_dump_command(table_config, table), &Proc.new)
      end

    private
      attr_reader :ssh_user, :ssh_hostname, :hostname, :user, :password, :schema, :file

      def cnf_file
        file.path
      end

      def write_defaults_file(connection_config)
        hostname = connection_config.hostname
        user = connection_config.user
        password = connection_config.password

        @file = Tempfile.new('my.cnf')
        @file.write <<-MYCNF.gsub(/^\s+/, '')
          [mysqldump]
          user = #{user}
          #{"password = #{password}" if !password.nil? && !password.empty?}
          host = #{hostname}
          hex-blob
          no-create-db
          skip-comments
          single-transaction
          complete-insert
          compress
          net_buffer_length = 1048576
        MYCNF
        @file.close
      end

      def tables_dump_command
        "#{ssh_connection} mysqldump --defaults-extra-file=#{cnf_file} --no-data --no-set-names --no-tablespaces --skip-add-drop-table --skip-add-locks --skip-set-charset #{schema}"
      end

      def data_dump_command(config, table)
        "#{ssh_connection} mysqldump --defaults-extra-file=#{cnf_file} --add-drop-table --add-locks #{data_flag(config)} #{where_flag(config)} #{schema} #{table}"
      end

      def ssh_connection
        user_string = "#{@ssh_user}@" if @ssh_user

        "ssh -C #{user_string}#{@ssh_hostname} " if @ssh_hostname
      end

      def data_flag(config)
        config.mode == :none ? '--no-data' : ''
      end

      def where_flag(config)
        config.mode == :some ? "--where='#{config.query}'" : ''
      end
    end
  end
end