text:
#pragma once

/* Generic header includes */
#include <aws/budgets/BudgetsErrors.h>
#include <aws/core/client/GenericClientConfiguration.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/client/AsyncCallerContext.h>
#include <aws/core/http/HttpTypes.h>
#include <aws/budgets/BudgetsEndpointProvider.h>
#include <future>
#include <functional>
/* End of generic header includes */

/* Service model headers required in BudgetsClient header */
#include <aws/budgets/model/CreateBudgetResult.h>
#include <aws/budgets/model/CreateBudgetActionResult.h>
#include <aws/budgets/model/CreateNotificationResult.h>
#include <aws/budgets/model/CreateSubscriberResult.h>
#include <aws/budgets/model/DeleteBudgetResult.h>
#include <aws/budgets/model/DeleteBudgetActionResult.h>
#include <aws/budgets/model/DeleteNotificationResult.h>
#include <aws/budgets/model/DeleteSubscriberResult.h>
#include <aws/budgets/model/DescribeBudgetResult.h>
#include <aws/budgets/model/DescribeBudgetActionResult.h>
#include <aws/budgets/model/DescribeBudgetActionHistoriesResult.h>
#include <aws/budgets/model/DescribeBudgetActionsForAccountResult.h>
#include <aws/budgets/model/DescribeBudgetActionsForBudgetResult.h>
#include <aws/budgets/model/DescribeBudgetNotificationsForAccountResult.h>
#include <aws/budgets/model/DescribeBudgetPerformanceHistoryResult.h>
#include <aws/budgets/model/DescribeBudgetsResult.h>
#include <aws/budgets/model/DescribeNotificationsForBudgetResult.h>
#include <aws/budgets/model/DescribeSubscribersForNotificationResult.h>
#include <aws/budgets/model/ExecuteBudgetActionResult.h>
#include <aws/budgets/model/UpdateBudgetResult.h>
#include <aws/budgets/model/UpdateBudgetActionResult.h>
#include <aws/budgets/model/UpdateNotificationResult.h>
#include <aws/budgets/model/UpdateSubscriberResult.h>
/* End of service model headers required in BudgetsClient header */

namespace Aws
{
  namespace Http
  {
    class HttpClient;
    class HttpClientFactory;
  } // namespace Http

  namespace Utils
  {
    template< typename R, typename E> class Outcome;

    namespace Threading
    {
      class Executor;
    } // namespace Threading
  } // namespace Utils

  namespace Auth
  {
    class AWSCredentials;
    class AWSCredentialsProvider;
  } // namespace Auth

  namespace Client
  {
    class RetryStrategy;
  } // namespace Client

  namespace Budgets
  {
    using BudgetsClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
    using BudgetsEndpointProviderBase = Aws::Budgets::Endpoint::BudgetsEndpointProviderBase;
    using BudgetsEndpointProvider = Aws::Budgets::Endpoint::BudgetsEndpointProvider;

    namespace Model
    {
      /* Service model forward declarations required in BudgetsClient header */
      class CreateBudgetRequest;
      class CreateBudgetActionRequest;
      class CreateNotificationRequest;
      class CreateSubscriberRequest;
      class DeleteBudgetRequest;
      class DeleteBudgetActionRequest;
      class DeleteNotificationRequest;
      class DeleteSubscriberRequest;
      class DescribeBudgetRequest;
      class DescribeBudgetActionRequest;
      class DescribeBudgetActionHistoriesRequest;
      class DescribeBudgetActionsForAccountRequest;
      class DescribeBudgetActionsForBudgetRequest;
      class DescribeBudgetNotificationsForAccountRequest;
      class DescribeBudgetPerformanceHistoryRequest;
      class DescribeBudgetsRequest;
      class DescribeNotificationsForBudgetRequest;
      class DescribeSubscribersForNotificationRequest;
      class ExecuteBudgetActionRequest;
      class UpdateBudgetRequest;
      class UpdateBudgetActionRequest;
      class UpdateNotificationRequest;
      class UpdateSubscriberRequest;
      /* End of service model forward declarations required in BudgetsClient header */

      /* Service model Outcome class definitions */
      typedef Aws::Utils::Outcome<CreateBudgetResult, BudgetsError> CreateBudgetOutcome;
      typedef Aws::Utils::Outcome<CreateBudgetActionResult, BudgetsError> CreateBudgetActionOutcome;
      typedef Aws::Utils::Outcome<CreateNotificationResult, BudgetsError> CreateNotificationOutcome;
      typedef Aws::Utils::Outcome<CreateSubscriberResult, BudgetsError> CreateSubscriberOutcome;
      typedef Aws::Utils::Outcome<DeleteBudgetResult, BudgetsError> DeleteBudgetOutcome;
      typedef Aws::Utils::Outcome<DeleteBudgetActionResult, BudgetsError> DeleteBudgetActionOutcome;
      typedef Aws::Utils::Outcome<DeleteNotificationResult, BudgetsError> DeleteNotificationOutcome;
      typedef Aws::Utils::Outcome<DeleteSubscriberResult, BudgetsError> DeleteSubscriberOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetResult, BudgetsError> DescribeBudgetOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetActionResult, BudgetsError> DescribeBudgetActionOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetActionHistoriesResult, BudgetsError> DescribeBudgetActionHistoriesOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetActionsForAccountResult, BudgetsError> DescribeBudgetActionsForAccountOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetActionsForBudgetResult, BudgetsError> DescribeBudgetActionsForBudgetOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetNotificationsForAccountResult, BudgetsError> DescribeBudgetNotificationsForAccountOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetPerformanceHistoryResult, BudgetsError> DescribeBudgetPerformanceHistoryOutcome;
      typedef Aws::Utils::Outcome<DescribeBudgetsResult, BudgetsError> DescribeBudgetsOutcome;
      typedef Aws::Utils::Outcome<DescribeNotificationsForBudgetResult, BudgetsError> DescribeNotificationsForBudgetOutcome;
      typedef Aws::Utils::Outcome<DescribeSubscribersForNotificationResult, BudgetsError> DescribeSubscribersForNotificationOutcome;
      typedef Aws::Utils::Outcome<ExecuteBudgetActionResult, BudgetsError> ExecuteBudgetActionOutcome;
      typedef Aws::Utils::Outcome<UpdateBudgetResult, BudgetsError> UpdateBudgetOutcome;
      typedef Aws::Utils::Outcome<UpdateBudgetActionResult, BudgetsError> UpdateBudgetActionOutcome;
      typedef Aws::Utils::Outcome<UpdateNotificationResult, BudgetsError> UpdateNotificationOutcome;
      typedef Aws::Utils::Outcome<UpdateSubscriberResult, BudgetsError> UpdateSubscriberOutcome;
      /* End of service model Outcome class definitions */

      /* Service model Outcome callable definitions */
      typedef std::future<CreateBudgetOutcome> CreateBudgetOutcomeCallable;
      typedef std::future<CreateBudgetActionOutcome> CreateBudgetActionOutcomeCallable;
      typedef std::future<CreateNotificationOutcome> CreateNotificationOutcomeCallable;
      typedef std::future<CreateSubscriberOutcome> CreateSubscriberOutcomeCallable;
      typedef std::future<DeleteBudgetOutcome> DeleteBudgetOutcomeCallable;
      typedef std::future<DeleteBudgetActionOutcome> DeleteBudgetActionOutcomeCallable;
      typedef std::future<DeleteNotificationOutcome> DeleteNotificationOutcomeCallable;
      typedef std::future<DeleteSubscriberOutcome> DeleteSubscriberOutcomeCallable;
      typedef std::future<DescribeBudgetOutcome> DescribeBudgetOutcomeCallable;
      typedef std::future<DescribeBudgetActionOutcome> DescribeBudgetActionOutcomeCallable;
      typedef std::future<DescribeBudgetActionHistoriesOutcome> DescribeBudgetActionHistoriesOutcomeCallable;
      typedef std::future<DescribeBudgetActionsForAccountOutcome> DescribeBudgetActionsForAccountOutcomeCallable;
      typedef std::future<DescribeBudgetActionsForBudgetOutcome> DescribeBudgetActionsForBudgetOutcomeCallable;
      typedef std::future<DescribeBudgetNotificationsForAccountOutcome> DescribeBudgetNotificationsForAccountOutcomeCallable;
      typedef std::future<DescribeBudgetPerformanceHistoryOutcome> DescribeBudgetPerformanceHistoryOutcomeCallable;
      typedef std::future<DescribeBudgetsOutcome> DescribeBudgetsOutcomeCallable;
      typedef std::future<DescribeNotificationsForBudgetOutcome> DescribeNotificationsForBudgetOutcomeCallable;
      typedef std::future<DescribeSubscribersForNotificationOutcome> DescribeSubscribersForNotificationOutcomeCallable;
      typedef std::future<ExecuteBudgetActionOutcome> ExecuteBudgetActionOutcomeCallable;
      typedef std::future<UpdateBudgetOutcome> UpdateBudgetOutcomeCallable;
      typedef std::future<UpdateBudgetActionOutcome> UpdateBudgetActionOutcomeCallable;
      typedef std::future<UpdateNotificationOutcome> UpdateNotificationOutcomeCallable;
      typedef std::future<UpdateSubscriberOutcome> UpdateSubscriberOutcomeCallable;
      /* End of service model Outcome callable definitions */
    } // namespace Model

    class BudgetsClient;

    /* Service model async handlers definitions */
    typedef std::function<void(const BudgetsClient*, const Model::CreateBudgetRequest&, const Model::CreateBudgetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateBudgetResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::CreateBudgetActionRequest&, const Model::CreateBudgetActionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateBudgetActionResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::CreateNotificationRequest&, const Model::CreateNotificationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateNotificationResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::CreateSubscriberRequest&, const Model::CreateSubscriberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateSubscriberResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DeleteBudgetRequest&, const Model::DeleteBudgetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBudgetResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DeleteBudgetActionRequest&, const Model::DeleteBudgetActionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBudgetActionResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DeleteNotificationRequest&, const Model::DeleteNotificationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteNotificationResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DeleteSubscriberRequest&, const Model::DeleteSubscriberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteSubscriberResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetRequest&, const Model::DescribeBudgetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetActionRequest&, const Model::DescribeBudgetActionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetActionResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetActionHistoriesRequest&, const Model::DescribeBudgetActionHistoriesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetActionHistoriesResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetActionsForAccountRequest&, const Model::DescribeBudgetActionsForAccountOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetActionsForAccountResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetActionsForBudgetRequest&, const Model::DescribeBudgetActionsForBudgetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetActionsForBudgetResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetNotificationsForAccountRequest&, const Model::DescribeBudgetNotificationsForAccountOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetNotificationsForAccountResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetPerformanceHistoryRequest&, const Model::DescribeBudgetPerformanceHistoryOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetPerformanceHistoryResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeBudgetsRequest&, const Model::DescribeBudgetsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeBudgetsResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeNotificationsForBudgetRequest&, const Model::DescribeNotificationsForBudgetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeNotificationsForBudgetResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::DescribeSubscribersForNotificationRequest&, const Model::DescribeSubscribersForNotificationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeSubscribersForNotificationResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::ExecuteBudgetActionRequest&, const Model::ExecuteBudgetActionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ExecuteBudgetActionResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::UpdateBudgetRequest&, const Model::UpdateBudgetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateBudgetResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::UpdateBudgetActionRequest&, const Model::UpdateBudgetActionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateBudgetActionResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::UpdateNotificationRequest&, const Model::UpdateNotificationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateNotificationResponseReceivedHandler;
    typedef std::function<void(const BudgetsClient*, const Model::UpdateSubscriberRequest&, const Model::UpdateSubscriberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateSubscriberResponseReceivedHandler;
    /* End of service model async handlers definitions */
  } // namespace Budgets
} // namespace Aws


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World, Home!</string>
    <string name="app_name">CSLite</string>

</resources>

redpajama_set_name: RedPajamaGithub


text:
This is the base grade for Fluid components that are intended to add new [Handlebars block helpers](http://handlebarsjs.com/block_helpers.html)
to an instance of [`fluid.express.hb`](handlebars.md).

## Component Invokers

### `{that}.getHelper()`

Each "helper" module is expected to implement a `getHelper` invoker with an invoker that returns a helper function.
something like the following:

```javascript
fluid.registerNamespace("your.helper");

your.helper.getHelperFn = function (that) {
    return function (arg1, arg2) {
        // The two argument variations have the "options" object as the second argument.  one-argument variations have it as the first.
        var options = arg2 ? arg2 : arg1;
        return options.fn(this);
    };
};

fluid.defaults("your.helper", {
    gradeNames: ["fluid.handlebars.helper"],
    invokers: {
        "getHelper": {
            "funcName": "your.helper.getHelperFn",
            "args":     ["{that}"]
        }
    }
});
```

See [the Handlebars documentation](http:handlebarsjs.com/block_helpers.html) for an overview of the various types of
helper functions that are possible.

## Helper functions included with this package

This package provides additional handlebars helpers that can be used in your handlebars templates.  On the server side,
these are available by default when you use the `fluid.express.hb` handlebars middleware.  On the client side, these are
prewired into `fluid.templates.renderer`, the client-side renderer.

### `{{jsonify}}`

Convert an object into a string representation using JSON.stringify.  To use this function in your handlebars templates,
add code like:

```handlebars
{{jsonify variable}}
```

For more information, see the [jsonify helper docs](jsonifyHelper.md).

### `{{md}}`

Transform markdown into html.  To use this function in your handlebars templates, add code like:

```handlebars
{{md variable}}

{{md "string value"}}
```

For more information, see the [md helper docs](mdHelper.md).

### `{{equals}}`

Display content when two values match.  Values can be context variables or strings:

```handlebars
{{#equals json.baz json.qux}}true{{else}}false{{/equals}}

{{#equals json.foo json.qux}}true{{else}}false{{/equals}}

{{#equals json.foo "bar"}}true{{else}}false{{/equals}}

{{#equals "nonsense" json.qux}}true{{else}}false{{/equals}}
```

Note that, just like the `{{#if}}` block provided by handlebars, the `{{#equals}}` block supports the use of an optional
`{{else}}` block for cases in which the two values are not equal. For example:

```handlebars
{{#equals VARIABLE1 VARIABLE2 }}
  The variables are equal.
{{/equals}}

{{#equals VARIABLE1 "TEXT" }}
  The variable is equal to the text.
{{else}}
  The variable is not equal to the text.
{{/equals}}
```

Note in the second example that `else` is supported if the condition is not matched, as with the built-in `{{#if}}`
helper.

### `{{messageHelper}}`

Resolves a message key based on the user's locale and language preferences, and replace it with
localised/internationalised text.  For example:

```handlebars
{{messageHelper "my-message-key" myContextVariable}}
```

See the [i18n documentation for more details](i18n.md) for more details.


text:
import java.util.*;
import static java.lang.Math.*;
import java.util.stream.*;

/*
Problem name: 11234 Expressions
Problem url: https://uva.onlinejudge.org/external/112/11234.pdf
Author: Andrey Yemelyanov
*/
public class _11234_Expressions {
  static class Node{
    public char value;
    public Node left;
    public Node right;
    public Node(char value){
      this.value = value;
    }
  }
  public static void main(String[] args){
    Scanner s = new Scanner(System.in);
    int T = s.nextInt();
    while(T-- > 0){
      String postfixExpression = s.next();
      List<Node> traversal = levelOrderTraversal(buildTree(postfixExpression));
      Collections.reverse(traversal);
      System.out.println(
        traversal.stream()
                 .map(node -> Character.toString(node.value))
                 .collect(Collectors.joining(""))
      );
    }
  }

  static List<Node> levelOrderTraversal(Node tree){
    List<Node> traversal = new ArrayList<>();
    Queue<Node> q = new LinkedList<>();
    q.add(tree);
    while(!q.isEmpty()){
      Node node = q.remove();
      traversal.add(node);
      if(node.left != null) q.add(node.left);
      if(node.right != null) q.add(node.right);
    }
    return traversal;
  }

  static Node buildTree(String postfixExpression){
    Stack<Node> s = new Stack<>();
    for(char c : postfixExpression.toCharArray()){
      if(!isOperator(c)) s.push(new Node(c));
      else{
        Node root = new Node(c);
        root.right = s.pop();
        root.left = s.pop();
        s.push(root);
      }
    }
    return s.pop();
  }

  static boolean isOperator(char c){
    return Character.isUpperCase(c);
  }
}


text:
module PublicActivity
  # Handles creation of Activities upon destruction of tracked model.
  module Destruction
    extend ActiveSupport::Concern

    included do
      before_destroy { create_activity :destroy }
    end
  end
end


text:
import abstract_filter

class AllHostsFilter(abstract_filter.AbstractHostFilter):
    """NOP host filter. Returns all hosts."""

    def host_passes(self, host_state, filter_properties):
        return True


text:
package com.happydroids.droidtowers.gui;

import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.happydroids.droidtowers.entities.GridObject;
import com.happydroids.droidtowers.entities.Player;

public class ConfirmRedecorationDialog extends Dialog {
	public ConfirmRedecorationDialog(final GridObject gridObject) {
		super();

		setMessage("Would you like to redecorate this room?\n\nIt will cost $1,000.");
		addButton("Yes", new VibrateClickListener() {
			@Override
			public void onClick(InputEvent event, float x, float y) {
				dismiss();

				int variationId = gridObject.getVariationId() + 1;
				if (variationId > gridObject.getGridObjectType().getNumVariations()) {
					variationId = 1;
				}

				gridObject.setVariationId(variationId);
				gridObject.updateSprite();

				Player.instance().subtractCurrency(1000);
			}
		});

		addButton("No", new VibrateClickListener() {
			@Override
			public void onClick(InputEvent event, float x, float y) {
				dismiss();
			}
		});
	}
}


text:
// LICENSE
package com.forgedui.editor.edit.tree;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.swt.graphics.Image;

import com.forgedui.editor.GUIEditorPlugin;
import com.forgedui.model.Container;
import com.forgedui.model.Element;
import com.forgedui.model.Screen;
import com.forgedui.model.titanium.AlertDialog;
import com.forgedui.model.titanium.Button;
import com.forgedui.model.titanium.ButtonBar;
import com.forgedui.model.titanium.CoverFlowView;
import com.forgedui.model.titanium.DashboardItem;
import com.forgedui.model.titanium.DashboardView;
import com.forgedui.model.titanium.EmailDialog;
import com.forgedui.model.titanium.ImageView;
import com.forgedui.model.titanium.Label;
import com.forgedui.model.titanium.OptionDialog;
import com.forgedui.model.titanium.Picker;
import com.forgedui.model.titanium.PickerColumn;
import com.forgedui.model.titanium.PickerRow;
import com.forgedui.model.titanium.ProgressBar;
import com.forgedui.model.titanium.ScrollView;
import com.forgedui.model.titanium.ScrollableView;
import com.forgedui.model.titanium.SearchBar;
import com.forgedui.model.titanium.Slider;
import com.forgedui.model.titanium.Switch;
import com.forgedui.model.titanium.Tab;
import com.forgedui.model.titanium.TabGroup;
import com.forgedui.model.titanium.TabbedBar;
import com.forgedui.model.titanium.TabbedBarButton;
import com.forgedui.model.titanium.TableView;
import com.forgedui.model.titanium.TableViewRow;
import com.forgedui.model.titanium.TableViewSection;
import com.forgedui.model.titanium.TextArea;
import com.forgedui.model.titanium.TextField;
import com.forgedui.model.titanium.TitleBar;
import com.forgedui.model.titanium.Toolbar;
import com.forgedui.model.titanium.View;
import com.forgedui.model.titanium.WebView;
import com.forgedui.model.titanium.Window;
import com.forgedui.model.titanium.ipad.Popover;
import com.forgedui.model.titanium.ipad.SplitWindow;
import com.forgedui.util.Utils;

/**
 * @author Dmitry {dmitry.grimm@gmail.com}
 *
 */
public class ModelLabelProvider {

	private static Image CONTAINER = GUIEditorPlugin.getImageDescriptor("icons/container.gif").createImage();
	private static Image ELEMENT = GUIEditorPlugin.getImageDescriptor("icons/flame.png").createImage();

	// Doing the rest of the images for the outline view.
	private static Image SCREEN_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/flame.png").createImage();
	private static Image WINDOW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/window.png").createImage();
	private static Image TITLEBAR_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/toolbar.png").createImage();
	private static Image BUTTON_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/buttonview.png").createImage();
	private static Image LABEL_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/labelview.png").createImage();
	private static Image WEBVIEW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/webview.png").createImage();
	private static Image SLIDER_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/sliderview.png").createImage();
	private static Image VIEW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/view.png").createImage();
	private static Image TAB_GROUP_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/tabgroup.png").createImage();
	private static Image TAB_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/tab.png").createImage();
	private static Image PICKER_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/pickerview.png").createImage();
	private static Image PICKER_COL_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/pickercolumn.png").createImage();
	private static Image PICKER_ROW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/pickerrow.png").createImage();
	private static Image SCROLL_VIEW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/scrollview.png").createImage();
	private static Image SCROLLABLE_VIEW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/scrollableview.png").createImage();

	private static Image COVER_FLOW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/coverflowview.png").createImage();
	private static Image SWITCH_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/switchview.png").createImage();
	private static Image IMAGEVIEW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/imageview.png").createImage();

	private static Image TABLEVIEW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/tableview.png").createImage();
	private static Image TABLEROW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/tableviewrow.png").createImage();
	private static Image TABLESECTION_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/tableviewsection.png").createImage();

	private static Image TEXTAREA_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/textview.png").createImage();
	private static Image TEXTFIELD_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/textfieldview.png").createImage();

	private static Image DASHBOARD_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/dashboardview.png").createImage();
	private static Image DASHBOARD_ITEM_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/dashboarditem.png").createImage();

	private static Image PROGRESS_BAR_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/progressbar.png").createImage();

	private static Image BUTTON_BAR_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/buttonbarview.png").createImage();
	private static Image SEARCH_BAR_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/searchbar.png").createImage();
	private static Image TABBED_BAR_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/tabbedbar.png").createImage();
	private static Image TOOL_BAR_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Controls/toolbar.png").createImage();

	private static Image ALERTDIALOG_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/alertdialog.png").createImage();
	private static Image OPTIONDIALOG_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/optiondialog.png").createImage();
	private static Image EMAILDIALOG_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/emaildialog.png").createImage();
	private static Image POPOVER_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/popover.png").createImage();
	private static Image SPLIT_WINDOW_IMAGE = GUIEditorPlugin.getImageDescriptor("icons/palette/16/Base/splitwindow.png").createImage();

	public static String getText(Object obj){
		if (obj instanceof Tab){
			return Utils.getString(((Tab)obj).getTitle(), "");
		} else if (obj instanceof Button){
			return Utils.getString(((Button)obj).getTitle(), "");
		} else if (obj instanceof Label){
			return Utils.getString(((Label)obj).getText(), "");
		} else if (obj instanceof PickerRow){
			return Utils.getString(((PickerRow)obj).getTitle(), "");
		} else if (obj instanceof Screen){
			Screen screen = (Screen)obj;
			Dimension res = screen.getDiagram().getResForText();
			if(res == null)
				res = screen.getResolution();
			return screen.getPlatform().name()
				+ " " + res.width
				+ "x" + res.height;
		}
		return Utils.getString(((Element)obj).getName(), "");
	}

	public static Image getIcon(Object obj){
		if (obj instanceof Screen){
			return SCREEN_IMAGE;
		} else if (obj instanceof Window) {
			return WINDOW_IMAGE;
		} else if (obj instanceof TitleBar) {
			return TITLEBAR_IMAGE;
		} else if (obj instanceof Button) {
			return BUTTON_IMAGE;
		} else if (obj instanceof Label) {
			return LABEL_IMAGE;
		} else if (obj instanceof WebView) {
			return WEBVIEW_IMAGE;
		} else if (obj instanceof Slider) {
			return SLIDER_IMAGE;
		} else if (obj instanceof TabGroup) {
			return TAB_GROUP_IMAGE;
		} else if (obj instanceof View) {
			return VIEW_IMAGE;
		} else if (obj instanceof Tab) {
			return TAB_IMAGE;
		} else if (obj instanceof CoverFlowView) {
			return COVER_FLOW_IMAGE;
		} else if (obj instanceof Switch) {
			return SWITCH_IMAGE;
		} else if (obj instanceof ImageView) {
			return IMAGEVIEW_IMAGE;
		} else if (obj instanceof TableView) {
			return TABLEVIEW_IMAGE;
		} else if (obj instanceof TableViewRow) {
			return TABLEROW_IMAGE;
		} else if (obj instanceof TableViewSection) {
			return TABLESECTION_IMAGE;
		} else if (obj instanceof TextArea) {
			return TEXTAREA_IMAGE;
		} else if (obj instanceof TextField) {
			return TEXTFIELD_IMAGE;
		} else if (obj instanceof Picker) {
			return PICKER_IMAGE;
		} else if (obj instanceof PickerColumn) {
			return PICKER_COL_IMAGE;
		} else if (obj instanceof PickerRow) {
			return PICKER_ROW_IMAGE;
		} else if (obj instanceof ScrollView) {
			return SCROLL_VIEW_IMAGE;
		} else if (obj instanceof ScrollableView) {
			return SCROLLABLE_VIEW_IMAGE;
		} else if (obj instanceof DashboardView) {
			return DASHBOARD_IMAGE;
		} else if (obj instanceof DashboardItem) {
			return DASHBOARD_ITEM_IMAGE;
		} else if (obj instanceof ProgressBar) {
			return PROGRESS_BAR_IMAGE;
		} else if (obj instanceof ButtonBar) {
			return BUTTON_BAR_IMAGE;
		} else if (obj instanceof SearchBar) {
			return SEARCH_BAR_IMAGE;
		} else if (obj instanceof TabbedBar) {
			return TABBED_BAR_IMAGE;
		} else if (obj instanceof Toolbar) {
			return TOOL_BAR_IMAGE;
		} else if (obj instanceof TabbedBarButton) {
			return TAB_IMAGE;
		} else if (obj instanceof AlertDialog) {
			return ALERTDIALOG_IMAGE;
		} else if (obj instanceof OptionDialog) {
			return OPTIONDIALOG_IMAGE;
		} else if (obj instanceof Popover) {
			return POPOVER_IMAGE;
		} else if (obj instanceof SplitWindow) {
			return SPLIT_WINDOW_IMAGE;
		} else if (obj instanceof EmailDialog) {
			return EMAILDIALOG_IMAGE;
		} else if (obj instanceof Container) {
			return CONTAINER;
		} else
			return ELEMENT;
	}

}


text:
/*
   ARPACK++ v1.2 2/18/2000
   c++ interface to ARPACK code.

   MODULE SymSimp.cc.
   Example program that illustrates how to solve a very simple
   real symmetric standard eigenvalue problem in regular mode
   using the ARSymStdEig class.

   1) Problem description:

      In this example we try to solve A*x = x*lambda in regular mode
      where A is the one dimensional discrete Laplacian on the interval
      [0,1] with zero Dirichlet boundary conditions.

  2) Data structure used to represent matrices A and B:

      When using ARSymGenEig, the user is required to provide a
      class that contain as member function the matrix-vector
      product w = Av. In this example, this class is called SymMatrix.

   3) Included header files:

      File             Contents
      -----------      -------------------------------------------
      arssym.h         The ARSymStdEig class definition.
      blas1.h          Some blas 1 routines.

   4) ARPACK Authors:

      Richard Lehoucq
      Kristyn Maschhoff
      Danny Sorensen
      Chao Yang
      Dept. of Computational & Applied Mathematics
      Rice University
      Houston, Texas
*/

#include "blas1c.h"
#include "arssym.h"

template<class T>
class SymMatrix {
/*

  This simple class exemplifies how to create a matrix class
  that can be used by ARPACK++.
  Basically, SymMatrix is required to have a member function
  that calculates the matrix-vector product SymMatrix*v,
  where v is a vector with elements of type T.

*/

 private:

  int  n;

 public:

  int  ncols() { return n; }

  void MultMv(T* v, T* w)

  /*
    Matrix vector subroutine
    where the matrix is the one dimensional discrete Laplacian on
    the interval [0,1] with zero Dirichlet boundary conditions.
  */

  {

    int  j;
    T    h2;

    const T two = 2.0;

    w[0] =  two*v[0] - v[1];
    for (j=1; j<n-1; j++) {
      w[j] = - v[j-1] + two*v[j] - v[j+1];
    }
    w[n-1] = - v[n-2] + two*v[n-1];

    // Scaling the vector w by (1 / h^2) using fortran blas routine scal.

    h2 = T((n+1)*(n+1));
    scal(n, h2, w, 1L);

  } // MultMv

  SymMatrix(int  nval) { n = nval; }

}; // SymMatrix.

template<class FLOAT, class EIGPROB>
void Solution(SymMatrix<FLOAT> &A, EIGPROB &Prob)
/*
  This function prints eigenvalues and eigenvetors on standard "cout"
  stream and exemplifies how to retrieve information from ARPACK++ classes.
*/

{

  int   i, n, nconv, mode;
  FLOAT *Ax;
  FLOAT *ResNorm;

  /*
     ARPACK++ includes some functions that provide information
     about the problem. For example, GetN furnishes the dimension
     of the problem and ConvergedEigenvalues the number of
     eigenvalues that attained the required accuracy. GetMode
     indicates if the problem was solved in regular,
     shift-and-invert or other mode.
  */

  n     = Prob.GetN();
  nconv = Prob.ConvergedEigenvalues();
  mode  = Prob.GetMode();

  cout << endl << endl << "Testing ARPACK++ class ARSymEig \n";
  cout << "Real symmetric eigenvalue problem: A*x - lambda*x" << endl;
  switch (mode) {
  case 1:
    cout << "Regular mode" << endl << endl;
    break;
  case 3:
    cout << "Shift and invert mode" << endl << endl;
  }

  cout << "Dimension of the system            : " << n             << endl;
  cout << "Number of 'requested' eigenvalues  : " << Prob.GetNev() << endl;
  cout << "Number of 'converged' eigenvalues  : " << nconv         << endl;
  cout << "Number of Arnoldi vectors generated: " << Prob.GetNcv() << endl;
  cout << endl;

  /*
    EigenvaluesFound is a boolean function that indicates
    if the eigenvalues were found or not. Eigenvalue can be
    used to obtain one of the "converged" eigenvalues. There
    are other functions that return eigenvectors elements,
    Schur vectors elements, residual vector elements, etc.
  */

  if (Prob.EigenvaluesFound()) {
    cout << "Eigenvalues:" << endl;
    for (i=0; i<nconv; i++) {
      cout << "  lambda[" << (i+1) << "]: " << Prob.Eigenvalue(i) << endl;
    }
    cout << endl;
  }

  /*
    EigenvectorsFound indicates if the eigenvectors are
    available. RawEigenvector is one of the functions that
    provide raw access to ARPACK++ output data. Other functions
    of this type include RawEigenvalues, RawEigenvectors,
    RawSchurVector, RawResidualVector, etc.
  */

  if (Prob.EigenvectorsFound()) {

    // Printing the residual norm || A*x - lambda*x ||
    // for the nconv accurately computed eigenvectors.

    Ax      = new FLOAT[n];
    ResNorm = new FLOAT[nconv];

    for (i=0; i<nconv; i++) {
      A.MultMv(Prob.RawEigenvector(i),Ax);
      axpy(n, -Prob.Eigenvalue(i), Prob.RawEigenvector(i), 1, Ax, 1);
      ResNorm[i] = nrm2(n, Ax, 1) / fabs(Prob.Eigenvalue(i));
    }

    for (i=0; i<nconv; i++) {
      cout << "||A*x(" << (i+1) << ") - lambda(" << (i+1);
      cout << ")*x(" << (i+1) << ")||: " << ResNorm[i] << "\n";
    }
    cout << "\n";

    delete[] Ax;
    delete[] ResNorm;

  }

} // Solution

void SimpleTest()
{

  int  nconv;

  // Creating a double precision 100x100 matrix.

  SymMatrix<double> A(100);

  // Defining what we need: the four eigenvectors of A with smallest magnitude.

  ARSymStdEig<double, SymMatrix<double> >
    dprob(A.ncols(), 4, &A, &SymMatrix<double>::MultMv, "SM");

  /*
    It is possible to pass other parameters directly to the constructor
    of class ARSymStdEig in order to define a problem. The list
    of parameters includes, among other values, the maximum number of
    iterations allowed and the the relative accuracy used to define the
    stopping criterion. Alternatively, it is also possible to use function
    DefineParameters to set ARPACK++ variables after declaring dprob as an
    object of ARSymStdEig class using the default constructor.
  */

  // Finding eigenvectors.

  nconv = dprob.FindEigenvectors();

  /*
    FindEigenvalues, FindArnoldiBasis and FindSchurVectors
    are alternatives for FindEigenvectors. However, FindSchurVectors
    can only be used with non-symmetric real and complex problems.
    Some other functions like Eigenvectors, Eigenvalues and
    EigenValVectors could also be used. These functions store the
    desired data in user supplied vectors and matrices.
  */

  // Printing solution.

  Solution(A, dprob);

} // SimpleTest

int main()
{

  // Solving a double precision problem with n = 100.

  SimpleTest();

} // main


text:
<?php
use yii\helpers\Html;

// Init FCEditor
$js=<<<JS
	var data = $selected;

    // Init editor
	ZSYFCEditor.init(
        data,
        {
            svg: d3.select("svg.ZSYFCEditor"),
            width: 1280,
            height: 940
        }
    );
JS;

$this->registerJs($js);

$this->registerJsFile('/js/stcombobox.js',['depends'=>'frontend\assets\AppAsset'] );

$this->registerJsFile('/js/d3.min.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/popuppanel.js',['depends'=>'frontend\assets\AppAsset']);

$this->registerJsFile('/js/ZSYFCEditorUtil.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/ZSYFCNodeData.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/ZSYFCShapeMaker.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/ZSYFCObjectCollector.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/ZSYFCLinePathPosition.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/ZSYFCHelperPosition.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/ZSYFCLinkline.js',['depends'=>'frontend\assets\AppAsset']);
$this->registerJsFile('/js/ZSYFCEditor.js',['depends'=>'frontend\assets\AppAsset']);

$this->registerCssFile('/css/stcombobox.css' );
$this->registerCssFile('/css/popuppanel.css');
$this->registerCssFile('/css/style.css');
$this->registerCssFile('/css/building-editor.css',['depends'=>'frontend\assets\AppAsset']);

?>

    选择设备
    <?=Html::button("添加设备",["class"=>"btn btn-info","id"=>"addSwitchBtn"])?>
    <?=Html::button("保存模板",["class"=>"btn btn-info","id"=>"saveTplDataBtn"])?>
    <?=Html::button("重置模版",["class"=>"btn btn-info","id"=>"resetTplDataBtn"])?>

	<svg class="ZSYFCEditor" oncontextmenu="return false;" >
		<defs>
			<marker id="ZSYFCEditor_MarkerArrow" markerWidth="13" markerHeight="13" refx="9" refy="6" orient="auto">
				<path d="M2,2 L2,11 L10,6 L2,2" style="fill: #000000;" />
			</marker>
		</defs>
	</svg>

<?php

/*
$switchList = <<<abc
[
    { id: 'a1', label: '交换机1' },
    { id: 'a2', label: '交换机2' },
    { id: 'a3', label: '交换机3' },
    { id: 'a4', label: '交换机4' },
    { id: 'a5', label: '交换机5' }
]
abc;
*/
$switchList = json_encode($lists);

$btnBarJS = <<<abc
!function(switchList){
$(function(){
    // Init combo component
    var combo = new STComboBox();
    var filterList,
        selectedData_;

    combo.Init('switchcombo');

    function _getHasSetIdsMap(){
        var data = {};
        var lst = ZSYFCEditor.getData();
        var keys = Object.keys( lst );
        for( var i = 0, len = keys.length; i < len ; i++ ){
            data[ lst[keys[i]]["data"]["id"] ]  = 1;
        }
        return data;
    }

    function _buildList(){
        var data = [];
        filterList = function(){
            var map = _getHasSetIdsMap();
            return switchList.filter( function ( itm, i ){
                if( map[itm['id']] == undefined )
                    return true;
            } );
        }();

        filterList.forEach( function(v, i){
            data.push({
              id: i,
              text:  filterList[i]["label"],
              data: filterList[i]
            });
        });
        if( data.length == 0 ){
            $('#addSwitchBtn').attr("disabled", "disabled");
        } else {
            $('#addSwitchBtn').removeAttr("disabled");
        }
        combo.populateList(data);
    }

    combo.onSelect = function(e, v, selectedData){
        selectedData_ = selectedData;
        combo.getInput().blur();
    };

    $('#addSwitchBtn').click( function() {
       if(filterList && selectedData_){
            console.log("Button: Add switch.");
            ZSYFCEditor.addShape("switch", selectedData_["data"]);
            combo.filterAndResetSelected();
            _buildList();
            selectedData_ = null;
       }
    });

    $("#resetTplDataBtn").click( function () {
        ZSYFCEditor.reset(true);
    } );

    $("#saveTplDataBtn").click( function () {
        $.ajax({
            url:'/system/template/save',
            type: 'post',
            data: {
                "data": ZSYFCEditor.getData(true),
                "dataType": $type
            },
            dataType:"json",
            success:function(res){
                if(res.status){
                    alert("操作成功")
                }else{
                    alert("操作失败")
                }
            }
        });
    } );

    // Refresh combo list.
    _buildList();

    // If remove switch node, will call updateCallback.
    ZSYFCEditor.updateCallback( function () {
        _buildList();
    });

    combo.getInput().bind("focus", function(e){
        selectedData_ = null;
    });

});
}($switchList);
abc;

$this->registerJs($btnBarJS);

?>


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Anales Soc. Esp. Hist. Nat. 26:198. 1897

#### Original name
null

### Remarks
null


text:
![](https://travis-ci.org/cocos2d/cocos2d-js.svg?branch=master)

<img src="http://www.cocos2d-x.org/attachments/1508/2dh5-logo.png" width=200>

Cocos2d-JS
===========

Cocos2d-JS is Cocos2d-x engine's javascript version which includes Cocos2d-html5 and Cocos2d-x JSBinding. It supports full Cocos2d-x features with a set of simplified javascript friendly APIs.

Cocos2d-JS provides a consistent development experience for whichever platform you want to distribute to, both web and native. "Code once, run everywhere" is incredibly easy and natural in Cocos2d-JS. With one single javascript code base, you can run your game on both web browsers and native platforms including Mac OS, Windows, Linux, iOS and Android. This will bring your game great opportunities in almost all channels of distribution.

Furthermore, javascript friendly APIs make your game development experience a breeze, easy to code, test and distribute. Cocos2d-JS also offers Cocos Console, a scripting tool, to simplify the creation of projects and let you start coding right away. You can use it to create a new project and publish it to android, iOS, Mac OS or web.

## API Reference

- API Reference: [Online API reference](http://www.cocos2d-x.org/reference/html5-js/V3.0rc3/index.html)
- And you can download it from
[Cocos2d-JS-v3.0-rc3-API.zip](http://www.cocos2d-x.org/filedown/Cocos2d-JS-v3.0-rc3-API.zip)

## Online demos
- [MoonWarriors](http://www.cocos2d-x.org/MoonWarriors/index.html)
- [Testcase](http://www.cocos2d-x.org/js-tests/)

##How to Start a New Game

1. Download the code from [Cocos2d download site](http://www.cocos2d-x.org/download)
2. Run `setup.py`
3. Run the `cocos` script

Example:

    $ cd cocos2d-js
    $ ./setup.py
    $ source FILE_TO_SAVE_SYSTEM_VARIABLE

    $ cocos new MyGame -l js -d /directory/to/project
    $ cd /directory/to/project/MyGame

###Run the project under the game directory

* Run Cocos2d-html5 project with a Websever:

	```
	cocos run -p web
	```

* Compile and run project in Cocos2d-JSB :

	```
	cocos compile -p ios|mac|android|web
	cocos run -p ios|mac|android|web
	```

You may need to provide your Android NDK, Android SDK and ANT's paths during the setup. Note that this tool is developed with python, so you will need python (32bit) 2.7.5 or later installed on your machine (but it doesn't support Python3). Please refer to [Cocos Console document](http://www.cocos2d-x.org/docs/manual/framework/html5/v2/cocos-console/en).

And if you have any doubt about the usage, please use `-h` with any command to have some help messages.

You can also use prebuilt Xcode or Visual Studio projects which are located in `Game/frameworks/runtime-src/proj.xxx`

##Folder structure of new project

- frameworks
    - cocos2d-html5     : Cocos2d-JS html5 engine source
    - js-bindings       : JSB engine source (include Cocos2d-x and JSB)
    - runtime-src       : IDE projects (Android, iOS, Mac OS, Win32)
- publish               : Published apps
- runtime               : Debug app files
- tools                 : JS Bindings generator
- res                   : Your game resource folder for images, sounds, etc
- src                   : The source code folder to place your game's js files
- main.js               : The entrance of your game logic
- index.html            : The web page for hosting your game in web server

##Built-in Projects

There are two prebuilt projects in Cocos2d-JS repo:

- Test cases, located in `samples/js-tests`

 ```
 cd samples/js-tests
 run -p ios|mac|android|web
 ```
- Game sample : Moon Warriors, located in `samples/js-moonwarriors`

```
cd samples/js-moonwarriors
run -p ios|mac|android|web
```
And they share the same project files which are located in `build` folder, there are Xcode and Visual Studio projects.

##Main features

   * Support All modern browsers and native platforms
   * Scene management (workflow)
   * Transitions between scenes
   * Sprites and Sprite Sheets
   * Effects: Lens, Ripple, Waves, Liquid, etc.
   * Actions (behaviours):
     * Trasformation Actions: Move, Rotate, Scale, Fade, Tint, etc.
     * Composable actions: Sequence, Spawn, Repeat, Reverse
     * Ease Actions: Exp, Sin, Cubic, Elastic, etc.
     * Misc actions: CallFunc, OrbitCamera, Follow, Tween
   * Basic menus and buttons
   * Integrated with physics engines: [Box2d][5] and [Chipmunk][6]
   * Particle system
   * Skeleton Animations: [Spine][7] and Armature support
   * Fonts:
     * Fast font rendering using Fixed and Variable width fonts
     * Support for .ttf fonts
   * Tile Map support: Orthogonal, Isometric and Hexagonal
   * Parallax scrolling
   * Motion Streak
   * Render To Texture
   * Touch/Accelerometer on mobile devices
   * Touch/Mouse/Keyboard on desktop systems
   * Sound Engine support (CocosDenshion library) based on OpenAL or WebAudio on web
   * Integrated Slow motion/Fast forward
   * Fast and compressed textures: PVR compressed and uncompressed textures, ETC1 compressed textures, and more
   * Resolution Independence
   * Modularized engine for customization
   * Open Source Commercial Friendly: Compatible with open and closed source projects
   * OpenGL ES 2.0 (mobile) / OpenGL 2.1 (desktop) based
   * Full WebGL support and auto canvas fallback

## Documentations

- [Getting Started with Cocos2d-JS](http://www.cocos2d-x.org/docs/manual/framework/html5/en)

##Github note

If you fork our github repository or download the package from github, you will need to do some extra tasks:

- Run `frameworks/js-bindings/cocos2d-x/download-deps.py` to download external dependencies for Cocos2d-x
- Run `tools/cocos2d-console/download-bin.py` to download bin files for some cocos2d-console plugins like Google Closure Compiler and JSC Compiler.

Otherwise, you will fail to compile your JSB projects.


text:
mathcore.set_use_cuda_default( util.is_cuda_available() )
april_print_script_header(arg)
print("# CUDA:", util.is_cuda_available())

local common = require "scripts.common"
local bagging    = common.bagging
local create_ds  = common.create_ds
local predict    = common.predict
local train_mlp  = common.train_mlp
local write_submission = common.write_submission
local mop  = matrix.op
local rnd  = random(95309) --random(12394)
local wrnd = random(53867) --random(24825)
local srnd = random(35863) --random(52958)
local prnd = random(78646) --random(24925)
local NUM_CLASSES  = 9
local ID           = assert(tonumber(arg[1]))
local HSIZE        = tonumber(arg[2] or 900)
local DEEP_SIZE    = tonumber(arg[3] or 2)
local bunch_size   = tonumber(arg[4] or 512)
local NUM_BAGS     = tonumber(arg[5] or 1)
local MAX_FEATS    = tonumber(arg[6])
local wd           = tonumber(arg[7] or 0.0)
local var          = tonumber(arg[8] or 0.0)
local mp           = tonumber(arg[9] or 999)
local feats_name   = arg[10] or "std"
local opt          = arg[11] or "adadelta"
local ACTF         = arg[12] or "prelu"
local input_drop   = tonumber(arg[13] or 0.2)
local use_dropout  = true
local use_all      = true

print("# hsize deep_size bunch_size num_bags max_feats wd var mp feats actf input_drop")
print("#", HSIZE, DEEP_SIZE, bunch_size, NUM_BAGS,
      MAX_FEATS, wd, var, mp, feats_name, ACTF, input_drop)

local max_epochs = 3000

local optimizer = opt
local options = {
  --learning_rate = 10,
  --momentum = 0.1,
  max_norm_penalty = (mp < 999 and mp) or nil
}
for i=14,#arg do
  local k,v = arg[i]:match("([^%=]+)%=([^%=]+)")
  options[k] = tonumber(v)
end

print("# max_epochs", max_epochs)
print("# optimizer", optimizer)
print("# options", iterator(pairs(options)):concat("="," "))

local bagging_iteration=0
local function train(train_data, train_labels, val_data, val_labels)
  local HSIZE = HSIZE
  bagging_iteration = bagging_iteration + 1
  if bagging_iteration > 1 then
    HSIZE = math.round( HSIZE * (prnd:rand(1.5) + 0.25) )
  end
  print("# HSIZE", HSIZE)
  local isize = train_data:dim(2)
  local topology = { "%d inputs"%{isize} }
  if use_dropout then
    table.insert(topology, "dropout{prob=#2,random=#1}")
  end
  for i=1,DEEP_SIZE do
    table.insert(topology, "%d %s"%{HSIZE,ACTF})
    if use_dropout then
      table.insert(topology, "dropout{prob=0.5,random=#1}")
    end
  end
  table.insert(topology, "%d log_softmax"%{NUM_CLASSES})
  local topology = table.concat(topology, " ")
  print("# MLP", topology)
  local model = ann.mlp.all_all.generate(topology, { prnd, input_drop })
  local trainer = trainable.supervised_trainer(model,
                                               ann.loss.multi_class_cross_entropy(),
                                               bunch_size,
                                               ann.optimizer[optimizer](),
                                               false)
  trainer:build()
  trainer:randomize_weights{
    name_match = "[bw].*",
    random = wrnd,
    inf = -3,
    sup = 3,
    use_fanin = true,
    use_fanout = true,
  }
  for _,b in trainer:iterate_weights("b.*") do b:zeros() end
  for _,a in trainer:iterate_weights("a.*") do a:fill(0.25) end
  trainer:set_layerwise_option("w.*", "weight_decay", wd)
  for name,value in pairs(options) do trainer:set_option(name, value) end

  local train_in_ds,train_out_ds = create_ds(train_data, train_labels,
                                             NUM_CLASSES)
  local val_in_ds,val_out_ds = create_ds(val_data, val_labels, NUM_CLASSES)

  if use_all then
    train_in_ds = dataset.union{ train_in_ds, val_in_ds }
    train_out_ds = dataset.union{ train_out_ds, val_out_ds }
  end

  local train_in_ds = dataset.perturbation{ dataset  = train_in_ds,
                                            random   = prnd,
                                            variance = var }

  local best = train_mlp(trainer,
                         max_epochs,
                         { input_dataset = train_in_ds,
                           output_dataset = train_out_ds,
                           shuffle = srnd,
                           -- loss = ann.loss.batch_fmeasure_macro_avg(),
                           replacement = math.max(2560, bunch_size) },
                         { input_dataset = val_in_ds,
                           -- loss = ann.loss.non_paired_multi_class_cross_entropy(),
                           output_dataset = val_out_ds })
  return best
end

local predict_mlp = function(models, data)
  local func = function(model, data)
    return model:calculate(data):exp()
  end
  local p = predict(models, data, func)
  return p
end

local train_data = matrix.fromTabFilename("DATA/train_feats.%s.split.mat.gz"%{feats_name})
local train_labels = matrix.fromTabFilename("DATA/train_labels.split.mat.gz")
local val_data = matrix.fromTabFilename("DATA/val_feats.%s.split.mat.gz"%{feats_name})
local val_labels = matrix.fromTabFilename("DATA/val_labels.split.mat.gz")

print("# DATA SIZES", train_data:dim(1), train_data:dim(2),
      val_data:dim(1), val_data:dim(2))

local bagging_models = bagging(NUM_CLASSES, NUM_BAGS, MAX_FEATS, rnd,
                               train_data, train_labels,
                               val_data, val_labels,
                               train, predict_mlp,
                               "ID_%03d.validation.mlp.csv"%{ID})

-----------------------------------------------------------------------------

local test_data = matrix.fromTabFilename("DATA/test_feats.%s.split.mat.gz"%{feats_name})
local test_p = predict_mlp(bagging_models, test_data)
print(test_p)

write_submission("ID_%03d.test.mlp.csv"%{ID}, test_p)


text:
package nioredis.clients.jedis;

public interface BasicCommands {

    String ping();

    String quit();

    String flushDB();

    Long dbSize();

    String select(int index);

    String flushAll();

    String auth(String password);

    String save();

    String bgsave();

    String bgrewriteaof();

    Long lastsave();

    String shutdown();

    String info();

    String info(String section);

    String slaveof(String host, int port);

    String slaveofNoOne();

    Long getDB();

    String debug(DebugParams params);

    String configResetStat();

    Long waitReplicas(int replicas, long timeout);
}


text:
package com.google.inject.internal;

import com.google.common.collect.ImmutableSet;
import com.google.inject.AbstractModule;
import com.google.inject.Binder;
import com.google.inject.Binding;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.MembersInjector;
import com.google.inject.Module;
import com.google.inject.Provider;
import com.google.inject.Scope;
import com.google.inject.Stage;
import com.google.inject.TypeLiteral;
import com.google.inject.spi.DefaultBindingTargetVisitor;

/**
 * Guarantees that processing of Binding elements happens in a sane way.
 *
 * @author sameb@google.com (Sam Berlin)
 */
abstract class AbstractBindingProcessor extends AbstractProcessor {

  // It's unfortunate that we have to maintain a blacklist of specific
  // classes, but we can't easily block the whole package because of
  // all our unit tests.
  private static final ImmutableSet<Class<?>> FORBIDDEN_TYPES =
      ImmutableSet.<Class<?>>of(
          AbstractModule.class,
          Binder.class,
          Binding.class,
          Injector.class,
          Key.class,
          MembersInjector.class,
          Module.class,
          Provider.class,
          Scope.class,
          Stage.class,
          TypeLiteral.class);

  protected final ProcessedBindingData bindingData;

  AbstractBindingProcessor(Errors errors, ProcessedBindingData bindingData) {
    super(errors);
    this.bindingData = bindingData;
  }

  protected <T> UntargettedBindingImpl<T> invalidBinding(
      InjectorImpl injector, Key<T> key, Object source) {
    return new UntargettedBindingImpl<T>(injector, key, source);
  }

  protected void putBinding(BindingImpl<?> binding) {
    Key<?> key = binding.getKey();

    Class<?> rawType = key.getTypeLiteral().getRawType();
    if (FORBIDDEN_TYPES.contains(rawType)) {
      errors.cannotBindToGuiceType(rawType.getSimpleName());
      return;
    }

    BindingImpl<?> original = injector.getExistingBinding(key);
    if (original != null) {
      // If it failed because of an explicit duplicate binding...
      if (injector.state.getExplicitBinding(key) != null) {
        try {
          if (!isOkayDuplicate(original, binding, injector.state)) {
            errors.bindingAlreadySet(key, original.getSource());
            return;
          }
        } catch (Throwable t) {
          errors.errorCheckingDuplicateBinding(key, original.getSource(), t);
          return;
        }
      } else {
        // Otherwise, it failed because of a duplicate JIT binding
        // in the parent
        errors.jitBindingAlreadySet(key);
        return;
      }
    }

    // prevent the parent from creating a JIT binding for this key
    injector.state.parent().blacklist(key, injector.state, binding.getSource());
    injector.state.putBinding(key, binding);
  }

  /**
   * We tolerate duplicate bindings if one exposes the other or if the two bindings are considered
   * duplicates (see {@link Bindings#areDuplicates(BindingImpl, BindingImpl)}.
   *
   * @param original the binding in the parent injector (candidate for an exposing binding)
   * @param binding the binding to check (candidate for the exposed binding)
   */
  private boolean isOkayDuplicate(BindingImpl<?> original, BindingImpl<?> binding, State state) {
    if (original instanceof ExposedBindingImpl) {
      ExposedBindingImpl exposed = (ExposedBindingImpl) original;
      InjectorImpl exposedFrom = (InjectorImpl) exposed.getPrivateElements().getInjector();
      return (exposedFrom == binding.getInjector());
    } else {
      original = (BindingImpl<?>) state.getExplicitBindingsThisLevel().get(binding.getKey());
      // If no original at this level, the original was on a parent, and we don't
      // allow deduplication between parents & children.
      if (original == null) {
        return false;
      } else {
        return original.equals(binding);
      }
    }
  }

  private <T> void validateKey(Object source, Key<T> key) {
    Annotations.checkForMisplacedScopeAnnotations(
        key.getTypeLiteral().getRawType(), source, errors);
  }

  /**
   * Processor for visiting bindings. Each overriden method that wants to actually process the
   * binding should call prepareBinding first.
   */
  abstract class Processor<T, V> extends DefaultBindingTargetVisitor<T, V> {
    final Object source;
    final Key<T> key;
    final Class<? super T> rawType;
    Scoping scoping;

    Processor(BindingImpl<T> binding) {
      source = binding.getSource();
      key = binding.getKey();
      rawType = key.getTypeLiteral().getRawType();
      scoping = binding.getScoping();
    }

    protected void prepareBinding() {
      validateKey(source, key);
      scoping = Scoping.makeInjectable(scoping, injector, errors);
    }

    /**
     * Schedule initialization of this binding to occur immediately after all bindings have been
     * initialially processed.
     */
    protected void scheduleInitialization(BindingImpl<?> binding) {
      bindingData.addUninitializedBinding(asRunnable(binding));
    }

    /**
     * Schedule initialization for this binding to occur after all other static initialization of
     * bindings.
     */
    protected void scheduleDelayedInitialization(BindingImpl<?> binding) {
      bindingData.addDelayedUninitializedBinding(asRunnable(binding));
    }

    private Runnable asRunnable(final BindingImpl<?> binding) {
      return () -> {
        try {
          binding.getInjector().initializeBinding(binding, errors.withSource(source));
        } catch (ErrorsException e) {
          errors.merge(e.getErrors());
        }
      };
    }
  }
}


text:
package com.koch.ambeth.security;

public interface ISecurityContextFactory {

	ISecurityContext createSecurityContext();

}


text:
class udp_client_server_runtime_error : public std::runtime_error
{
public:
    udp_client_server_runtime_error(const char *w) : std::runtime_error(w) {}
};

class udp_client
{
public:
    udp_client(const std::string& addr, int port);
    ~udp_client();

    int                 get_socket() const;
    int                 get_port() const;
    std::string         get_addr() const;

    int                 send(const char *msg, size_t size);

private:
    int                 f_socket;
    int                 f_port;
    std::string         f_addr;
    struct addrinfo *   f_addrinfo;
};

class udp_server
{
public:
    udp_server(const std::string& addr, int port);
    ~udp_server();

    int                 get_socket() const;
    int                 get_port() const;
    std::string         get_addr() const;

    int                 recv(char *msg, size_t max_size);
    int                 timed_recv(char *msg, size_t max_size, int max_wait_ms);

private:
    int                 f_socket;
    int                 f_port;
    std::string         f_addr;
    struct addrinfo *   f_addrinfo;
};

#endif


text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using Rock.Messaging.NamedPipes;
using Rock.Messaging.Routing;
using Rock.StaticDependencyInjection;

namespace Rock.Messaging.Rock.StaticDependencyInjection
{
    internal partial class CompositionRoot : CompositionRootBase
    {
        public override void Bootstrap()
        {
            ImportFirst<IMessageParser>(DefaultMessageParser.SetCurrent);
            ImportFirst<INamedPipeConfigProvider>(NamedPipeMessagingScenarioFactory.SetDefaultConfigProvider);
            ImportFirst<ITypeLocator>(DefaultTypeLocator.SetCurrent);
            ImportFirst<IMessagingScenarioFactory>(MessagingScenarioFactory.SetFallback);
        }

        /// <summary>
        /// Gets a value indicating whether static dependency injection is enabled.
        /// </summary>
        public override bool IsEnabled
        {
            get
            {
                const string key = "Rock.StaticDependencyInjection.Enabled";
                var enabledValue = ConfigurationManager.AppSettings.Get(key) ?? "true";
                return enabledValue.ToLower() != "false";
            }
        }

        /// <summary>
        /// Return a collection of metadata objects that describe the export operations for a type.
        /// </summary>
        /// <param name="type">The type to get export metadata.</param>
        /// <returns>A collection of metadata objects that describe export operations.</returns>
        protected override IEnumerable<ExportInfo> GetExportInfos(Type type)
        {
            // Modify this method if your library needs to support a different
            // export mechanism (possibly a different attribute) that inspects
            // the type of a class.
            //
            // Remove this method if your library should not support any advanced
            // export mechanisms based on the type of a class.

            var attributes = Attribute.GetCustomAttributes(type, typeof(ExportAttribute));

            if (attributes.Length == 0)
            {
                return base.GetExportInfos(type);
            }

            return
                attributes.Cast<ExportAttribute>()
                .Select(attribute =>
                    new ExportInfo(type, attribute.Priority)
                    {
                        Disabled = attribute.Disabled,
                        Name = attribute.Name
                    });
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.Serialization;
using Orleans.Runtime;
using Orleans.Serialization;
using TestExtensions;
using Xunit;

namespace UnitTests.Serialization
{
    [TestCategory("BVT"), TestCategory("Serialization")]
    [Collection(TestEnvironmentFixture.DefaultCollection)]
    public class ILSerializerTests
    {
        private readonly TestEnvironmentFixture fixture;

        public ILSerializerTests(TestEnvironmentFixture fixture)
        {
            this.fixture = fixture;
        }

        /// <summary>
        /// Tests that <see cref="ILSerializerGenerator"/> supports distinct field selection for serialization
        /// versus copy operations.
        /// </summary>
        [Fact]
        public void ILSerializer_AllowCopiedFieldsToDifferFromSerializedFields()
        {
            var input = new FieldTest
            {
                One = 1,
                Two = 2,
                Three = 3
            };

            var generator = new ILSerializerGenerator();
            var serializers = generator.GenerateSerializer(input.GetType(), f => f.Name != "One", f => f.Name != "Three");
            var writer = new BinaryTokenStreamWriter();
            var context = new SerializationContext(this.fixture.SerializationManager)
            {
                StreamWriter = writer
            };
            var copy = (FieldTest)serializers.DeepCopy(input, context);
            Assert.Equal(1, copy.One);
            Assert.Equal(2, copy.Two);
            Assert.Equal(0, copy.Three);

            serializers.Serialize(input, context, input.GetType());
            var reader = new DeserializationContext(this.fixture.SerializationManager)
            {
                StreamReader = new BinaryTokenStreamReader(writer.ToByteArray())
            };
            var deserialized = (FieldTest)serializers.Deserialize(input.GetType(), reader);

            Assert.Equal(0, deserialized.One);
            Assert.Equal(2, deserialized.Two);
            Assert.Equal(3, deserialized.Three);
        }

        /// <summary>
        /// Tests that <see cref="ILSerializerGenerator"/> supports the <see cref="IOnDeserialized"/> lifecycle hook.
        /// </summary>
        [Fact]
        public void ILSerializer_LifecycleHooksAreCalled()
        {
            var input = new FieldTest();
            var generator = new ILSerializerGenerator();
            var serializers = generator.GenerateSerializer(input.GetType());
            var writer = new BinaryTokenStreamWriter();
            var context = new SerializationContext(this.fixture.SerializationManager)
            {
                StreamWriter = writer
            };
            serializers.Serialize(input, context, input.GetType());
            var reader = new DeserializationContext(this.fixture.SerializationManager)
            {
                StreamReader = new BinaryTokenStreamReader(writer.ToByteArray())
            };
            var deserialized = (FieldTest)serializers.Deserialize(input.GetType(), reader);

            Assert.Null(input.Context);
            Assert.NotNull(deserialized.Context);
            Assert.Equal(this.fixture.SerializationManager, deserialized.Context.GetSerializationManager());
        }

        /// <summary>
        /// Tests that <see cref="ILSerializerGenerator"/> does not serialize fields marked as [NonSerialized].
        /// </summary>
        [Fact]
        public void ILSerializer_NonSerializedFields()
        {
            var input = new FieldTest
            {
                One = 1,
                Two = 2,
                NonSerializedInt = 1098
            };
            var generator = new ILSerializerGenerator();
            var serializers = generator.GenerateSerializer(input.GetType());
            var writer = new BinaryTokenStreamWriter();
            var context = new SerializationContext(this.fixture.SerializationManager)
            {
                StreamWriter = writer
            };
            serializers.Serialize(input, context, input.GetType());
            var reader = new DeserializationContext(this.fixture.SerializationManager)
            {
                StreamReader = new BinaryTokenStreamReader(writer.ToByteArray())
            };
            var deserialized = (FieldTest) serializers.Deserialize(input.GetType(), reader);

            Assert.Equal(input.One, deserialized.One);
            Assert.Equal(input.Two, deserialized.Two);
            Assert.NotEqual(input.NonSerializedInt, deserialized.NonSerializedInt);
            Assert.Equal(default(int), deserialized.NonSerializedInt);
        }

        /// <summary>
        /// Tests that <see cref="ILBasedSerializer"/> can correctly serialize objects which have serialization lifecycle hooks.
        /// </summary>
        [Fact]
        public void ILSerializer_SerializesObjectWithHooks()
        {
            var input = new SimpleISerializableObject
            {
                Payload = "pyjamas"
            };

            // Verify that our behavior conforms to our expected behavior.
            var result = SerializerLoop(input);
            Assert.Equal(
                new[]
                {
                    "default_ctor",
                    "serializing",
                    "serialized"
                },
                input.History);
            Assert.Equal(2, input.Contexts.Count);
            Assert.All(input.Contexts,
                ctx => Assert.True(ctx.Context is ICopyContext || ctx.Context is ISerializationContext));

            Assert.Equal(
                new[]
                {
                    "default_ctor",
                    "deserializing",
                    "deserialized",
                    "deserialization"
                },
                result.History);
            Assert.Equal(input.Payload, result.Payload, StringComparer.Ordinal);
            Assert.Equal(2, result.Contexts.Count);
            Assert.All(result.Contexts, ctx => Assert.True(ctx.Context is IDeserializationContext));

            // Verify that our behavior conforms to the behavior of BinaryFormatter.
            var input2 = new SimpleISerializableObject
            {
                Payload = "pyjamas"
            };

            var result2 = (SimpleISerializableObject) BuiltInSerializerTests.DotNetSerializationLoop(
                input2,
                this.fixture.SerializationManager);

            Assert.Equal(input2.History, input.History);
            Assert.Equal(result2.History, result.History.Skip(1).ToList());
        }

        /// <summary>
        /// Tests that <see cref="ILBasedSerializer"/> can correctly serialize structs which have serialization lifecycle hooks.
        /// </summary>
        [Fact]
        public void ILSerializer_SerializesStructWithHooks()
        {
            var input = new SimpleISerializableStruct
            {
                Payload = "pyjamas"
            };

            // Verify that our behavior conforms to our expected behavior.
            var result = SerializerLoop(input);
            Assert.Equal(
                new[]
                {
                    "deserializing",
                    "deserialized",
                    "deserialization"
                },
                result.History);
            Assert.Equal(input.Payload, result.Payload, StringComparer.Ordinal);
            Assert.Equal(2, result.Contexts.Count);
            Assert.All(result.Contexts, ctx => Assert.True(ctx.Context is IDeserializationContext));

            // Verify that our behavior conforms to the behavior of BinaryFormatter.
            var input2 = new SimpleISerializableStruct
            {
                Payload = "pyjamas"
            };

            var result2 = (SimpleISerializableStruct) BuiltInSerializerTests.DotNetSerializationLoop(
                input2,
                this.fixture.SerializationManager);

            Assert.Equal(input2.History, input.History);
            Assert.Equal(result2.History, result.History);
        }

        private T SerializerLoop<T>(T input)
        {
#pragma warning disable CS0618 // Type or member is obsolete
            var serializer = new ILBasedSerializer(new CachedTypeResolver());
#pragma warning restore CS0618 // Type or member is obsolete
            Assert.True(serializer.IsSupportedType(input.GetType()));

            var writer = new BinaryTokenStreamWriter();
            var serializationContext =
                new SerializationContext(this.fixture.SerializationManager)
                {
                    StreamWriter = writer
                };
            serializer.Serialize(input, serializationContext, typeof(T));
            var deserializationContext = new DeserializationContext(this.fixture.SerializationManager)
            {
                StreamReader = new BinaryTokenStreamReader(writer.ToBytes())
            };

            return (T) serializer.Deserialize(typeof(T), deserializationContext);
        }

        [Serializable]
        public class SimpleISerializableObject : IDeserializationCallback
        {
            [NonSerialized]
            private List<string> history;

            [NonSerialized]
            private List<StreamingContext> contexts;

            public SimpleISerializableObject()
            {
                this.History.Add("default_ctor");
            }

            public List<string> History => this.history ?? (this.history = new List<string>());
            public List<StreamingContext> Contexts => this.contexts ?? (this.contexts = new List<StreamingContext>());

            public string Payload { get; set; }

            [OnSerializing]
            internal void OnSerializingMethod(StreamingContext context)
            {
                this.History.Add("serializing");
                this.Contexts.Add(context);
            }

            [OnSerialized]
            internal void OnSerializedMethod(StreamingContext context)
            {
                this.History.Add("serialized");
                this.Contexts.Add(context);
            }

            [OnDeserializing]
            internal void OnDeserializingMethod(StreamingContext context)
            {
                this.History.Add("deserializing");
                this.Contexts.Add(context);
            }

            [OnDeserialized]
            internal void OnDeserializedMethod(StreamingContext context)
            {
                this.History.Add("deserialized");
                this.Contexts.Add(context);
            }

            void IDeserializationCallback.OnDeserialization(object sender)
            {
                this.History.Add("deserialization");
            }
        }

        [Serializable]
        public struct SimpleISerializableStruct : IDeserializationCallback
        {
            [NonSerialized]
            private List<string> history;

            [NonSerialized]
            private List<StreamingContext> contexts;

            public List<string> History => this.history ?? (this.history = new List<string>());
            public List<StreamingContext> Contexts => this.contexts ?? (this.contexts = new List<StreamingContext>());

            public string Payload { get; set; }

            [OnSerializing]
            internal void OnSerializingMethod(StreamingContext context)
            {
                this.History.Add("serializing");
                this.Contexts.Add(context);
            }

            [OnSerialized]
            internal void OnSerializedMethod(StreamingContext context)
            {
                this.History.Add("serialized");
                this.Contexts.Add(context);
            }

            [OnDeserializing]
            internal void OnDeserializingMethod(StreamingContext context)
            {
                this.History.Add("deserializing");
                this.Contexts.Add(context);
            }

            [OnDeserialized]
            internal void OnDeserializedMethod(StreamingContext context)
            {
                this.History.Add("deserialized");
                this.Contexts.Add(context);
            }

            void IDeserializationCallback.OnDeserialization(object sender)
            {
                this.History.Add("deserialization");
            }
        }

        [SuppressMessage("ReSharper", "StyleCop.SA1401", Justification = "This is for testing purposes.")]
        private class FieldTest : IOnDeserialized
        {
#pragma warning disable 169
            public int One;
            public int Two;
            public int Three;

            [NonSerialized]
            public int NonSerializedInt;

            [NonSerialized]
            public ISerializerContext Context;

            public void OnDeserialized(ISerializerContext context)
            {
                this.Context = context;
            }
#pragma warning restore 169
        }
    }
}


text:
This is a [Jekyll][1] theme for [@jasonlong][2]'s [Cayman theme][4] on [GitHub Pages][3].

Cayman is a clean, responsive theme for [GitHub Pages](https://pages.github.com). This theme is available as an option if you use the [Automatic Page Generator](https://help.github.com/articles/creating-pages-with-the-automatic-generator/) or you can copy the template and styles to use on your own.

You can preview the theme at http://jasonlong.github.io/cayman-theme or with real content at http://jasonlong.github.io/geo_pattern.

![](http://cl.ly/image/1T3r3d18311V/content)

# How to use it?

Download the theme @ http://github.com/pietromenna/jekyll-cayman-theme/archive/master.zip

Unzip it and use it as a regular jekyll folder.

```
$ unzip jekyll-cayman-theme-master.zip
```

Get inside the newly extracted folder
```
$ cd jekyll-cayman-theme-master
```

Get the required gems
```
$ bundle install
```

Use it!

```
$ jekyll serve
```

For more details read about [Jekyll][1] on its web page.

# Setup

Some important configuration can be done in the file `_config.yml`. Please, check the Setup section in that file.

## baseurl

`baseurl` parameter is required in the case the site doesn't sit on the root of the domain. For example: http://pietromenna.github.io/jekyll-cayman-theme

In the case above the baseurl should be set to "/jekyll-cayman-theme".

In the case the site sits in the root, you can leave `baseurl` as empty "".

# Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pietromenn/jekyll-cayman-theme.

# Development

To set up your environment to develop this theme, run `bundle install`.

You theme is setup just like a normal Jelyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.

# License

This work is licensed under a [Creative Commons Attribution 4.0 International](http://creativecommons.org/licenses/by/4.0/) license.

[1]: http://jekyllrb.com/
[2]: https://github.com/jasonlong
[3]: http://pages.github.com/
[4]: https://github.com/jasonlong/cayman-theme


text:
package org.wx.sdk.statistic.object;

/**
 * 接口分析数据实体类
 * @author Rocye
 * @version 2017-10-09
 */
public class InterfaceSummaryHour {

	/** 数据的日期 */
    private String ref_date;
    /** 数据的小时 */
    private Integer ref_hour;
    /** 通过服务器配置地址获得消息后,被动回复用户消息的次数 */
    private Integer callback_count;
    /** 上述动作的失败次数 */
    private Integer fail_count;
    /** 总耗时,除以callback_count即为平均耗时 */
    private Integer total_time_cost;
    /** 最大耗时 */
    private Integer max_time_cost;

	public String getRef_date() {
		return ref_date;
	}
	public void setRef_date(String ref_date) {
		this.ref_date = ref_date;
	}

	public Integer getRef_hour() {
		return ref_hour;
	}
	public void setRef_hour(Integer ref_hour) {
		this.ref_hour = ref_hour;
	}

	public Integer getCallback_count() {
		return callback_count;
	}
	public void setCallback_count(Integer callback_count) {
		this.callback_count = callback_count;
	}

	public Integer getFail_count() {
		return fail_count;
	}
	public void setFail_count(Integer fail_count) {
		this.fail_count = fail_count;
	}

	public Integer getTotal_time_cost() {
		return total_time_cost;
	}
	public void setTotal_time_cost(Integer total_time_cost) {
		this.total_time_cost = total_time_cost;
	}

	public Integer getMax_time_cost() {
		return max_time_cost;
	}
	public void setMax_time_cost(Integer max_time_cost) {
		this.max_time_cost = max_time_cost;
	}

}


text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

namespace osu.Framework.Timing
{
    public class OffsetClock : IClock
    {
        protected IClock Source;

        public double Offset;

        public double CurrentTime => Source.CurrentTime + Offset;

        public double Rate => Source.Rate;

        public bool IsRunning => Source.IsRunning;

        public OffsetClock(IClock source)
        {
            Source = source;
        }
    }
}


text: @&&run_dir schema


text:
<!DOCTYPE html>

Tests that an animation with no keyframes does not start.

FAIL - nothing happened


text:
{-# LANGUAGE LambdaCase, OverloadedStrings #-}
module Transformations.Optimising.CaseCopyPropagation where

import Grin.Grin
import Grin.TypeEnv
import Data.Maybe
import qualified Data.Set as Set
import qualified Data.Map as Map ( fromList, union )
import Control.Monad.Trans.State
import Control.Monad.Trans ( lift )
import Data.Bifunctor ( first )

import Data.Functor.Foldable
import Transformations.Names
import Transformations.Util

caseCopyPropagation :: Exp -> (Exp, ExpChanges)
caseCopyPropagation exp0 = first neExp $ evalNameM exp0 $ paraM folder exp0

data Changes = None | InChange Tag | Final deriving (Eq, Show)

data NewExp = NE
  { neChanges :: Changes
  , neExp     :: Exp
  } deriving Show

folder :: ExpF (Exp, NewExp) -> NameM NewExp
folder = \case
  ProgramF exts ds                      -> pure $ NE Final (Program exts $ map (neExp . snd) ds)
  DefF n ps body@(b, NE (InChange _) _) -> pure $ NE Final (Def n ps b)
  DefF n ps body@(_, NE c e)            -> pure $ NE c (Def n ps e)

  SReturnF (ConstTagNode tag [value]) -> pure $ NE (InChange tag) (SReturn value)

  SBlockF (b, NE (InChange _) _) -> pure $ NE None (SBlock b)
  SBlockF (_, NE c e)            -> pure $ NE c    (SBlock e)

  exp | isPrimitiveExp (embed $ fmap fst exp) -> pure $ NE None (embed $ fmap (neExp . snd) exp)

  EBindF (_, NE None  lhse) pat (_, NE None rhse)                -> pure $ NE None (EBind lhse pat rhse)
  EBindF (_, NE None  lhse) pat (_, NE (InChange t) rhse)        -> pure $ NE (InChange t) (EBind lhse pat rhse)
  EBindF (_, NE None  lhse) pat (_, NE Final rhse)               -> pure $ NE Final (EBind lhse pat rhse)
  EBindF (_, NE Final lhse) pat (_, NE None  rhse)               -> pure $ NE Final (EBind lhse pat rhse)
  EBindF (_, NE Final lhse) pat (rhso, NE (InChange _) _)        -> pure $ NE Final (EBind lhse pat rhso)
  EBindF (_, NE Final lhse) pat (_, NE Final rhse)               -> pure $ NE Final (EBind lhse pat rhse)
  EBindF (lhso, _) pat (_, NE change rhse) | isPrimitiveExp lhso -> pure $ NE change (EBind lhso pat rhse)

  AltF cpat body@(_, NE c e) -> pure $ NE c (Alt cpat e)

  exp@(ECaseF val alts)
    -- Each alternative has the same tag and they are changed.
    | tags <- map (neTag . snd) alts, all isJust tags
      -> if allSame tags
          then do var <- deriveNewName "ccp"
                  let (Just tag) = neTag $ snd $ head alts
                  pure $ NE
                    Final
                    (SBlock (EBind
                        (ECase val (map (neExp . snd) alts))
                        (Var var)
                        (SReturn (ConstTagNode tag [Var var]))))
          else pure $ NE None (ECase val (map fst alts))
    -- Some of the alternatives are final, thus we mark this case as Final and we don't change it.
    | any (hasChange Final) alts
        -> pure $ NE Final (ECase val $ map getFinalExp alts)
    -- Nothing has changed in the alternatives.
    | all (hasChange None) alts
        -> pure $ NE None (ECase val $ map (neExp . snd) alts)
    -- Some of the alternatives could change, some none, thus we leave them unchanged.
    | any (isJust . neTag . snd) alts
        -> pure $ NE None (ECase val $ map fst alts)
  where
    neTag (NE (InChange t)_ ) = Just t
    neTag _                   = Nothing

    hasChange c0 (_, NE c _) = c == c0
    getFinalExp (oe, NE c ne) = case c of { Final -> ne; _ -> oe }

allSame :: (Eq a) => [a] -> Bool
allSame [] = False
allSame (x:xs) = all (x ==) xs


text:
import { OperatorFunction } from 'rxjs';
import { filter } from 'rxjs/operators';

export function ofPacketType(
  type: string,
  subType?: string
): OperatorFunction<any, any> {
  return filter((packet: any) => {
      let matches = type === packet.type;
      if (packet.superType) {
        matches = matches || type === packet.superType;
      }
      if (subType) {
        matches = matches && packet.subType === subType;
      }
      return matches;
    }
  );
}


text:
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="nitd">
  <service name="site/nitd" type="service" version="5">

    <create_default_instance enabled="true"/>

    <single_instance/>

    <dependency name="network" grouping="require_all" restart_on="refresh" type="service">
      <service_fmri value="svc:/milestone/network:default"/>
    </dependency>

    <dependency name="filesystem" grouping="require_all" restart_on="refresh" type="service">
      <service_fmri value="svc:/system/filesystem/local"/>
    </dependency>

    <method_context working_directory="/home/admin/nitd">
      <method_credential user="admin" group="staff" privileges='basic,net_privaddr'  />
      <method_environment>
        <envvar name="PATH" value="/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin"/>
        <envvar name="HOME" value="/root"/>
      </method_environment>
    </method_context>

    <exec_method
      type="method"
      name="start"
      exec="/opt/local/bin/node /home/admin/nitd/index.js"
      timeout_seconds="60"/>

    <exec_method
      type="method"
      name="stop"
      exec=":kill"
      timeout_seconds="60"/>

    <property_group name="startd" type="framework">
      <propval name="duration" type="astring" value="child"/>
      <propval name="ignore_error" type="astring" value="core,signal"/>
    </property_group>

    <property_group name="application" type="application">

    </property_group>

    <stability value="Evolving"/>

    <template>
      <common_name>
        <loctext xml:lang="C">nitd</loctext>
      </common_name>
    </template>

  </service>

</service_bundle>


text:
<?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

AdminUIHelper::startAdminArea($this);

// Loading Templates in Tabs
$tabarray = array();
$tabarray['calc'] = 'COM_VIRTUEMART_CALC_DETAILS';

AdminUIHelper::buildTabs ( $this, $tabarray );
// Loading Templates in Tabs END

AdminUIHelper::endAdminArea();


text:
package fi.vrk.xroad.catalog.persistence.entity;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;

@EqualsAndHashCode
@AllArgsConstructor
public class MemberId {
    @Getter
    private String xRoadInstance;
    @Getter
    private String memberClass;
    @Getter
    private String memberCode;
}


text:
package org.springframework.security.messaging.access.intercept;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.messaging.Message;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.SecurityConfig;
import org.springframework.security.core.Authentication;
import org.springframework.security.messaging.util.matcher.MessageMatcher;

import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashMap;

import static org.assertj.core.api.Assertions.assertThat;
import static org.powermock.api.mockito.PowerMockito.when;

@RunWith(MockitoJUnitRunner.class)
public class DefaultMessageSecurityMetadataSourceTests {
	@Mock
	MessageMatcher<Object> matcher1;
	@Mock
	MessageMatcher<Object> matcher2;
	@Mock
	Message<?> message;
	@Mock
	Authentication authentication;

	SecurityConfig config1;

	SecurityConfig config2;

	LinkedHashMap<MessageMatcher<?>, Collection<ConfigAttribute>> messageMap;

	MessageSecurityMetadataSource source;

	@Before
	public void setup() {
		messageMap = new LinkedHashMap<MessageMatcher<?>, Collection<ConfigAttribute>>();
		messageMap.put(matcher1, Arrays.<ConfigAttribute> asList(config1));
		messageMap.put(matcher2, Arrays.<ConfigAttribute> asList(config2));

		source = new DefaultMessageSecurityMetadataSource(messageMap);
	}

	@Test
	public void getAttributesNull() {
		assertThat(source.getAttributes(message)).isNull();
	}

	@Test
	public void getAttributesFirst() {
		when(matcher1.matches(message)).thenReturn(true);

		assertThat(source.getAttributes(message)).containsOnly(config1);
	}

	@Test
	public void getAttributesSecond() {
		when(matcher1.matches(message)).thenReturn(true);

		assertThat(source.getAttributes(message)).containsOnly(config2);
	}

	@Test
	public void getAllConfigAttributes() {
		assertThat(source.getAllConfigAttributes()).containsOnly(config1, config2);
	}

	@Test
	public void supportsFalse() {
		assertThat(source.supports(Object.class)).isFalse();
	}

	@Test
	public void supportsTrue() {
		assertThat(source.supports(Message.class)).isTrue();
	}
}


text:
After a 24 hour long journey I finally made it to Shanghai. I was
welcomed by the border police with a special check up because they were
questioning a scratched entry page in my passport. I told them well that
was Nigeria, oh well.

My friend Zaiming had his dad come pick me up with their fancy car and
got me an entire apartment in central Shanghai. On the way there were 20
stories buildings, perhaps 10 in a row, in a very rural section near the
airport. It got me thinking about the reason behind it, perhaps the
developers were building it for a show, or that there are this huge of a
demand. The next few days I was bombarded by all the flashy colors and
lights of Shanghai. American bars that sells bacon beer with flamboyant
Americans; Japanese grill with the waitress tries to sell us everything;
Rooftop bars on the Bund that has red wine shipped directly from
Bordeaux. I find it that there's something missing behind all these
colors and lights and noises, and I hope I can find out more by
venturing into the rural part of china.

My real journey started the next day when my cousin drove me and my bike
to the Province of Anhui in his bimmer. We went through yet many many
more buildings that are 20 stories high, all seems to be in the middle
of nowhere next to the highway. My tourmate Marian wanted to meet in
this "scenic area" called Marenshan, about 300km west of Shanghai since
"it's what chinese people wanted to do", according to her. On the small
road approaching to it I finally get to see rural China for the first
time: fields, farmers, water buffalo, all those in the romance. It still
exists outside of all the flashy buildings. Marenshan itself was a
really weird experience. It was supposed to be a geological park with
interestingly shaped rock formations. They tried to sell it by: building
a Mongolian Yurt as an restaurant; building a Mao's button museum; hired
a village of Wa minority group from few thousand KM away to work as a
"primordial human life scene" event. Everything seems a little fake and
rootless.

The second day I built my bike in the parking lot of the vacation hotel
of Marenshan and started my journey! This was the first time I rode a
touring bike with all my luggage of the next two month on the side of
the back wheel. The steering is a bit funny. We biked on the small
coutry road where we came from earlier the day before, and ate at a
random food spot in the first town. Two other patrons start to pique
interest in Marian who is decidedly not chinese looking. She actually is
an expert in country side touring in china (this is her 5th or 6th tour)
so she casually started a conversation with them while I pretend to be a
foreigner. This is an interesting dynamic since we both can speak both
languages quite well. We rode along side of a semi polluted river. Met a
guy who's tractor's wheel fell off. Talked to an old guy sitting next to
a Taoist Temple. We went on a bigger road and it started to pour. Water,
mud, smog, pollution, dirt, whatever came down all together onto me
unexpectedly. After soaking wet and few more hours we came to a town
with a huge Kaifaqu (read, new planned town center). There was a church
on the side of the road but it wasn't a church: it was a purposely built
wedding venue. We found lodging at a hotel, roughly 20 bucks us dollars.
Well, they did try to sell me one that costs 22 bucks but with sex toys
on the bed..

Next day I made yirgacheff coffee from my aeropress to start the day.
Couldn't be better. We biked next to the Yangtze river. It was the first
time I saw the Yangtze river so I was kinda excited for this
significance. Although the river, though vast, is no more than a huge
muddy water. We biked next to the Anhui Greenway for about a mile, when
the greenway turned into a typical new wide road and we started to see
factories after factories on the side of the road. I couldn't breath, my
eyes itches. I used my facemask and tried to squint my eye and go as
fast as possible to get out of this damned place. Tongling, the city
where we spent the night, means Copper Hill in Chinese. There are miles
after miles of copper factories that inherited the city's name sake. But
it was awful. After about 2 hours we decide to take a detour to see an
ancient town. We saw another road side church, this time a real one
built in 1875, but it was a ruin, even the archaeological plaque was
smashed in halves. We went to the port, and hundred of farmers rushed to
the land with their dark green or grey clothing, with a bamboo stick on
the shoulder carrying very heavy load of vegetable to the market. Next
to the market is the marketed "ancient town". They were rennovating it
by relaying the old stone road on cement. At the end of the day we took
a ferry across Yangtze to a little village that has only one hotel,
operated by the pair of lovely old couple. They told us about their
lives, their kids lives, their kids' kids who are in Guangzhou and
recently got married. I was like, yes, this is what I want to see, after
all the crazy lights. This is the real china in the shadow, struggling.

tbd