text:
define([
        'marionette',
        'build/JST.FileManagerBundle',
        'views/nav/FileManagerNavView',
        'views/header/FileManagerHeaderView',
        'views/content/FileManagerContentView'

    ],
    function(
        Marionette,
        JST,
        FileManagerNavView,
        FileManagerHeaderView,
        FileManagerContentView

        ) {
        return Marionette.View.extend({
            className:'file-manager-main',
            _header:true,
            initialize:function(args){
                if('undefined'!==typeof args.header ){
                    this._header=args.header;
                }
            },
            childViewTriggers:{
                "selectFile":"selectFile"
            },
            template: JST.FileManagerLayoutView,

            regions: {
                headerRegion: "[data-region=header]",
                navRegion: "[data-region=nav]",
                contentRegion: "[data-region=content]",
                footerRegion: "[data-region=footer]"

            },
            onRender:function(){
                var fileManagerNavView = new FileManagerNavView(),
                    fileManagerHeaderView = new FileManagerHeaderView(),
                    fileManagerContentView = new FileManagerContentView();
                this.showChildView('navRegion',fileManagerNavView);
                if(this._header===true) {
                    this.showChildView('headerRegion',fileManagerHeaderView);
                }

                //fileManagerContentView.on('selectFile',this.trigger.bind(this,'selectFile'));
                this.showChildView('contentRegion',fileManagerContentView);
            }
        });
    }
);


text:
<?php

declare(strict_types=1);

namespace Zhiyi\Plus\Http\Controllers\APIs\V2;

use DB;
use Zhiyi\Plus\Models\User;
use Illuminate\Http\Request;

class RankController extends Controller
{
    /**
     * Get the full rank of user who has more followers.
     *
     * @author bs<414606094@qq.com>
     * @param  Illuminate\Http\Request $request
     * @param  Zhiyi\Plus\Models\User $userModel
     * @return mixed
     */
    public function followers(Request $request, User $userModel)
    {
        $auth = $request->user('api')->id ?? 0;
        $limit = $request->query('limit', 10);
        $offset = $request->query('offset', 0);

        $users = $userModel->select('users.*', 'user_extras.followers_count')
            ->join('user_extras', function ($join) {
                return $join->on('users.id', '=', 'user_extras.user_id');
            })
            ->orderBy('user_extras.followers_count', 'desc')
            ->orderBy('users.id', 'asc')
            ->offset($offset)
            ->take($limit)
            ->get();

        return response()->json($userModel->getConnection()->transaction(function () use ($users, $userModel, $auth, $offset) {
            return $users->map(function ($user, $key) use ($auth, $offset) {
                $user->extra->count = $user->followers_count;
                $user->extra->rank = $key + $offset + 1;

                $user->following = $user->hasFollwing($auth);
                $user->follower = $user->hasFollower($auth);

                unset($user->followers_count);

                return $user;
            });
        }), 200);
    }

    /**
     * Get the total fortune ranking.
     *
     * @author bs<414606094@qq.com>
     * @param  Illuminate\Http\Request $request
     * @param  Zhiyi\Plus\Models\User $userModel
     * @return mixed
     */
    public function balance(Request $request, User $userModel)
    {
        $auth = $request->user('api')->id ?? 0;
        $limit = $request->query('limit', 10);
        $offset = $request->query('offset', 0);

        $users = $userModel->select('users.*', 'users.name')
            ->join('wallets', function ($join) {
                return $join->on('users.id', '=', 'wallets.user_id');
            })
            ->orderBy('wallets.balance', 'desc')
            ->orderBy('users.id', 'asc')
            ->offset($offset)
            ->take($limit)
            ->get();

        return response()->json($userModel->getConnection()->transaction(function () use ($users, $auth, $offset) {
            return $users->map(function ($user, $key) use ($auth, $offset) {
                $user->following = $user->hasFollwing($auth);
                $user->follower = $user->hasFollower($auth);

                $user = $user->toArray();
                $user['extra']['rank'] = $key + $offset + 1;

                return $user;
            });
        }), 200);
    }

    /**
     * Get the rank of user`s income.
     *
     * @author bs<414606094@qq.com>
     * @param  Illuminate\Http\Request $request
     * @param  Zhiyi\Plus\Models\User $userModel
     * @return mixed
     */
    public function income(Request $request, User $userModel)
    {
        $auth = $request->user('api')->id ?? 0;
        $limit = $request->query('limit', 10);
        $offset = $request->query('offset', 0);

        $users = $userModel->select('users.id', 'users.name', 'users.sex')
            ->join(DB::raw("(select `user_id`, SUM(`amount`) as `count` from `wallet_charges` where `action` = '1' and `channel` = 'user' group by `user_id`) as count"), function ($join) {
                return $join->on('users.id', '=', 'count.user_id');
            })
            ->orderBy('count.count', 'desc')
            ->orderBy('users.id', 'asc')
            ->offset($offset)
            ->take($limit)
            ->get();

        return response()->json($userModel->getConnection()->transaction(function () use ($users, $auth, $offset) {
            return $users->map(function ($user, $key) use ($auth, $offset) {
                $user->following = $user->hasFollwing($auth);
                $user->follower = $user->hasFollower($auth);

                $user = $user->toArray();
                $user['extra']['rank'] = $key + $offset + 1;

                return $user;
            });
        }), 200);
    }
}

redpajama_set_name: RedPajamaGithub


text:
char* randstring(size_t length);

int main(void)
{
    tree_page_ptr_t root;
    root.leaf = (leaf_page_t*) calloc(1, sizeof(leaf_page_t));
    int level = 0;

    data_entry_t inserted_entry;
    tree_entry_t* tmp_new_child = NULL;

    // Insert a lot of data-entry
    for(int j=0; j<1000; j++) {
        inserted_entry.key.i = j;
        inserted_entry.pid = j;
        inserted_entry.slot_num = j;
        bp__insert(&root, root, &inserted_entry, &tmp_new_child, level, &level, TYPE_INT);
    }

    // Test bp__scan
    printf("\n\nTotal index pages: %d\n", bp__scan(root, level, TYPE_INT, 1));
    printf("Total leaf pages: %d\n", bp__scan_leaf(root, level));

    // Test bp__range_search
    printf("\n\n\n");
    index_t key2;
    inserted_entry.key.i = 25;
    key2.i = 35;
    bp__range_search(root, inserted_entry.key, key2, level, TYPE_INT);

    // Test bp__find_record
    printf("\n\n\n");
    inserted_entry.key.i = 439;
    bp__find_record(root, inserted_entry.key, level, TYPE_INT);
    inserted_entry.key.i = 258;
    bp__find_record(root, inserted_entry.key, level, TYPE_INT);
    inserted_entry.key.i = 694;
    bp__find_record(root, inserted_entry.key, level, TYPE_INT);
    inserted_entry.key.i = 9527;
    bp__find_record(root, inserted_entry.key, level, TYPE_INT);

    // -------------------------------------------------------------------------------
    // ---------------------------------- Test String --------------------------------
    // -------------------------------------------------------------------------------

    tree_page_ptr_t str_root;
    str_root.leaf = (leaf_page_t*) calloc(1, sizeof(leaf_page_t));
    int str_level = 0;

    data_entry_t str_inserted_entry;
    tree_entry_t* str_tmp_new_child = NULL;
    memset(str_inserted_entry.key.str, '\0',10);

    // Insert a lot of data-entry
    for(int j=0; j<100; j++) {
        memset(str_inserted_entry.key.str, j+64, 10);

        str_inserted_entry.pid = j;
        str_inserted_entry.slot_num = j;
        bp__insert(&str_root, str_root, &str_inserted_entry,
                   &str_tmp_new_child, str_level, &str_level, TYPE_STRING);
    }

    // Test bp__scan
    printf("\n\nTotal index pages: %d\n", bp__scan(str_root, str_level, TYPE_STRING, 1));
    printf("Total leaf pages: %d\n", bp__scan_leaf(str_root, str_level));

    // Test bp__range_search
    printf("\n\n\n");
    index_t str_key2;
    memset(str_inserted_entry.key.str, 83, 10);
    memset(str_key2.str, 99, 4);
    bp__range_search(str_root, str_inserted_entry.key, str_key2, str_level, TYPE_STRING);

    printf("\n\n\n");

    // Test bp__find_record
    memset(str_inserted_entry.key.str, 85, 10);
    bp__find_record(str_root, str_inserted_entry.key, str_level, TYPE_STRING);
    memset(str_inserted_entry.key.str, 97, 10);
    bp__find_record(str_root, str_inserted_entry.key, str_level, TYPE_STRING);
    memset(str_inserted_entry.key.str, 150, 10);
    bp__find_record(str_root, str_inserted_entry.key, str_level, TYPE_STRING);
    memset(str_inserted_entry.key.str, 209, 10);
    bp__find_record(str_root, str_inserted_entry.key, str_level, TYPE_STRING);

    return 0;
}

char* randstring(size_t length)
{

    static char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.-#'?!";
    char* randomString = NULL;

    if (length) {
        randomString = (char*) malloc(sizeof(char) * (length +1));

        if (randomString) {
            for (int n = 0; n < length; n++) {
                int key = rand() % (int)(sizeof(charset) -1);
                randomString[n] = charset[key];
            }

            randomString[length] = '\0';
        }
    }

    return randomString;
}


text:
#include <aws/ssm/model/DescribeInstancePatchesResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::SSM::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DescribeInstancePatchesResult::DescribeInstancePatchesResult()
{
}

DescribeInstancePatchesResult::DescribeInstancePatchesResult(const AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DescribeInstancePatchesResult& DescribeInstancePatchesResult::operator =(const AmazonWebServiceResult<JsonValue>& result)
{
  const JsonValue& jsonValue = result.GetPayload();
  if(jsonValue.ValueExists("Patches"))
  {
    Array<JsonValue> patchesJsonList = jsonValue.GetArray("Patches");
    for(unsigned patchesIndex = 0; patchesIndex < patchesJsonList.GetLength(); ++patchesIndex)
    {
      m_patches.push_back(patchesJsonList[patchesIndex].AsObject());
    }
  }

  if(jsonValue.ValueExists("NextToken"))
  {
    m_nextToken = jsonValue.GetString("NextToken");

  }

  return *this;
}


text:
<?php

/**
 * The "members" collection of methods.
 * Typical usage is:
 *  <code>
 *   $monitoringService = new Google_Service_Monitoring(...);
 *   $members = $monitoringService->members;
 *  </code>
 */
class Google_Service_Monitoring_Resource_ProjectsGroupsMembers extends Google_Service_Resource
{
  /**
   * Lists the monitored resources that are members of a group.
   * (members.listProjectsGroupsMembers)
   *
   * @param string $name The group whose members are listed. The format is
   * "projects/{project_id_or_number}/groups/{group_id}".
   * @param array $optParams Optional parameters.
   *
   * @opt_param string interval.endTime Required. The end of the time interval.
   * @opt_param string filter An optional list filter describing the members to be
   * returned. The filter may reference the type, labels, and metadata of
   * monitored resources that comprise the group. For example, to return only
   * resources representing Compute Engine VM instances, use this filter:
   * resource.type = "gce_instance"
   * @opt_param string pageToken If this field is not empty then it must contain
   * the nextPageToken value returned by a previous call to this method. Using
   * this field causes the method to return additional results from the previous
   * method call.
   * @opt_param string interval.startTime Optional. The beginning of the time
   * interval. The default value for the start time is the end time. The start
   * time must not be later than the end time.
   * @opt_param int pageSize A positive number that is the maximum number of
   * results to return.
   * @return Google_Service_Monitoring_ListGroupMembersResponse
   */
  public function listProjectsGroupsMembers($name, $optParams = array())
  {
    $params = array('name' => $name);
    $params = array_merge($params, $optParams);
    return $this->call('list', array($params), "Google_Service_Monitoring_ListGroupMembersResponse");
  }
}


text:
package com.intellij.patterns;

import com.intellij.openapi.util.Comparing;
import com.intellij.psi.xml.XmlTag;
import com.intellij.psi.meta.PsiMetaData;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

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

/**
 * @author spleaner
*/
public class XmlTagPattern<Self extends XmlTagPattern<Self>> extends XmlNamedElementPattern<XmlTag, Self> {
  protected XmlTagPattern() {
    super(new InitialPatternCondition<XmlTag>(XmlTag.class) {
      @Override
      public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
        return o instanceof XmlTag;
      }
    });
  }

  protected XmlTagPattern(@NotNull final InitialPatternCondition<XmlTag> condition) {
    super(condition);
  }

  @Override
  protected String getLocalName(XmlTag tag) {
    return tag.getLocalName();
  }

  @Override
  protected String getNamespace(XmlTag tag) {
    return tag.getNamespace();
  }

  public Self withAttributeValue(@NotNull @NonNls final String attributeName, @NotNull final String attributeValue) {
    return with(new PatternCondition<XmlTag>("withAttributeValue") {
      @Override
      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
        return Comparing.equal(xmlTag.getAttributeValue(attributeName), attributeValue);
      }
    });
  }

  public Self withAnyAttribute(@NotNull @NonNls final String... attributeNames) {
    return with(new PatternCondition<XmlTag>("withAnyAttribute") {
      @Override
      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
        for (String attributeName : attributeNames) {
          if (xmlTag.getAttribute(attributeName) != null) {
            return true;
          }
        }
        return false;
      }
    });
  }

  public Self withDescriptor(@NotNull final ElementPattern<? extends PsiMetaData> metaDataPattern) {
    return with(new PatternCondition<XmlTag>("withDescriptor") {
      @Override
      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
        return metaDataPattern.accepts(xmlTag.getDescriptor());
      }
    });
  }

  public Self isFirstSubtag(@NotNull final ElementPattern pattern) {
    return with(new PatternCondition<XmlTag>("isFirstSubtag") {
      @Override
      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
        final XmlTag parent = xmlTag.getParentTag();
        return parent != null &&
               pattern.accepts(parent, context) && parent.getSubTags()[0] == xmlTag;
      }
    });
  }

  public Self withFirstSubTag(@NotNull final ElementPattern<? extends XmlTag> pattern) {
    return withSubTags(StandardPatterns.<XmlTag>collection().first(pattern));
  }

  public Self withSubTags(@NotNull final ElementPattern<? extends Collection<XmlTag>> pattern) {
    return with(new PatternCondition<XmlTag>("withSubTags") {
      @Override
      public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) {
        return pattern.accepts(Arrays.asList(xmlTag.getSubTags()), context);
      }
    });
  }

  public Self withoutAttributeValue(@NotNull @NonNls final String attributeName, @NotNull final String attributeValue) {
    return and(StandardPatterns.not(withAttributeValue(attributeName, attributeValue)));
  }

  public static class Capture extends XmlTagPattern<Capture> {
    static final Capture XML_TAG_PATTERN = new Capture();
  }
}


text:
require 'spec_helper.rb'
require 'stitches/spec'

describe "have_api_error" do
  let(:errors) {
    [
      { code: "foo", message: "bar" },
      { code: "baz", message: "quux" }
    ]
  }
  let(:response_code) { 422 }
  let(:response) {
    double(
      response_code: response_code,
      body: { errors: errors }.to_json)
  }
  context "missing required arguments from expectation" do
    let(:response_code) { 422 }
    it "blows up with a decent message" do
      expect {
        expect(response).to have_api_error(message: errors.first[:message])
      }.to raise_error(/key not found: :code/)
      expect {
        expect(response).to have_api_error(code: errors.first[:code])
      }.to raise_error(/key not found: :message/)
    end
  end
  context "no expected status specified" do
    context "status is 422" do
      let(:response_code) { 422 }
      context "an error in the expectation exists" do
        it "indicates there is an error" do
          expect(response).to have_api_error(errors.first)
        end
        it "indicates there is an error for another error in the errors list" do
          expect(response).to have_api_error(errors.second)
        end
        it "indicates there is an error via regexp" do
          expect(response).to have_api_error(code: errors.second[:code], message: /^.*$/)
        end
      end
      context "no error from the expectation exists" do
        it "indicates there is no error" do
          expect(response).not_to have_api_error(code: "blah", message: "crud")
        end
      end
    end
    context "status is 200" do
      let(:response_code) { 200 }
      it "indicates there is no error" do
        expect(response).not_to have_api_error(errors.first)
      end
    end
    context "status is e.g. 404" do
      let(:response_code) { 404 }
      it "indicates there is no error" do
        expect(response).not_to have_api_error(errors.first)
      end
    end
  end
  context "expected status is specified" do
    context "status is the expected status" do
      let(:response_code) { 404 }
      context "there is an error" do
        it "indicates there is an error" do
          expect(response).to have_api_error(status: 404,
                                             code: errors.first[:code],
                                             message: errors.first[:message])
        end
      end
      context "there is not an error" do
        context "and the status code is what's wrong" do
          let(:response) {
            double(
              response_code: 401,
              body: { errors: errors }.to_json)
          }
          it "fails the test" do
            begin
              expect(response).to have_api_error(status: 404,
                                                 code: errors.first[:code],
                                                 message: errors.first[:message])
            rescue Exception => ex
              expect(ex.class).to eq(RSpec::Expectations::ExpectationNotMetError)
              expect(ex.message).to match(/HTTP status was 401 and not 404/i)
            end
          end
        end
      end
    end
    context "status is not the expected status" do
      let(:response_code) { 422 }
      it "indicates there is no error" do
        expect(response).not_to have_api_error(status: 404,
                                               code: errors.first[:code],
                                               message: errors.first[:bar])
      end
    end
    context "response errors don't match expectations" do
      context "because the status code is what's wrong" do
        let(:response) {
          double(
            response_code: 401,
            body: { errors: errors }.to_json)
        }
        it "fails the test" do
          begin
            expect(response).to have_api_error(code: errors.first[:code],
                                               message: errors.first[:message])
          rescue Exception => ex
            expect(ex.class).to eq(RSpec::Expectations::ExpectationNotMetError)
            expect(ex.message).to match(/HTTP status was 401 and not 422/i)
          end
        end
      end
      context "because there is no matching code" do
        let(:errors) {
          [
            { code: "foo", message: "bar" },
            { code: "baz", message: "quux" }
          ]
        }
        it "fails the test" do
          begin
            expect(response).to have_api_error(code: errors.first[:code] + "blah",
                                               message: errors.first[:message])
          rescue Exception => ex
            expect(ex.class).to eq(RSpec::Expectations::ExpectationNotMetError)
            expect(ex.message).to match(/Could not find an error for code/i)
          end
        end
      end
      context "because there is no matching message" do
        let(:errors) {
          [
            { code: "foo", message: "bar" },
            { code: "baz", message: "quux" }
          ]
        }
        it "fails the test" do
          begin
            expect(response).to have_api_error(code: errors.first[:code],
                                               message: errors.first[:message] + "blah")
          rescue Exception => ex
            expect(ex.class).to eq(RSpec::Expectations::ExpectationNotMetError)
            expect(ex.message).to match(/Expected message to be/i)
          end
        end
      end
    end
  end
end


text:
Transform or convert your farm solutions to the SharePoint app model. Learn how to convert web parts, page layouts, master pages, timer jobs, and so on to the SharePoint app model.

 **Last modified:** April 20, 2015

 _**Applies to:** apps for SharePoint | SharePoint 2013 | SharePoint Online_

 **In this article**

 [Plan the transformation process](#sectionSection0)

 [Transformation approaches to deploy your new app for SharePoint](#sectionSection1)

 [Best practices for specific farm solutions ](#sectionSection2)

 [Additional resources](#bk_addresources)

If you have extended your SharePoint environment by using farm solutions and you want to migrate your extensions to the SharePoint app model to make your transition to SharePoint Online easier, you need to transform your farm solutions to the SharePoint app model. Transforming your farm solutions to the SharePoint app model involves analyzing your existing extensions, designing and developing your new app for SharePoint, and then testing and deploying your app in your production environment. This article describes the process and best practices to use when you transform your farm solutions to the SharePoint app model.

**Note**  You can [view this article](https://msdn.microsoft.com/EN-US/library/dn986827.aspx) in the [Solutions guidance](https://msdn.microsoft.com/en-us/library/dn904529.aspx) node on MSDN.

## Plan the transformation process

 When you transform your farm solutions to the SharePoint app model, you want to ensure that the impact on your users is minimal. Carefully analyze your current farm solutions, and then design your new app for SharePoint to meet the needs of your organization. We recommend the following process to ensure a successful transformation.

1. Readiness. Learn about:

      - The SharePoint app model, different kinds of apps, and hosting options. For more information, see  [Overview of apps for SharePoint](https://msdn.microsoft.com/library/office/fp179930.aspx).

  - Remote access technologies for accessing your on-premises data.

2. Solution assessment. Analyze the functional and business requirements by:

      - Identifying deployed farm solutions in your current environment. Consider using third-party tools to help identify deployed extensions. Perform a detailed analysis of each farm solution identified.

  - Reviewing requirements with your users. Consider asking your users to demonstrate how they use the existing farm solutions to perform their daily work.

  - Identifying, documenting, and designing new functionality to include in the new app for SharePoint. Consider reviewing your list of new feature requests from your users for additional ideas.

  - Identifying unused features, and agreeing with your users to omit this functionality from the new app for SharePoint.

  - For each farm solution, determining whether to replace it with an app for SharePoint. Some solutions, such as SharePoint administration extensions, cannot be duplicated in the SharePoint app model. For more information, see  [Apps for SharePoint compared with SharePoint solutions](http://msdn.microsoft.com/library/0e9efadb-aaf2-4c0d-afd5-d6cf25c4e7a8.aspx) and [Deciding between apps for SharePoint and SharePoint solutions](http://msdn.microsoft.com/library/8459e265-b8fd-4bf8-911e-d63cae8bf96f.aspx).

3.  Solution planning. Design the new application using the SharePoint app model based on:

      - The requirements gathered in step 2.

  - Your analysis of the existing code. During your code analysis, consider identifying portions of the code that can be dropped (for example, the code is no longer being used, or the requirements have changed).

4. Develop and test the SharePoint app model version of your application. This is usually the most time-consuming step in the transformation process.

5. Deploy your new app. Depending on your requirements, you might decide to keep the farm solutions running in parallel to the new app for SharePoint, or you may retract the farm solution and only allow users to use the new app for SharePoint. In either scenario, ensure that your deployment is stable, and send appropriate communication to your users. If your content in existing site collections depended on your farm solutions (for example, if content was created by using a content type), before you fully retract the farm solution, you need to transform your existing content to use your new SharePoint app model solution. Ensure that you allow enough time to complete this task because it can be time consuming and difficult.

## Transformation approaches to deploy your new app for SharePoint

After you finish development and unit testing of your new app for SharePoint, start transforming your farm solution to the new app for SharePoint by using one of the transformation approaches listed in the following table.

|**Transformation approach**|**Description**|**Advantages**|**Disadvantages**|
|:-----|:-----|:-----|:-----|
|In-place|Deploy your new app for SharePoint into your existing SharePoint environment. You need to ensure your site is using the new app for SharePoint before retracting the farm solution.|

Less overall user impact.

Less resources needed because you are using your existing SharePoint environment.

No need for third-party tools.

Minimal site downtime.

Upgrade one site collection at a time, rather than upgrading the entire farm all at once.

URLs do not change.

|

Difficult to track completion progress of all affected assets on a site.

Increased chance of creating orphans. When an asset points to a file on the file system which does not exist, this is referred to as an orphan.

|
|Swing or content migration|Extract your content from your existing site collections where your farm solutions are currently deployed, and deploy the content in a new site collection which uses the new app for SharePoint. When you migrate content to SharePoint Online, this process is normally used.|

Clean SharePoint environment with no previous farm solution dependencies.

The new site collection is isolated from your production environment. Release the updated site collection when ready.</li.
|

Requires third-party tools to help with the content migration.

Requires an additional SharePoint environment.

Site downtime required.

URLs might change if you keep both sites running in parallel for a period of time.
|

## Best practices for specific farm solutions

Apply the following best practices when transforming specific solutions:

- Page layouts and master pages. Custom page layouts and master pages might exist in publishing sites, or team sites with the publishing features turned on. To replace page layouts and master pages:

      1. Upload the new page layout or master page to your site. Upload new master pages and page layouts to your site collection either manually or by using remote APIs. Remote APIs include the client-side object model (CSOM) or REST. This ensures that the master pages and page layouts do not have dependencies on a farm solution.

  2. Configure your site to use the new page layouts and master pages.

  3. Retract the previous version of the page layouts and master pages.

- Web parts and controls. To replace web parts and controls:

      1. Scan all your existing pages to determine which pages have web parts.

  2. (Optional) Review out-of-the-box web parts to determine if any can replace your custom web part.

  3. Replace existing web parts with app part instances, or using other techniques (such as embedded JavaScript in pages or page layouts) to achieve the same functionality.
  4. Use embedded JavaScript to manipulate UI elements.

    **Note**  To replace your existing web parts with app parts, you need to:

	- Enable side loading of apps in your Office 365 subscription. Consult with your Office 365 administrator.
	- Use CSOM to enable side loading of apps on your site. For more information, see the Core.SideLoading code sample.
	- Install your app part on your site.
	- Disable side loading of apps on your site.
	- Disable side loading of apps on your Office 365 subscription. Consult with your Office 365 administrator.

- Page manipulation. You might need to implement page manipulation during your custom site provisioning process. The  [Provisioning.Pages](https://github.com/OfficeDev/PnP/tree/dev/Scenarios/Provisioning.Pages) code sample shows page manipulation techniques, including creating a wiki page, adding HTML content to the page, creating a promoted links list, creating pages with different layouts, adding out-of-the-box web parts to the page, and removing the page.

- Site columns, list definitions, and content types. If your site columns, list definitions, and content types were created using the Feature framework elements, which were deployed using farm solutions, then you must use the swing or content migration transformation approach. This does not apply to Feature framework elements deployed using sandbox solutions. To use the content migration transformation approach, you must use third-party tools to remove the farm solution dependencies.

- Modules or Feature framework. Modules use pointers to files, which means that the files are not customized and are deployed on the file system. If your farm solutions use modules, customize the files by deploying alternate versions of the same files to the content database, scan and update your solutions to point to the new files stored in the content database, and then retract the farm solution that pointed to files stored on the file system.

- Site templates and web templates. You should focus on transforming Feature framework elements deployed by the site template or web template. For example, ensure that the default.aspx page of the site is not replaced when retracting the farm solution.

- Timer jobs. If you are using SharePoint Online, you cannot create and manage timer jobs. Instead, you can create a console application that uses Windows Task Scheduler or an  [Azure Web Job](http://azure.microsoft.com/documentation/articles/web-sites-create-web-jobs/) to schedule and run the console application remotely. When creating a custom timer job, determine whether you need to use a specific account or an OAuth-based app-only token. The [Core.TimerJobs.Samples](https://github.com/OfficeDev/PnP/tree/dev/Solutions/Core.TimerJobs.Samples) code sample shows how to create your own custom timer job.

    **Note**  If your timer job uses server-side code, you will have to redesign your timer job to use the CSOM or another method.

## Additional resources

-  [Office 365 development patterns and practices solution guidance](https://msdn.microsoft.com/library/office/dn904529.aspx)

-  [Build apps for SharePoint](https://msdn.microsoft.com/library/jj163230.aspx)


text:
<?php
namespace Crunchmail\PHPUnit;

class IsResourceConstraint extends \PHPUnit_Framework_Constraint_IsInstanceOf
{
    public function __construct($name)
    {
        $name = '\Crunchmail\Resources\\' . $name . 'Resource';
        parent::__construct($name);
    }

    /**
     * Make it public
     */
    public function matches($other)
    {
        return parent::matches($other);
    }
}


text:
#include "scripting/js-bindings/manual/dragonbones/jsb_cocos2dx_dragonbones_manual.h"
#include "scripting/js-bindings/manual/ScriptingCore.h"
#include "scripting/js-bindings/manual/cocos2d_specifics.hpp"
#include "editor-support/dragonbones/cocos2dx/CCDragonBonesHeaders.h"

using namespace dragonBones;

bool js_cocos2dx_dragonbones_Armature_getAnimation(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::Armature* cobj = (dragonBones::Armature *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Armature_getAnimation : Invalid Native Object");
    if (argc == 0) {
        dragonBones::Animation& ret = cobj->getAnimation();
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::Animation>(cx, (dragonBones::Animation*)&ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_Armature_getAnimation : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_Armature_getArmatureData(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::Armature* cobj = (dragonBones::Armature *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Armature_getArmatureData : Invalid Native Object");
    if (argc == 0) {
        const dragonBones::ArmatureData& ret = cobj->getArmatureData();
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::ArmatureData>(cx, (dragonBones::ArmatureData*)&ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_Armature_getArmatureData : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_Armature_getDisplay(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::Armature* cobj = (dragonBones::Armature *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Armature_getDisplay : Invalid Native Object");
    if (argc == 0) {
        dragonBones::CCArmatureDisplay* ret = dynamic_cast<CCArmatureDisplay*>(cobj->getDisplay());
        JS::RootedValue jsret(cx);
        if (ret) {
            jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::CCArmatureDisplay>(cx, ret));
        } else {
            jsret = JSVAL_NULL;
        };
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_Armature_getDisplay : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_CCArmatureDisplay_getAnimation(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::CCArmatureDisplay* cobj = (dragonBones::CCArmatureDisplay *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Armature_getAnimation : Invalid Native Object");
    if (argc == 0) {
        dragonBones::Animation& ret = cobj->getAnimation();
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::Animation>(cx, (dragonBones::Animation*)&ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_CCArmatureDisplay_getAnimation : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_AnimationState_getAnimationData(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::AnimationState* cobj = (dragonBones::AnimationState *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_AnimationState_getClip : Invalid Native Object");
    if (argc == 0) {
        const dragonBones::AnimationData& ret = cobj->getAnimationData();
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::AnimationData>(cx, (dragonBones::AnimationData*)&ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_AnimationState_getClip : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_ArmatureData_get_animations(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::ArmatureData* cobj = (dragonBones::ArmatureData *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_ArmatureData_get_animations : Invalid Native Object");

    JS::RootedObject proto(cx);
    JS::RootedObject parent(cx);
    JS::RootedObject jsRet(cx, JS_NewObject(cx, NULL, proto, parent));
    const std::map<std::string, dragonBones::AnimationData*>& v = cobj->animations;
    for (auto iter = v.begin(); iter != v.end(); ++iter)
    {
        JS::RootedValue element(cx);
        std::string key = iter->first;
        dragonBones::AnimationData* valueObj = iter->second;
        element = OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::AnimationData>(cx, valueObj));
        if (!key.empty())
        {
            JS_SetProperty(cx, jsRet, key.c_str(), element);
        }
    }
    vp.set(OBJECT_TO_JSVAL(jsRet));
    return true;
}

bool js_cocos2dx_dragonbones_ArmatureData_get_bones(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::ArmatureData* cobj = (dragonBones::ArmatureData *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_ArmatureData_get_bones : Invalid Native Object");

    JS::RootedObject proto(cx);
    JS::RootedObject parent(cx);
    JS::RootedObject jsRet(cx, JS_NewObject(cx, NULL, proto, parent));
    const std::map<std::string, dragonBones::BoneData*>& v = cobj->bones;
    for (auto iter = v.begin(); iter != v.end(); ++iter)
    {
        JS::RootedValue element(cx);
        std::string key = iter->first;
        dragonBones::BoneData* valueObj = iter->second;
        element = OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::BoneData>(cx, valueObj));
        if (!key.empty())
        {
            JS_SetProperty(cx, jsRet, key.c_str(), element);
        }
    }
    vp.set(OBJECT_TO_JSVAL(jsRet));
    return true;
}

bool js_cocos2dx_dragonbones_ArmatureData_get_skins(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::ArmatureData* cobj = (dragonBones::ArmatureData *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_ArmatureData_get_skins : Invalid Native Object");

    JS::RootedObject proto(cx);
    JS::RootedObject parent(cx);
    JS::RootedObject jsRet(cx, JS_NewObject(cx, NULL, proto, parent));
    const std::map<std::string, dragonBones::SkinData*>& v = cobj->skins;
    for (auto iter = v.begin(); iter != v.end(); ++iter)
    {
        JS::RootedValue element(cx);
        std::string key = iter->first;
        dragonBones::SkinData* valueObj = iter->second;
        element = OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::SkinData>(cx, valueObj));
        if (!key.empty())
        {
            JS_SetProperty(cx, jsRet, key.c_str(), element);
        }
    }
    vp.set(OBJECT_TO_JSVAL(jsRet));
    return true;
}

bool js_cocos2dx_dragonbones_ArmatureData_get_slots(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::ArmatureData* cobj = (dragonBones::ArmatureData *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_ArmatureData_get_slots : Invalid Native Object");

    JS::RootedObject proto(cx);
    JS::RootedObject parent(cx);
    JS::RootedObject jsRet(cx, JS_NewObject(cx, NULL, proto, parent));
    const std::map<std::string, dragonBones::SlotData*>& v = cobj->slots;
    for (auto iter = v.begin(); iter != v.end(); ++iter)
    {
        JS::RootedValue element(cx);
        std::string key = iter->first;
        dragonBones::SlotData* valueObj = iter->second;
        element = OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::SlotData>(cx, valueObj));
        if (!key.empty())
        {
            JS_SetProperty(cx, jsRet, key.c_str(), element);
        }
    }
    vp.set(OBJECT_TO_JSVAL(jsRet));
    return true;
}

bool js_cocos2dx_dragonbones_DragonBonesData_get_armatureNames(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::DragonBonesData* cobj = (dragonBones::DragonBonesData *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_DragonBonesData_get_armatureNames : Invalid Native Object");
    const std::vector<std::string>& ret = cobj->getArmatureNames();
    JS::RootedValue jsret(cx);
    jsret = std_vector_string_to_jsval(cx, ret);
    vp.set(jsret);
    return true;
}

bool js_cocos2dx_dragonbones_WorldClock_getClock(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::WorldClock>(cx, &dragonBones::WorldClock::clock)));
    vp.set(jsret);
    return true;
}

bool js_cocos2dx_dragonbones_WorldClock_remove(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::WorldClock* cobj = (dragonBones::WorldClock *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_WorldClock_remove : Invalid Native Object");
    if (argc == 1) {
        dragonBones::IAnimateble* arg0 = nullptr;
        do {
            if (args.get(0).isNull()) { arg0 = nullptr; break; }
            if (!args.get(0).isObject()) { ok = false; break; }
            js_proxy_t *jsProxy;
            JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull());
            jsProxy = jsb_get_js_proxy(tmpObj);
            auto armatureObj = static_cast<dragonBones::Armature*>(jsProxy ? jsProxy->ptr : NULL);
            auto clockObj = static_cast<dragonBones::WorldClock*>(jsProxy ? jsProxy->ptr : NULL);
            if (armatureObj) {
                arg0 = dynamic_cast<dragonBones::IAnimateble*>(armatureObj);
            }
            else {
                arg0 = dynamic_cast<dragonBones::IAnimateble*>(clockObj);
            }
            JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object");
        } while (0);
        JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_dragonbones_WorldClock_remove : Error processing arguments");
        cobj->remove(arg0);
        args.rval().setUndefined();
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_WorldClock_remove : wrong number of arguments: %d, was expecting %d", argc, 1);
    return false;
}

bool js_cocos2dx_dragonbones_WorldClock_add(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::WorldClock* cobj = (dragonBones::WorldClock *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_WorldClock_add : Invalid Native Object");
    if (argc == 1) {
        dragonBones::IAnimateble* arg0 = nullptr;
        do {
            if (args.get(0).isNull()) { arg0 = nullptr; break; }
            if (!args.get(0).isObject()) { ok = false; break; }
            js_proxy_t *jsProxy;
            JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull());
            jsProxy = jsb_get_js_proxy(tmpObj);
            auto armatureObj = static_cast<dragonBones::Armature*>(jsProxy ? jsProxy->ptr : NULL);
            auto clockObj = static_cast<dragonBones::WorldClock*>(jsProxy ? jsProxy->ptr : NULL);
            if (armatureObj) {
                arg0 = dynamic_cast<dragonBones::IAnimateble*>(armatureObj);
            }
            else {
                arg0 = dynamic_cast<dragonBones::IAnimateble*>(clockObj);
            }
            JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object");
        } while (0);
        JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_dragonbones_WorldClock_add : Error processing arguments");
        cobj->add(arg0);
        args.rval().setUndefined();
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_WorldClock_add : wrong number of arguments: %d, was expecting %d", argc, 1);
    return false;
}

bool js_cocos2dx_dragonbones_CCFactory_getFactory(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    if (argc == 0) {
        const dragonBones::CCFactory& ret = dragonBones::CCFactory::factory;
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::CCFactory>(cx, (dragonBones::CCFactory*)&ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_CCFactory_getFactory : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_TransformObject_getGlobal(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::TransformObject* cobj = (dragonBones::TransformObject *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_TransformObject_getGlobal : Invalid Native Object");
    JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::Transform>(cx, &cobj->global)));
    vp.set(jsret);
    return true;
}

bool js_cocos2dx_dragonbones_TransformObject_getOrigin(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::TransformObject* cobj = (dragonBones::TransformObject *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_TransformObject_getOrigin : Invalid Native Object");
    JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::Transform>(cx, &cobj->origin)));
    vp.set(jsret);
    return true;
}

bool js_cocos2dx_dragonbones_TransformObject_getOffset(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
{
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::TransformObject* cobj = (dragonBones::TransformObject *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_TransformObject_getOffset : Invalid Native Object");
    JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::Transform>(cx, &cobj->offset)));
    vp.set(jsret);
    return true;
}

bool js_cocos2dx_dragonbones_Slot_getRawDisplay(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::Slot* cobj = (dragonBones::Slot *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Slot_getRawDisplay : Invalid Native Object");
    if (argc == 0) {
        dragonBones::DBCCSprite* ret = static_cast<dragonBones::DBCCSprite*>(cobj->getRawDisplay());
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::DBCCSprite>(cx, ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_Slot_getRawDisplay : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_Slot_getDisplay(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::Slot* cobj = (dragonBones::Slot *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Slot_getDisplay : Invalid Native Object");
    if (argc == 0) {
        dragonBones::DBCCSprite* ret = static_cast<dragonBones::DBCCSprite*>(cobj->getDisplay());
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::DBCCSprite>(cx, ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_Slot_getDisplay : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_Slot_getMeshDisplay(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::Slot* cobj = (dragonBones::Slot *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Slot_getMeshDisplay : Invalid Native Object");
    if (argc == 0) {
        dragonBones::DBCCSprite* ret = static_cast<dragonBones::DBCCSprite*>(cobj->getMeshDisplay());
        JS::RootedValue jsret(cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject<dragonBones::DBCCSprite>(cx, ret)));
        args.rval().set(jsret);
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_Slot_getMeshDisplay : wrong number of arguments: %d, was expecting %d", argc, 0);
    return false;
}

bool js_cocos2dx_dragonbones_Slot_setDisplay(JSContext *cx, uint32_t argc, jsval *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    bool ok = true;
    JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
    js_proxy_t *proxy = jsb_get_js_proxy(obj);
    dragonBones::Slot* cobj = (dragonBones::Slot *)(proxy ? proxy->ptr : NULL);
    JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_dragonbones_Slot_setDisplay : Invalid Native Object");
    if (argc == 2) {
        ok = true;
        js_proxy_t *jsProxy;
        JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull());
        jsProxy = jsb_get_js_proxy(tmpObj);
        dragonBones::DBCCSprite* arg0 = (dragonBones::DBCCSprite*)(jsProxy ? jsProxy->ptr : NULL);
        dragonBones::DisplayType arg1;
        ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1);
        JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_dragonbones_Slot_setDisplay : Error processing arguments");
        cobj->setDisplay(arg0, arg1);
        args.rval().setUndefined();
        return true;
    }

    JS_ReportError(cx, "js_cocos2dx_dragonbones_Slot_setDisplay : wrong number of arguments: %d, was expecting %d", argc, 2);
    return false;
}

extern JSObject *jsb_dragonBones_Armature_prototype;
extern JSObject *jsb_dragonBones_ArmatureData_prototype;
extern JSObject *jsb_dragonBones_DragonBonesData_prototype;
extern JSObject *jsb_dragonBones_CCArmatureDisplay_prototype;
extern JSObject *jsb_dragonBones_AnimationState_prototype;
extern JSObject *jsb_dragonBones_TransformObject_prototype;
extern JSObject *jsb_dragonBones_WorldClock_prototype;
extern JSObject *jsb_dragonBones_Slot_prototype;

void register_all_cocos2dx_dragonbones_manual(JSContext* cx, JS::HandleObject global)
{
    JS::RootedObject armature(cx, jsb_dragonBones_Armature_prototype);
    JS_DefineFunction(cx, armature, "getAnimation", js_cocos2dx_dragonbones_Armature_getAnimation, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
    JS_DefineFunction(cx, armature, "getArmatureData", js_cocos2dx_dragonbones_Armature_getArmatureData, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
    JS_DefineFunction(cx, armature, "getDisplay", js_cocos2dx_dragonbones_Armature_getDisplay, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);

    JS::RootedObject armatureDisplay(cx, jsb_dragonBones_CCArmatureDisplay_prototype);
    JS_DefineFunction(cx, armatureDisplay, "getAnimation", js_cocos2dx_dragonbones_CCArmatureDisplay_getAnimation, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);

    JS::RootedObject animationState(cx, jsb_dragonBones_AnimationState_prototype);
    JS_DefineFunction(cx, animationState, "getAnimationData", js_cocos2dx_dragonbones_AnimationState_getAnimationData, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);

    JS::RootedObject armatureData(cx, jsb_dragonBones_ArmatureData_prototype);
    JS_DefineProperty(cx, armatureData, "animations", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_ArmatureData_get_animations);
    JS_DefineProperty(cx, armatureData, "bones", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_ArmatureData_get_bones);
    JS_DefineProperty(cx, armatureData, "skins", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_ArmatureData_get_skins);
    JS_DefineProperty(cx, armatureData, "slots", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_ArmatureData_get_slots);

    JS::RootedObject dragonBonesData(cx, jsb_dragonBones_DragonBonesData_prototype);
    JS_DefineProperty(cx, dragonBonesData, "armatureNames", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_DragonBonesData_get_armatureNames);

    JS::RootedObject tmpObj(cx);
    get_or_create_js_obj(cx, global, "dragonBones", &tmpObj);
    get_or_create_js_obj(cx, tmpObj, "WorldClock", &tmpObj);
    JS_DefineProperty(cx, tmpObj, "clock", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_WorldClock_getClock);

    JS::RootedObject worldClock(cx, jsb_dragonBones_WorldClock_prototype);
    JS_DefineFunction(cx, worldClock, "add", js_cocos2dx_dragonbones_WorldClock_add, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);
    JS_DefineFunction(cx, worldClock, "remove", js_cocos2dx_dragonbones_WorldClock_remove, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);

    JS::RootedObject factoryObj(cx);
    get_or_create_js_obj(cx, global, "dragonBones", &factoryObj);
    get_or_create_js_obj(cx, factoryObj, "CCFactory", &factoryObj);
    JS_DefineFunction(cx, factoryObj, "getFactory", js_cocos2dx_dragonbones_CCFactory_getFactory, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);

    JS::RootedObject transformObject(cx, jsb_dragonBones_TransformObject_prototype);
    JS_DefineProperty(cx, transformObject, "global", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_TransformObject_getGlobal);
    JS_DefineProperty(cx, transformObject, "origin", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_TransformObject_getOrigin);
    JS_DefineProperty(cx, transformObject, "offset", JS::UndefinedHandleValue, JSPROP_ENUMERATE | JSPROP_PERMANENT, js_cocos2dx_dragonbones_TransformObject_getOffset);

    JS::RootedObject slotObject(cx, jsb_dragonBones_Slot_prototype);
    JS_DefineFunction(cx, slotObject, "getRawDisplay", js_cocos2dx_dragonbones_Slot_getRawDisplay, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
    JS_DefineFunction(cx, slotObject, "getDisplay", js_cocos2dx_dragonbones_Slot_getDisplay, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
    JS_DefineFunction(cx, slotObject, "getMeshDisplay", js_cocos2dx_dragonbones_Slot_getMeshDisplay, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
    JS_DefineFunction(cx, slotObject, "setDisplay", js_cocos2dx_dragonbones_Slot_setDisplay, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
}


text:
#ifndef __BINHEX_H
#define __BINHEX_H

int	cli_binhex(const char *dir, int desc);

#endif


text:
import type { RenovateConfig } from '../../../config/types';
import { checkOnboardingBranch } from '../onboarding/branch';
import { mergeRenovateConfig } from './merge';
import { detectSemanticCommits } from './semantic';

// istanbul ignore next
export async function getRepoConfig(
  config_: RenovateConfig
): Promise<RenovateConfig> {
  let config = { ...config_ };
  config.baseBranch = config.defaultBranch;
  config = await checkOnboardingBranch(config);
  config = await mergeRenovateConfig(config);
  if (config.semanticCommits === 'auto') {
    config.semanticCommits = await detectSemanticCommits();
  }
  return config;
}


text:
package hip.ch4;

import hip.ch3.StockPriceWritable;
import hip.util.Cli;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.MultipleOutputs;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

import java.io.IOException;
import java.util.HashSet;

import static hip.util.CliCommonOpts.IOOptions;

/**
 * A job which produces multiple dynamic outputs.
 */
public final class MultipleOutputsJob extends Configured implements Tool {

  /**
   * Main entry point for the example.
   *
   * @param args arguments
   * @throws Exception when something goes wrong
   */
  public static void main(final String[] args) throws Exception {
    int res = ToolRunner.run(new Configuration(), new MultipleOutputsJob(), args);
    System.exit(res);
  }

  /**
   * The MapReduce driver - setup and launch the job.
   *
   * @param args the command-line arguments
   * @return the process exit code
   * @throws Exception if something goes wrong
   */
  public int run(final String[] args) throws Exception {

    Cli cli = Cli.builder().setArgs(args).addOptions(IOOptions.values()).build();
    int result = cli.runCmd();

    if (result != 0) {
      return result;
    }

    Path input = new Path(cli.getArgValueAsString(IOOptions.INPUT));
    Path output = new Path(cli.getArgValueAsString(IOOptions.OUTPUT));

    Configuration conf = super.getConf();

    Job job = new Job(conf);
    job.setJarByClass(MultipleOutputsJob.class);
    job.setMapperClass(Map.class);

    job.setMapOutputKeyClass(Text.class);
    job.setMapOutputValueClass(Text.class);

    FileInputFormat.setInputPaths(job, input);
    FileOutputFormat.setOutputPath(job, output);

    job.setNumReduceTasks(0);

    MultipleOutputs.addNamedOutput(job, "partition",
        TextOutputFormat.class, Text.class, Text.class);

    return job.waitForCompletion(true) ? 0 : 1;
  }

  /**
   * The mapper, which partitions the stock data by date.
   */
  public static class Map extends Mapper<LongWritable, Text, Text, Text> {

    private MultipleOutputs output;

    @Override
    protected void setup(Context context) {
      output = new MultipleOutputs(context);
    }

    @Override
    protected void map(LongWritable key, Text value, Context context)
        throws IOException, InterruptedException {

      StockPriceWritable stock =
          StockPriceWritable.fromLine(value.toString());

      output.write(value, null, stock.getDate());
    }

    @Override
    protected void cleanup(Context context) throws IOException, InterruptedException {
      output.close();
    }
  }
}


text:
using namespace std;

class Solution {
public:
    typedef string::iterator Iter;
    vector<int> diffWaysToCompute(string input) {
        return diffWaysToCompute(input.begin(), input.end());
    }
    vector<int> diffWaysToCompute(Iter first, Iter last) {
        vector<int> ret;
        bool isPrimitive = true;
        for (Iter i = first; i != last; ++i) {
            if (isdigit(*i))
                continue;
            isPrimitive = false;
            vector<int> left = diffWaysToCompute(first, i);
            vector<int> right = diffWaysToCompute(i+1, last);
            for (auto lhs : left)
                for (auto rhs : right)
                    ret.push_back(compute(lhs, rhs, *i));
        }
        if (isPrimitive) {
            istringstream is(string(first, last));
            int tmp;
            is >> tmp;
            ret.push_back(tmp);
        }
        return ret;
    }
    int compute(int lhs, int rhs, char c) {
        switch (c) {
            case '+':
                return lhs + rhs;
            case '-':
                return lhs - rhs;
            case '*':
                return lhs * rhs;
            default:
                assert(false);
        }
        return 0;
    }
};

int main(void)
{
    Solution s;
    vector<int> res{-34, -14, -10, -10, 10};
    vector<int> ret = s.diffWaysToCompute("2*3-4*5");
    sort(ret.begin(), ret.end());
    assert(equal(res.begin(), res.end(), ret.begin()));
    return 0;
}


text:
/* jshint node: true  */
'use strict';

const util = require('util'),
      defaults = require('../defaults'),
      options = require('../options'),
      command_utils = require('./command-utils');

var descriptor = defaults.defaultDescriptor({
  roleName: {
    name: 'Role Name',
    required: true,
    prompt: true
  },
  email: {
    name: 'EMail for the user',
    required: true,
    prompt: true
  }
});

module.exports.descriptor = descriptor;

module.exports.run = function(opts, cb) {
  if (opts.debug) {
    console.log('verifyUserRole: %j', opts);
  }

  let uri = util.format('%s/v1/o/%s/userroles/%s/users/%s',
                        opts.baseuri, opts.organization, opts.roleName, opts.email );
  let requestOptions = {
        uri,
        method:'GET',
        json:true
      };
  command_utils.run('verifyUserRole', opts,requestOptions, cb);
};


text:
module CabooseStore
  class Review < ActiveRecord::Base
    self.table_name = 'store_reviews'

    belongs_to :product

    attr_accessible :id,
      :product_id,
      :name,
      :rating,
      :content
  end
end


text:
require './lib/cricket_api/request.rb'
require 'cricapi_response.rb'
require './lib/seo_page_content/ballbyball_seo_content.rb'
require './lib/seo_page_content/seo_page_content.rb'
require 'ballbyball/ballbyball.rb'

class BallbyballController < ApplicationController

   def show
    match_id = permitted_params[:match_id]
    unique_id =  params[:unique_id]
    cricApires = CricApi::Request.new('https://apecricket.herokuapp.com', 0)
    if match_id.present?
      @match_data = Ballbyball.new(CricApi::ProfessionalProfile.new().getResponseforBallbyBall(match_id), match_id)
      render "show"
    else
      @match_data = Ballbyball.new(CricApi::ProfessionalProfile.new().getResponseforBallbyBall(unique_id), unique_id)
    end
    set_seo_content if @match_data.present? && @match_data.matchScore.present?
   end

   # def index
    # unique_id = permitted_params[:match_id]
    # cricApires = CricApi::Request.new('https://apecricket.herokuapp.com', 0)
    # @match_data = Ballbyball.new(CricApi::ProfessionalProfile.new().getResponseforBallbyBall(unique_id), unique_id)
    # @data = @match_data
    # set_seo_content if @match_data.present? && @match_data.matchScore.present?
#
  # end

   def set_seo_content
    seo_page_data SeoPageContent::BallbyballPageSeoData.new(@match_data.matchScore).content
   end

   def permitted_params
    params.permit(:match_id)
   end

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision: 2761 $ -->
<!-- EN-Revision: 0 Maintainer: freespace Status: ready -->
<refentry id="api.config.load">
 <refnamediv>
  <refname>config_load()</refname>
  <refpurpose>загружает данные из конфигурационного файла и назначает их шаблону</refpurpose>
 </refnamediv>
 <refsect1>
  <title>Описание</title>
  <methodsynopsis>
   <type>void</type><methodname>config_load</methodname>
   <methodparam><type>string</type><parameter>file</parameter></methodparam>
   <methodparam choice="opt"><type>string</type><parameter>section</parameter></methodparam>
  </methodsynopsis>
  <para>
   Эта функция загружает данные из
   <link linkend="config.files">конфигурационного файла</link>
   и назначает их шаблону. Работает идентично функции шаблона
   <link linkend="language.function.config.load">{config_load}</link>.
  </para>
  <note>
   <title>Техническое Замечание</title>
   <para>
    Начиная с версии Smarty 2.4.0, присвоенные переменные шаблона сохраняются
    между вызовами методов
    <link linkend="api.fetch">fetch()</link>
    и
    <link linkend="api.display">display()</link>.
    Конфигурационные переменные, загруженные через config_load(), всегда
    находятся в глобальной зоне видимости. Конфигурационные файлы также
    компилируются для более быстрой обработки, и учитывают настройки
    <link linkend="variable.force.compile">$force_compile</link>
    и
    <link linkend="variable.compile.check">$compile_check</link>.
   </para>
  </note>
  <example>
   <title>config_load()</title>
   <programlisting role="php">
<![CDATA[
<?php
// загружаем конфигурационные переменные и присваиваем их шаблону
$smarty->config_load('my.conf');

// загружаем секцию
$smarty->config_load('my.conf', 'foobar');
?>
]]>
   </programlisting>
  </example>
  <para>
   См. также
   <link linkend="language.function.config.load">{config_load}</link>,
   <link linkend="api.get.config.vars">get_config_vars()</link>,
   <link linkend="api.clear.config">clear_config()</link>,
   и
   <link linkend="language.config.variables">конфигурационные переменные</link>.
  </para>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
package com.aqua.sanity.fixures;

import jsystem.framework.fixture.Fixture;

public class Fixture4 extends Fixture {

	public static int VALUE = -1;

	public Fixture4(){
		setParentFixture(Fixture2.class);
	}

	public void setUp() throws Exception{
		VALUE = 1;
	}

	public void tearDown() throws Exception{
		VALUE=0;
	}

}


text:
package jp.edainc.androidsamplesjava.utility;

import android.os.Looper;

import timber.log.Timber;

/**
 * Created by kobayashiryou on 2017/10/25.
 *
 * スレッドユーティリティ
 */

public final class ThreadUtility {
    private ThreadUtility(){}

    public static void sleep(long millisecond) {
        assertMain();
        try {
            Thread.sleep(millisecond);
        } catch(InterruptedException e) {}
    }

    public static void assertMain() {
        if(Looper.getMainLooper().getThread() == Thread.currentThread()) {
            throw new IllegalStateException("このメソッドをMain Threadから呼んではいけない");
        }
    }

    public static void dumpName() {
        Timber.i("Thread : %s", Thread.currentThread().getName());
    }
}


text:
<?xml version="1.0"?>
<entry name="callbacks.empty" type="method" return="Callbacks">
  <title>callbacks.empty()</title>
  <signature>
    <added>1.7</added>
  </signature>
  <desc>Remove all of the callbacks from a list.</desc>
  <longdesc>

This method returns the Callbacks object onto which it is attached (this).

  </longdesc>
  <example>
    <desc>Use callbacks.empty() to empty a list of callbacks:</desc>
    <![CDATA[
// A sample logging function to be added to a callbacks list
var foo = function( value1, value2 ) {
  console.log( "foo: " + value1 + "," + value2 );
};

// Another function to also be added to the list
var bar = function( value1, value2 ) {
  console.log( "bar: " + value1 + "," + value2 );
};

var callbacks = $.Callbacks();

// Add the two functions
callbacks.add( foo );
callbacks.add( bar );

// Empty the callbacks list
callbacks.empty();

// Check to ensure all callbacks have been removed
console.log( callbacks.has( foo ) );
// false
console.log( callbacks.has( bar ) );
// false
]]>
  </example>
  <category slug="callbacks-object"/>
  <category slug="version/1.7"/>
</entry>


text:
import TravisRoute from 'travis/routes/basic';
import config from 'travis/config/environment';

export default TravisRoute.extend({
  needsAuth: false
});


text:
'use strict';

// ==============================
// ABSTRACT COMPONENT
// ==============================

var Toy = function () {
    if (this.constructor === Toy) {
        throw new Error("You cannot instantiate an abstract class!");
    }
}

Toy.prototype.description = function () {
    throw new Error("You cannot call an abstract method!");
};

module.exports = Toy;


text:
--TEST--
Test array_push() function : usage variations - Pass different data types as $stack arg
--FILE--
<?php
/* Prototype  : int array_push(array $stack, mixed $var [, mixed $...])
 * Description: Pushes elements onto the end of the array
 * Source code: ext/standard/array.c
 */

/*
 * Pass different data types as $stack argument to array_push() to test behaviour
 */

echo "*** Testing array_push() : usage variations ***\n";

// Initialise function arguments not being substituted
$var = 'value';

//get an unset variable
$unset_var = 10;
unset ($unset_var);

// get a class
class classA
{
  public function __toString() {
    return "Class A object";
  }
}

// heredoc string
$heredoc = <<<EOT
hello world
EOT;

// get a resource variable
$fp = fopen(__FILE__, "r");

// unexpected values to be passed to $stack argument
$inputs = array(

       // int data
/*1*/  0,
       1,
       12345,
       -2345,

       // float data
/*5*/  10.5,
       -10.5,
       12.3456789000e10,
       12.3456789000E-10,
       .5,

       // null data
/*10*/ NULL,
       null,

       // boolean data
/*12*/ true,
       false,
       TRUE,
       FALSE,

       // empty data
/*16*/ "",
       '',
       array(),

       // string data
/*19*/ "string",
       'string',
       $heredoc,

       // object data
/*22*/ new classA(),

       // undefined data
/*23*/ @$undefined_var,

       // unset data
/*24*/ @$unset_var,

       // resource variable
/*25*/ $fp
);

// loop through each element of $inputs to check the behavior of array_push()
$iterator = 1;
foreach($inputs as $input) {
  echo "\n-- Iteration $iterator --\n";
  var_dump( array_push($input, $var) );
  $iterator++;
};

fclose($fp);

echo "Done";
?>
--EXPECTF--
*** Testing array_push() : usage variations ***

-- Iteration 1 --

Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
NULL

-- Iteration 2 --

Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
NULL

-- Iteration 3 --

Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
NULL

-- Iteration 4 --

Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
NULL

-- Iteration 5 --

Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
NULL

-- Iteration 6 --

Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
NULL

-- Iteration 7 --

Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
NULL

-- Iteration 8 --

Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
NULL

-- Iteration 9 --

Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
NULL

-- Iteration 10 --

Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
NULL

-- Iteration 11 --

Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
NULL

-- Iteration 12 --

Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
NULL

-- Iteration 13 --

Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
NULL

-- Iteration 14 --

Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
NULL

-- Iteration 15 --

Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
NULL

-- Iteration 16 --

Warning: array_push() expects parameter 1 to be array, string given in %s on line %d
NULL

-- Iteration 17 --

Warning: array_push() expects parameter 1 to be array, string given in %s on line %d
NULL

-- Iteration 18 --
int(1)

-- Iteration 19 --

Warning: array_push() expects parameter 1 to be array, string given in %s on line %d
NULL

-- Iteration 20 --

Warning: array_push() expects parameter 1 to be array, string given in %s on line %d
NULL

-- Iteration 21 --

Warning: array_push() expects parameter 1 to be array, string given in %s on line %d
NULL

-- Iteration 22 --

Warning: array_push() expects parameter 1 to be array, object given in %s on line %d
NULL

-- Iteration 23 --

Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
NULL

-- Iteration 24 --

Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
NULL

-- Iteration 25 --

Warning: array_push() expects parameter 1 to be array, resource given in %s on line %d
NULL
Done


text:
const Ractive = require('ractive');
const { EVENT, bookmarks, github, helper, config } = require('../services');
const $ = require('../util');
const IssueBox = require('./issue-box');
const RepoTitle = require('./repo-title');

let Module;
const DEFAULT_REPO_NAME = 'Pages';				// for ungrouped pages
const DEFAULT_PROJECTS_REPO_NAME = 'Projects';	// for ungrouped projects

const template = `
	{{#groupedBookmarks:repo}}

			<RepoTitle url="{{repoUrl}}" title="{{repoShortName}}" />

				{{#items}}<IssueBox issue="{{this}}" />{{/items}}

	{{/groupedBookmarks}}
`;

const data = {
	bookmarks: [],
};

const computed = {
	groupedBookmarks: function () {
		const groups = helper.groupIssues(this.get('bookmarks'));
		if (!groups[DEFAULT_PROJECTS_REPO_NAME]) {
			const repo = `${config.get('repoToSearch')}/projects`;
			groups[DEFAULT_PROJECTS_REPO_NAME] = {
				name: DEFAULT_PROJECTS_REPO_NAME,
				repo,
				repoShortName: DEFAULT_PROJECTS_REPO_NAME,
				repoUrl: `${config.get('baseUrl')}${repo}`,
			};
		}
		return groups;
	}
};

async function addBookmark (issue) {
	if (!issue) issue = config.get('state.issue');
	issue = completeIssueModel(issue);
	bookmarks.add(issue);
	data.bookmarks.push(issue);
	render(data.bookmarks);

	await github.checkIssuesForUpdates([issue]);
	render(data.bookmarks);
}

function removeBookmark (issue) {
	if (!issue) issue = config.get('state.issue');
	const iss = data.bookmarks.filter(i => i.url === issue.url)[0];
	if (!iss) return;
	this.splice('bookmarks', data.bookmarks.indexOf(iss), 1);
	bookmarks.remove(issue);
}

async function toggleBookmark () {
	const exists = await checkIfBookmarked();
	if (exists) $.trigger(EVENT.bookmark.remove);
	else $.trigger(EVENT.bookmark.add);
}

async function onUrlChanged (issue) {
	if (!issue || !issue.url) return;
	const iss = data.bookmarks.filter(i => i.url === issue.url)[0];
	if (iss) {
		iss.unread = false;
		iss.name = issue.name;
	}
	this.set('bookmarks', data.bookmarks);
	bookmarks.setUnreadByUrl(issue.url, false);

	const book = await checkIfBookmarked(issue.url);
	$.trigger(EVENT.bookmark.exists, !!book);
	if (book && book.name !== issue.name) bookmarks.update(book.id, { name: issue.name });
}

function checkIfBookmarked (url) {
	if (!url) url = config.get('state.url');
	if (url.indexOf('#') > -1) url = url.substr(0, url.indexOf('#'));
	return bookmarks.getByUrl(url);
}

async function refresh (reset) {
	if (Module) {
		Module.transitionsEnabled = false;
		if (reset === true) {
			data.bookmarks = [];
			Module.reset(data);
		}
		Module.transitionsEnabled = true;
	}
	let issues = await bookmarks.get();
	render(issues);
	issues = await github.checkIssuesForUpdates(issues);
	render(issues);
}

function completeIssueModel (iss) {
	if (!iss.repo) {
		if (helper.getPageActualTypeFromUrl(iss.url) === 'project') {
			iss.repo = DEFAULT_PROJECTS_REPO_NAME;
			iss.type = 'project';
		}
		else {
			iss.repo = DEFAULT_REPO_NAME;
			iss.type = 'page';
		}
	}
	iss.build = iss.build || {};
	return iss;
}

function render (issues) {
	issues = issues.map(completeIssueModel);
	issues = helper.mergeArrays(issues, data.bookmarks);

	if (issues.length) {
		issues.forEach(is => {
			bookmarks.update(is.id, { name: is.name, state: is.state });
		});
	}
	Module.set('bookmarks', issues);
	return issues;
}

function oninit () {
	$.on(EVENT.bookmark.add, addBookmark);
	$.on(EVENT.bookmark.remove, removeBookmark.bind(this));
	$.on(EVENT.bookmark.toggle, toggleBookmark);

	$.on(EVENT.section.refresh, sectionRefresh);
	$.on(EVENT.section.change, sectionChanged);
	$.on(EVENT.url.change.done, (wv, i) => onUrlChanged.call(this, i));
	$.on(EVENT.frame.domchanged, onUrlChanged.bind(this));
}

function sectionRefresh (id) {
	if (id === 'bookmarks') refresh(true);
}

function sectionChanged (id) {
	if (id === 'bookmarks' && !data.bookmarks.length) refresh();
}

Module = new Ractive({
	el: '#subnav .subnav-bookmarks .subnav-section-list',
	data,
	template,
	oninit,
	components: { RepoTitle, IssueBox },
	computed,
	transitionsEnabled: false
});

module.exports = Module;


text:
package com.koushikdutta.monojavabridge;

public interface MonoProxy {
	long getGCHandle();
	void setGCHandle(long gcHandle);
}


text:
package org.persistence;

import static javax.persistence.GenerationType.AUTO;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity
@NamedQueries({
	@NamedQuery(name = "AllMeasurements", query = "select m from Measurement m"),
	@NamedQuery(name = "LastSensorReading", query = "select m from Measurement m where m.sensorId = :paramSensorId and m.storedAt =  (SELECT MAX(r.storedAt) from Measurement r where r.sensorId = :paramSensorId)"),
	@NamedQuery(name = "LastReadingsFromSensor", query = "select p from Measurement p where p.sensorId = :paramSensorId order by p.storedAt DESC") })

public class Measurement implements Serializable {
	private static final long serialVersionUID = 1L;
	public Measurement() {
	}

	@Id
	@GeneratedValue(strategy = AUTO)

	private Long id;
	private String unit;
	private Timestamp storedAt;
	private Double value;
	private long sensorId;

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public Timestamp getStoredAt() {
		return storedAt;
	}
	public void setStoredAt(Timestamp dateStored) {
		this.storedAt = dateStored;
	}
	public Double getValue() {
		return value;
	}
	public void setValue(Double sensorValue) {
		this.value = sensorValue;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	public long getSensorId() {
		return sensorId;
	}
	public void setSensorId(long param) {
		this.sensorId = param;
	}
}


text:
package com.github.akarnokd.scp.gui;

import java.util.*;

import org.eclipse.rap.rwt.application.*;
import org.eclipse.rap.rwt.client.WebClient;

/** RWT Application configuration. */
public class SCPConfiguration implements ApplicationConfiguration {
    @Override
    public void configure(Application application) {
        Map<String, String> properties = new HashMap<>();
        properties.put(WebClient.PAGE_TITLE, "Supplier Collaboration Platform");
        properties.put(WebClient.THEME_ID, "business");
        application.addStyleSheet("business", "theme/business/business.css");
        application.addEntryPoint("/login", SCPEntryPointLogin.class, properties);
        application.addEntryPoint("/main", SCPEntryPoint.class, properties);
    }
}


text:
/*
 * reserved comment block
 * DO NOT REMOVE OR ALTER!
 */
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sun.org.apache.bcel.internal.classfile;

import java.io.DataInput;
import java.io.DataOutputStream;
import java.io.IOException;
import com.sun.org.apache.bcel.internal.Const;

/**
 * This class represents a stack map entry recording the types of
 * local variables and the the of stack items at a given byte code offset.
 * See CLDC specification 5.3.1.2
 *
 * @see     StackMap
 * @see     StackMapType
 */
public final class StackMapEntry implements Node, Cloneable
{

    private int frameType;
    private int byteCodeOffset;
    private StackMapType[] typesOfLocals;
    private StackMapType[] typesOfStackItems;
    private ConstantPool constantPool;

    /**
     * Construct object from input stream.
     *
     * @param input Input stream
     * @throws IOException
     */
    StackMapEntry(final DataInput input, final ConstantPool constantPool) throws IOException {
        this(input.readByte() & 0xFF, -1, null, null, constantPool);

        if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {
            byteCodeOffset = frameType - Const.SAME_FRAME;
        } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                   frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
            byteCodeOffset = frameType - Const.SAME_LOCALS_1_STACK_ITEM_FRAME;
            typesOfStackItems = new StackMapType[1];
            typesOfStackItems[0] = new StackMapType(input, constantPool);
        } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
            byteCodeOffset = input.readShort();
            typesOfStackItems = new StackMapType[1];
            typesOfStackItems[0] = new StackMapType(input, constantPool);
        } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) {
            byteCodeOffset = input.readShort();
        } else if (frameType == Const.SAME_FRAME_EXTENDED) {
            byteCodeOffset = input.readShort();
        } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {
            byteCodeOffset = input.readShort();
            final int number_of_locals = frameType - 251;
            typesOfLocals = new StackMapType[number_of_locals];
            for (int i = 0; i < number_of_locals; i++) {
                typesOfLocals[i] = new StackMapType(input, constantPool);
            }
        } else if (frameType == Const.FULL_FRAME) {
            byteCodeOffset = input.readShort();
            final int number_of_locals = input.readShort();
            typesOfLocals = new StackMapType[number_of_locals];
            for (int i = 0; i < number_of_locals; i++) {
                typesOfLocals[i] = new StackMapType(input, constantPool);
            }
            final int number_of_stack_items = input.readShort();
            typesOfStackItems = new StackMapType[number_of_stack_items];
            for (int i = 0; i < number_of_stack_items; i++) {
                typesOfStackItems[i] = new StackMapType(input, constantPool);
            }
        } else {
            /* Can't happen */
            throw new ClassFormatException ("Invalid frame type found while parsing stack map table: " + frameType);
        }
    }

    /**
     * DO NOT USE
     *
     * @param byteCodeOffset
     * @param numberOfLocals NOT USED
     * @param typesOfLocals array of {@link StackMapType}s of locals
     * @param numberOfStackItems NOT USED
     * @param typesOfStackItems array ot {@link StackMapType}s of stack items
     * @param constantPool the constant pool
     * @deprecated Since 6.0, use {@link #StackMapEntry(int, int, StackMapType[], StackMapType[], ConstantPool)}
     * instead
     */
    @java.lang.Deprecated
    public StackMapEntry(final int byteCodeOffset, final int numberOfLocals,
            final StackMapType[] typesOfLocals, final int numberOfStackItems,
            final StackMapType[] typesOfStackItems, final ConstantPool constantPool) {
        this.byteCodeOffset = byteCodeOffset;
        this.typesOfLocals = typesOfLocals != null ? typesOfLocals : new StackMapType[0];
        this.typesOfStackItems = typesOfStackItems != null ? typesOfStackItems : new StackMapType[0];
        this.constantPool = constantPool;
    }

    /**
     * Create an instance
     *
     * @param tag the frameType to use
     * @param byteCodeOffset
     * @param typesOfLocals array of {@link StackMapType}s of locals
     * @param typesOfStackItems array ot {@link StackMapType}s of stack items
     * @param constantPool the constant pool
     */
    public StackMapEntry(final int tag, final int byteCodeOffset,
            final StackMapType[] typesOfLocals,
            final StackMapType[] typesOfStackItems, final ConstantPool constantPool) {
        this.frameType = tag;
        this.byteCodeOffset = byteCodeOffset;
        this.typesOfLocals = typesOfLocals != null ? typesOfLocals : new StackMapType[0];
        this.typesOfStackItems = typesOfStackItems != null ? typesOfStackItems : new StackMapType[0];
        this.constantPool = constantPool;
    }

    /**
     * Dump stack map entry
     *
     * @param file Output file stream
     * @throws IOException
     */
    public void dump( final DataOutputStream file ) throws IOException {
        file.write(frameType);
        if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {
            // nothing to be done
        } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                   frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
            typesOfStackItems[0].dump(file);
        } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
            file.writeShort(byteCodeOffset);
            typesOfStackItems[0].dump(file);
        } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) {
            file.writeShort(byteCodeOffset);
        } else if (frameType == Const.SAME_FRAME_EXTENDED) {
            file.writeShort(byteCodeOffset);
        } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {
            file.writeShort(byteCodeOffset);
            for (final StackMapType type : typesOfLocals) {
                type.dump(file);
            }
        } else if (frameType == Const.FULL_FRAME) {
            file.writeShort(byteCodeOffset);
            file.writeShort(typesOfLocals.length);
            for (final StackMapType type : typesOfLocals) {
                type.dump(file);
            }
            file.writeShort(typesOfStackItems.length);
            for (final StackMapType type : typesOfStackItems) {
                type.dump(file);
            }
        } else {
            /* Can't happen */
            throw new ClassFormatException ("Invalid Stack map table tag: " + frameType);
        }
    }

    /**
     * @return String representation.
     */
    @Override
    public String toString() {
        final StringBuilder buf = new StringBuilder(64);
        buf.append("(");
        if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {
            buf.append("SAME");
        } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                  frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
            buf.append("SAME_LOCALS_1_STACK");
        } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
            buf.append("SAME_LOCALS_1_STACK_EXTENDED");
        } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) {
            buf.append("CHOP ").append(String.valueOf(251-frameType));
        } else if (frameType == Const.SAME_FRAME_EXTENDED) {
            buf.append("SAME_EXTENDED");
        } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {
            buf.append("APPEND ").append(String.valueOf(frameType-251));
        } else if (frameType == Const.FULL_FRAME) {
            buf.append("FULL");
        } else {
            buf.append("UNKNOWN (").append(frameType).append(")");
        }
        buf.append(", offset delta=").append(byteCodeOffset);
        if (typesOfLocals.length > 0) {
            buf.append(", locals={");
            for (int i = 0; i < typesOfLocals.length; i++) {
                buf.append(typesOfLocals[i]);
                if (i < typesOfLocals.length - 1) {
                    buf.append(", ");
                }
            }
            buf.append("}");
        }
        if (typesOfStackItems.length > 0) {
            buf.append(", stack items={");
            for (int i = 0; i < typesOfStackItems.length; i++) {
                buf.append(typesOfStackItems[i]);
                if (i < typesOfStackItems.length - 1) {
                    buf.append(", ");
                }
            }
            buf.append("}");
        }
        buf.append(")");
        return buf.toString();
    }

    /**
     * Calculate stack map entry size
     *
     */
    int getMapEntrySize() {
        if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {
            return 1;
        } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                   frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
            return 1 + (typesOfStackItems[0].hasIndex() ? 3 : 1);
        } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
            return 3 + (typesOfStackItems[0].hasIndex() ? 3 : 1);
        } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) {
            return 3;
        } else if (frameType == Const.SAME_FRAME_EXTENDED) {
            return 3;
        } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {
            int len = 3;
            for (final StackMapType types_of_local : typesOfLocals) {
                len += types_of_local.hasIndex() ? 3 : 1;
            }
            return len;
        } else if (frameType == Const.FULL_FRAME) {
            int len = 7;
            for (final StackMapType types_of_local : typesOfLocals) {
                len += types_of_local.hasIndex() ? 3 : 1;
            }
            for (final StackMapType types_of_stack_item : typesOfStackItems) {
                len += types_of_stack_item.hasIndex() ? 3 : 1;
            }
            return len;
        } else {
            throw new IllegalStateException("Invalid StackMap frameType: " + frameType);
        }
    }

    public void setFrameType( final int f ) {
        if (f >= Const.SAME_FRAME && f <= Const.SAME_FRAME_MAX) {
            byteCodeOffset = f - Const.SAME_FRAME;
        } else if (f >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                   f <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
            byteCodeOffset = f - Const.SAME_LOCALS_1_STACK_ITEM_FRAME;
        } else if (f == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (f >= Const.CHOP_FRAME && f <= Const.CHOP_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (f == Const.SAME_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (f >= Const.APPEND_FRAME && f <= Const.APPEND_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (f == Const.FULL_FRAME) { // CHECKSTYLE IGNORE EmptyBlock
        } else {
            throw new IllegalArgumentException("Invalid StackMap frameType");
        }
        frameType = f;
    }

    public int getFrameType() {
        return frameType;
    }

    public void setByteCodeOffset( final int new_offset ) {
        if (new_offset < 0 || new_offset > 32767) {
            throw new IllegalArgumentException("Invalid StackMap offset: " + new_offset);
        }

        if (frameType >= Const.SAME_FRAME &&
            frameType <= Const.SAME_FRAME_MAX) {
            if (new_offset > Const.SAME_FRAME_MAX) {
                frameType = Const.SAME_FRAME_EXTENDED;
            } else {
                frameType = new_offset;
            }
        } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                   frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
            if (new_offset > Const.SAME_FRAME_MAX) {
                frameType = Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
            } else {
                frameType = Const.SAME_LOCALS_1_STACK_ITEM_FRAME + new_offset;
            }
        } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (frameType >= Const.CHOP_FRAME &&
                   frameType <= Const.CHOP_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (frameType == Const.SAME_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (frameType >= Const.APPEND_FRAME &&
                   frameType <= Const.APPEND_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
        } else if (frameType == Const.FULL_FRAME) { // CHECKSTYLE IGNORE EmptyBlock
        } else {
            throw new IllegalStateException("Invalid StackMap frameType: " + frameType);
        }
        byteCodeOffset = new_offset;
    }

    /**
     * Update the distance (as an offset delta) from this StackMap
     * entry to the next.  Note that this might cause the the
     * frame type to change.  Note also that delta may be negative.
     *
     * @param delta offset delta
     */
    public void updateByteCodeOffset(final int delta) {
        setByteCodeOffset(byteCodeOffset + delta);
    }

    public int getByteCodeOffset() {
        return byteCodeOffset;
    }

    /**
     *
     * @deprecated since 6.0
     */
    @java.lang.Deprecated
    public void setNumberOfLocals( final int n ) { // TODO unused
    }

    public int getNumberOfLocals() {
        return typesOfLocals.length;
    }

    public void setTypesOfLocals( final StackMapType[] types ) {
        typesOfLocals = types != null ? types : new StackMapType[0];
    }

    public StackMapType[] getTypesOfLocals() {
        return typesOfLocals;
    }

    /**
     *
     * @deprecated since 6.0
     */
    @java.lang.Deprecated
    public void setNumberOfStackItems( final int n ) { // TODO unused
    }

    public int getNumberOfStackItems() {
        return typesOfStackItems.length;
    }

    public void setTypesOfStackItems( final StackMapType[] types ) {
        typesOfStackItems = types != null ? types : new StackMapType[0];
    }

    public StackMapType[] getTypesOfStackItems() {
        return typesOfStackItems;
    }

    /**
     * @return deep copy of this object
     */
    public StackMapEntry copy() {
        StackMapEntry e;
        try {
            e = (StackMapEntry) clone();
        } catch (final CloneNotSupportedException ex) {
            throw new Error("Clone Not Supported");
        }

        e.typesOfLocals = new StackMapType[typesOfLocals.length];
        for (int i = 0; i < typesOfLocals.length; i++) {
            e.typesOfLocals[i] = typesOfLocals[i].copy();
        }
        e.typesOfStackItems = new StackMapType[typesOfStackItems.length];
        for (int i = 0; i < typesOfStackItems.length; i++) {
            e.typesOfStackItems[i] = typesOfStackItems[i].copy();
        }
        return e;
    }

    /**
     * Called by objects that are traversing the nodes of the tree implicitely
     * defined by the contents of a Java class. I.e., the hierarchy of methods,
     * fields, attributes, etc. spawns a tree of objects.
     *
     * @param v Visitor object
     */
    @Override
    public void accept( final Visitor v ) {
        v.visitStackMapEntry(this);
    }

    /**
     * @return Constant pool used by this object.
     */
    public ConstantPool getConstantPool() {
        return constantPool;
    }

    /**
     * @param constantPool Constant pool to be used for this object.
     */
    public void setConstantPool( final ConstantPool constantPool ) {
        this.constantPool = constantPool;
    }
}


text:
all: fastbin

fastbin: fastbin.c
	gcc -g fastbin.c -o fastbin


text: Android API for the College Box (Open Source Multipurpose Box)