text:
require 'helper'
require 'deviantart'

class DeviantArt::Client::User::Test < Test::Unit::TestCase
  setup do
    @da, @credentials = create_da
  end
  sub_test_case '#get_profile' do
    setup do
      @profile = fixture('user_profile.json')
      @username = @profile.json['user']['username']
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/profile/#{@username}`,
        da: @da,
        body: @profile)
    end
    test 'requests the correct resource' do
      resp = @da.get_profile(@username)
      assert_instance_of(DeviantArt::User::Profile, resp)
      assert_instance_of(DeviantArt::User, resp.user)
      assert_equal("DeviantArt::User: #{@profile.json['user']['username']} #{@profile.json['user']['userid']}", resp.user.to_s)
      assert_instance_of(DeviantArt::Deviation, resp.profile_pic)
    end
  end
  sub_test_case '#update_profile' do
    setup do
      @profile = fixture('user_profile.json')
      @username = @profile.json['user']['username']
      @update_profile = fixture('user_update_profile.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/profile/#{@username}`,
        da: @da,
        body: @profile)
      stub_da_request(
        method: :post,
        url: "https://#{@da.host}/api/v1/oauth2/user/profile/update",
        da: @da,
        body: @update_profile)
    end
    test 'requests the correct resource' do
      original_profile = @da.get_profile(@username)
      resp = @da.update_profile(countryid: DeviantArt::CountryID::UnitedStates)
      assert_instance_of(DeviantArt::User::UpdateProfile, resp)
      updated_profile = @da.get_profile(@username)
      assert(updated_profile)
      resp = @da.update_profile(countryid: original_profile.countryid)
    end
  end
  sub_test_case '#update_profile' do
    setup do
      @profile = fixture('user_update_profile_with_no_parameters.json')
      stub_da_request(
        method: :post,
        url: "https://#{@da.host}/api/v1/oauth2/user/profile/update",
        da: @da,
        body: @profile,
        status_code: 400)
    end
    test 'with no parameters should fail' do
      resp = @da.update_profile
      assert_instance_of(DeviantArt::Error, resp)
    end
  end
  sub_test_case '#get_friends' do
    setup do
      @username = fixture('user_friends-input.json').json['username']
      @friends = fixture('user_friends.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends`,
        da: @da,
        body: @friends)
    end
    test 'requests the correct resource' do
      resp = @da.get_friends(@username)
      assert_instance_of(DeviantArt::User::Friends, resp)
      assert_instance_of(Array, resp.results)
      assert_instance_of(DeviantArt::User, resp.results.first.user)
    end
  end
  sub_test_case '#whois' do
    setup do
      @users = fixture('user_whois-input.json')
      @whois = fixture('user_whois.json')
      stub_da_request(
        method: :post,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/whois`,
        da: @da,
        body: @whois)
    end
    test 'requests the correct resource' do
      resp = @da.whois(@users.json)
      assert_instance_of(DeviantArt::User::Whois, resp)
      assert_instance_of(Array, resp.results)
      assert_instance_of(DeviantArt::User, resp.results.first)
    end
  end
  sub_test_case '#whoami' do
    setup do
      @whoami = fixture('user_whoami.json')
      stub_da_request(
        method: :get,
        url: "https://#{@da.host}/api/v1/oauth2/user/whoami",
        da: @da,
        body: @whoami)
    end
    test 'requests the correct resource' do
      resp = @da.whoami
      assert_instance_of(DeviantArt::User, resp)
    end
  end
  sub_test_case '#search_friends' do
    setup do
      @friends_search = fixture('user_friends_search.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/search`,
        da: @da,
        body: @friends_search)
    end
    test 'requests the correct resource' do
      resp = @da.search_friends('n', username: 'Ray-kbys')
      assert_instance_of(DeviantArt::User::Friends::Search, resp)
      assert_instance_of(Array, resp.results)
      assert_instance_of(DeviantArt::User, resp.results.first)
    end
  end
  sub_test_case '#get_statuses' do
    setup do
      @statuses = fixture('user_statuses.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/statuses`,
        da: @da,
        body: @statuses)
    end
    test 'requests the correct resource' do
      resp = @da.get_statuses(@statuses.json['results'].first['author']['username'])
      assert_instance_of(DeviantArt::User::Statuses, resp)
      assert_instance_of(Array, resp.results)
      assert_boolean(resp.has_more)
      assert_instance_of(DeviantArt::Status, resp.results.first) unless resp.results.empty?
    end
  end
  sub_test_case '#get_status' do
    setup do
      @status = fixture('user_statuses_status.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/statuses/`,
        da: @da,
        body: @status)
    end
    test 'requests the correct resource' do
      resp = @da.get_status(@status.json['statusid'])
      assert_instance_of(DeviantArt::Status, resp)
      assert_equal("DeviantArt::Status: #{resp.body} by #{resp.author.username} #{resp.statusid}", resp.to_s)
    end
  end
  sub_test_case '#get_watchers' do
    setup do
      @watchers = fixture('user_watchers.json')
      @username = fixture('user_watchers-input.json').json['username']
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/watchers/`,
        da: @da,
        body: @watchers)
    end
    test 'requests the correct resource' do
      resp = @da.get_watchers(username: @username)
      assert_instance_of(DeviantArt::User::Watchers, resp)
      assert_instance_of(Array, resp.results)
      assert_instance_of(DeviantArt::User, resp.results.first.user)
    end
  end
  sub_test_case '#watch_status' do
    setup do
      @watching = fixture('user_friends_watching.json')
      @username = fixture('user_friends_watching-input.json').json['username']
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watching/`,
        da: @da,
        body: @watching)
    end
    test 'requests the correct resource' do
      resp = @da.watch_status(@username)
      assert_instance_of(DeviantArt::User::Friends::Watching, resp)
      assert_boolean(resp.watching)
    end
  end
  sub_test_case '#watch_status' do
    setup do
      @watching_error = fixture('user_friends_watching-error_username_required.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watching/`,
        da: @da,
        body: @watching_error,
        status_code: 400)
    end
    test 'failds with no username' do
      resp = @da.watch_status(nil)
      assert_instance_of(DeviantArt::Error, resp)
      assert_equal('error', resp.status)
      assert_equal('invalid_request', resp.error)
      assert_equal('Request field validation failed.', resp.error_description)
      assert_equal('username is required', resp.error_details.username)
    end
  end
  sub_test_case '#watch' do
    setup do
      @username = fixture('user_friends_watch-input.json').json['username']
      @watch = fixture('user_friends_watch.json')
      stub_da_request(
        method: :post,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watch/`,
        da: @da,
        body: @watch)
    end
    test 'requests the correct resource' do
      resp = @da.watch(@username)
      assert_instance_of(DeviantArt::User::Friends::Watch, resp)
      assert_equal(true, resp.success)
    end
  end
  sub_test_case '#watch' do
    setup do
      @watch = fixture('user_friends_watch-username_required.json')
      stub_da_request(
        method: :post,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watch/`,
        da: @da,
        body: @watch,
        status_code: 400)
    end
    test 'requires username' do
      resp = @da.watch('')
      assert_instance_of(DeviantArt::Error, resp)
      assert_equal(400, resp.status_code)
      assert_equal('invalid_request', resp.error)
      assert_equal('username is required', resp.error_details.username)
      assert_equal('Request field validation failed.', resp.error_description)
      assert_equal('error', resp.status)
    end
  end
  sub_test_case '#watch' do
    setup do
      @username = fixture('user_friends_watch-user_not_found-input.json').json['username']
      @watch = fixture('user_friends_watch-user_not_found.json')
      stub_da_request(
        method: :post,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watch/`,
        da: @da,
        body: @watch,
        status_code: 400)
    end
    test 'user not found' do
      resp = @da.watch(@username)
      assert_instance_of(DeviantArt::Error, resp)
      assert_equal(400, resp.status_code)
      assert_equal('invalid_request', resp.error)
      assert_equal('User not found.', resp.error_description)
      assert_equal(0, resp.error_code)
      assert_equal('error', resp.status)
    end
  end
  sub_test_case '#watch' do
    setup do
      @watch = fixture('user_friends_watch-user_own.json')
      @whoami = fixture('user_friends_watch-user_own-whoami.json')
      stub_da_request(
        method: :get,
        url: "https://#{@da.host}/api/v1/oauth2/user/whoami?",
        da: @da,
        body: @whoami)
      stub_da_request(
        method: :post,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watch/`,
        da: @da,
        body: @watch,
        status_code: 400)
    end
    test 'add you to your own friend' do
      resp = @da.watch(@da.whoami.username)
      assert_instance_of(DeviantArt::Error, resp)
      assert_equal(400, resp.status_code)
      assert_equal('invalid_request', resp.error)
      assert_equal('Failed to add friend - You can not add yourself to your own friends list.', resp.error_description)
      assert_equal(2, resp.error_code)
      assert_equal('error', resp.status)
    end
  end
  sub_test_case '#unwatch' do
    setup do
      @username = fixture('user_friends_unwatch-input.json').json['username']
      @unwatch = fixture('user_friends_unwatch.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/unwatch/`,
        da: @da,
        body: @unwatch)
    end
    test 'requests the correct resource' do
      resp = @da.unwatch(@username)
      assert_instance_of(DeviantArt::User::Friends::Unwatch, resp)
      assert_equal(true, resp.success)
    end
  end
  sub_test_case '#unwatch' do
    setup do
      @watch = fixture('user_friends_watch-username_required.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/unwatch/`,
        da: @da,
        body: @watch,
        status_code: 400)
    end
    test 'requires username' do
      resp = @da.unwatch('')
      assert_instance_of(DeviantArt::Error, resp)
      assert_equal(400, resp.status_code)
      assert_equal('invalid_request', resp.error)
      assert_equal('username is required', resp.error_details.username)
      assert_equal('Request field validation failed.', resp.error_description)
      assert_equal('error', resp.status)
    end
  end
  sub_test_case '#unwatch' do
    setup do
      @username = fixture('user_friends_unwatch-user_not_found-input.json').json['username']
      @watch = fixture('user_friends_unwatch-user_not_found.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/unwatch/`,
        da: @da,
        body: @watch,
        status_code: 400)
    end
    test 'user not found' do
      resp = @da.unwatch(@username)
      assert_instance_of(DeviantArt::Error, resp)
      assert_equal(400, resp.status_code)
      assert_equal('invalid_request', resp.error)
      assert_equal('User not found.', resp.error_description)
      assert_equal(0, resp.error_code)
      assert_equal('error', resp.status)
    end
  end
  sub_test_case '#watch_status after #watch' do
    setup do
      @username = fixture('user_friends_watch-input.json').json['username']
      @unwatch = fixture('user_friends_unwatch.json')
      @watch = fixture('user_friends_watch.json')
      @watching = fixture('user_friends_watching-true.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/unwatch/`,
        da: @da,
        body: @unwatch)
      stub_da_request(
        method: :post,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watch/`,
        da: @da,
        body: @watch)
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watching/`,
        da: @da,
        body: @watching)
      @da.unwatch(@username)
      @da.watch(@username)
    end
    test 'requests the correct resource' do
      resp = @da.watch_status(@username)
      assert_instance_of(DeviantArt::User::Friends::Watching, resp)
      assert_equal(true, resp.watching)
    end
  end
  sub_test_case '#watch_status after #unwatch' do
    setup do
      @username = fixture('user_friends_watch-input.json').json['username']
      @unwatch = fixture('user_friends_unwatch.json')
      @watch = fixture('user_friends_watch.json')
      @watching = fixture('user_friends_watching-false.json')
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/unwatch/`,
        da: @da,
        body: @unwatch)
      stub_da_request(
        method: :post,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watch/`,
        da: @da,
        body: @watch)
      stub_da_request(
        method: :get,
        url: %r`^https://#{@da.host}/api/v1/oauth2/user/friends/watching/`,
        da: @da,
        body: @watching)
      @da.watch(@username)
      @da.unwatch(@username)
    end
    test 'requests the correct resource' do
      resp = @da.watch_status(@username)
      assert_instance_of(DeviantArt::User::Friends::Watching, resp)
      assert_equal(false, resp.watching)
    end
  end
  sub_test_case '#damntoken' do
    setup do
      @damntoken = fixture('user_damntoken.json')
      stub_da_request(
        method: :get,
        url: "https://#{@da.host}/api/v1/oauth2/user/damntoken?",
        da: @da,
        body: @damntoken)
    end
    test 'requests the correct resource' do
      resp = @da.damntoken
      assert_instance_of(DeviantArt::User::DamnToken, resp)
      assert_instance_of(String, resp.damntoken)
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;

namespace ArkController.Kit
{
    /// <summary>
    /// 守护类
    /// </summary>
    public class Protect
    {
        /// <summary>
        /// 核实adb文件是否存在,不存在则拷贝一个
        /// </summary>
        public static void CheckAdb()
        {
            string adbPath = "./adb/adb.exe";
            if (!File.Exists(adbPath))
            {
                Directory.CreateDirectory("./adb/");
                //释放资源
                var outStream = File.Open(adbPath, FileMode.OpenOrCreate);
                byte[] data = global::ArkController.Properties.Resources.adb;
                outStream.Write(data, 0, data.Length);
                outStream.Flush();
                outStream.Close();
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include <QtCore/QObject>

#include "deviceInterface.h"

#include <trikControl/trikControlDeclSpec.h>

namespace trikControl {

/// Provides battery voltage info.
class TRIKCONTROL_EXPORT BatteryInterface : public QObject, public DeviceInterface
{
	Q_OBJECT
public slots:
	/// Returns current battery voltage in volts.
	virtual float readVoltage() = 0;

	/// Returns current raw reading of battery.
	virtual float readRawDataVoltage() = 0;
};

}

Q_DECLARE_METATYPE(trikControl::BatteryInterface*)


text:
package com.example.utils.navigationutils;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;

import com.baidu.navisdk.adapter.BNaviCommonParams;

public class BNEventHandler {

    private BNEventDialog mEventDialog = null;

    private static class LazyLoader {
        private static BNEventHandler mInstance = new BNEventHandler();
    }

    public static BNEventHandler getInstance() {
        return LazyLoader.mInstance;
    }

    private BNEventHandler() {
    }

    public BNEventDialog getDialog(Context ctx) {
        if (mEventDialog == null) {
            mEventDialog = new BNEventDialog(ctx);
        }
        return mEventDialog;
    }

    public void showDialog() {
        if (mEventDialog != null) {
            mEventDialog.setCanceledOnTouchOutside(false);
            mEventDialog.show();
        }
    }

    public void dismissDialog() {
        if (mEventDialog != null) {
            mEventDialog.dismiss();
        }
    }

    public void disposeDialog() {
        mEventDialog = null;
    }

    public void handleNaviEvent(int what, int arg1, int arg2, Bundle bundle) {
        Log.i("onCommonEventCall", String.format("%d,%d,%d,%s", what, arg1, arg2,
                (bundle == null ? "" : bundle.toString())));
        switch (what) {
            case BNaviCommonParams.MessageType.EVENT_NAVIGATING_STATE_BEGIN:
                break;
            case BNaviCommonParams.MessageType.EVENT_NAVIGATING_STATE_END:
                break;
            case BNaviCommonParams.MessageType.EVENT_GPS_LOCATED:
                mEventDialog.updateLocateState(true);
                break;
            case BNaviCommonParams.MessageType.EVENT_GPS_DISMISS:
                mEventDialog.updateLocateState(false);
                break;
            case BNaviCommonParams.MessageType.EVENT_ON_YAW_SUCCESS:
                break;
            case BNaviCommonParams.MessageType.EVENT_ROAD_TURN_ICON_UPDATE:
                byte[] byteArray = bundle.getByteArray(BNaviCommonParams.BNGuideKey.ROAD_TURN_ICON);
                Bitmap map = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
                mEventDialog.updateTurnIcon(map);
                break;
            case BNaviCommonParams.MessageType.EVENT_ROAD_TURN_DISTANCE_UPDATE:
                String turndis = bundle.getString(BNaviCommonParams.BNGuideKey.TROAD_TURN_DISTANCE);
                mEventDialog.updateGoDistanceTx(turndis);
                mEventDialog.updateAlongMeters(turndis);
                break;
            case BNaviCommonParams.MessageType.EVENT_ROAD_NEXT_ROAD_NAME:
                String nextRoad = bundle.getString(BNaviCommonParams.BNGuideKey.NEXT_ROAD_NAME);
                if (!TextUtils.isEmpty(nextRoad)) {
                    mEventDialog.updateNextRoad(nextRoad);
                }
                break;
            case BNaviCommonParams.MessageType.EVENT_ROAD_CURRENT_ROAD_NAME:
                String currentRoad = bundle.getString(BNaviCommonParams.BNGuideKey.CURRENT_ROAD_NAME);
                if (!TextUtils.isEmpty(currentRoad)) {
                    mEventDialog.updateCurrentRoad(currentRoad);
                }
                break;
            case BNaviCommonParams.MessageType.EVENT_REMAIN_DISTANCE_UPDATE:
                String remainDisctance = bundle.getString(BNaviCommonParams.BNGuideKey.TOTAL_REMAIN_DISTANCE);
                mEventDialog.updateRemainDistance(remainDisctance);
                break;
            case BNaviCommonParams.MessageType.EVENT_REMAIN_TIME_UPDATE:
                String remainTime = bundle.getString(BNaviCommonParams.BNGuideKey.TOTAL_REMAIN_TIME);
                mEventDialog.updateRemainTime(remainTime);
                break;
            case BNaviCommonParams.MessageType.EVENT_RASTER_MAP_SHOW:
                int type = bundle.getInt(BNaviCommonParams.BNEnlargeRoadKey.ENLARGE_TYPE);
                byte[] arrowByte = bundle.getByteArray(BNaviCommonParams.BNEnlargeRoadKey.ARROW_IMAGE);
                byte[] bgByte = bundle.getByteArray(BNaviCommonParams.BNEnlargeRoadKey.BACKGROUND_IMAGE);
                Bitmap arrowMap = BitmapFactory.decodeByteArray(arrowByte, 0, arrowByte.length);
                Bitmap bgMap = BitmapFactory.decodeByteArray(bgByte, 0, bgByte.length);
                mEventDialog.onEnlageShow(type, arrowMap, bgMap);
                break;
            case BNaviCommonParams.MessageType.EVENT_RASTER_MAP_UPDATE:
                String remainDistance = bundle.getString(BNaviCommonParams.BNEnlargeRoadKey.REMAIN_DISTANCE);
                String roadName = bundle.getString(BNaviCommonParams.BNEnlargeRoadKey.ROAD_NAME);
                int progress = bundle.getInt(BNaviCommonParams.BNEnlargeRoadKey.DRIVE_PROGRESS);
                break;
            case BNaviCommonParams.MessageType.EVENT_RASTER_MAP_HIDE:
                mEventDialog.onEnlargeHide();
                break;
            case BNaviCommonParams.MessageType.EVENT_ROUTE_PLAN_SUCCESS:
                int distance = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TOTAL_DISTANCE);
                int time = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TOTAL_TIME);
                int tollFees = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TOLL_FESS);
                int lightCounts = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TRAFFIC_LIGHT);
                int gasMoney = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.GAS_MONEY);
                break;
            case BNaviCommonParams.MessageType.EVENT_SERVICE_AREA_UPDATE:
                String firstName = bundle.getString(BNaviCommonParams.BNGuideKey.FIRST_SERVICE_NAME);
                int firstDistance = bundle.getInt(BNaviCommonParams.BNGuideKey.FIRST_SERVICE_TIME);
                String secondeName = bundle.getString(BNaviCommonParams.BNGuideKey.SECOND_SERVICE_NAME);
                int secondeDistance = bundle.getInt(BNaviCommonParams.BNGuideKey.SECOND_SERVICE_TIME);
                break;
            case BNaviCommonParams.MessageType.EVENT_CURRENT_SPEED:
                mEventDialog.updateCurrentSpeed(String.valueOf(arg1));
                break;
            case BNaviCommonParams.MessageType.EVENT_ALONG_UPDATE:
                boolean isAlong = bundle.getBoolean(BNaviCommonParams.BNGuideKey.IS_ALONG);
                break;
            case BNaviCommonParams.MessageType.EVENT_CURRENT_MILES:
                int miles = arg1;
            default :
                break;
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Okvpn\Bundle\MQInsightBundle\Matcher;

use Oro\Component\MessageQueue\Transport\MessageInterface;

interface MessageInfoInterface
{

    /**
     * @param MessageInterface $message
     * @return string
     */
    public function getMarker(MessageInterface $message): string;
}


text:
<?php

/**
 * Provides the business logic for wrapping a very basic test suite around simpletest.
 */

require_once dirname(__FILE__) . "/../../TestConfiguration.php";
define("UNITS", TEST_CONFIG_PATH . "/units/testcases");

require_once TestConfiguration::SIMPLETEST_PATH . "/unit_tester.php";
require_once TestConfiguration::SIMPLETEST_PATH . "/mock_objects.php";
require_once TestConfiguration::SIMPLETEST_PATH . "/reporter.php";

/**
 * Test suite controller.
 * @author Chris Corbyn
 */
class BasicTestSuite
{
	/**
	 * Template variables.
	 * @var array
	 */
	protected $vars = array();
	/**
	 * Singleton instance.
	 * @var BasicTestSuite
	 */
	protected static $instance = null;

	/**
	 * Singleton factory.
	 * @return BasicTestSuite
	 */
	public function getInstance()
	{
		if (self::$instance === null)
		{
			self::$instance = new self();
		}
		return self::$instance;
	}
	/**
	 * Set a template variable.
	 * @param string Key
	 * @param mixed Value
	 */
	protected function setVar($key, $value)
	{
		$this->vars[$key] = $value;
	}
	/**
	 * Load the template file and create variables from the template vars.
	 * @param string Path to template file.
	 */
	protected function render($path)
	{
		foreach ($this->vars as $k => $v)
		{
			$$k = $v;
		}
		require_once dirname(__FILE__) . "/" . $path;
	}
	/**
	 * Recursively load test cases into the test runner.
	 * @param string Path to scan
	 * @param GroupTest The test case from SimpleTest
	 */
	public function loadTests($path, &$group)
	{
		$base = basename($path);
		if (is_file($path) && !is_dir($path)
			&& substr($base, -4) == ".php" && substr($base, 0, 4) == "Test")
		{
			require_once $path;
			$name = substr($base, 0, -4);
			$group->addTestCase(new $name());
		}
		elseif (is_dir($path))
		{
			$mygroup = new GroupTest($base);
			$group->addTestCase($mygroup);
			$handle = opendir($path);
			while (false !== $file = readdir($handle))
			{
				if (substr($file, 0, 1) != "." && is_dir($path . "/" . $file))
				{
					$this->loadTests($path . "/" . $file, $mygroup);
				}
				else
				{
					if (is_file($path . "/" . $file) && !is_dir($path . "/" . $file)
						&& substr($file, -4) == ".php" && substr($file, 0, 6) == "TestOf")
					{
						require_once $path . "/" . $file;
						$name = basename($file);
						$name = substr($file, 0, -4);
						$mygroup->addTestCase(new $name());
					}
				}
			}
			closedir($handle);
		}
	}
	/**
	 * Execute the list action to show test cases.
	 */
	public function executeList()
	{
		$tests = array();
		$handle = opendir(UNITS);
		while (false !== $file = readdir($handle))
		{
			if (substr($file, 0, 1) == ".") continue;
			if (substr($file, -4) == ".php" && substr($file, 0, 4) == "Test" && !is_dir(UNITS . "/" . $file))
			{
				$tests[$file] = array("name" => substr($file, 0, -4), "tests" => array());
			}
			elseif (is_dir(UNITS . "/" . $file))
			{
				$tests[$file] = array("name" => $file, "tests" => array());
				$subhandle = opendir(UNITS . "/" . $file);
				while (false !== $subfile = readdir($subhandle))
				{
					if (substr($subfile, -4) == ".php" && substr($subfile, 0, 4) == "Test" && !is_dir(UNITS . "/" . $file . "/" . $subfile))
					{
						$tests[$file]["tests"][$file . "/" . $subfile] = substr($subfile, 0, -4);
					}
				}
			}
		}
		closedir($handle);
		$this->setVar("tests", $tests);
		$this->setVar("phpVersion", phpversion());
		$simpletestVer = "Unknown";
		if (file_exists(TestConfiguration::SIMPLETEST_PATH . "/VERSION"))
		{
		  $simpletestVer = trim(file_get_contents(TestConfiguration::SIMPLETEST_PATH . "/VERSION"));
	  }
		$this->setVar("simpletestVer", $simpletestVer);
		$this->setVar("os", PHP_OS);
		$this->setVar("safeMode", ini_get("safe_mode") ? "On!!" : "Off");
		$this->setVar("magicQuotes", get_magic_quotes_runtime() ? "On!!" : "Off");
		$this->setVar("registerGlobals", ini_get("register_globals") ? "On!!" : "Off");
		$this->setVar("memLimit", ini_get("memory_limit"));
		$notices = array();
		$swift_found = file_exists(TestConfiguration::SWIFT_LIBRARY_PATH . "/Swift.php");
		$simpletest_found = file_exists(TestConfiguration::SIMPLETEST_PATH . "/unit_tester.php");
		$files_found = is_dir(TestConfiguration::FILES_PATH);
		$swiftVer = "Unknown";
		if (!($swift_found && $simpletest_found && $files_found))
		{
		  $notices[] = "FAULTY!";
		  if (!$swift_found)
		  {
		    $color = "red";
	      $notices[] = "Swift not found.";
	    }
	    if (!$simpletest_found)
	    {
	      $color = "red";
	      $notices[] = "SimpleTest not found.";
      }
      if (!$files_found)
      {
        $color = "red";
	      $notices[] = "'files' dir not found.";
      }
	  }
	  else
	  {
	    require_once TestConfiguration::SWIFT_LIBRARY_PATH . "/Swift.php";
	    $swiftVer = Swift::VERSION;
	    $color = "green";
	    $notices[] = "OK";
    }
		$this->setVar("swiftVer", $swiftVer);
		$this->setVar("confOk", '' . implode("
", $notices) . '');
		$this->render("templates/list_panel.tpl.php");
	}
	/**
	 * Execute the Test action to run test cases.
	 */
	public function executeTests()
	{
		if (empty($_GET["doTests"]))
		{
			echo "Select a test case or a group from the left.
";
			echo "If your memory limit is exhausted, change memory_limit in php.ini, or run less tests at one time.";
			return;
		}
		$name = false;
		if ($_GET["doTests"] == "all")
		{
			$path = UNITS;
			$name = "All Tests";
		}
		else
		{
			$path = UNITS . "/" . $_GET["doTests"];
		}
		if (!$name) $name = ucwords(basename($path));
		if (substr($name, -4) == ".php")
		{
			$name = substr($name, 0, -4);
		}
		$suite = new GroupTest($name);
		$this->loadTests($path, $suite);
		$suite->run(new HtmlReporter());
	}
}


text:
<?php

// Generates a phar signature (as .sig next to the phar file)

// args: phar path, privkey, privkey password
$pkeyid = openssl_pkey_get_private("file://".realpath($_SERVER['argv'][2]), $_SERVER['argv'][3]);
if (!openssl_sign(file_get_contents($_SERVER['argv'][1]), $sha384sig, $pkeyid, OPENSSL_ALGO_SHA384)) {
    echo 'Failed to sign';
    exit(1);
}
openssl_free_key($pkeyid);

$sha384sig = base64_encode($sha384sig);
file_put_contents($_SERVER['argv'][1].'.sig', json_encode(['sha384' => $sha384sig], JSON_UNESCAPED_SLASHES));


text:
<?php

declare(strict_types=1);

namespace FSi\Bundle\TerytDatabaseBundle\Command;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class TerytDownloadPlacesDictionaryDatabaseCommand extends TerytDownloadCommand
{
    protected function configure(): void
    {
        $this->setName('teryt:download:places-dictionary')
            ->setDescription('Download teryt places dictionary (WMRODZ) database files')
            ->addArgument(
                'target',
                InputArgument::OPTIONAL,
                'Default target path where downloader will save teryt database file'
            )
            ->addArgument(
                'filename',
                InputArgument::OPTIONAL,
                'Default target file where downloader will save teryt database file',
                'places-dictionary.zip'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output): ?int
    {
        $this->saveFile(
            $this->getApiClient()->getPlacesDictionaryData(),
            $input->getArgument('target') ?? $this->getDefaultTargetPath(),
            $input->getArgument('filename')
        );

        return 0;
    }
}


text:
Grape::Swagger::Ui
===============

[![Code Climate](https://codeclimate.com/github/kendrikat/grape-swagger-ui.png)](https://codeclimate.com/github/kendrikat/grape-swagger-ui)

TODO/WIP: Write a gem description

Integrates [swagger-ui] with your "grapified" Rails application.

## Dependencies

* [grape-swagger]
> Add swagger compliant documentation to your grape API

* [grape]
> An opinionated micro-framework for creating REST-like APIs in Ruby

## Installation

Add this line to your application's Gemfile:

    gem 'grape-swagger-ui'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install grape-swagger-ui

## Usage example:

    class YourAPI < Grape::API
      version 'v1'
      format :json
      ...
      add_swagger_documentation :add_version => true,
                                :base_path => '/api'
    end

*See https://github.com/ruby-grape/grape-swagger#configure for more configuration settings.*

If your api path is "api/v1" just go to

    http://host:port/api/swagger

else

*Generate the main layout for customizations*

	rails generate swagger:layout [TEMPLATE_ENGINE]

and change the initializer. Currently supported: ERB, HAML, SLIM.

Since this is a seperate layout and if you want to use this in your staging environment you need to precompile it.

	#staging.rb
	config.assets.precompile += %w(swagger_ui.js swagger_ui.css swagger_ui_print.css swagger_ui_screen.css)

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## License
MIT License, full text of license see [here][License]

*Free Software, Fuck Yeah!*

[License]: https://github.com/kendrikat/grape-swagger-ui/blob/master/LICENSE.txt "LICENSE"
[grape-swagger]: https://github.com/tim-vandecasteele/grape-swagger
[grape]: https://github.com/intridea/grape
[swagger-ui]: https://github.com/wordnik/swagger-ui/


text:
<!doctype html>
<title>canvas with flow content and phrasing parent</title>
<canvas>
foo
</canvas>


text:
<?php namespace Propaganistas\LaravelHelperMacros\Tests;

use Propaganistas\LaravelHelperMacros\Support\Reflection;

class HelpersTest extends BaseTestCase
{
    public function test_array_expand()
    {
        $array = array_expand(['foo.bar' => 'baz']);
        $this->assertEquals(['foo' => ['bar' => 'baz']], $array);
    }

    public function test_glob_recursive()
    {
        $files = glob_recursive(__DIR__ . '/TestDir/*.txt');
        $this->assertEquals([__DIR__ . '/TestDir/foo.txt', __DIR__ . '/TestDir/directory/bar.txt'], $files);
    }

    public function test_reflect()
    {
        $object = new Object;
        $reflect = reflect($object);
        $this->assertEquals(new Reflection($object), $reflect);
    }

    public function test_str_after()
    {
        $string = str_after('user@example.org', '@');
        $this->assertEquals('example.org', $string);
    }

    public function test_str_before()
    {
        $string = str_before('user@example.org', '@');
        $this->assertEquals('user', $string);
    }

    public function test_str_between()
    {
        $string = str_between('user@example.org', '@', '.');
        $this->assertEquals('example', $string);
    }

    public function test_str_firstSegment()
    {
        $string = str_firstSegment('path/to/route', '/');
        $this->assertEquals('path', $string);
    }

    public function test_str_lastSegment()
    {
        $string = str_lastSegment('path/to/route', '/');
        $this->assertEquals('route', $string);
    }

    public function test_str_pop()
    {
        $string = str_pop('path/to/route', '/');
        $this->assertEquals('path/to', $string);
    }

    public function test_str_tease()
    {
        $string = str_tease('This is some very long string.', 15);
        $this->assertEquals('This is some...', $string);
    }

    public function test_str_segment()
    {
        $string = str_segment('path/to/route', '/', 2);
        $this->assertEquals('to', $string);
    }

    public function test_str_shift()
    {
        $string = str_shift('path/to/route', '/');
        $this->assertEquals('to/route', $string);
    }
}

class Object
{
    protected $property = 'value';

    protected function method($parameter)
    {
        return $parameter;
    }
}


text:
package org.xsaas.xstat.web.action.manage.list;

import java.util.LinkedList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xsaas.xstat.web.conf.SmgkConstants;
import org.xsaas.xstat.web.conf.StatusConstants;
import org.xsaas.xstat.web.util.PaginationUtil;

import org.xsaas.xstat.business.IClientInfoService;
import org.xsaas.xstat.business.IEmployeeInfoService;
import org.xsaas.xstat.business.IInquisitionInfoService;
import org.xsaas.xstat.business.IIssueInfoService;
import org.xsaas.xstat.business.IProjectInfoService;
import org.xsaas.xstat.business.IRealityCheckInfoService;
import org.xsaas.xstat.po.ClientInfo;
import org.xsaas.xstat.po.EmployeeInfo;
import org.xsaas.xstat.po.InquisitionInfo;
import org.xsaas.xstat.po.IssueInfo;
import org.xsaas.xstat.po.ProjectInfo;
import org.xsaas.xstat.po.RealityCheckInfo;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ListRealityAction extends ActionSupport {
	private static final long serialVersionUID = 179282249083478153L;
	private static Log logger = LogFactory.getLog(ListRealityAction.class);
	private IRealityCheckInfoService realityCheckInfoService = null;
	private IInquisitionInfoService inquisitionInfoService = null;
	private IIssueInfoService issueInfoService = null;
	private IProjectInfoService projectInfoService = null;
	private IClientInfoService clientInfoService = null;

	private Long inquisitionID = null;

	private List<String> iiList = new LinkedList<String>();
	private List<InquisitionInfo> inquisitionList = new LinkedList<InquisitionInfo>();
	private List<IssueInfo> issueList = new LinkedList<IssueInfo>();
	private List<ProjectInfo> projectList = new LinkedList<ProjectInfo>();
	private Long issueID = null;
	private Long clientID = null;
	private Long projectID = null;
	/**
	 * 当前第几页
	 */
	private Integer num = null;
	/**
	 * 分页数据列表
	 */
	private List<RealityCheckInfo> pageList = null;

	private PaginationUtil pu = null;

	private Long realityCheckID = null;

	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception {
		try{
			String username = (String)ActionContext.getContext().getSession().get("LOGINUSERNAME");
			String password = (String)ActionContext.getContext().getSession().get("LOGINPASSWORD");
			if(username == null || password == null) {
				return LOGIN;
			}
			int page = 1;
			if(num != null){
				page = num.intValue();
			}
			List<ClientInfo> clientInfoList = (List<ClientInfo>)ActionContext.getContext().getSession().get("GLOBALCLIENTINFOLIST");
			if(clientInfoList == null) {
				clientInfoList = clientInfoService.getClientInfoList();
				ActionContext.getContext().getSession().put("GLOBALCLIENTINFOLIST",clientInfoList);//初始化省份信息
			}
			long selectClientID = 0;
			if(clientID != null){
				selectClientID = clientID.longValue();
			}else{
				if(clientInfoList.size()>0){
					ClientInfo ci = clientInfoList.get(0);
					if(ci!=null){
						selectClientID = ci.getClientID().longValue();
						ActionContext.getContext().put("CLIENTVALUE",selectClientID);
					}
				}
			}

			int total = 0;
			if(selectClientID !=0){
				total = realityCheckInfoService.getRealityCheckInfoTotal(selectClientID);
			}else{
				total = realityCheckInfoService.getRealityCheckInfoTotal();
			}

			pu = new PaginationUtil(total,page,SmgkConstants.PAGE_MAX_RESULT);

			if(selectClientID !=0){
				pageList = realityCheckInfoService.findRealityCheckInfoByPage(selectClientID,pu.getStartRecord(),SmgkConstants.PAGE_MAX_RESULT);
			}else{
				pageList = realityCheckInfoService.findRealityCheckInfoByPage(pu.getStartRecord(),SmgkConstants.PAGE_MAX_RESULT);
			}

			for(RealityCheckInfo info:pageList){
				InquisitionInfo iti = inquisitionInfoService.getInquisitionInfo(info.getInquisitionID());

				if(iti!=null && iti.getTitle()!=null){
					iiList.add(""+iti.getTitle());
				}else{
					iiList.add("");
				}
			}
		}catch(Exception e) {
			logger.error(""+e.getMessage(),e.getCause());
		}
		return SUCCESS;
	}

	public String detail() throws Exception {
		String username = (String)ActionContext.getContext().getSession().get("LOGINUSERNAME");
		String password = (String)ActionContext.getContext().getSession().get("LOGINPASSWORD");
		if(username == null || password == null) {
			return LOGIN;
		}
		try{
			if(realityCheckID == null) {
				this.addActionError("编号为空!");
				return ERROR;
			}
			RealityCheckInfo info = realityCheckInfoService.getRealityCheckInfo(realityCheckID);
			if(info!=null){
				ActionContext.getContext().put("REALITYDETAIL",info);
			}
			InquisitionInfo ii = inquisitionInfoService.getInquisitionInfo(info.getInquisitionID());

			if(ii!=null && ii.getTitle()!=null){
				ActionContext.getContext().put("INQUISITION",ii.getTitle());
			}
			if(info.getStatus()!=null){
				ActionContext.getContext().put("STATUS",StatusConstants.StatusDict.get(info.getStatus()));
			}
		}catch(Exception e) {
			logger.error(""+e.getMessage(),e.getCause());
		}

		return SUCCESS;
	}
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	public List<String> getIiList() {
		return iiList;
	}
	public void setIiList(List<String> iiList) {
		this.iiList = iiList;
	}
	public void setInquisitionInfoService(
			IInquisitionInfoService inquisitionInfoService) {
		this.inquisitionInfoService = inquisitionInfoService;
	}

	public PaginationUtil getPu() {
		return pu;
	}

	public List<RealityCheckInfo> getPageList() {
		return pageList;
	}

	public void setPageList(List<RealityCheckInfo> pageList) {
		this.pageList = pageList;
	}

	public Long getRealityCheckID() {
		return realityCheckID;
	}

	public void setRealityCheckID(Long realityCheckID) {
		this.realityCheckID = realityCheckID;
	}

	public void setRealityCheckInfoService(
			IRealityCheckInfoService realityCheckInfoService) {
		this.realityCheckInfoService = realityCheckInfoService;
	}

	public Long getInquisitionID() {
		return inquisitionID;
	}

	public void setInquisitionID(Long inquisitionID) {
		this.inquisitionID = inquisitionID;
	}

	public List<InquisitionInfo> getInquisitionList() {
		return inquisitionList;
	}

	public void setInquisitionList(List<InquisitionInfo> inquisitionList) {
		this.inquisitionList = inquisitionList;
	}

	public List<IssueInfo> getIssueList() {
		return issueList;
	}

	public void setIssueList(List<IssueInfo> issueList) {
		this.issueList = issueList;
	}

	public List<ProjectInfo> getProjectList() {
		return projectList;
	}

	public void setProjectList(List<ProjectInfo> projectList) {
		this.projectList = projectList;
	}

	public Long getIssueID() {
		return issueID;
	}

	public void setIssueID(Long issueID) {
		this.issueID = issueID;
	}

	public Long getClientID() {
		return clientID;
	}

	public void setClientID(Long clientID) {
		this.clientID = clientID;
	}

	public Long getProjectID() {
		return projectID;
	}

	public void setProjectID(Long projectID) {
		this.projectID = projectID;
	}

	public void setIssueInfoService(IIssueInfoService issueInfoService) {
		this.issueInfoService = issueInfoService;
	}

	public void setProjectInfoService(IProjectInfoService projectInfoService) {
		this.projectInfoService = projectInfoService;
	}

	public void setClientInfoService(IClientInfoService clientInfoService) {
		this.clientInfoService = clientInfoService;
	}
}


text:
#pragma once
#include <lfant/stdafx.h>

// Internal

// External

namespace lfant {
namespace galaga {

}
}


text:
package version

import (
	"context"
	"fmt"

	"github.com/tektoncd/pipeline/pkg/apis/config"
	"knative.dev/pkg/apis"
)

// ValidateEnabledAPIFields checks that the enable-api-fields feature gate is set
// to the wantVersion value and, if not, returns an error stating which feature
// is dependent on the version and what the current version actually is.
func ValidateEnabledAPIFields(ctx context.Context, featureName, wantVersion string) *apis.FieldError {
	currentVersion := config.FromContextOrDefaults(ctx).FeatureFlags.EnableAPIFields
	if currentVersion != wantVersion {
		var errs *apis.FieldError
		message := fmt.Sprintf(`%s requires "enable-api-fields" feature gate to be %q but it is %q`, featureName, wantVersion, currentVersion)
		return errs.Also(apis.ErrGeneric(message))
	}
	return nil
}


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (IBAction)buildFat:(id)sender {
    HCDPersonBuilderDirector *director = [[HCDPersonBuilderDirector alloc]init];
    HCDPresionBuilder builder = [[HCDPersonFatBuilder alloc]init];
    //为director指定builder
    director.builder = builder;
    //director发出构建的指令,builder负责具体的建造过程
    [director buildPerson];
}

- (IBAction)buildThin:(id)sender {

    HCDPersonBuilderDirector *director = [[HCDPersonBuilderDirector alloc]init];
    HCDPresionBuilder builder = [[HCDPersonThinBuilder alloc]init];
    //为director指定builder
    director.builder = builder;
    //director发出构建的指令,builder负责具体的建造过程
    [director buildPerson];
}

@end


text:
VornamenOOE
===================

Visualisierung der häufigsten Vornamen von Neugeborenen in Oberösterreich (Beispielcode für Shed01 Blog)

## Repository enthält:
Ressourcendateien, Anwendungen und Beispieldaten (falls keine Downloadanweisung in den Projekten enthalten ist) aus den Beispielen des Shed01 Blogs (http://shed01.blogspot.co.at/):
* ...
* data: Daten Ordner, enthält eigenen Datei mit Referenzen zu Datenquellen (./data/ref.txt)
* ...

### Kontakt: datadonk23@gmail.com

### Lizenz: Apache Licence, Version 2 (siehe LICENSE Datei)
Copyright 2014 Thomas Treml

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


text:
      <input type="text" class="form-control" ng-change="search.isSearching = false" ng-model="search.text" placeholder="{{'search_table' | translate}}">

  <button ng-if="advFilters" type="button" class="filter-button btn btn-default table-btn" ng-click="applyFilters()"
          translate="apply_filters" ng-disabled="tableviewform.$visible">
  </button>
  <button ng-if="advFilters" type="button" class="filter-button btn btn-default table-btn" ng-click="clearFilters()"
          translate="clear_filters" ng-disabled="tableviewform.$visible">
  </button>
  <button type="button" class="filter-button btn btn-default table-btn" ng-click="toggleAdvancedFilters()"
          translate="advanced_filters" ng-disabled="tableviewform.$visible" data-toggle="button">
  </button>

  <form editable-form name="tableviewform" onaftersave="saveTable()">

                  {{'filter' | translate}}

                  <filteroptions attribute="attr" type="restrictions[attr.name].type"></filteroptions>

            {{'feature_id' | translate}}
            {{attr.name}}

          {{row.feature.id}}

              {{row.feature.properties[attr.name]}}
              {{row.feature.properties[attr.name]}}
              {{row.feature.properties[attr.name]}}
              {{row.feature.properties[attr.name]}}

                  {{row.feature.properties[attr.name] | date:"MM/dd/yyyy @ h:mm a"}}
                  <datetimepicker ng-if="tableviewform.$visible" id="table-datetime" date-object="row.feature.properties[attr.name]"
                        default-date="false" seperate-time="false"></datetimepicker>

                    {{row.feature.properties[attr.name] | date:"MM/dd/yyyy"}}
                    <datetimepicker ng-if="tableviewform.$visible" id="table-datetime" date-object="row.feature.properties[attr.name]"
                                    default-date="false" seperate-time="false" time="false"></datetimepicker>

                    {{row.feature.properties[attr.name] | date:"h:mm a"}}
                    <datetimepicker ng-if="tableviewform.$visible" id="table-datetime" date-object="row.feature.properties[attr.name]"
                                    default-date="false" seperate-time="false" date="false"></datetimepicker>

                {{row.feature.properties[attr.name]}}

                  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

                  </button>

                      {{enum._value}}

                <input ng-if="tableviewform.$visible" ng-model="row.feature.properties[attr.name]" type="text" class="table-dropdown form-control" disabled/>

      <button type="button" class="btn btn-primary table-btn" ng-click="tableviewform.$submit()" ng-show="tableviewform.$visible">{{'save_btn' | translate}}</button>
      <button type="button" class="btn btn-default table-btn" ng-click="tableviewform.$cancel(); applyFilters()" ng-show="tableviewform.$visible">{{'cancel_btn' | translate}}</button>
        <button type="button" class="btn btn-default table-btn" ng-click="tableviewform.$show()"
            ng-show="!tableviewform.$visible && !readOnly" tooltip="{{'edit_attributes' | translate}}" tooltip-append-to-body="true">

      </button>
      <button type="button" class="btn btn-default table-btn" ng-click="toggleWordWrap()" tooltip="{{'word_wrap' | translate}}" tooltip-append-to-body="true">

      </button>
      <button type="button" class="btn btn-default table-btn" ng-click="goToMap()" ng-show="!tableviewform.$visible && selectedRow != null" tooltip="{{'go_to_map' | translate}}" tooltip-append-to-body="true">

      </button>

      <button type="button" ng-click="showStatistics()" class="btn btn-default table-btn" tooltip-append-to-body="true"  ng-class="{disabled: !selectedAttribute}"
         tooltip-placement="top" tooltip="{{'statistics_view' | translate}}" tooltip-append-to-body="true">

      </button>

        <button id='previous-page-btn' type="button" class="btn btn-default table-btn"
                ng-controller="previous-tt-controller" ng-click="onPrevious()" ng-disabled="currentPage < 2"
                tooltip="{{'previous_page' | translate}}" tooltip-append-to-body="true">

        </button>

{{getPageText()}}

        <button id='next-page-btn' type="button" class="btn btn-default table-btn"
                ng-controller="next-tt-controller" ng-click="onNext()" ng-disabled="currentPage >= totalPages"
                tooltip="{{'next_page' | translate}}" tooltip-append-to-body="true">

        </button>

{{totalFeatures | number:0}} {{'features' | translate}}

  </form>


text:
<?php

return [
    // Components
    'components' => [
        'last_updated' => 'Sidst opdateret :timestamp',
        'status'       => [
            1 => 'Normal',
            2 => 'Hastighedsproblemer',
            3 => 'Nogen udfald',
            4 => 'Store problemer',
        ],
        'group' => [
            'other' => 'Andre komponenter',
        ],
    ],

    // Incidents
    'incidents' => [
        'none'          => 'Ingen hændelser er rapporteret',
        'past'          => 'Tidligere hændelser',
        'previous_week' => 'Forrige uge',
        'next_week'     => 'Næste uge',
        'scheduled'     => 'Planlagt vedligeholdelse',
        'scheduled_at'  => ', planlagt til :timestamp',
        'status'        => [
            0 => 'Planlagt', // TODO: Hopefully remove this.
            1 => 'Undersøger',
            2 => 'Identificeret',
            3 => 'Overvåger',
            4 => 'Rettet',
        ],
    ],

    // Service Status
    'service' => [
        'good'  => '[0,1] Systemet virker|[2,Inf] Alle systemer virker',
        'bad'   => '[0,1] Systemet har i øjeblikket problemer|[2,Inf] Nogle systemer har i øjeblikket problemer',
        'major' => '[0,1] Systemet har i øjeblikket store problemer|[2,Inf] Nogle systemer har i øjeblikket store problemer',
    ],

    'api' => [
        'regenerate' => 'Generer en ny API nøgle',
        'revoke'     => 'Tilbagekald API nøgle',
    ],

    // Metrics
    'metrics' => [
        'filter' => [
            'last_hour' => 'Sidste time',
            'hourly'    => 'Sidste 12 timer',
            'weekly'    => 'Ugentlig',
            'monthly'   => 'Månedlig',
        ],
    ],

    // Subscriber
    'subscriber' => [
        'subscribe' => 'Tilmeld dig for at få de seneste opdateringer',
        'button'    => 'Abonner',
        'manage'    => [
            'no_subscriptions' => 'Du abonner i øjeblikket på alle opdateringer.',
            'my_subscriptions' => 'Du abonnere i øjeblikket på følgende opdateringer.',
        ],
        'email' => [
            'subscribe'          => 'Abonner på email opdateringer.',
            'subscribed'         => 'Du er blevet tilmeldt email notifikationer. Vi har sendt dig en bekræftelse på den indtastede email-adresse.',
            'verified'           => 'Din tilmelding er nu blevet bekræftet, tak.',
            'manage'             => 'Manage your subscription',
            'unsubscribe'        => 'Afmeld email notifikationer.',
            'unsubscribed'       => 'Du er nu blevet frameldt vores emailnotifikationer.',
            'failure'            => 'Noget gik galt med bekræftelsen.',
            'already-subscribed' => 'Kan ikke abonnere da :email allerede er tilmeldt.',
            'verify'             => [
                'text'   => "Please confirm your email subscription to :app_name status updates.\n:link",
                'html'   => '
Please confirm your email subscription to :app_name status updates.
',
                'button' => 'Confirm Subscription',
            ],
            'maintenance' => [
                'subject' => '[Maintenance Scheduled] :name',
            ],
            'incident' => [
                'subject' => '[New Incident] :status: :name',
            ],
            'component' => [
                'subject'       => 'Komponent status opdatering',
                'text'          => 'Komponentet :component_name har ændret status. Komponentet er nu :component_human_status.\nTak, :app_name',
                'html'          => '
Komponentet :component_name har ændret status. Komponentet er nu :component_human_status.

\nTak, :app_name
',
                'tooltip-title' => 'Abonner på notifikation for :component_name.',
            ],
        ],
    ],

    'users' => [
        'email' => [
            'invite' => [
                'text' => "Du er blevet inviteret til :app_name status status side, Klik på linket for at oprette dig.\n:link\nTak, :app_name",
                'html' => '
Du er blevet inviteret til :app_name status side, Klik på linket for at oprette dig.

:link

Tak, :app_name
',
            ],
        ],
    ],

    'signup' => [
        'title'    => 'Tilmeld',
        'username' => 'Brugernavn',
        'email'    => 'Email',
        'password' => 'Adgangskode',
        'success'  => 'Din konto er nu oprettet.',
        'failure'  => 'Noget gik galt under tilmeldingen.',
    ],

    'system' => [
        'update' => 'Der er en nyere version af Cachet tilgængelig. Du kan læse mere om hvordan du opdatere her!',
    ],

    // Modal
    'modal' => [
        'close'     => 'Luk',
        'subscribe' => [
            'title'  => 'Abonner på komponent opdateringer',
            'body'   => 'Indtast din email adresse for at abonnere på opdateringer angående dette komponent. Hvis du allerede er tilmeldt, vil du modtage emails angående dette komponent.',
            'button' => 'Abonner',
        ],
    ],

    // Other
    'home'            => 'Hjem',
    'description'     => 'Hold dig opdateret med de seneste opdateringer fra :app.',
    'powered_by'      => 'Drevet af  Cachet.',
    'about_this_site' => 'Om denne side',
    'rss-feed'        => 'RSS',
    'atom-feed'       => 'Atom',
    'feed'            => 'Status Feed',

];


text:
class testApp : public ofBaseApp{

	public:

		void setup();
		void update();
		void draw();

		void keyPressed(int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);

        // member variables to store the current mouse X and Y position
        // as a percentage of the width/height of the screen
        float mouseXPercent, mouseYPercent;
};


text:
#ifndef _MULTICAMERASENSOR_HH_
#define _MULTICAMERASENSOR_HH_

#include <string>
#include <vector>

#include "gazebo/sensors/Sensor.hh"
#include "gazebo/msgs/MessageTypes.hh"
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/rendering/RenderTypes.hh"

namespace gazebo
{
  namespace sensors
  {
    /// \addtogroup gazebo_sensors Sensors
    /// \brief A set of sensor classes, functions, and definitions
    /// \{

    /// \class MultiCameraSensor MultiCameraSensor.hh sensors/sensors.hh
    /// \brief Multiple camera sensor. This sensor type can create one or
    /// more synchronized cameras.
    class MultiCameraSensor : public Sensor
    {
      /// \brief Constructor
      public: MultiCameraSensor();

      /// \brief Destructor
      public: virtual ~MultiCameraSensor();

      // Documentation inherited
      public: virtual void Load(const std::string &_worldName);

      // Documentation inherited
      public: virtual void Init();

      // Documentation inherited
      public: virtual std::string GetTopic() const;

      /// \brief Get the number of cameras.
      /// \return The number of cameras.
      public: unsigned int GetCameraCount() const;

      /// \brief Returns a pointer to a rendering::Camera.
      /// \param[in] _index Index of the camera to get
      /// \return The Pointer to the camera sensor.
      /// \sa MultiCameraSensor::GetCameraCount
      public: rendering::CameraPtr GetCamera(unsigned int _index) const;

      /// \brief Gets the width of the image in pixels.
      /// \param[in] _index Index of the camera
      /// \return The image width in pixels.
      /// \sa MultiCameraSensor::GetCameraCount
      public: unsigned int GetImageWidth(unsigned int _index) const;

      /// \brief Gets the height of the image in pixels.
      /// \param[in] _index Index of the camera
      /// \return The image height in pixels.
      /// \sa MultiCameraSensor::GetCameraCount
      public: unsigned int GetImageHeight(unsigned int _index) const;

      /// \brief Gets the raw image data from the sensor.
      /// \param[in] _index Index of the camera
      /// \return The pointer to the image data array.
      /// \sa MultiCameraSensor::GetCameraCount
      public: const unsigned char *GetImageData(unsigned int _index);

      /// \brief Saves the camera image(s) to the disk.
      /// \param[in] _filenames The name of the files for each camera.
      /// \return True if successful, false if unsuccessful.
      /// \sa MultiCameraSensor::GetCameraCount
      public: bool SaveFrame(const std::vector<std::string> &_filenames);

      // Documentation inherited.
      public: virtual bool IsActive();

      // Documentation inherited.
      protected: virtual void UpdateImpl(bool _force);

      // Documentation inherited.
      protected: virtual void Fini();

      /// \brief All the cameras.
      private: std::vector<rendering::CameraPtr> cameras;

      /// \brief Mutex to protect the cameras list.
      private: mutable boost::mutex cameraMutex;

      /// \brief Publishes messages of type msgs::ImagesStamped.
      private: transport::PublisherPtr imagePub;

      private: rendering::ScenePtr scene;
    };
    /// \}
  }
}
#endif


text:
Pattern: Use of shadowed variable in template

Issue: -

## Description

This rule aims to eliminate shadowed variable declarations of `v-for` directives or scope attributes.

<eslint-code-block :rules="{'vue/no-template-shadow': ['error']}">

```vue
<template>
  <!-- ✓ GOOD -->
  <div v-for="i in 5"></div>
  <div v-for="j in 5"></div>

  <!-- ✗ BAD -->
  <div>
    <div v-for="k in 5">
      <div v-for="k in 10"></div>
      <div slot-scope="{ k }"></div>
    </div>
  </div>
  <div v-for="l in 5"></div>
</template>

<script>
  export default {
    data () {
      return {
        l: false
      }
    }
  }
</script>
```

</eslint-code-block>

## Further Reading

* [eslint-plugin-vue - no-template-shadow](https://eslint.vuejs.org/rules/no-template-shadow.html)


text:
var Path = require('path');
var FontLib = require('font-lib');

module('font-lib');

test('basic test', function() {
    var font = loadTestFont('test/fonts/catman.ttf');
    ok(font, 'can load font');
    font.setSize(64);
    equal(font.size.y_ppem, 64, 'can access size');
    ok(font.size.height > 0, 'can get lineHeight');
    equal(font.size.ascender, 46, 'can get base 1');
    font.setSize(262);
    equal(font.size.ascender, 188, 'can get base 2');
});


text:
if (!process.env.MONGO_URL) {
  throw new Error('No environment variable called "MONGO_URL".');
}

module.exports = {
  db: {
    name: 'db',
    connector: 'loopback-connector-mongodb',
    url: process.env.MONGO_URL
  }
};


text:
'use strict';

//Setting up route
angular.module('machinery-equipment-lists').config(['$stateProvider',
	function($stateProvider) {
		// Machinery equipment lists state routing
		$stateProvider.
		state('listMachineryEquipmentLists', {
			url: '/machinery-equipment-lists',
			templateUrl: 'modules/machinery-equipment-lists/views/list-machinery-equipment-lists.client.view.html'
		}).
		state('createMachineryEquipmentList', {
			url: '/machinery-equipment-lists/create',
			templateUrl: 'modules/machinery-equipment-lists/views/create-machinery-equipment-list.client.view.html'
		}).
		state('viewMachineryEquipmentList', {
			url: '/machinery-equipment-lists/:machineryEquipmentListId',
			templateUrl: 'modules/machinery-equipment-lists/views/view-machinery-equipment-list.client.view.html'
		}).
		state('editMachineryEquipmentList', {
			url: '/machinery-equipment-lists/:machineryEquipmentListId/edit',
			templateUrl: 'modules/machinery-equipment-lists/views/edit-machinery-equipment-list.client.view.html'
		});
	}
]);


text:
<?php

namespace ZendTest\Filter;

use Zend\Filter\StringTrim;
use stdClass;

/**
 * @covers \Zend\Filter\StringTrim
 */
class StringTrimTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var StringTrim
     */
    protected $_filter;

    /**
     * Creates a new Zend\Filter\StringTrim object for each test method
     *
     * @return void
     */
    public function setUp()
    {
        $this->_filter = new StringTrim();
    }

    /**
     * Ensures that the filter follows expected behavior
     *
     * @return void
     */
    public function testBasic()
    {
        $filter = $this->_filter;
        $valuesExpected = array(
            'string' => 'string',
            ' str '  => 'str',
            "\ns\t"  => 's'
            );
        foreach ($valuesExpected as $input => $output) {
            $this->assertEquals($output, $filter($input));
        }
    }

    /**
     * Ensures that the filter follows expected behavior
     *
     * @return void
     */
    public function testUtf8()
    {
        $this->assertEquals('a', $this->_filter->filter(utf8_encode("\xa0a\xa0")));
    }

    /**
     * Ensures that getCharList() returns expected default value
     *
     * @return void
     */
    public function testGetCharList()
    {
        $this->assertEquals(null, $this->_filter->getCharList());
    }

    /**
     * Ensures that setCharList() follows expected behavior
     *
     * @return void
     */
    public function testSetCharList()
    {
        $this->_filter->setCharList('&');
        $this->assertEquals('&', $this->_filter->getCharList());
    }

    /**
     * Ensures expected behavior under custom character list
     *
     * @return void
     */
    public function testCharList()
    {
        $filter = $this->_filter;
        $filter->setCharList('&');
        $this->assertEquals('a&b', $filter('&&a&b&&'));
    }

    /**
     * @group ZF-7183
     */
    public function testZF7183()
    {
        $filter = $this->_filter;
        $this->assertEquals('Зенд', $filter('Зенд'));
    }

    /**
     * @group ZF2-170
     */
    public function testZF2170()
    {
        $filter = $this->_filter;
        $this->assertEquals('Расчет', $filter('Расчет'));
    }

    /**
     * @group ZF-7902
     */
    public function testZF7902()
    {
        $filter = $this->_filter;
        $this->assertEquals('/', $filter('/'));
    }

    /**
     * @group ZF-10891
     */
    public function testZF10891()
    {
        $filter = $this->_filter;
        $this->assertEquals('Зенд', $filter('   Зенд   '));
        $this->assertEquals('Зенд', $filter('Зенд   '));
        $this->assertEquals('Зенд', $filter('   Зенд'));

        $trim_charlist = " \t\n\r\x0B・。";
        $filter = new StringTrim($trim_charlist);
        $this->assertEquals('Зенд', $filter->filter('。  Зенд  。'));
    }

    public function getNonStringValues()
    {
        return array(
            array(1),
            array(1.0),
            array(true),
            array(false),
            array(null),
            array(array(1, 2, 3)),
            array(new stdClass()),
        );
    }

    /**
     * @dataProvider getNonStringValues
     */
    public function testShouldNotFilterNonStringValues($value)
    {
        $filtered = $this->_filter->filter($value);
        $this->assertSame($value, $filtered);
    }

    /**
     * Ensures expected behavior with '0' as character list
     *
     * @group 6261
     */
    public function testEmptyCharList()
    {
        $filter = $this->_filter;
        $filter->setCharList('0');
        $this->assertEquals('a0b', $filter('00a0b00'));

        $filter->setCharList('');
        $this->assertEquals('str', $filter(' str '));
    }
}


text:
// Copyright (c)2012 The Obvious Corporation

/**
 * @fileoverview Basic benchmark for hello world template that calls one nested template.
 */

var soynode = require('../lib/soynode')

var USER = process.env.USER || 'Stranger'

soynode.setOptions({
    outputDir: '/tmp/soynode-example'
  , uniqueDir: true
  , eraseTemporaryFiles: true
})

var iterations = 5000

soynode.compileTemplates(__dirname, function (err) {
  if (err) throw err
  var d = Date.now()
  var results = []
  for (var i = 0; i < iterations; i++) {
    results.push(soynode.render('example.message.hello', {
        name: USER
      , date: new Date().toLocaleTimeString()
    }))
  }
  var diff = Date.now() - d

  console.log('Total time spent:', diff, 'ms')
  console.log('Number of iterations:', iterations)
  console.log('Ops per sec:', Math.round((1000 / diff) * iterations))
})


text:
'use strict';

/* global Connector */

Connector.playerSelector = '.page-station__bar';
Connector.trackArtImageSelector = '.slider__items > div:nth-child(3) .track__cover';
Connector.trackSelector = '.slider__items > div:nth-child(3) .track__title';
Connector.artistSelector = '.slider__items > div:nth-child(3) .track__artists';
Connector.isPlaying = function() {
	return $('body').hasClass('body_state_playing');
};


text:
/*
 * In The Name Of God
 * ======================================
 * [] Project Name : JLamp
 *
 * [] Package Name : ir.ac.aut.ceit.aolab.jlamp.rest.helper
 *
 * [] Creation Date : 05-07-2016
 *
 * [] Created By : Parham Alvani (parham.alvani@gmail.com)
 * =======================================
*/

package ir.ac.aut.ceit.aolab.jlamp.rest.http;

import com.google.gson.Gson;

import spark.ResponseTransformer;

public class JsonTransformer implements ResponseTransformer {
    private Gson gson = new Gson();

    @Override
    public String render(Object model) {
        return gson.toJson(model);
    }
}


text:
package org.sagebionetworks.repo.model.v2.dao;

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

import org.sagebionetworks.repo.model.DatastoreException;
import org.sagebionetworks.repo.model.ObjectType;
import org.sagebionetworks.repo.model.dao.WikiPageKey;
import org.sagebionetworks.repo.model.file.FileHandle;
import org.sagebionetworks.repo.model.v2.wiki.V2WikiHeader;
import org.sagebionetworks.repo.model.v2.wiki.V2WikiHistorySnapshot;
import org.sagebionetworks.repo.model.v2.wiki.V2WikiMarkdownVersion;
import org.sagebionetworks.repo.model.v2.wiki.V2WikiOrderHint;
import org.sagebionetworks.repo.model.v2.wiki.V2WikiPage;
import org.sagebionetworks.repo.web.NotFoundException;

/**
 * The abstraction of the V2 wikipage data access object.
 * (Derived from org.sagebionetworks.repo.model.dao.WikiPageDao)
 *
 * @author hso
 *
 */
public interface V2WikiPageDao {
	/**
	 * Create a new WikiPage.
	 * @param toCreate
	 * @param fileNameToFileHandleMap - Maps the name of a file to its FileHandle.  Used to ensure file names are unique within a single WikiPage.
	 * @param ownerId
	 * @param ownerType
	 * @return
	 * @throws NotFoundException
	 */
	public V2WikiPage create(V2WikiPage toCreate, Map<String, FileHandle> fileNameToFileHandleMap, String ownerId, ObjectType ownerType, List<String> newFileHandleIds) throws NotFoundException;

	/**
	 * Update a wikipage.
	 * @param toUpdate
	 * @param fileNameToFileHandleMap - Maps the name of a file to its FileHandle.  Used to ensure file names are unique within a single WikiPage/keeps track of which files this wiki contains
	 * @param ownerId
	 * @param ownerType
	 * @param newFileHandleIds - Identifies which files are to be inserted. Ensures that only new files are added to the database.
	 * @return
	 * @throws NotFoundException
	 */
	public V2WikiPage updateWikiPage(V2WikiPage toUpdate, Map<String, FileHandle> fileNameToFileHandleMap, String ownerId, ObjectType ownerType, List<String> newFileHandleIds) throws NotFoundException;
	/**
	 * Get a version of a wiki page.
	 * @param version TODO
	 * @param id
	 * @return
	 * @throws NotFoundException
	 */
	public V2WikiPage get(WikiPageKey key, Long version) throws NotFoundException;

	/**
	 * Get the order hint of a root wiki page.
	 * @param key
	 * @param version
	 * @return
	 * @throws NotFoundException
	 * @requires rootKey is the assosiated WikiPageKey of a root wiki.
	 */
	V2WikiOrderHint getWikiOrderHint(WikiPageKey rootKey) throws NotFoundException;

	/**
	 * Update the order hint of a root wiki page.
	 * @param orderHint The order hint with changes made to update.
	 * @param key The key to the wiki page.
	 * @return The updated wiki order hint.
	 * @throws NotFoundException
	 */
	V2WikiOrderHint updateOrderHint(V2WikiOrderHint orderHint, WikiPageKey key) throws NotFoundException;

	/**
	 * Get the markdown of a wiki page as a string.
	 * @param key
	 * @param version TODO
	 * @return
	 * @throws IOException
	 * @throws NotFoundException
	 */
	public String getMarkdown(WikiPageKey key, Long version) throws IOException, NotFoundException;

	/**
	 * Get ALL the file handle ids used (in the past/currently) for a wiki page.
	 * @param key
	 * @param version
	 * @return
	 * @throws NotFoundException
	 */
	public List<Long> getFileHandleReservationForWiki(WikiPageKey key);

	/**
	 * Get ALL file handle ids for a wiki's markdown
	 * @param key
	 * @return
	 */
	public List<Long> getMarkdownFileHandleIdsForWiki(WikiPageKey key);

	/**
	 * Get the ID of the root wiki page for a given Object.
	 * @param ownerId
	 * @param ownerType
	 * @return
	 * @throws NotFoundException
	 */
	public Long getRootWiki(String ownerId, ObjectType ownerType) throws NotFoundException;

	/**
	 * Delete a wiki page.
	 * @param id
	 */
	public void delete(WikiPageKey key);

	/**
	 * Get snapshots of a wiki page's history.
	 * @param key
	 * @param limit
	 * @param offset
	 */
	public List<V2WikiHistorySnapshot> getWikiHistory(WikiPageKey key, Long limit, Long offset) throws NotFoundException, DatastoreException;

	/**
	 * Gets a version of a wiki's title, markdown handle id, and list of attachments' file handle ids.
	 * @param key
	 * @param version
	 * @return
	 * @throws NotFoundException
	 */
	public V2WikiMarkdownVersion getVersionOfWikiContent(WikiPageKey key, Long version) throws NotFoundException;

	/**
	 * Get the entire tree of wiki pages for a given owner.
	 * @param parentId
	 * @return
	 * @throws NotFoundException
	 * @throws DatastoreException
	 */
	List<V2WikiHeader> getHeaderTree(String ownerId, ObjectType ownerType, Long limit, Long offset) throws DatastoreException, NotFoundException;

	/**
	 * Lock for update, returning the current etag
	 * @param wikiId
	 * @return
	 */
	String lockForUpdate(String wikiId);

	/**
	 * Lock for wiki owners for update, returning the current etag
	 * @param wikiId
	 * @return
	 */
	String lockWikiOwnersForUpdate(String rootWikiId);

	/**
	 * To look at ANY VERSION of a wiki's attachments: Get the handle ids of a version's attachments.
	 * If version is null, the current attachments of the wiki are returned.
	 * @param key
	 * @param version
	 * @return
	 * @throws NotFoundException
	 */
	List<String> getWikiFileHandleIds(WikiPageKey key, Long version) throws NotFoundException;

	/**
	 * Lookup the FileHandleId for an attachment, for a given WikiPage with the given name.
	 * @param fileName
	 * @param version TODO
	 * @param ownerId
	 * @param type
	 *
	 * @return
	 */
	String getWikiAttachmentFileHandleForFileName(WikiPageKey key, String fileName, Long version) throws NotFoundException;

	/**
	 * To look at ANY VERSION of a wiki's markdown: Get the handle id of a version's markdown.
	 * If version is null, then the current markdown handle id is returned.
	 * @param key
	 * @param version
	 * @return
	 * @throws NotFoundException
	 */
	String getMarkdownHandleId(WikiPageKey key, Long version) throws NotFoundException;

	/**
	 * Given a wiki id, lookup the key
	 * @param wikiId
	 * @return
	 */
	public WikiPageKey lookupWikiKey(String wikiId) throws NotFoundException;

	long getCount() throws DatastoreException;

	/**
	 *
	 * @param fileHandleIds
	 * @param wikiPageId
	 * @return
	 */
	public Set<String> getFileHandleIdsAssociatedWithWikiAttachments(List<String> fileHandleIds, String wikiPageId);

	/**
	 * Delete the versions of a Wiki page with versions < minVersionToKeep
	 * @param key
	 * @param minVersionToKeep
	 */
	public void deleteWikiVersions(WikiPageKey key, Long minVersionToKeep);

	/**
	 * Return the number of versions of a Wiki page
	 * @param key
	 * @return
	 */
	public Long getNumberOfVersions(WikiPageKey key);

	/**
	 * Return the current version of a Wiki
	 * @param ownerId
	 * @param ownerType
	 * @param wikiId
	 * @return
	 * @throws NotFoundException
	 */
	Long getCurrentWikiVersion(String ownerId, ObjectType ownerType,
			String wikiId) throws NotFoundException;

	/**
	 * Returns the version of the Wiki for given rank (order by version desc)
	 * @param ownerId
	 * @param objectType
	 * @param wikiId
	 * @return
	 * @throws NotFoundException
	 */
	public Long getWikiVersionByRank(WikiPageKey key, Long rank) throws NotFoundException;

	/**
	 * Get the markdown FileHandleIds associated with the given wiki page.
	 * @param fileHandleIds
	 * @param wikiId
	 * @return
	 */
	public Set<String> getFileHandleIdsAssociatedWithWikiMarkdown(
			List<String> fileHandleIds, String wikiId);

	// For testing
	void truncateAll();
}


text:
namespace internal {

Node* get_first_node_in_tour(Node* node) {
    if (node == nullptr) {
        return nullptr;
    }

    // Remember that we want to stay/be as high as possible before going to the left.
    // Go as far up and to the left as possible, to skip over as many nodes as possible.
    while (node->left != nullptr || node->up != nullptr) {
        // Go up as far as possible on this node.
        while (node->up != nullptr) {
            node = node->up;
        }

        if (node->left != nullptr) {
            node = node->left;
        }
    }

    // Now get to the very start of the list, at level 0.
    while (node->left != nullptr || node->down != nullptr) {
        while (node->left != nullptr) {
            node = node->left;
        }

        // Go down a level, since will need to be able to reach height 0.
        if (node->down != nullptr) {
            node = node->down;
        }
    }

    return node;
}

}

using internal::get_first_node_in_tour;

// Utility functions for skiplist.
// Returns nullptr if no node with a higher level considering this node
// and all nodes to the right.
Node* find_next_higher_level_to_right(Node* node, Node* farthest_right=nullptr) {
    while (node != nullptr && node->up == nullptr && node != farthest_right) {
        node = node->right;
    }

    if (node == nullptr) {
        return nullptr;
    }

    return node->up;
}

// Returns nullptr if no node with a higher level considering this node
// and all nodes to the left.
Node* find_next_higher_level_to_left(Node* node, Node* farthest_left=nullptr) {
    while (node != nullptr && node->up == nullptr && node != farthest_left) {
        node = node->left;
    }

    if (node == nullptr) {
        return nullptr;
    }

    return node->up;
}

// Will go up in heights, then go down until reached the end.
// Should be ~O(lg n) - log(n) heights), and each height will let us skip enough nodes for
// it to also be lg n.
Node* get_last_node_in_list(Node* node) {
    if (node == nullptr) {
        return nullptr;
    }

    // Remember that we want to stay/be as high as possible before going to the right.
    // Go as far up and to the right as possible, to skip over as many nodes as possible.
    while (node->right != nullptr || node->up != nullptr) {
        // Go up as far as possible on this node.
        while (node->up != nullptr) {
            node = node->up;
        }

        if (node->right != nullptr) {
            node = node->right;
        }
    }

    // Now get to the very start of the list, at level 0.
    while (node->right != nullptr || node->down != nullptr) {
        while (node->right != nullptr) {
            node = node->right;
        }

        // Go down a level, since will need to be able to reach height 0.
        if (node->down != nullptr) {
            node = node->down;
        }
    }

    return node;
}

EulerTourSkiplist::~EulerTourSkiplist() {
   for (Node* node : all_allocated_stacks) {
       // Delete upwards
       for (Node* up_next = node->up; node != nullptr;
               node = up_next) {
           up_next = node->up;
           delete node;
       }
   }
}

// Returns list with size = elements.size.
// Each provided element will be transformed into a stack of nodes with random height
std::vector<Node*> EulerTourSkiplist::euler_tour_to_skiplist(std::vector<int> elements) {
    // Everything starts with height >= 1
    std::vector<int> random_heights(elements.size(), 1);
    for (size_t i = 0; i < elements.size(); ++i) {
        // 50% chance to continue increasing the height.
        while (rand() % 2 == 1) {
            ++random_heights[i];
        }
    }

    return euler_tour_to_skiplist(elements, random_heights);
}

// Returns a list of nodes with size = elements.size.
// Each provided element will be transformed into a stack of nodes with height equal
// to the provided height.
// Heights MUST BE >= 1
std::vector<Node*> EulerTourSkiplist::euler_tour_to_skiplist(std::vector<int> elements,
        std::vector<int> heights) {
    // Keep track of tallest node*
    std::vector<Node*> all_nodes;
    all_nodes.reserve(elements.size());
    std::vector<Node*> most_recent_node_with_height;

    for (size_t i = 0; i < elements.size(); ++i) {
        const int elem = elements[i];
        const size_t height = static_cast<size_t>(heights[i]);
        Node* prev;

        // Setup base node.
        {
        Node* node = new Node{elem};
        all_nodes.push_back(node);

        if (!most_recent_node_with_height.empty()) {
            link_horizontal(most_recent_node_with_height[0], node);

            most_recent_node_with_height[0] = node;
        } else {
            most_recent_node_with_height.push_back(node);
        }

        prev = node;
        }

        assert(height >= 1);

        // Add for random height.
        for (size_t h = 1; h < height; ++h) {
            Node* next = new Node{elem};
            next->down = prev;
            prev->up = next;

            // Already included a node stack with this height - link to it.
            if (most_recent_node_with_height.size() > h) {
                link_horizontal(most_recent_node_with_height[h], next);

                most_recent_node_with_height[h] = next;
            } else {
                most_recent_node_with_height.push_back(next);
            }

            prev = next;
        }
    }

    return all_nodes;
}

bool EulerTourSkiplist::nodes_are_connected(Node* n1, Node* n2) const {
    return get_first_node_in_tour(n1) == get_first_node_in_tour(n2);
}

// If new_height is -1, will be randomly set. Otherwise will use the provided height, which must be >= 1
Node* EulerTourSkiplist::insert_tour_after_node(Node* inserted,
        Node* second, int new_after_node_height) {
    assert(inserted != nullptr);
    // Need to update the first and last pointer for each level that the inserted
    // list contains.

    // Setup the first level.
    Node* before_inserted = second;
    Node* after_inserted = second->right;

    if (new_after_node_height == -1) {
        new_after_node_height = 1;
        while (rand() % 2 == 1) {
            ++new_after_node_height;
        }
    }
    assert(new_after_node_height >= 1);

    Node* new_second = new Node{second->element};
    Node* const base_new_second = new_second;
    all_allocated_stacks.insert(new_second);

    {
    Node* temp = new_second;
    for (int h = 1; h < new_after_node_height; ++h) {
        Node* next = new Node{second->element};

        temp->up = next;
        next->down = temp;

        temp = next;
    }

    }

    Node* inserted_start = get_first_node_in_tour(inserted);
    Node* inserted_end = get_last_node_in_list(inserted);

    // Setup the remaining levels, until have gone through all levels for
    // inserted_start/end or until have gone through all levels for before/after_inserted.

    while (inserted_start != nullptr && // If inserted_{start/end} is nullptr, other is also nullptr.
            (before_inserted != nullptr || after_inserted != nullptr) // Their values are not related.
            ) {
        // Connect everything up at this level.
        // before_inserted -> inserted_start ... inserted_end -> additional second (if it is high enough)
        // -> after_inserted

        link_horizontal(before_inserted, inserted_start);
        if (new_second != nullptr) {
            link_horizontal(inserted_end, new_second);
            link_horizontal(new_second, after_inserted);
        }  else {
            link_horizontal(inserted_end, after_inserted);
        }

        // Now advance levels for everything.

        if (new_second != nullptr) {
            new_second = new_second->up;
        }

        Node* temp_inserted_start = inserted_start;
        // Don't let it go past the end of inserted.
        inserted_start = find_next_higher_level_to_right(inserted_start, inserted_end);
        // Don't let it go past the end of inserted
        inserted_end = find_next_higher_level_to_left(inserted_end, temp_inserted_start);

        // Before/after inserted are related, because they would have been directly connected
        // to each other.
        // If there is a node in before_inserted that is of sufficient height,
        // after_inserted will be its right sibling. Otherwise need to find after_inserted
        // using the previous value of after_inserted.
        before_inserted = find_next_higher_level_to_left(before_inserted);
        if (before_inserted != nullptr) {
            after_inserted = before_inserted->right;
        } else {
            // If it doesn't exist, find using what we just put after the inserted
            // block on previous level.
            after_inserted = find_next_higher_level_to_right(after_inserted);
        }

        assert((inserted_start == nullptr) == (inserted_end == nullptr));
    }

    // May just need to do additional work for the additional second node.
    // Note that at this point, everything is on a level that hasn't yet been inserted.

    // Know that before + after inserted are nullptrs.
    while (new_second != nullptr && inserted_end != nullptr) {
        // Link. Note that before_inserted and after_inesrted are nullptr.
        // So just link inserted_end to
        link_horizontal(inserted_end, new_second);

        // Advance up one level.
        new_second = new_second->up;

        Node* temp_inserted_start = inserted_start;
        // Don't let it go past the end of inserted.
        inserted_start = find_next_higher_level_to_right(inserted_start, inserted_end);
        // Don't let it go past the end of inserted
        inserted_end = find_next_higher_level_to_left(inserted_end, temp_inserted_start);
    }

    // Know that inserted_end and inserted_start are nullptr.
    // So need to link before+after_inserted to new_second
    while (new_second != nullptr &&
            (before_inserted != nullptr || after_inserted != nullptr)) {
        link_horizontal(before_inserted, new_second);
        link_horizontal(new_second, after_inserted);

        // Advance up one level.
        new_second = new_second->up;

        // Before/after inserted are related, because they would have been directly connected
        // to each other.
        // If there is a node in before_inserted that is of sufficient height,
        // after_inserted will be its right sibling. Otherwise need to find after_inserted
        // using the previous value of after_inserted.
        before_inserted = find_next_higher_level_to_left(before_inserted);
        if (before_inserted != nullptr) {
            after_inserted = before_inserted->right;
        } else {
            // If it doesn't exist, find using what we just put after the inserted
            // block on previous level.
            after_inserted = find_next_higher_level_to_right(after_inserted);
        }
    }

    return base_new_second;
}

Node* EulerTourSkiplist::cut_out_tour(Node* tour_start, Node* tour_end) {
    Node* before_tour = tour_end->right;
    Node* after_tour = tour_end->right;

    assert(before_tour->element == after_tour->element);

    // Remove the cut start + end from the list they are already in, but going up levels,
    // and connected left + right together.
    while (tour_start != nullptr) {
        // Link what is to left of tour_start with what is to right of tour_end.
        link_horizontal(tour_start->left, tour_end->right);

        tour_start->left = nullptr;
        tour_end->right = nullptr;

        Node* temp_tour_start = tour_start;
        // Don't let it go past the end of what is to be cut.
        tour_start = find_next_higher_level_to_right(tour_start, tour_end);
        // Don't let it go past the start of what is to be cut.
        tour_end = find_next_higher_level_to_left(tour_end, temp_tour_start);
    }

    // Remove the duplicated node.
    all_allocated_stacks.erase(after_tour);
    for (Node* next; after_tour != nullptr; after_tour = next) {
        next = after_tour->up;

        // Reconnect what it was connecting
        link_horizontal(after_tour->left, after_tour->right);
    }

    return before_tour;
}

// Able to handle either node, or even both, being a nullptr.
inline void EulerTourSkiplist::link_horizontal(Node* left_node, Node* right_node) const {
    if (left_node != nullptr) {
        left_node->right = right_node;
    }

    if (right_node != nullptr) {
        right_node->left = left_node;
    }
}


text:
<?php
// .-----------------------------------------------------------------------------------
// | WE TRY THE BEST WAY
// |-----------------------------------------------------------------------------------
// | Author: 贝贝 <hebiduhebi@163.com>
// | Copyright (c) 2013-2015, http://www.gooraye.net. All Rights Reserved.
// |-----------------------------------------------------------------------------------

namespace Ucenter\Controller;

class LogController extends UcenterController{

	protected function _initialize(){
		parent::_initialize();
		$this->assignTitle('日志管理');
	}

	public function index(){

		//get.startdatetime
		$startdatetime = I('startdatetime',date('Y/m/d H:i',time()-24*3600),'urldecode');
		$enddatetime = I('enddatetime',date('Y/m/d H:i',time()),'urldecode');

		//分页时带参数get参数
		$params = array(
			'startdatetime'=>$startdatetime,
			'enddatetime'=>$enddatetime
		);

		$startdatetime = strtotime($startdatetime);
		$enddatetime = strtotime($enddatetime);

		if($startdatetime === FALSE || $enddatetime === FALSE){
			LogRecord('INFO:'.$result['info'],'[FILE] '.__FILE__.' [LINE] '.__LINE__);
			$this->error(L('ERR_DATE_INVALID'));
		}

		$map = array();

		$map['timestamp'] = array(array('EGT',$startdatetime),array('elt',$enddatetime),'and');

		$page = array('curpage' => I('get.p', 0), 'size' => C('LIST_ROWS'));
		$order = " timestamp desc ";
		//
		$result = apiCall('Ucenter/Log/query',array($map,$page,$order,$params));
		//
		if($result['status']){
			$this->assign('startdatetime',$startdatetime);
			$this->assign('enddatetime',$enddatetime);
			$this->assign('show',$result['info']['show']);
			$this->assign('list',$result['info']['list']);
			$this->display();
		}else{
			LogRecord('INFO:'.$result['info'],'[FILE] '.__FILE__.' [LINE] '.__LINE__);
			$this->error(L('UNKNOWN_ERR'));
		}
	}

	public function system(){
		$this->index();
	}

}


text:
package com.bradbergeron.splitviewcontroller;

import android.app.FragmentTransaction;

public abstract class SplitViewMasterFragment extends SplitViewAbsFragment {

    // ================================================================================
    // Presentation
    // ================================================================================

    protected void setDetailFragment (final SplitViewDetailFragment detailFragment) {
        getController().setDetailFragment(detailFragment);
    }

    protected void setDetailFragment (final SplitViewDetailFragment detailFragment, final
                                      FragmentTransaction transaction) {
        getController().setDetailFragment(detailFragment, transaction);
    }

    // ================================================================================
    // Helpers
    // ================================================================================

    @Override
    protected int getViewId () {
        return getController().getMasterFragmentContainerId();
    }
}