text:
import lbry from "../lbry.js";
import React from "react";
import FormField from "component/formField";
import Link from "../component/link";

const fs = require("fs");
const { ipcRenderer } = require("electron");

class DeveloperPage extends React.PureComponent {
  constructor(props) {
    super(props);

    this.state = {
      showDeveloperMenu: lbry.getClientSetting("showDeveloperMenu"),
      useCustomLighthouseServers: lbry.getClientSetting(
        "useCustomLighthouseServers"
      ),
      customLighthouseServers: lbry
        .getClientSetting("customLighthouseServers")
        .join("\n"),
      upgradePath: "",
    };
  }

  handleShowDeveloperMenuChange(event) {
    lbry.setClientSetting("showDeveloperMenu", event.target.checked);
    lbry.showMenuIfNeeded();
    this.setState({
      showDeveloperMenu: event.target.checked,
    });
  }

  handleUseCustomLighthouseServersChange(event) {
    lbry.setClientSetting("useCustomLighthouseServers", event.target.checked);
    this.setState({
      useCustomLighthouseServers: event.target.checked,
    });
  }

  handleUpgradeFileChange(event) {
    this.setState({
      upgradePath: event.target.value,
    });
  }

  handleForceUpgradeClick() {
    let upgradeSent = false;
    if (!this.state.upgradePath) {
      alert(__("Please select a file to upgrade from"));
    } else {
      try {
        const stats = fs.lstatSync(this.state.upgradePath);
        if (stats.isFile()) {
          console.log("Starting upgrade using " + this.state.upgradePath);
          ipcRenderer.send("upgrade", this.state.upgradePath);
          upgradeSent = true;
        }
      } catch (e) {}
      if (!upgradeSent) {
        alert(
          'Failed to start upgrade. Is "' +
            this.state.upgradePath +
            '" a valid path to the upgrade?'
        );
      }
    }
  }

  render() {
    return (

{__("Developer Settings")}

              <FormField
                type="checkbox"
                onChange={event => {
                  this.handleShowDeveloperMenuChange();
                }}
                checked={this.state.showDeveloperMenu}
              />
              {" "}
              {__("Show developer menu")}

              <FormField
                type="checkbox"
                onChange={event => {
                  this.handleUseCustomLighthouseServersChange();
                }}
                checked={this.state.useCustomLighthouseServers}
              />
              {" "}
              {__("Use custom search servers")}

          {this.state.useCustomLighthouseServers
            ?

                  {__("Custom search servers (one per line)")}

                    <FormField
                      type="textarea"
                      className="developer-page__custom-lighthouse-servers"
                      value={this.state.customLighthouseServers}
                      onChange={event => {
                        this.handleCustomLighthouseServersChange();
                      }}
                      checked={this.state.debugMode}
                    />

            : null}

            <FormField
              name="file"
              ref="file"
              type="file"
              onChange={event => {
                this.handleUpgradeFileChange();
              }}
            />

            <Link
              label={__("Force Upgrade")}
              button="alt"
              onClick={event => {
                this.handleForceUpgradeClick();
              }}
            />

    );
  }
}

export default DeveloperPage;


text:
using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF8;
using base::android::ScopedJavaLocalRef;

namespace content {

DeviceInfo::DeviceInfo() {
  JNIEnv* env = AttachCurrentThread();
  j_device_info_.Reset(Java_DeviceInfo_create(env,
      base::android::GetApplicationContext()));
}

DeviceInfo::~DeviceInfo() {
}

int DeviceInfo::GetHeight() {
  JNIEnv* env = AttachCurrentThread();
  jint result =
      Java_DeviceInfo_getHeight(env, j_device_info_.obj());
  return static_cast<int>(result);
}

int DeviceInfo::GetWidth() {
  JNIEnv* env = AttachCurrentThread();
  jint result =
      Java_DeviceInfo_getWidth(env, j_device_info_.obj());
  return static_cast<int>(result);
}

int DeviceInfo::GetBitsPerPixel() {
  JNIEnv* env = AttachCurrentThread();
  jint result =
      Java_DeviceInfo_getBitsPerPixel(env, j_device_info_.obj());
  return static_cast<int>(result);
}

int DeviceInfo::GetBitsPerComponent() {
  JNIEnv* env = AttachCurrentThread();
  jint result =
      Java_DeviceInfo_getBitsPerComponent(env, j_device_info_.obj());
  return static_cast<int>(result);
}

double DeviceInfo::GetDPIScale() {
  JNIEnv* env = AttachCurrentThread();
  jdouble result =
      Java_DeviceInfo_getDPIScale(env, j_device_info_.obj());
  return static_cast<double>(result);
}

double DeviceInfo::GetRefreshRate() {
  JNIEnv* env = AttachCurrentThread();
  jdouble result =
      Java_DeviceInfo_getRefreshRate(env, j_device_info_.obj());
  return static_cast<double>(result);
}

std::string DeviceInfo::GetNetworkCountryIso() {
  JNIEnv* env = AttachCurrentThread();
  ScopedJavaLocalRef<jstring> result =
      Java_DeviceInfo_getNetworkCountryIso(env, j_device_info_.obj());
  return ConvertJavaStringToUTF8(result);
}

bool RegisterDeviceInfo(JNIEnv* env) {
  return RegisterNativesImpl(env);
}

}  // namespace content

redpajama_set_name: RedPajamaGithub


text:
@implementation MWVariableList

- (id) init {
	self = [super init];
	if (self != nil) {
		current_vars = [[NSMutableArray alloc] init];
		syncEventIndex = -1;
	}
	return self;
}

- (id)delegate {
	return delegate;
}

- (void)setDelegate:(id)new_delegate {
	if(![new_delegate respondsToSelector:@selector(updateVariableFilter)]) {
		[NSException raise:NSInternalInconsistencyException
					format:@"Delegate doesn't respond to required methods for MWVariableList"];
	}

	delegate = new_delegate;
}

- (void)addVariable:(MWVarEntry *)var {
	[current_vars addObject:var];
}

- (void)reloadData {
	[variablesView reloadData];
}

- (void)clear {
	[current_vars removeAllObjects];
}

- (void)setSyncEventName:(NSString *)syncEventName {
	syncEventIndex = 0;

	NSEnumerator *enumerator = [current_vars objectEnumerator];
	MWVarEntry *mve;

	while(mve = [enumerator nextObject]) {
		if([syncEventName isEqualToString:[mve name]]) {
			[mve setSelected:YES];
			break;
		}
		++syncEventIndex;
	}
}

- (NSArray *)current_vars {
	NSArray *return_variables = [NSArray arrayWithArray:current_vars];
	return return_variables;
}

- (NSArray *)currentSelectedVariables {
	NSMutableArray *current_selected_variables = [NSMutableArray array];

	for (MWVarEntry *mve in current_vars) {
		if([[mve selected] boolValue]) {
			[current_selected_variables addObject:[mve name]];
		}
	}

	return current_selected_variables;
}

// delegate methods
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
    return [current_vars count];
}

- (id)tableView:(NSTableView *)aTableView
      objectValueForTableColumn:(NSTableColumn *)aTableColumn
			row:(int)rowIndex
{
	if(aTableColumn == nameCol) {
		return [[current_vars objectAtIndex:rowIndex] name];
	} else if(aTableColumn == selectedCol) {
		if(rowIndex == syncEventIndex) {
			return [NSNumber numberWithInt:NSControlStateValueOn];
		} else {
			if([[[current_vars objectAtIndex:rowIndex] selected] boolValue]) {
				return [NSNumber numberWithInt:NSControlStateValueOn];
			} else {
				return [NSNumber numberWithInt:NSControlStateValueOff];
			}
		}
	}
	return nil;
}

- (void)tableView:(NSTableView *)aTableView
   setObjectValue:(id)anObject
   forTableColumn:(NSTableColumn *)aTableColumn
			  row:(int)rowIndex {
	if(aTableColumn == selectedCol) {
		[[current_vars objectAtIndex:rowIndex] setSelected:[anObject boolValue]];
		if(delegate != nil) {
			[delegate updateVariableFilter];
		}
	}
}

- (BOOL)tableView:(NSTableView *)aTableView
shouldEditTableColumn:(NSTableColumn *)aTableColumn
			  row:(int)rowIndex {
	if(aTableColumn == selectedCol) {
		return rowIndex != syncEventIndex;
	} else {
		return NO;
	}
}

@end


text:
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>or-tools/src/base/join.cc Source File - Doxy</title>
    <link rel="shortcut icon" href="../../../favicon.ico">

    <link href="../../../doxygen.css" rel="stylesheet" type="text/css">
    <link href="../../../tabs.css" rel="stylesheet" type="text/css">

          Generated on: Thu Mar 29 07:46:58 PDT 2012
            for custom file set

        <tt>//
            doxy/
            or-tools/
            src/
            base/
            </tt>

Main Page

Namespaces

Classes

Files

or-tools/src/base/join.cc
Go to the documentation of this file.

00001 // Copyright 2010-2012 Google
00002 // Licensed under the Apache License, Version 2.0 (the "License");
00003 // you may not use this file except in compliance with the License.
00004 // You may obtain a copy of the License at
00005 //
00006 //     http://www.apache.org/licenses/LICENSE-2.0
00007 //
00008 // Unless required by applicable law or agreed to in writing, software
00009 // distributed under the License is distributed on an "AS IS" BASIS,
00010 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00011 // See the License for the specific language governing permissions and
00012 // limitations under the License.
00013
00014 #include "base/basictypes.h"
00015 #include "base/stringpiece.h"
00016 #include "base/stringprintf.h"
00017
00018 namespace operations_research {
00019 // ----- StrCat -----
00020
00021 std::string StrCat(const StringPiece& p1, const StringPiece& p2) {
00022   std::string result = p1.ToString();
00023   result += p2.ToString();
00024   return result;
00025 }
00026
00027 std::string StrCat(const StringPiece& p1,
00028                    const StringPiece& p2,
00029                    const StringPiece& p3) {
00030   std::string result = p1.ToString();
00031   result += p2.ToString();
00032   result += p3.ToString();
00033   return result;
00034 }
00035
00036 std::string StrCat(const StringPiece& p1,
00037                    const StringPiece& p2,
00038                    const StringPiece& p3,
00039                    const StringPiece& p4) {
00040   std::string result = p1.ToString();
00041   result += p2.ToString();
00042   result += p3.ToString();
00043   result += p4.ToString();
00044   return result;
00045 }
00046
00047 std::string StrCat(const StringPiece& p1,
00048                    const StringPiece& p2,
00049                    const StringPiece& p3,
00050                    const StringPiece& p4,
00051                    const StringPiece& p5) {
00052   std::string result = p1.ToString();
00053   result += p2.ToString();
00054   result += p3.ToString();
00055   result += p4.ToString();
00056   result += p5.ToString();
00057   return result;
00058 }
00059
00060 std::string StrCat(int64 a1, const StringPiece& p2) {
00061   return StringPrintf("%lld%s", a1, p2.ToString().c_str());
00062 }
00063
00064 std::string StrCat(const StringPiece& p1, int64 a2) {
00065   return StringPrintf("%s%lld", p1.ToString().c_str(), a2);
00066 }
00067
00068 }  // namespace operations_research


text:
class AddLockingForPages < ActiveRecord::Migration
  def self.up
    remove_column :contents, :category_alias_id
    add_column :contents, :locked, :boolean, :default => false
    add_column Content.versioned_table_name, :locked, :boolean
  end

  def self.down
    remove_column :contents, :locked
    remove_column Content.versioned_table_name, :locked
    add_column :contents, :category_alias_id, :integer
  end
end


text:
import { PaginationComponent } from './pagination'

export { PaginationComponent } from './pagination'

export const PAGINATION_DIRECTIVES: Array<any> = [PaginationComponent]


text:
if not SERVER then return end

require("mysqloo")
include("sh_weightmanager.lua")
include("sh_playerweight.lua")

local function Message(msg)
    print("[TTT WeightSystem MySQL] ".. msg .. ".")
end

function DateTime()
    return os.date( "%y-%m-%d %H:%M:%S" )
end

local db = mysqloo.connect(WeightSystem.Database.Host, WeightSystem.Database.User, WeightSystem.Database.Password, WeightSystem.Database.DatabaseName, WeightSystem.Database.Port)
local queue = {}

function DatabaseExists()
	ExecuteQuery("SELECT count(*) FROM information_schema.tables WHERE table_name = '" .. WeightSystem.Database.TableName .. "'", function(data)
                if table.Count(data) <= 0 then
                    Message(WeightSystem.Database.TableName .. " table does NOT exist")
					return false
                else
					Message(WeightSystem.Database.TableName .. " exists")
					return true
                end
        end)

		return false -- if it could not run most likely failed.
end

function ExecuteQuery(str, callback)

        callback = callback or function() end
        local q = db:query(str)
        function q:onSuccess(data)
                callback(data)
        end

        function q:onError(err)
                local status = db:status()
                if status == mysqloo.DATABASE_NOT_CONNECTED or status == mysqloo.DATABASE_CONNECTING then
                        Message("Inserting missed query into queue: " .. str)
                        table.insert( queue, { str, callback } )

                        if status == mysqloo.DATABASE_NOT_CONNECTED then
                                Message("Attempting reconnect to database!")
                                db:connect()
                        end
                        return
                end
        end
        q:start()
end

function db:onConnected()
    Message("Connected to database")
	DatabaseExists()

	ExecuteQuery("CREATE TABLE IF NOT EXISTS " .. WeightSystem.Database.TableName .. " (Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, SteamId BIGINT UNSIGNED NOT NULL, Weight SMALLINT UNSIGNED NOT NULL, LastUpdated DATETIME DEFAULT '" .. DateTime() .. "', PRIMARY KEY (Id))")

    Message("Running commands that were lost")
    for k, v in pairs( queue ) do
        ExecuteQuery( v[ 1 ], v[ 2 ] )
    end
    queue = {}
    -- Delete records older then 3 weeks, just clean out the database a little bit.
    ExecuteQuery("DELETE FROM " .. WeightSystem.Database.TableName .. " WHERE DATEDIFF(CURDATE(), LastUpdated) >= 21")
end

function db:onConnectionFailed(err)

	for k,v in pairs(player.GetAll()) do
	v:PrintMessage( HUD_PRINTTALK, "[Weight System] Could not connect to database, please ensure the settings are filled out properly.")
	end

    Message("Connection to database failed")
end

function UpdatePlayerWeight(ply, weight)
        local newWeight = weight or ply:GetWeight()
        if ply:IsPlayer() and not ply:IsBot() then
            ExecuteQuery("UPDATE " .. WeightSystem.Database.TableName .. " SET Weight = " .. newWeight .. ", LastUpdated = '" .. DateTime() .. "' WHERE steamid = " .. ply:SteamID64())
        end
end

-- Connect database on Initialize
hook.Add("Initialize", "TTTKS_Initialize", function()
    db:connect()
end)

-- When player joins check if they have a record already, if not create one and set their default weight.
hook.Add("PlayerInitialSpawn", "TTTWS_PlayerInitialSpawn", function(ply)
    if ply:IsPlayer() and not ply:IsBot() then
        ExecuteQuery("SELECT Weight FROM " .. WeightSystem.Database.TableName .. " WHERE SteamId = " .. ply:SteamID64(), function(data)
                if table.Count(data) > 0 then
                    Message(ply:GetName() .. " exists in database, setting player weight to: " .. data[1].Weight)
                    ply:SetWeight( data[1].Weight )
                else
                    local defaultWeight = DefaultWeight()
                    Message(ply:GetName() .. " does not exist in database, creating user and setting default weight to: " .. defaultWeight)
                    ExecuteQuery("INSERT INTO " .. WeightSystem.Database.TableName .. " ( SteamId, Weight, LastUpdated ) VALUES ( '" .. ply:SteamID64() .. "', " .. defaultWeight .. ", '" .. DateTime() .. "' )")
                    ply:SetWeight( defaultWeight )
                end
        end)
   end

end)


text:
<?php

namespace Oro\Bundle\NavigationBundle\Config\Definition\Builder;

use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;

/**
 * Configuration definition for menu nodes
 */
class MenuNodeDefinition extends ArrayNodeDefinition
{
    /**
     * Make menu hierarchy
     *
     * @param  int                $depth
     * @return MenuNodeDefinition
     */
    public function menuNodeHierarchy($depth = 10)
    {
        if ($depth == 0) {
            return $this;
        }

        return $this->useAttributeAsKey('id')
            ->prototype('array')
                ->children()
                    ->scalarNode('position')->end()
                    ->scalarNode('merge_strategy')
                        ->defaultValue('append')
                    ->end()
                    ->menuNode('children')->menuNodeHierarchy($depth - 1)
                ->end()
            ->end();
    }
}


text:
/**
 * @constructor
 * @implements {WebInspector.ViewFactory}
 */
WebInspector.AdvancedSearchController = function()
{
    this._shortcut = WebInspector.AdvancedSearchController.createShortcut();
    this._searchId = 0;

    WebInspector.settings.advancedSearchConfig = WebInspector.settings.createSetting("advancedSearchConfig", new WebInspector.SearchConfig("", true, false));

    WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._frameNavigated, this);
    WebInspector.inspectorView.registerViewInDrawer("search", WebInspector.UIString("Search"), this);
}

/**
 * @return {!WebInspector.KeyboardShortcut.Descriptor}
 */
WebInspector.AdvancedSearchController.createShortcut = function()
{
    if (WebInspector.isMac())
        return WebInspector.KeyboardShortcut.makeDescriptor("f", WebInspector.KeyboardShortcut.Modifiers.Meta | WebInspector.KeyboardShortcut.Modifiers.Alt);
    else
        return WebInspector.KeyboardShortcut.makeDescriptor("f", WebInspector.KeyboardShortcut.Modifiers.Ctrl | WebInspector.KeyboardShortcut.Modifiers.Shift);
}

WebInspector.AdvancedSearchController.prototype = {
    /**
     * @param {string=} id
     * @return {WebInspector.View}
     */
    createView: function(id)
    {
        if (!this._searchView)
            this._searchView = new WebInspector.SearchView(this);
        return this._searchView;
    },

    /**
     * @param {KeyboardEvent} event
     * @return {boolean}
     */
    handleShortcut: function(event)
    {
        if (WebInspector.KeyboardShortcut.makeKeyFromEvent(event) === this._shortcut.key) {
            if (!this._searchView || !this._searchView.isShowing() || this._searchView._search !== document.activeElement) {
                WebInspector.showPanel("sources");
                this.show();
            } else
                WebInspector.inspectorView.closeDrawer();
            event.consume(true);
            return true;
        }
        return false;
    },

    _frameNavigated: function()
    {
        this.resetSearch();
    },

    /**
     * @param {WebInspector.SearchScope} searchScope
     */
    registerSearchScope: function(searchScope)
    {
        // FIXME: implement multiple search scopes.
        this._searchScope = searchScope;
    },

    show: function()
    {
        var selection = window.getSelection();
        var queryCandidate;
        if (selection.rangeCount)
            queryCandidate = selection.toString().replace(/\r?\n.*/, "");

        if (!this._searchView || !this._searchView.isShowing())
            WebInspector.inspectorView.showViewInDrawer("search");
        if (queryCandidate)
            this._searchView._search.value = queryCandidate;
        this._searchView.focus();

        this.startIndexing();
    },

    /**
     * @param {boolean} finished
     */
    _onIndexingFinished: function(finished)
    {
        delete this._isIndexing;
        this._searchView.indexingFinished(finished);
        if (!finished)
            delete this._pendingSearchConfig;
        if (!this._pendingSearchConfig)
            return;
        var searchConfig = this._pendingSearchConfig
        delete this._pendingSearchConfig;
        this._innerStartSearch(searchConfig);
    },

    startIndexing: function()
    {
        this._isIndexing = true;
        // FIXME: this._currentSearchScope should be initialized based on searchConfig
        this._currentSearchScope = this._searchScope;
        if (this._progressIndicator)
            this._progressIndicator.done();
        this._progressIndicator = new WebInspector.ProgressIndicator();
        this._searchView.indexingStarted(this._progressIndicator);
        this._currentSearchScope.performIndexing(this._progressIndicator, this._onIndexingFinished.bind(this));
    },

    /**
     * @param {number} searchId
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     */
    _onSearchResult: function(searchId, searchResult)
    {
        if (searchId !== this._searchId)
            return;
        this._searchView.addSearchResult(searchResult);
        if (!searchResult.searchMatches.length)
            return;
        if (!this._searchResultsPane)
            this._searchResultsPane = this._currentSearchScope.createSearchResultsPane(this._searchConfig);
        this._searchView.resultsPane = this._searchResultsPane;
        this._searchResultsPane.addSearchResult(searchResult);
    },

    /**
     * @param {number} searchId
     * @param {boolean} finished
     */
    _onSearchFinished: function(searchId, finished)
    {
        if (searchId !== this._searchId)
            return;
        if (!this._searchResultsPane)
            this._searchView.nothingFound();
        this._searchView.searchFinished(finished);
        delete this._searchConfig;
    },

    /**
     * @param {WebInspector.SearchConfig} searchConfig
     */
    startSearch: function(searchConfig)
    {
        this.resetSearch();
        ++this._searchId;
        if (!this._isIndexing)
            this.startIndexing();
        this._pendingSearchConfig = searchConfig;
    },

    /**
     * @param {WebInspector.SearchConfig} searchConfig
     */
    _innerStartSearch: function(searchConfig)
    {
        this._searchConfig = searchConfig;
        // FIXME: this._currentSearchScope should be initialized based on searchConfig
        this._currentSearchScope = this._searchScope;

        if (this._progressIndicator)
            this._progressIndicator.done();
        this._progressIndicator = new WebInspector.ProgressIndicator();
        var totalSearchResultsCount = this._currentSearchScope.performSearch(searchConfig, this._progressIndicator, this._onSearchResult.bind(this, this._searchId), this._onSearchFinished.bind(this, this._searchId));
        this._searchView.searchStarted(this._progressIndicator);
    },

    resetSearch: function()
    {
        this.stopSearch();

        if (this._searchResultsPane) {
            this._searchView.resetResults();
            delete this._searchResultsPane;
        }
    },

    stopSearch: function()
    {
        if (this._progressIndicator)
            this._progressIndicator.cancel();
        if (this._currentSearchScope)
            this._currentSearchScope.stopSearch();
        delete this._searchConfig;
    }
}

/**
 * @constructor
 * @extends {WebInspector.View}
 * @param {WebInspector.AdvancedSearchController} controller
 */
WebInspector.SearchView = function(controller)
{
    WebInspector.View.call(this);

    this._controller = controller;

    this.element.className = "search-view vbox";

    this._searchPanelElement = this.element.createChild("div", "search-drawer-header");
    this._searchPanelElement.addEventListener("keydown", this._onKeyDown.bind(this), false);

    this._searchResultsElement = this.element.createChild("div");
    this._searchResultsElement.className = "search-results";

    this._search = this._searchPanelElement.createChild("input");
    this._search.placeholder = WebInspector.UIString("Search sources");
    this._search.setAttribute("type", "text");
    this._search.addStyleClass("search-config-search");
    this._search.setAttribute("results", "0");
    this._search.setAttribute("size", 30);

    this._ignoreCaseLabel = this._searchPanelElement.createChild("label");
    this._ignoreCaseLabel.addStyleClass("search-config-label");
    this._ignoreCaseCheckbox = this._ignoreCaseLabel.createChild("input");
    this._ignoreCaseCheckbox.setAttribute("type", "checkbox");
    this._ignoreCaseCheckbox.addStyleClass("search-config-checkbox");
    this._ignoreCaseLabel.appendChild(document.createTextNode(WebInspector.UIString("Ignore case")));

    this._regexLabel = this._searchPanelElement.createChild("label");
    this._regexLabel.addStyleClass("search-config-label");
    this._regexCheckbox = this._regexLabel.createChild("input");
    this._regexCheckbox.setAttribute("type", "checkbox");
    this._regexCheckbox.addStyleClass("search-config-checkbox");
    this._regexLabel.appendChild(document.createTextNode(WebInspector.UIString("Regular expression")));

    this._searchStatusBarElement = this.element.createChild("div", "search-status-bar-summary");
    this._searchMessageElement = this._searchStatusBarElement.createChild("span");
    this._searchResultsMessageElement = document.createElement("span");

    this._load();
}

// Number of recent search queries to store.
WebInspector.SearchView.maxQueriesCount = 20;

WebInspector.SearchView.prototype = {
    /**
     * @return {WebInspector.SearchConfig}
     */
    get searchConfig()
    {
        return new WebInspector.SearchConfig(this._search.value, this._ignoreCaseCheckbox.checked, this._regexCheckbox.checked);
    },

    /**
     * @type {WebInspector.SearchResultsPane}
     */
    set resultsPane(resultsPane)
    {
        this.resetResults();
        this._searchResultsElement.appendChild(resultsPane.element);
    },

    /**
     * @param {WebInspector.ProgressIndicator} progressIndicator
     */
    searchStarted: function(progressIndicator)
    {
        this.resetResults();
        this._resetCounters();

        this._searchMessageElement.textContent = WebInspector.UIString("Searching...");
        progressIndicator.show(this._searchStatusBarElement);
        this._updateSearchResultsMessage();

        if (!this._searchingView)
            this._searchingView = new WebInspector.EmptyView(WebInspector.UIString("Searching..."));
        this._searchingView.show(this._searchResultsElement);
    },

    /**
     * @param {WebInspector.ProgressIndicator} progressIndicator
     */
    indexingStarted: function(progressIndicator)
    {
        this._searchMessageElement.textContent = WebInspector.UIString("Indexing...");
        progressIndicator.show(this._searchStatusBarElement);
    },

    /**
     * @param {boolean} finished
     */
    indexingFinished: function(finished)
    {
        this._searchMessageElement.textContent = finished ? "" : WebInspector.UIString("Indexing interrupted.");
    },

    _updateSearchResultsMessage: function()
    {
        if (this._searchMatchesCount && this._searchResultsCount)
            this._searchResultsMessageElement.textContent = WebInspector.UIString("Found %d matches in %d files.", this._searchMatchesCount, this._nonEmptySearchResultsCount);
        else
            this._searchResultsMessageElement.textContent = "";
    },

    resetResults: function()
    {
        if (this._searchingView)
            this._searchingView.detach();
        if (this._notFoundView)
            this._notFoundView.detach();
        this._searchResultsElement.removeChildren();
    },

    _resetCounters: function()
    {
        this._searchMatchesCount = 0;
        this._searchResultsCount = 0;
        this._nonEmptySearchResultsCount = 0;
    },

    nothingFound: function()
    {
        this.resetResults();

        if (!this._notFoundView)
            this._notFoundView = new WebInspector.EmptyView(WebInspector.UIString("No matches found."));
        this._notFoundView.show(this._searchResultsElement);
        this._searchResultsMessageElement.textContent = WebInspector.UIString("No matches found.");
    },

    /**
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     */
    addSearchResult: function(searchResult)
    {
        this._searchMatchesCount += searchResult.searchMatches.length;
        this._searchResultsCount++;
        if (searchResult.searchMatches.length)
            this._nonEmptySearchResultsCount++;
        this._updateSearchResultsMessage();
    },

    /**
     * @param {boolean} finished
     */
    searchFinished: function(finished)
    {
        this._searchMessageElement.textContent = finished ? WebInspector.UIString("Search finished.") : WebInspector.UIString("Search interrupted.");
    },

    focus: function()
    {
        WebInspector.setCurrentFocusElement(this._search);
        this._search.select();
    },

    afterShow: function()
    {
        this.focus();
    },

    willHide: function()
    {
        this._controller.stopSearch();
    },

    /**
     * @param {Event} event
     */
    _onKeyDown: function(event)
    {
        switch (event.keyCode) {
        case WebInspector.KeyboardShortcut.Keys.Enter.code:
            this._onAction();
            break;
        }
    },

    _save: function()
    {
        var searchConfig = new WebInspector.SearchConfig(this.searchConfig.query, this.searchConfig.ignoreCase, this.searchConfig.isRegex);
        WebInspector.settings.advancedSearchConfig.set(searchConfig);
    },

    _load: function()
    {
        var searchConfig = WebInspector.settings.advancedSearchConfig.get();
        this._search.value = searchConfig.query;
        this._ignoreCaseCheckbox.checked = searchConfig.ignoreCase;
        this._regexCheckbox.checked = searchConfig.isRegex;
    },

    _onAction: function()
    {
        if (!this.searchConfig.query || !this.searchConfig.query.length)
            return;

        this._save();
        this._controller.startSearch(this.searchConfig);
    },

    __proto__: WebInspector.View.prototype
}

/**
 * @constructor
 * @param {string} query
 * @param {boolean} ignoreCase
 * @param {boolean} isRegex
 */
WebInspector.SearchConfig = function(query, ignoreCase, isRegex)
{
    this.query = query;
    this.ignoreCase = ignoreCase;
    this.isRegex = isRegex;
}

/**
 * @interface
 */
WebInspector.SearchScope = function()
{
}

WebInspector.SearchScope.prototype = {
    /**
     * @param {WebInspector.SearchConfig} searchConfig
     * @param {WebInspector.Progress} progress
     * @param {function(WebInspector.FileBasedSearchResultsPane.SearchResult)} searchResultCallback
     * @param {function(boolean)} searchFinishedCallback
     */
    performSearch: function(searchConfig, progress, searchResultCallback, searchFinishedCallback) { },

    stopSearch: function() { },

    /**
     * @param {WebInspector.SearchConfig} searchConfig
     * @return {WebInspector.SearchResultsPane}
     */
    createSearchResultsPane: function(searchConfig) { }
}

/**
 * @constructor
 * @param {number} offset
 * @param {number} length
 */
WebInspector.SearchResult = function(offset, length)
{
    this.offset = offset;
    this.length = length;
}

/**
 * @constructor
 * @param {WebInspector.SearchConfig} searchConfig
 */
WebInspector.SearchResultsPane = function(searchConfig)
{
    this._searchConfig = searchConfig;
    this.element = document.createElement("div");
}

WebInspector.SearchResultsPane.prototype = {
    /**
     * @return {WebInspector.SearchConfig}
     */
    get searchConfig()
    {
        return this._searchConfig;
    },

    /**
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     */
    addSearchResult: function(searchResult) { }
}

/**
 * @constructor
 * @extends {WebInspector.SearchResultsPane}
 * @param {WebInspector.SearchConfig} searchConfig
 */
WebInspector.FileBasedSearchResultsPane = function(searchConfig)
{
    WebInspector.SearchResultsPane.call(this, searchConfig);

    this._searchResults = [];

    this.element.id ="search-results-pane-file-based";

    this._treeOutlineElement = document.createElement("ol");
    this._treeOutlineElement.className = "search-results-outline-disclosure";
    this.element.appendChild(this._treeOutlineElement);
    this._treeOutline = new TreeOutline(this._treeOutlineElement);

    this._matchesExpandedCount = 0;
}

WebInspector.FileBasedSearchResultsPane.matchesExpandedByDefaultCount = 20;
WebInspector.FileBasedSearchResultsPane.fileMatchesShownAtOnce = 20;

WebInspector.FileBasedSearchResultsPane.prototype = {
    /**
     * @param {WebInspector.UISourceCode} uiSourceCode
     * @param {number} lineNumber
     * @param {number} columnNumber
     * @return {Element}
     */
    _createAnchor: function(uiSourceCode, lineNumber, columnNumber)
    {
        var anchor = document.createElement("a");
        anchor.preferredPanel = "sources";
        anchor.href = sanitizeHref(uiSourceCode.originURL());
        anchor.uiSourceCode = uiSourceCode;
        anchor.lineNumber = lineNumber;
        return anchor;
    },

    /**
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     */
    addSearchResult: function(searchResult)
    {
        this._searchResults.push(searchResult);
        var uiSourceCode = searchResult.uiSourceCode;
        if (!uiSourceCode)
            return;
        var searchMatches = searchResult.searchMatches;

        var fileTreeElement = this._addFileTreeElement(uiSourceCode.fullDisplayName(), searchMatches.length, this._searchResults.length - 1);
    },

    /**
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     * @param {TreeElement} fileTreeElement
     */
    _fileTreeElementExpanded: function(searchResult, fileTreeElement)
    {
        if (fileTreeElement._initialized)
            return;

        var toIndex = Math.min(searchResult.searchMatches.length, WebInspector.FileBasedSearchResultsPane.fileMatchesShownAtOnce);
        if (toIndex < searchResult.searchMatches.length) {
            this._appendSearchMatches(fileTreeElement, searchResult, 0, toIndex - 1);
            this._appendShowMoreMatchesElement(fileTreeElement, searchResult, toIndex - 1);
        } else
            this._appendSearchMatches(fileTreeElement, searchResult, 0, toIndex);

        fileTreeElement._initialized = true;
    },

    /**
     * @param {TreeElement} fileTreeElement
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     * @param {number} fromIndex
     * @param {number} toIndex
     */
    _appendSearchMatches: function(fileTreeElement, searchResult, fromIndex, toIndex)
    {
        var uiSourceCode = searchResult.uiSourceCode;
        var searchMatches = searchResult.searchMatches;

        var regex = createSearchRegex(this._searchConfig.query, !this._searchConfig.ignoreCase, this._searchConfig.isRegex);
        for (var i = fromIndex; i < toIndex; ++i) {
            var lineNumber = searchMatches[i].lineNumber;
            var lineContent = searchMatches[i].lineContent;
            var matchRanges = this._regexMatchRanges(lineContent, regex);

            var anchor = this._createAnchor(uiSourceCode, lineNumber, matchRanges[0].offset);

            var numberString = numberToStringWithSpacesPadding(lineNumber + 1, 4);
            var lineNumberSpan = document.createElement("span");
            lineNumberSpan.addStyleClass("search-match-line-number");
            lineNumberSpan.textContent = numberString;
            anchor.appendChild(lineNumberSpan);

            var contentSpan = this._createContentSpan(lineContent, matchRanges);
            anchor.appendChild(contentSpan);

            var searchMatchElement = new TreeElement("", null, false);
            searchMatchElement.selectable = false;
            fileTreeElement.appendChild(searchMatchElement);
            searchMatchElement.listItemElement.className = "search-match source-code";
            searchMatchElement.listItemElement.appendChild(anchor);
        }
    },

    /**
     * @param {TreeElement} fileTreeElement
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     * @param {number} startMatchIndex
     */
    _appendShowMoreMatchesElement: function(fileTreeElement, searchResult, startMatchIndex)
    {
        var matchesLeftCount = searchResult.searchMatches.length - startMatchIndex;
        var showMoreMatchesText = WebInspector.UIString("Show all matches (%d more).", matchesLeftCount);
        var showMoreMatchesElement = new TreeElement(showMoreMatchesText, null, false);
        fileTreeElement.appendChild(showMoreMatchesElement);
        showMoreMatchesElement.listItemElement.addStyleClass("show-more-matches");
        showMoreMatchesElement.onselect = this._showMoreMatchesElementSelected.bind(this, searchResult, startMatchIndex, showMoreMatchesElement);
    },

    /**
     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
     * @param {number} startMatchIndex
     * @param {TreeElement} showMoreMatchesElement
     */
    _showMoreMatchesElementSelected: function(searchResult, startMatchIndex, showMoreMatchesElement)
    {
        var fileTreeElement = showMoreMatchesElement.parent;
        fileTreeElement.removeChild(showMoreMatchesElement);
        this._appendSearchMatches(fileTreeElement, searchResult, startMatchIndex, searchResult.searchMatches.length);
    },

    /**
     * @param {string} fileName
     * @param {number} searchMatchesCount
     * @param {number} searchResultIndex
     */
    _addFileTreeElement: function(fileName, searchMatchesCount, searchResultIndex)
    {
        var fileTreeElement = new TreeElement("", null, true);
        fileTreeElement.toggleOnClick = true;
        fileTreeElement.selectable = false;

        this._treeOutline.appendChild(fileTreeElement);
        fileTreeElement.listItemElement.addStyleClass("search-result");

        var fileNameSpan = document.createElement("span");
        fileNameSpan.className = "search-result-file-name";
        fileNameSpan.textContent = fileName;
        fileTreeElement.listItemElement.appendChild(fileNameSpan);

        var matchesCountSpan = document.createElement("span");
        matchesCountSpan.className = "search-result-matches-count";
        if (searchMatchesCount === 1)
            matchesCountSpan.textContent = WebInspector.UIString("(%d match)", searchMatchesCount);
        else
            matchesCountSpan.textContent = WebInspector.UIString("(%d matches)", searchMatchesCount);

        fileTreeElement.listItemElement.appendChild(matchesCountSpan);

        var searchResult = this._searchResults[searchResultIndex];
        fileTreeElement.onexpand = this._fileTreeElementExpanded.bind(this, searchResult, fileTreeElement);

        // Expand until at least certain amount of matches is expanded.
        if (this._matchesExpandedCount < WebInspector.FileBasedSearchResultsPane.matchesExpandedByDefaultCount)
            fileTreeElement.expand();
        this._matchesExpandedCount += searchResult.searchMatches.length;

        return fileTreeElement;
    },

    /**
     * @param {string} lineContent
     * @param {RegExp} regex
     * @return {Array.<WebInspector.SearchResult>}
     */
    _regexMatchRanges: function(lineContent, regex)
    {
        regex.lastIndex = 0;
        var match;
        var offset = 0;
        var matchRanges = [];
        while ((regex.lastIndex < lineContent.length) && (match = regex.exec(lineContent)))
            matchRanges.push(new WebInspector.SearchResult(match.index, match[0].length));

        return matchRanges;
    },

    /**
     * @param {string} lineContent
     * @param {Array.<WebInspector.SearchResult>} matchRanges
     */
    _createContentSpan: function(lineContent, matchRanges)
    {
        var contentSpan = document.createElement("span");
        contentSpan.className = "search-match-content";
        contentSpan.textContent = lineContent;
        WebInspector.highlightRangesWithStyleClass(contentSpan, matchRanges, "highlighted-match");
        return contentSpan;
    },

    __proto__: WebInspector.SearchResultsPane.prototype
}

/**
 * @constructor
 * @param {WebInspector.UISourceCode} uiSourceCode
 * @param {Array.<Object>} searchMatches
 */
WebInspector.FileBasedSearchResultsPane.SearchResult = function(uiSourceCode, searchMatches) {
    this.uiSourceCode = uiSourceCode;
    this.searchMatches = searchMatches;
}

/**
 * @type {WebInspector.AdvancedSearchController}
 */
WebInspector.advancedSearchController = null;


text:
/*
 * Location Intelligence APIs
 *
 * Incorporate our extensive geodata into everyday applications, business processes and workflows.
 *
 * OpenAPI spec version: 8.5.0
 *
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * 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.
 */

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace pb.locationIntelligence.Model
{
    /// <summary>
    /// GeoPropertyResponse
    /// </summary>
    [DataContract]
    public partial class GeoPropertyResponse :  IEquatable<GeoPropertyResponse>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GeoPropertyResponse" /> class.
        /// </summary>
        /// <param name="ObjectId">ObjectId.</param>
        /// <param name="Category">Category.</param>
        /// <param name="IndividualValueVariable">IndividualValueVariable.</param>
        /// <param name="MatchedAddress">MatchedAddress.</param>
        public GeoPropertyResponse(string ObjectId = null, string Category = null, List<IndividualValueVariable> IndividualValueVariable = null, MatchedAddress MatchedAddress = null)
        {
            this.ObjectId = ObjectId;
            this.Category = Category;
            this.IndividualValueVariable = IndividualValueVariable;
            this.MatchedAddress = MatchedAddress;
        }

        /// <summary>
        /// Gets or Sets ObjectId
        /// </summary>
        [DataMember(Name="objectId", EmitDefaultValue=false)]
        public string ObjectId { get; set; }
        /// <summary>
        /// Gets or Sets Category
        /// </summary>
        [DataMember(Name="category", EmitDefaultValue=false)]
        public string Category { get; set; }
        /// <summary>
        /// Gets or Sets IndividualValueVariable
        /// </summary>
        [DataMember(Name="individualValueVariable", EmitDefaultValue=false)]
        public List<IndividualValueVariable> IndividualValueVariable { get; set; }
        /// <summary>
        /// Gets or Sets MatchedAddress
        /// </summary>
        [DataMember(Name="matchedAddress", EmitDefaultValue=false)]
        public MatchedAddress MatchedAddress { get; set; }
        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class GeoPropertyResponse {\n");
            sb.Append("  ObjectId: ").Append(ObjectId).Append("\n");
            sb.Append("  Category: ").Append(Category).Append("\n");
            sb.Append("  IndividualValueVariable: ").Append(IndividualValueVariable).Append("\n");
            sb.Append("  MatchedAddress: ").Append(MatchedAddress).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="obj">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object obj)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            return this.Equals(obj as GeoPropertyResponse);
        }

        /// <summary>
        /// Returns true if GeoPropertyResponse instances are equal
        /// </summary>
        /// <param name="other">Instance of GeoPropertyResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GeoPropertyResponse other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
                return false;

            return
                (
                    this.ObjectId == other.ObjectId ||
                    this.ObjectId != null &&
                    this.ObjectId.Equals(other.ObjectId)
                ) &&
                (
                    this.Category == other.Category ||
                    this.Category != null &&
                    this.Category.Equals(other.Category)
                ) &&
                (
                    this.IndividualValueVariable == other.IndividualValueVariable ||
                    this.IndividualValueVariable != null &&
                    this.IndividualValueVariable.SequenceEqual(other.IndividualValueVariable)
                ) &&
                (
                    this.MatchedAddress == other.MatchedAddress ||
                    this.MatchedAddress != null &&
                    this.MatchedAddress.Equals(other.MatchedAddress)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks etc, of course :)
                if (this.ObjectId != null)
                    hash = hash * 59 + this.ObjectId.GetHashCode();
                if (this.Category != null)
                    hash = hash * 59 + this.Category.GetHashCode();
                if (this.IndividualValueVariable != null)
                    hash = hash * 59 + this.IndividualValueVariable.GetHashCode();
                if (this.MatchedAddress != null)
                    hash = hash * 59 + this.MatchedAddress.GetHashCode();
                return hash;
            }
        }
    }

}


text:
select pracId, klient, round(sum("2011"),4) as "2011", round(sum("2012"),4) as "2012", round(sum("2013"),4) as "2013", round(sum("2014"),4) as "2014" from
(
	select pracId,klient,KwotaSprzedazy as "2011" ,null as "2012" ,null as "2013" ,null as "2014"  from
	(
		select sod.SalesPersonID pracId,sod.CustomerID klient,subtotal KwotaSprzedazy,YEAR(sod.orderdate) rok from sales.SalesOrderHeader sod
		where sod.SalesPersonID is not NULL
	) as p1
	where rok=2011
	union
	select pracId,klient,null as "2011" ,KwotaSprzedazy as "2012" ,null as "2013" ,null as "2014"  from
	(
		select sod.SalesPersonID pracId,sod.CustomerID klient,subtotal KwotaSprzedazy,YEAR(sod.orderdate) rok from sales.SalesOrderHeader sod
		where sod.SalesPersonID is not NULL
	) as p2
	where rok=2012
	union
	select pracId,klient,null as "2011" ,null as "2012" ,KwotaSprzedazy as "2013" ,null as "2014" from
	(
		select sod.SalesPersonID pracId,sod.CustomerID klient,subtotal KwotaSprzedazy,YEAR(sod.orderdate) rok from sales.SalesOrderHeader sod
		where sod.SalesPersonID is not NULL
	) as p3
	where rok=2013
	union
	select pracId,klient,null as "2011" ,null as "2012" ,null as "2013" ,KwotaSprzedazy as "2014" from
	(
		select sod.SalesPersonID pracId,sod.CustomerID klient,subtotal KwotaSprzedazy,YEAR(sod.orderdate) rok from sales.SalesOrderHeader sod
		where sod.SalesPersonID is not NULL
	) as p4
	where rok=2014
) as pAll
group by pracId,klient
order by pracId


text:
var searchData=
[
  ['clock_20manager',['Clock Manager',['../group__clock__manager.html',1,'']]]
];


text:
<?php

use frontend\modules\bbii\models\BbiiPost;
use frontend\modules\bbii\models\BbiiMessage;

use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use yii\widgets\ListView;

/* @var $this ForumController */
/* @var $forum BbiiForum */
/* @var $dataProvider ArrayDataProvider */

/* $this->context->bbii_breadcrumbs = array(
    Yii::t('BbiiModule.bbii', 'Forum') => array('forum/index'),
    $forum->name,
); */

$this->title = Yii::t('forum', $forum->name);
$this->params['breadcrumbs'][] = $this->title;

$approvals = BbiiPost::find()->unapproved()->count();
$reports   = BbiiMessage::find()->report()->count();

$item = array(
    array('label' => Yii::t('BbiiModule.bbii', 'Forum'),                             'url' => array('forum/index')),
    array('label' => Yii::t('BbiiModule.bbii', 'Members'),                             'url' => array('member/index')),
    array('label' => Yii::t('BbiiModule.bbii', 'Approval'). ' (' . $approvals . ')','url' => array('moderator/approval'),     'visible' => $this->context->isModerator()),
    array('label' => Yii::t('BbiiModule.bbii', 'Reports').     ' (' . $reports . ')',     'url' => array('moderator/report'),     'visible' => $this->context->isModerator()),
);
?>

<?php
foreach (\Yii::$app->session->getAllFlashes() as $key => $message) {
    echo '
' . $message . '
';
}
\Yii::$app->session->removeAllFlashes();
?>

            <?php echo $this->render('_header', array('item' => $item)); ?>

                            <?php echo $forum->name; ?>

                        <?php if (!(\Yii::$app->user->isGuest || $forum->locked) || $this->context->isModerator()) { ?>

                            <?php // @depricated Kept for referance
                            /* $form = $this->beginWidget('ActiveForm', array(
                                'id' => 'create-topic-form',
                                'action' => array('forum/createTopic'),
                                'enableAjaxValidation' => false,
                            )); ?>
                                <?php echo $form->hiddenField($forum, 'id'); ?>
                                <?php echo Html::submitButton(Yii::t('BbiiModule.bbii','Create new topic'), array('class' => 'bbii-topic-button')); ?>
                            <?php $this->endWidget(); ?>
                            */ ?>
                            <?php
                            $form = ActiveForm::begin([
                                    'action'               => array('createtopic'),
                                    'enableAjaxValidation' => false,
                                    'id'                   => 'create-topic-form',
                            ]);
                                echo $form->field($forum, 'id')->hiddenInput()->label(false);
                                echo Html::submitButton(Yii::t('BbiiModule.bbii', 'Create new topic'), array('class' => 'btn btn-success btn-lg'));
                            ActiveForm::end();
                            ?>

                        <?php }; ?>

            <?php // @depricated 2.7.5 Kept for referance
            /* $this->widget('zii.widgets.CListView', array(
                'id' => 'bbiiTopic',
                'dataProvider' => $dataProvider,
                'itemView' => '_topic',
                'template' => '{pager}{items}{pager}',
                'pager' => array('firstPageCssClass' => 'previous', 'lastPageCssClass' => 'next', 'firstPageLabel' => '<<', 'lastPageLabel' => '>>'),
            ));*/ ?>

                    <?php echo ListView::widget([
                            'dataProvider' => $dataProvider,
                            'id'           => 'bbiiTopic',
                            'itemView'     => '_topic',
                            //'pager'        => array('firstPageCssClass' => 'previous', 'lastPageCssClass' => 'next', 'firstPageLabel' => '<<', 'lastPageLabel' => '>>'),
                            //'template'     => '{pager}{items}{pager}',
                        ]);
                    ?>

            <?php echo $this->render('_forumfooter'); ?>

                <a href = "http://www.yiiframework.com/extension/bbii/" target = "_blank" title = "© 2013-<?php echo date('Y'); ?>
                    <?php echo Yii::t('BbiiModule.bbii','version') . ' ' . $this->context->module->version; ?>">BBii forum software
                ,
                © <?php echo date('Y'); ?>
                    Sourcetoad, LLC.

<?php // @depricated 2.7.5 Kept for referance
/*

    if ($this->context->isModerator()) {
        $this->beginWidget('zii.widgets.jui.CJuiDialog',array(
            'id' => 'dlgTopicForm',
            'theme' => $this->module->juiTheme,
            'options' => array(
                'title' => Yii::t('BbiiModule.bbii', 'Update topic'),
                'autoOpen' => false,
                'modal' => true,
                'width' => 800,
                'show' => 'fade',
                'buttons' => array(
                    Yii::t('BbiiModule.bbii','Change') => 'js:function(){ BBii.changeTopic("' . \Yii::$app->urlManager->createAbsoluteUrl('moderator/changeTopic') . '"); }',
                    Yii::t('BbiiModule.bbii','Cancel') => 'js:function(){ $(this).dialog("close"); }',
                ),
            ),
        ));

            echo $this->render('_topicForm', array('model' => new BbiiTopic));

        $this->endWidget('zii.widgets.jui.CJuiDialog');
    };
    ?>

*/
?>


text:
package blueOrigin;

import java.util.ArrayList;
import java.util.Collection;

public class Spaceship {
    private static final String INVALID_SPACESHIP_NAME = "Invalid spaceship name!";
    private static final String INVALID_CAPACITY = "Invalid capacity!";
    private static final String SPACESHIP_FULL = "Spaceship is full!";
    private static final String ASTRONAUT_EXIST = "Astronaut %s is already in!";
    private static final int ZERO_CAPACITY = 0;

    private int capacity;
    private String name;
    private Collection<Astronaut> astronauts;

    public Spaceship(String name, int capacity) {
        this.setName(name);
        this.setCapacity(capacity);
        this.astronauts = new ArrayList<>();
    }

    public int getCount() {
        return this.astronauts.size();
    }

    public String getName() {
        return this.name;
    }

    public int getCapacity() {
        return this.capacity;
    }

    public void add(Astronaut astronaut) {
        if (astronauts.size() == this.getCapacity()) {
            throw new IllegalArgumentException(SPACESHIP_FULL);
        }

        boolean astronautExists = this.astronauts
                .stream()
                .anyMatch(a -> a.getName().equals(astronaut.getName()));

        if (astronautExists) {
            throw new IllegalArgumentException(String.format(ASTRONAUT_EXIST, astronaut.getName()));
        }

        this.astronauts.add(astronaut);
    }

    public boolean remove(String astronautName) {
        Astronaut astronaut = this.astronauts
                .stream()
                .filter(a -> a.getName().equals(astronautName))
                .findFirst()
                .orElse(null);

        boolean isRemove = this.astronauts.remove(astronaut);
        return isRemove;
    }

    private void setCapacity(int capacity) {
        if (capacity < ZERO_CAPACITY) {
            throw new IllegalArgumentException(INVALID_CAPACITY);
        }

        this.capacity = capacity;
    }

    private void setName(String name) {
        if (name == null || name.trim().isEmpty()) {
            throw new NullPointerException(INVALID_SPACESHIP_NAME);
        }

        this.name = name;
    }
}


text:
package controller

import (
	"encoding/json"
	"net/http"

	"github.com/gorilla/mux"
	"gopkg.in/mgo.v2"
	"gopkg.in/mgo.v2/bson"

	utils "github.com/shijuvar/gokit/examples/bookmark-api/apputil"
	"github.com/shijuvar/gokit/examples/bookmark-api/store"
)

// CreateBookmark insert a new Bookmark.
// Handler for HTTP Post - "/bookmarks
func CreateBookmark(w http.ResponseWriter, r *http.Request) {
	var dataResource BookmarkResource
	// Decode the incoming Bookmark json
	err := json.NewDecoder(r.Body).Decode(&dataResource)
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"Invalid Bookmark data",
			500,
		)
		return
	}
	bookmark := &dataResource.Data
	// Creates a new DatStore value to working with MongoDB store.
	dataStore := NewDataStore()
	// Add to the mgo.Session.Close()
	defer dataStore.Close()
	// Get the mgo.Collection for "bookmarks"
	col := dataStore.Collection("bookmarks")
	// Creates an instance of BookmarkStore
	bookmarkStore := store.BookmarkStore{C: col}
	// Takes user name from Context
	user := r.Context().Value("user")
	if user != nil {
		bookmark.CreatedBy = user.(string)
	}
	// Insert a bookmark document
	err = bookmarkStore.Create(bookmark)
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"Invalid Bookmark data",
			500,
		)
		return
	}
	j, err := json.Marshal(BookmarkResource{Data: *bookmark})
	// If error is occured,
	// Send JSON response using helper function common.DisplayAppError
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"An unexpected error has occurred",
			500,
		)
		return
	}
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(http.StatusCreated)
	// Write the JSON data to the ResponseWriter
	w.Write(j)

}

// GetBookmarks returns all Bookmark documents
// Handler for HTTP Get - "/Bookmarks"
func GetBookmarks(w http.ResponseWriter, r *http.Request) {
	dataStore := NewDataStore()
	defer dataStore.Close()
	col := dataStore.Collection("bookmarks")
	bookmarkStore := store.BookmarkStore{C: col}
	bookmarks := bookmarkStore.GetAll()
	j, err := json.Marshal(BookmarksResource{Data: bookmarks})
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"An unexpected error has occurred",
			500,
		)
		return
	}
	w.WriteHeader(http.StatusOK)
	w.Header().Set("Content-Type", "application/json")
	w.Write(j)
}

// GetBookmarkByID returns a single bookmark document by id
// Handler for HTTP Get - "/Bookmarks/{id}"
func GetBookmarkByID(w http.ResponseWriter, r *http.Request) {
	// Get id from the incoming url
	vars := mux.Vars(r)
	id := vars["id"]

	dataStore := NewDataStore()
	defer dataStore.Close()
	col := dataStore.Collection("bookmarks")
	bookmarkStore := store.BookmarkStore{C: col}

	bookmark, err := bookmarkStore.GetByID(id)
	if err != nil {
		if err == mgo.ErrNotFound {
			w.WriteHeader(http.StatusNoContent)

		} else {
			utils.DisplayAppError(
				w,
				err,
				"An unexpected error has occurred",
				500,
			)

		}
		return
	}
	j, err := json.Marshal(bookmark)
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"An unexpected error has occurred",
			500,
		)
		return
	}
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(http.StatusOK)
	w.Write(j)
}

// GetBookmarksByUser returns all Bookmarks created by a User
// Handler for HTTP Get - "/Bookmarks/users/{id}"
func GetBookmarksByUser(w http.ResponseWriter, r *http.Request) {
	// Get id from the incoming url
	vars := mux.Vars(r)
	user := vars["id"]
	dataStore := NewDataStore()
	defer dataStore.Close()
	col := dataStore.Collection("bookmarks")
	bookmarkStore := store.BookmarkStore{C: col}
	bookmarks := bookmarkStore.GetByUser(user)
	j, err := json.Marshal(BookmarksResource{Data: bookmarks})
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"An unexpected error has occurred",
			500,
		)
		return
	}
	w.WriteHeader(http.StatusOK)
	w.Header().Set("Content-Type", "application/json")
	w.Write(j)
}

// UpdateBookmark update an existing Bookmark document
// Handler for HTTP Put - "/Bookmarks/{id}"
func UpdateBookmark(w http.ResponseWriter, r *http.Request) {
	// Get id from the incoming url
	vars := mux.Vars(r)
	id := bson.ObjectIdHex(vars["id"])
	var dataResource BookmarkResource
	// Decode the incoming Bookmark json
	err := json.NewDecoder(r.Body).Decode(&dataResource)
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"Invalid Bookmark data",
			500,
		)
		return
	}
	bookmark := dataResource.Data
	bookmark.ID = id
	dataStore := NewDataStore()
	defer dataStore.Close()
	col := dataStore.Collection("bookmarks")
	bookmarkStore := store.BookmarkStore{C: col}
	// Update an existing Bookmark document
	if err := bookmarkStore.Update(bookmark); err != nil {
		utils.DisplayAppError(
			w,
			err,
			"An unexpected error has occurred",
			500,
		)
		return
	}
	w.WriteHeader(http.StatusNoContent)

}

// DeleteBookmark deletes an existing Bookmark document
// Handler for HTTP Delete - "/Bookmarks/{id}"
func DeleteBookmark(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	id := vars["id"]
	dataStore := NewDataStore()
	defer dataStore.Close()
	col := dataStore.Collection("bookmarks")
	bookmarkStore := store.BookmarkStore{C: col}
	// Delete an existing Bookmark document
	err := bookmarkStore.Delete(id)
	if err != nil {
		utils.DisplayAppError(
			w,
			err,
			"An unexpected error has occurred",
			500,
		)
		return
	}
	w.WriteHeader(http.StatusNoContent)
}


text:
package com.thoughtworks.go.apiv1.internaldependencypipelines;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.thoughtworks.go.api.ApiController;
import com.thoughtworks.go.api.ApiVersion;
import com.thoughtworks.go.api.spring.ApiAuthenticationHelper;
import com.thoughtworks.go.config.CaseInsensitiveString;
import com.thoughtworks.go.config.CruiseConfig;
import com.thoughtworks.go.server.presentation.FetchArtifactViewHelper;
import com.thoughtworks.go.server.service.GoConfigService;
import com.thoughtworks.go.spark.Routes;
import com.thoughtworks.go.spark.spring.SparkSpringController;
import com.thoughtworks.go.util.SystemEnvironment;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import spark.Request;
import spark.Response;

import static spark.Spark.*;

@Component
public class InternalDependencyPipelinesControllerV1 extends ApiController implements SparkSpringController {

    private final ApiAuthenticationHelper apiAuthenticationHelper;
    private SystemEnvironment systemEnvironment;
    private GoConfigService goConfigService;
    private Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().create();

    @Autowired
    public InternalDependencyPipelinesControllerV1(ApiAuthenticationHelper apiAuthenticationHelper,
                                                   SystemEnvironment systemEnvironment,
                                                   GoConfigService goConfigService) {
        super(ApiVersion.v1);
        this.apiAuthenticationHelper = apiAuthenticationHelper;
        this.systemEnvironment = systemEnvironment;
        this.goConfigService = goConfigService;
    }

    @Override
    public String controllerBasePath() {
        return Routes.InternalDependencyPipelines.BASE;
    }

    @Override
    public void setupRoutes() {
        path(controllerBasePath(), () -> {
            before("", mimeType, this::setContentType);
            before("/*", mimeType, this::setContentType);

            before("", mimeType, this::verifyContentType);
            before("/*", mimeType, this::verifyContentType);

            before("", mimeType, apiAuthenticationHelper::checkUserAnd403);

            get("", mimeType, this::index);
        });
    }

    public String index(Request request, Response response) {
        String pipelineName = request.params("pipeline_name");
        String stageName = request.params("stage_name");

        CruiseConfig config = goConfigService.getMergedConfigForEditing();
        FetchArtifactViewHelper helper = new FetchArtifactViewHelper(systemEnvironment, config, new CaseInsensitiveString(pipelineName), new CaseInsensitiveString(stageName), StringUtils.isNotBlank(request.queryParams("template")));

        response.type("application/json");
        return gson.toJson(helper.autosuggestMap());
    }

}