text:
/**
 * // This is the interface that allows for creating nested lists.
 * // You should not implement it, or speculate about its implementation
 * class NestedInteger {
 *   public:
 *     // Return true if this NestedInteger holds a single integer, rather than a nested list.
 *     bool isInteger() const;
 *
 *     // Return the single integer that this NestedInteger holds, if it holds a single integer
 *     // The result is undefined if this NestedInteger holds a nested list
 *     int getInteger() const;
 *
 *     // Return the nested list that this NestedInteger holds, if it holds a nested list
 *     // The result is undefined if this NestedInteger holds a single integer
 *     const vector<NestedInteger> &getList() const;
 * };
 */
class Solution {
public:
    int depthSumInverse(vector<NestedInteger>& nestedList) {
        stack<pair<NestedInteger, int> > s;
        for (int i = 0; i < nestedList.size(); i++) {
            s.push(make_pair(nestedList[i], 1));
        }
        int height = 1;
        while (!s.empty()) {
            NestedInteger u = s.top().first;
            int depth = s.top().second;
            s.pop();
            height = max(height, depth);
            if (!u.isInteger()) {
                vector<NestedInteger> m = u.getList();
                for (int i = 0; i < m.size(); i++) {
                    s.push(make_pair(m[i], depth + 1));
                }
            }
        }
        int ans = 0;
        for (int i = 0; i < nestedList.size(); i++) {
            s.push(make_pair(nestedList[i], height));
        }
        while (!s.empty()) {
            NestedInteger u = s.top().first;
            int depth = s.top().second;
            s.pop();
            if (u.isInteger()) {
                ans += u.getInteger() * depth;
            } else {
                vector<NestedInteger> m = u.getList();
                for (int i = 0; i < m.size(); i++) {
                    s.push(make_pair(m[i], depth - 1));
                }
            }
        }
        return ans;
    }
};


text:
/* Mowe Menu 1.0 */

var Menu = (function () {

	/**
	 * @param viewport {Element}
	 */
	function Menu(viewport) {

		var self = this;

		this.viewport = viewport;

		this.backdrop = {};
		this.backdrop.defaultClass = 'Menu-backdrop';
		this.backdrop.isAppended = false;

		this.items = [];

		this.isActive = false;

		this.closeAnimationTime = 300;
		this.openAnimationTime = 100;

		this.onMenuItemClick = function (ev) {

			if (self.isActive)
				self.close();

		};

		this.onToggleClick = function (ev) {

			ev.preventDefault();
			self.toggle();

		};

		this.onBackdropClick = function(ev) {

			self.close();

		};

		this.onKeyDown = function (ev) {

			if (self.isActive)
				if (ev.keyCode == 27) {

					ev.preventDefault();
					self.close();

				}

		};

		// auto init the menu instance
		if (this.viewport)
			this.init();

	}

	Menu.prototype.close = function () {

		var self = this;

		if (this.isActive)
			this.isActive = false;

		this.viewport.classList.remove('is-active');
		this.viewport.classList.add('is-animating');

		document.body.classList.remove('has-menu');

		if (this.animationDelay)
			clearTimeout(this.animationDelay);

		this.animationDelay = setTimeout(function () {
			self.viewport.classList.remove('is-animating');
			self.detachBackdrop();
		}, this.closeAnimationTime);

	};

	Menu.prototype.open = function () {

		var self = this;

		if (!this.isActive)
			this.isActive = true;

		this.appendBackdrop();

		this.viewport.classList.add('is-active');
		this.viewport.classList.add('is-animating');

		document.body.classList.add('has-menu');

		if (this.animationDelay)
			clearTimeout(this.animationDelay);

		this.animationDelay = setTimeout(function () {
			self.viewport.classList.remove('is-animating');
		}, this.openAnimationTime);

	};

	Menu.prototype.toggle = function () {

		if (!this.isActive)
			this.open();
		else
			this.close();

	};

	Menu.prototype.detachBackdrop = function () {

		if (this.backdrop.viewport)
			this.backdrop.viewport.remove();

		this.backdrop.isAppended = false;

	};

	Menu.prototype.appendBackdrop = function () {

		if (!this.backdrop.viewport)
			this.backdrop.viewport = this.buildBackdrop();

		this.viewport.insertBefore(this.backdrop.viewport, this.viewport.firstChild);
		this.backdrop.isAppended = true;

	};

	Menu.prototype.buildBackdrop = function () {

		var backdrop = document.createElement('div');
		backdrop.className = this.backdrop.defaultClass;

		backdrop.addEventListener('click', this.onBackdropClick, false);

		return backdrop;

	};

	Menu.prototype.addListeners = function () {

		window.addEventListener('keydown', this.onKeyDown, false);

		if (this.items.length)
			for (var i = this.items.length; i--; )
				this.items[i].addEventListener('click', this.onMenuItemClick, false);

	};

	/**
	 * Find Menu items based on 'MenuItem-select-area' class
	 */
	Menu.prototype.getItems = function () {

		this.items = this.viewport.querySelectorAll('.MenuItem-select-area');

	};

	/**
	 * Find Menu backdrop element, if it not exists, build it
	 */
	Menu.prototype.initBackdrop = function () {

		this.backdrop.viewport = this.viewport.querySelector('.Menu-backdrop');

		if (this.backdrop.viewport) {
			this.backdrop.defaultClass = this.backdrop.viewport.className;
			this.backdrop.viewport.addEventListener('click', this.onBackdropClick, false);
		}

	};

	/**
	 * Find Toggle Buttons and add toggle listeners to this
	 */
	Menu.prototype.getToggleButton = function () {

		var toggleButton = this.viewport.querySelectorAll('.MenuToggleButton');

		for (var i = toggleButton.length; i--; )
			toggleButton[i].addEventListener('click', this.onToggleClick, false);

	};

	/**
	 * Init the Menu
	 */
	Menu.prototype.init = function () {

		this.getToggleButton();
		this.initBackdrop();

		this.getItems();

		this.addListeners();

		// force menu to close
		this.close();

	};

	return Menu;

})();

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows;
using System.Linq;

namespace JPassword.Core
{
    public class Language
    {
        public event Action<int> LanguageChanged;

        public List<CultureInfo> Lib { get; set; }
        public CultureInfo Current { get; set; }

        public Language(params CultureInfo[] cl)
        {
            Lib = new List<CultureInfo>();

            foreach (var item in cl)
                Add(item);

            Current = Properties.Settings.Default.Language;
            Set(Current);
        }

        public Language Add(CultureInfo cl)
        {
            Lib.Add(cl);
            return this;
        }
        public void Set(CultureInfo cl)
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = cl;
            ResourceDictionary dict = new ResourceDictionary();

            try { dict.Source = new Uri(string.Format("Lang/lang.{0}.xaml", cl.Name), UriKind.Relative); }
            catch { dict.Source = new Uri(string.Format("Lang/lang.{0}.xaml", cl.Name), UriKind.Relative); }

            ResourceDictionary oldDict = (from d in Application.Current.Resources.MergedDictionaries
                                          where d.Source != null && d.Source.OriginalString.StartsWith("Lang/lang.")
                                          select d).First();
            if (oldDict != null)
            {
                int ind = Application.Current.Resources.MergedDictionaries.IndexOf(oldDict);
                Application.Current.Resources.MergedDictionaries.Remove(oldDict);
                Application.Current.Resources.MergedDictionaries.Insert(ind, dict);
            }
            else
                Application.Current.Resources.MergedDictionaries.Add(dict);

            Current = cl;
            if (LanguageChanged != null)
                LanguageChanged(0);
        }
    }
}


text:
'use strict'

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var lib = require('../../../lib/dictionaries/jscs/requireSpacesInNamedFunctionExpression.js')

var getFn = caller(lib)

describe('jscs#requireSpacesInNamedFunctionExpression', function() {
  it('converts the rule correctly', function() {
    var fn = getFn()

    expect(fn({
      'beforeOpeningRoundBrace': true,
      'beforeOpeningCurlyBrace': true
    })).to.eql({ 'space-before-function-paren': [2, 'always'] })

    expect(fn({ 'beforeOpeningCurlyBrace': true })).to.be.empty
  })
})


text:
/*
 * encoder.cpp
 *
 *  Created on: Apr 3, 2015
 *      Author: Justin Werre
 */

#include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <sstream>
#include <vector>
#include "../headers/compressor.h"
#include "../headers/encoder.h"
#include "../headers/decompressor.h"
#include "../headers/modelA.h"

void encode(Wavelet &image, std::string file_name)
{
	std::ofstream fout;
	std::string temp_file_name = "temp_e.txt";
	fout.open( temp_file_name.c_str() );

	// write the wavelets out to a temporary file
	for( unsigned int i = 0; i < image.size(); i++ )
	{
		for( unsigned int j = 0; j < image.at( i ).size(); j++ )
		{
			fout << image.at( i ).at( j ) << " ";
		}
		fout << std::endl;
	}

	fout.close();

	// compress the file
    std::ifstream input( temp_file_name.c_str(), std::ifstream::binary );
    std::ofstream output( file_name.c_str(), std::ofstream::binary );
    modelA<int, 16, 14> cmodel;
    cmodel.dump("cmodel", std::clog);
    compress(input, output, cmodel);

    input.close();
    output.close();
	//std::remove( temp_file_name.c_str() );
}

void decode( Wavelet &image, std::string file_name )
{
	std::string temp_file_name = "temp.txt";
	std::ifstream input( file_name.c_str(), std::ifstream::binary );
	std::ofstream output( temp_file_name.c_str(), std::ofstream::binary );
	modelA<int, 16, 14> cmodel;
	cmodel.dump( "cmodel", std::clog );
	decompress( input, output, cmodel );
	input.close();
	output.close();

	// read file into a Wavelet
	int i = 0;
	std::ifstream fin;
	std::string line;
	fin.open( temp_file_name.c_str() );
	image.resize( 0 ); // make sure the image is empty
	while( std::getline( fin, line ) )
	{
		double temp;
		std::stringstream ss(line);
		image.push_back( std::vector<double>() );

		while( ss >> temp )
		{
			image.at( i ).push_back( temp );
		}

		i++;
	}

	// clean up
	fin.close();
	std::remove( temp_file_name.c_str() );
}


text:
'use strict';

describe('Service: DataService', function describe() {
  beforeEach(module('wallabyTestingApp'));

  var DataService;

  beforeEach(inject(function(_DataService_){
    // The injector unwraps the underscores (_) from around the parameter names when matching
    DataService = _DataService_;
  }));

  var expect = chai.expect;

  it('getData function should return data that have property id', inject(function(DataService) {
    var data = DataService.getData();

    expect(data[0]).to.have.property('id');
  }));

  it('getData function should return data that have property name', inject(function(DataService) {
    var data = DataService.getData();

    expect(data[0]).to.have.property('name');
  }));

  it('getData function should return data that have only two properties', inject(function(DataService) {
    var data = DataService.getData();

    expect(Object.keys(data[0])).to.have.length(2);
  }));
});


text:
package com.twineworks.collections.shapemap;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

class ShapeN implements Shape {

  // keys in shape
  public final HashSet<ShapeKey> keys;

  // which indexes they are stored in
  public final HashMap<ShapeKey, Integer> keyIntMap;

  // which other shapes have been derived from this shape
  public final HashMap<HashSet<ShapeKey>, Shape> transitions = new HashMap<>(32, 0.65f);

  private ShapeN(HashSet<ShapeKey> keys, HashMap<ShapeKey, Integer> keyIntMap){
    this.keys = keys;
    this.keyIntMap = keyIntMap;
  }

  public ShapeN(Set<ShapeKey> keys) {
    this.keys = new HashSet<>(keys);
    keyIntMap = new HashMap<>(Math.max(keys.size() * 2, 16), 0.65f);

    int i = 1;
    for (ShapeKey key : keys) {
      keyIntMap.put(key, i);
      i+=1;
    }

  }

  @Override
  public int idxFor(ShapeKey k) {
    Integer val = keyIntMap.get(k);
    if (val == null) return 0;
    return val;
  }

  @Override
  public void init(ShapeMap m) {
    m.storage = new Object[(keys.size()+1)*2];
    m.presence = new ShapeKey[(keys.size()+1)*2];
  }

  @Override
  public void ensureCapacity(ShapeMap m) {

    int targetLen = keys.size()+1;
    int currentLen = m.storage.length;
    Object[] s = m.storage;
    Object[] p = m.presence;

    if (currentLen < targetLen){
      Object[] a = new Object[targetLen*2];
      System.arraycopy(s, 0, a, 0, s.length);
      m.storage = a;

      ShapeKey[] b = new ShapeKey[targetLen*2];
      System.arraycopy(p, 0, b, 0, p.length);
      m.presence = b;
    }

  }

  @Override
  public int size() {
    return keys.size();
  }

  @Override
  public void initConst(ConstShapeMap m) {
    m.storage = new Object[(keys.size()+1)];
  }

  @Override
  @SuppressWarnings("unchecked")
  public synchronized Shape extendBy(Set<ShapeKey> byKeys) {

    // byKeys -> potentially new keys to add to existing
    // toKeys -> new set of all keys in shape

    HashSet<ShapeKey> toKeys = (HashSet<ShapeKey>) keys.clone();
    toKeys.addAll(byKeys);

    // existing transition available?
    Shape shape = transitions.get(toKeys);
    if (shape != null) return shape;

    // no existing transition available, copy shape and add keys to the copy,
    // keeping existing indexes as they are
    HashMap<ShapeKey, Integer> newKeyIntMap = (HashMap<ShapeKey, Integer>) keyIntMap.clone();

    int idx = keys.size()+1;
    for(ShapeKey newKey : byKeys){
      if (!newKeyIntMap.containsKey(newKey)){
        newKeyIntMap.put(newKey, idx);
        idx += 1;
      }
    }

    Shape newShape = new ShapeN(toKeys, newKeyIntMap);
    transitions.put(toKeys, newShape);
    return newShape;

  }

  @Override
  @SuppressWarnings("unchecked")
  public synchronized Shape shrinkBy(Set<ShapeKey> byKeys) {

    // byKeys -> keys to remove from existing
    // toKeys -> new set of all keys in shape

    HashSet<ShapeKey> toKeys = (HashSet<ShapeKey>) keys.clone();
    toKeys.removeAll(byKeys);

    // existing transition available?
    Shape shape = transitions.get(toKeys);
    if (shape != null) return shape;

    // no existing transition available, copy shape and skip keys in the copy,
    // keeping existing indexes as they are
    HashMap<ShapeKey, Integer> newKeyIntMap = (HashMap<ShapeKey, Integer>) keyIntMap.clone();

    for(ShapeKey rmKey : byKeys){
      if (newKeyIntMap.containsKey(rmKey)){
        newKeyIntMap.remove(rmKey);
      }
    }

    Shape newShape = new ShapeN(toKeys, newKeyIntMap);
    transitions.put(toKeys, newShape);
    return newShape;

  }

  @Override
  public Set<ShapeKey> keySet() {
    return keys;
  }

}


text:
#ifndef __WINE_EVCODE_H
#define __WINE_EVCODE_H

#define EC_SYSTEMBASE                       0x00
#define EC_USER                             0x8000

#define EC_COMPLETE                         0x01
#define EC_USERABORT                        0x02
#define EC_ERRORABORT                       0x03
#define EC_TIME                             0x04
#define EC_REPAINT                          0x05
#define EC_STREAM_ERROR_STOPPED             0x06
#define EC_STREAM_ERROR_STILLPLAYING        0x07
#define EC_ERROR_STILLPLAYING               0x08
#define EC_PALETTE_CHANGED                  0x09
#define EC_VIDEO_SIZE_CHANGED               0x0A
#define EC_QUALITY_CHANGE                   0x0B
#define EC_SHUTTING_DOWN                    0x0C
#define EC_CLOCK_CHANGED                    0x0D
#define EC_OPENING_FILE                     0x10
#define EC_BUFFERING_DATA                   0x11
#define EC_FULLSCREEN_LOST                  0x12
#define EC_ACTIVATE                         0x13
#define EC_NEED_RESTART                     0x14
#define EC_WINDOW_DESTROYED                 0x15
#define EC_DISPLAY_CHANGED                  0x16
#define EC_STARVATION                       0x17
#define EC_OLE_EVENT                        0x18
#define EC_NOTIFY_WINDOW                    0x19
#define EC_STREAM_CONTROL_STOPPED           0x1A
#define EC_STREAM_CONTROL_STARTED           0x1B
#define EC_END_OF_SEGMENT                   0x1C
#define EC_SEGMENT_STARTED                  0x1D
#define EC_LENGTH_CHANGED                   0x1E

#endif /* __WINE_EVCODE_H */


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datalakestore.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The display information for a particular operation. */
@Immutable
public final class OperationDisplay {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class);

    /*
     * The resource provider of the operation.
     */
    @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY)
    private String provider;

    /*
     * The resource type of the operation.
     */
    @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY)
    private String resource;

    /*
     * A friendly name of the operation.
     */
    @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY)
    private String operation;

    /*
     * A friendly description of the operation.
     */
    @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
    private String description;

    /**
     * Get the provider property: The resource provider of the operation.
     *
     * @return the provider value.
     */
    public String provider() {
        return this.provider;
    }

    /**
     * Get the resource property: The resource type of the operation.
     *
     * @return the resource value.
     */
    public String resource() {
        return this.resource;
    }

    /**
     * Get the operation property: A friendly name of the operation.
     *
     * @return the operation value.
     */
    public String operation() {
        return this.operation;
    }

    /**
     * Get the description property: A friendly description of the operation.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}


text:
<?php
namespace Futon;

class QueryRow implements QueryRowInterface
{
    protected $_originalData = [];
    protected $_currentData = [];
    protected $_table = null;
    protected $_primaryKey = null;
    protected $_queryRunner = null;

    public function __construct(array $data, string $table, string $primaryKey, QueryRunnerInterface $queryRunner)
    {
        $this->_originalData = $data;
        $this->_currentData = $data;
        $this->_table = $table;
        $this->_primaryKey = $primaryKey;
        $this->_queryRunner = $queryRunner;
    }

    public function __isset($column)
    {
        return isset($this->_currentData[$column]);
    }

    public function __get($column)
    {
        return $this->_currentData[$column];
    }

    public function __set($column, $value)
    {
        $this->_currentData[$column] = $value;
    }

    public function asArray(): array
    {
        return $this->_currentData;
    }

    public function save(): QueryRowInterface
    {
        $values = array_diff($this->_currentData, $this->_originalData);
        foreach ($values as $column=>$value) {
            $values[$column] = $this->_queryRunner->quote($value);
        }

        if (isset($this->_originalData[$this->_primaryKey]) === true) {
            $sql = 'update '.$this->_table.' set ';
            $needsComma = false;
            foreach($values as $column => $value) {
                $sql .= (($needsComma)?',':'').$column.'='.$value;
                $needsComma = true;
            }
            $sql .= ' where '.$this->_primaryKey.'='.$this->_queryRunner->quote($this->_originalData[$this->_primaryKey]);
            $this->_queryRunner->execute($sql);
        } else {
            $sql = 'insert into '.$this->_table.' ';
            $sql .= '('.implode(',', array_keys($values)).')';
            $sql .= ' values ';
            $sql .= '('.implode(',', array_values($values)).')';
            $this->_queryRunner->execute($sql);
            $this->_currentData[$this->_primaryKey] = $this->_queryRunner->lastInsertId();
        }
        $this->_originalData = $this->_currentData;
        return $this;
    }

    public function delete()
    {
        if (isset($this->_currentData[$this->_primaryKey]) === false) {
            throw new \Exception('Cannot call Futon\\QueryRow->delete unless primary key is set');
        }
        $sql = 'delete from '.$this->_table.' where '.$this->_primaryKey.'='.$this->_queryRunner->quote($this->_currentData[$this->_primaryKey]);
        $this->_queryRunner->execute($sql);
        return $this;
    }

    public function set(array $fields, array $source = null): QueryRowInterface
    {
        $source = $source ?? $_REQUEST;
        foreach ($fields as $field) {
            $this->__set($field, ($source[$field] ?? null));
        }
        return $this;
    }

    public function isDirty(): bool
    {
        return (count(array_diff($this->_currentData, $this->_originalData)) > 0);
    }

    public function found(): bool
    {
        return count(array_keys($this->_currentData)) > 0;
    }

    public function notFound(): bool
    {
        return count(array_keys($this->_currentData)) == 0;
    }
}


text:
using Newtonsoft.Json;

namespace PubNub.Async.Presence.Models
{
	public class Subscriber<TState> where TState : class
	{
		[JsonProperty("uuid")]
		public string Uuid { get; set; }

		[JsonProperty("state")]
		public TState State { get; set; }
	}
}


text:
**VERSION 1.4.0** (latest)

* Feat: Upgrade Bootstrap to 3.3.x
* Feat: Update Font-awesome, jquery-steps, to the latest version
* Feat: Upgrade "seiyria-bootstrap-slider" to latest version, i.e. 4.0.1
* Feat: Upgrade weather-icons to latest version, i.e. 1.2.1
* Feat: Upgrade bourbon to 4.0.x
* Feat: Update NPM packages to latest version
* Fix: Fix fullscreen page style on mobile, thanks @paiwan
* Fix: Update table markup, remove buggy responsive table by Zurb
* Fix: Hide select arrow in Firefox 30+, thanks @calidae
* Feat: Upgrade ng-tags-input to latest version, i.e. 2.1.x
* Chore: Update index.html to make it HTML5 valid
* Chore: Allow you also to run it with "grunt serve"
* Chore: Remove intro.js
* Chore: Some clean up

**VERSION 1.3.0** (08/20/2014)

* Feature: Upgrade Bootstrap to 3.2.x
* Feature: Upgrade ngmap to 0.6.x
* Fix: Layout fix for LESS

**VERSION 1.2.1** (06/17/2014)

* Feature: Better timeline style on phone
* Fix: Fix radio box weird position in Firefox and Safari
* Fix: Fix dropdown button fail to open bug

**VERSION 1.2** (06/06/2014)

* Feature: Add LESS CSS (Now you can use Sass or LESS)
* Feature: allowing user to add plain js in scripts folder
* Fix: Fix pagination component for dynamic table page
* Fix: Make Select dropdown icon clickable as well
* Fix: Turn cursor into pointer when hover over radio and checkbox
* Fix: Fix a typo for validation page
* Docs: Update docs
* Chore: Update invoice, 500 page style
* Chore: Update some UI elements

**VERSION 1.1** (05/22/2014)

* Feature: Add landinge page
* Chore: Update HTML markup, thanks @coderdude

**VERSION 1.0.1** (05/21/2014)

* Fix: Fix textAngular 404 error caused by its new version
* Fix: disable morris chart auto resize cause firefox(29.0.1) to freeze problem
* Feature: Update jQuery to 2.x, ui-bootrap to 0.11.x
* Chore: Clean up bower.json file


text:
package cloud::azure::network::networkinterface::mode::discovery;

use base qw(cloud::azure::management::monitor::mode::discovery);

use strict;
use warnings;

sub check_options {
    my ($self, %options) = @_;
    $self->SUPER::check_options(%options);

    $self->{namespace} = 'Microsoft.Network';
    $self->{type} = 'networkInterfaces';
}

1;

__END__

=head1 MODE

Network Interface discovery.

=over 8

=item B<--resource-group>

Specify resource group.

=item B<--location>

Specify location.

=item B<--prettify>

Prettify JSON output.

=back

=cut


text:
package com.intellij.lang.javascript;

import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import consulo.annotation.access.RequiredReadAction;
import consulo.javascript.icon.JavaScriptIconGroup;
import consulo.javascript.lang.JavaScriptFileTypeWithVersion;
import consulo.javascript.lang.JavaScriptLanguage;
import consulo.javascript.lang.StandardJavaScriptVersions;
import consulo.javascript.localize.JavaScriptLocalize;
import consulo.javascript.module.extension.JavaScriptModuleExtension;
import consulo.lang.LanguageVersion;
import consulo.localize.LocalizeValue;
import consulo.ui.image.Image;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * User: max
 * Date: Jan 27, 2005
 * Time: 6:02:59 PM
 */
public class JavaScriptFileType extends LanguageFileType implements JavaScriptFileTypeWithVersion
{
	public static final JavaScriptFileType INSTANCE = new JavaScriptFileType();

	public JavaScriptFileType()
	{
		super(JavaScriptLanguage.INSTANCE);
	}

	@Override
	@Nonnull
	public String getId()
	{
		return "JavaScript";
	}

	@Override
	@Nonnull
	public LocalizeValue getDescription()
	{
		return JavaScriptLocalize.javascriptFiletypeDescription();
	}

	@Override
	@Nonnull
	public String getDefaultExtension()
	{
		return "js";
	}

	@Override
	public Image getIcon()
	{
		return JavaScriptIconGroup.javaScript();
	}

	@RequiredReadAction
	@Nonnull
	@Override
	public LanguageVersion getLanguageVersion(@Nullable Module module, @Nullable VirtualFile virtualFile)
	{
		if(module == null)
		{
			return StandardJavaScriptVersions.getInstance().getDefaultVersion();
		}

		JavaScriptModuleExtension<?> extension = ModuleUtilCore.getExtension(module, JavaScriptModuleExtension.class);
		if(extension != null)
		{
			return extension.getLanguageVersion();
		}
		return StandardJavaScriptVersions.getInstance().getDefaultVersion();
	}
}


text:
<?php

namespace Fhaculty\Graph\Exception;

use Fhaculty\Graph;

class OutOfBoundsException extends \OutOfBoundsException implements Graph\Exception
{
}


text:
FactoryBot.define do
  factory :static_page do
    sequence(:title) {|n| "Page #{n}"}
    sequence(:body) {|n| "My Static Page #{n}"}
  end
end


text:
package com.github.gwt.user.client.ui;

import com.github.gwt.user.client.ui.resources.DateTimeBoxResources;
import com.github.gwt.user.client.ui.resources.DateTimeBoxResourcesImpl;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.logical.shared.*;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.*;

import java.util.Date;

/**
 * Input box for date value (with date time picker).
 *
 * @author Rinat Enikeev (rinat.enikeev[at]gmail[dot]com)
 * @version %I%, %G%
 * @since 1.0
 */
public class DateTimeBox extends Composite implements HasValue<Date> {

    interface DateTimeBoxUiBinder
            extends UiBinder<HorizontalPanel, DateTimeBox> {}
    private static DateTimeBoxUiBinder ourUiBinder
            = GWT.create(DateTimeBoxUiBinder.class);

    private static final DateTimeBoxResources DEFAULT_RESOURCES
            = DateTimeBoxResourcesImpl.dateTimeBoxResources();

    static {
        DEFAULT_RESOURCES.style().ensureInjected();
    }

    //region UiFields
    @UiField
    ClearDateBox box;
    @UiField(provided = true)
    FocusWidget button;
    //endregion

    private PopupPanel popup;
    private DateTimeBoxResources resources;
    private DateTimePicker dateTimePicker;

    @UiConstructor
    public DateTimeBox() {
        this(null);
    }

    public DateTimeBox(FocusWidget calendarButton) {
        this(calendarButton, DEFAULT_RESOURCES);
    }

    public DateTimeBox(FocusWidget calendarButton,
                       DateTimeBoxResources resources) {

        if (resources == null) {
            this.resources = DEFAULT_RESOURCES;
        } else if (resources != DEFAULT_RESOURCES) {
            resources.style().ensureInjected();
            this.resources = resources;
        } else {
            this.resources = DEFAULT_RESOURCES;
        }

        if (calendarButton == null) {
            button = defaultButton();
        } else {
            button = calendarButton;
        }

        initWidget(ourUiBinder.createAndBindUi(this));

        assert resources != null;
        getWidget().setStyleName(resources.style().dateTimeBox());
        button.setStyleName(resources.style().calButton());

        initPopup(box);
    }

    @UiHandler("button")
    void onButtonClick(ClickEvent event) {
        popup.showRelativeTo(button);
    }

    public ClearBoxSpecification<String> clearBox() {
        return box;
    }

    public DateTimePickerSpecification dateTimePicker() {
        return dateTimePicker;
    }

    //region HasValue<Date>
    @Override
    public Date getValue() {
        return box.getDate();
    }

    @Override
    public void setValue(Date value) {
        setValue(value, false);
    }

    @Override
    public void setValue(Date value, boolean fireEvents) {
        Date oldValue = box.getDate();
        box.setDate(value);
        if (fireEvents) {
            ValueChangeEvent.fireIfNotEqual(this, oldValue, value);
        }
    }

    @Override
    public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Date> handler) {
        return addHandler(handler, ValueChangeEvent.getType());
    }
    //endregion HasValue<Date>

    private FocusWidget defaultButton() {
        PushButton button = new PushButton();
        Image up = new Image(resources.calButton().up());
        button.getUpFace().setImage(up);
        Image upHover = new Image(resources.calButton().upHover());
        button.getUpHoveringFace().setImage(upHover);
        Image upDisable = new Image(resources.calButton().upDisabled());
        button.getUpDisabledFace().setImage(upDisable);
        Image down = new Image(resources.calButton().down());
        button.getDownFace().setImage(down);
        Image downHover = new Image(resources.calButton().downHover());
        button.getDownHoveringFace().setImage(downHover);
        Image downDsbl = new Image(resources.calButton().downDsbld());
        button.getDownDisabledFace().setImage(downDsbl);
        return button;
    }

    private void initPopup(UIObject autoHidePartner) {
        this.popup = new PopupPanel(true);
        popup.addAutoHidePartner(autoHidePartner.getElement());
        popup.setStyleName(resources.style().popup());

        dateTimePicker = initPicker();
        popup.setWidget(dateTimePicker);

        @SuppressWarnings("deprecation")
        Element popupContent = DOM.getParent(dateTimePicker.getElement());
        popupContent.setAttribute("style", "height: 100%;");

        popup.addCloseHandler(new CloseHandler<PopupPanel>() {
            @Override
            public void onClose(CloseEvent<PopupPanel> event) {
                delegateEvent(dateTimePicker, event);
            }
        });
    }

    @SuppressWarnings("deprecation")
    protected DateTimePicker initPicker() {
        Date initial = new Date();
        initial.setMinutes(0);
        initial.setSeconds(0);
        final DateTimePicker dateTimePicker = new DateTimePicker(this, initial);
        dateTimePicker.addSelectionHandler(new SelectionHandler<Date>() {
            @Override
            public void onSelection(SelectionEvent<Date> event) {
                setValue(event.getSelectedItem(), true);
            }
        });
        dateTimePicker.addCloseHandler(new CloseHandler<Widget>() {
            @Override
            public void onClose(CloseEvent<Widget> event) {
                setValue(dateTimePicker.getSelectedValue(), true);
                popup.hide();
            }
        });
        return dateTimePicker;
    }

}


text:
#include <jni.h>
#include <v8.h>

#include <AndroidUtil.h>
#include <KrollBindings.h>
#include <V8Util.h>

#include "BootstrapJS.cpp"
#include "KrollGeneratedBindings.cpp"

#define TAG "com.alfonsojanus.beacons"

using namespace v8;

static Persistent<Object> bindingCache;

static Handle<Value> JanusBeacons_getBinding(const Arguments& args)
{
	HandleScope scope;

	if (args.Length() == 0) {
		return ThrowException(Exception::Error(String::New("JanusBeacons.getBinding requires 1 argument: binding")));
	}

	if (bindingCache.IsEmpty()) {
		bindingCache = Persistent<Object>::New(Object::New());
	}

	Handle<String> binding = args[0]->ToString();

	if (bindingCache->Has(binding)) {
		return bindingCache->Get(binding);
	}

	String::Utf8Value bindingValue(binding);

	LOGD(TAG, "Looking up binding: %s", *bindingValue);

	titanium::bindings::BindEntry *extBinding = ::JanusBeaconsBindings::lookupGeneratedInit(
		*bindingValue, bindingValue.length());

	if (!extBinding) {
		LOGE(TAG, "Couldn't find binding: %s, returning undefined", *bindingValue);
		return Undefined();
	}

	Handle<Object> exports = Object::New();
	extBinding->bind(exports);
	bindingCache->Set(binding, exports);

	return exports;
}

static void JanusBeacons_init(Handle<Object> exports)
{
	HandleScope scope;

	for (int i = 0; titanium::natives[i].name; ++i) {
		Local<String> name = String::New(titanium::natives[i].name);
		Handle<String> source = IMMUTABLE_STRING_LITERAL_FROM_ARRAY(
			titanium::natives[i].source, titanium::natives[i].source_length);

		exports->Set(name, source);
	}

	exports->Set(String::New("getBinding"), FunctionTemplate::New(JanusBeacons_getBinding)->GetFunction());
}

static void JanusBeacons_dispose()
{
	HandleScope scope;
	if (bindingCache.IsEmpty()) {
		return;
	}

	Local<Array> propertyNames = bindingCache->GetPropertyNames();
	uint32_t length = propertyNames->Length();

	for (uint32_t i = 0; i < length; ++i) {
		String::Utf8Value binding(propertyNames->Get(i));
		int bindingLength = binding.length();

		titanium::bindings::BindEntry *extBinding =
			::JanusBeaconsBindings::lookupGeneratedInit(*binding, bindingLength);

		if (extBinding && extBinding->dispose) {
			extBinding->dispose();
		}
	}

	bindingCache.Dispose();
	bindingCache = Persistent<Object>();
}

static titanium::bindings::BindEntry JanusBeaconsBinding = {
	"com.alfonsojanus.beacons",
	JanusBeacons_init,
	JanusBeacons_dispose
};

// Main module entry point
extern "C" JNIEXPORT void JNICALL
Java_com_alfonsojanus_beacons_JanusBeaconsBootstrap_nativeBootstrap
	(JNIEnv *env, jobject self)
{
	titanium::KrollBindings::addExternalBinding("com.alfonsojanus.beacons", &JanusBeaconsBinding);
	titanium::KrollBindings::addExternalLookup(&(::JanusBeaconsBindings::lookupGeneratedInit));
}


text:
@interface OwnerCheckingDetailViewController ()<UITableViewDelegate,UITableViewDataSource,UIScrollViewDelegate>
@property(nonatomic,strong) Helper_DetailV *detailView;
@property(nonatomic,copy) UITableView *tableView;
@property(nonatomic,strong) HelpDetailModel *detailModel;
@property(nonatomic,strong) UIButton *helpBtn;
@property(nonatomic,strong) UIButton *agreeBtn;
@property(nonatomic,strong) UIButton *disAgreeBtn;
@property(nonatomic,strong) UIView *bgView;
@property(nonatomic,strong) UIScrollView *scrollView;
@property(nonatomic,strong) UIView *grayView;
@property(nonatomic,strong) memberInfo *memberView;
@property(nonatomic,strong) NSString *chooseID;
@property(nonatomic,assign) NSInteger index;

@end

@implementation OwnerCheckingDetailViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self setNavi];
    [self loadData];

    [[UIApplication sharedApplication] setStatusBarStyle:(UIStatusBarStyleDefault)];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self setUI];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cooperation:) name:@"cooperation" object:nil];
}

- (void)setNavi{
    [self initNav:_titleStr color:kWhite imgName:@"back_black"];
    self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:kDarkText,NSForegroundColorAttributeName,[UIFont systemFontOfSize:18],NSFontAttributeName, nil];
    self.view.backgroundColor = kMainGray;
}

- (void)loadData{
    NSString *url;
    NSDictionary *dic;
    if (_flag) {
        url = @"IosIndex/myProjectDetail";
        dic = @{@"p_id":_ID};
    }else{
        url = @"IosIndex/myFviewDetail";
        dic = @{@"p_id":_ID,@"u_id":[Utils getValueForKey:@"u_id"]};
    }
    [self.view loadingOnAnyView];
    [HYBNetworking getWithUrl:url refreshCache:NO params:dic success:^(id response) {
        SESSIONSTATE state = [Utils getStatus:response View:self showSuccessMsg:NO showErrorMsg:YES];
        if (state == SESSIONSUCCESS) {
            NSError *error;
            _detailModel = [[HelpDetailModel alloc] initWithDictionary:response[@"data"] error:&error];
            if (!error) {
                [_detailView initWithModel:_detailModel];
                if ([_detailModel.Status integerValue] != 2) {
                    _helpBtn.hidden = YES;
                }
                [_tableView reloadData];
                if (_detailModel.list.count > 7) {
                    _scrollView.contentSize = CGSizeMake(_detailModel.list.count * ((ScreenW - 30) / 7), 50);
                }else{
                    _scrollView.contentSize = CGSizeMake(ScreenW, 50);
                }
                [self creatImgList];
                [self buttonHiddenOrShow];
            }
        }
    } fail:^(NSError *error) {
        [self.view removeAnyView];
    }];
}

- (void)buttonHiddenOrShow{
    if (!_flag) {
        if ([[Utils getValueForKey:@"u_id"] integerValue] == [_detailModel.F_id integerValue]) {
            if ([_detailModel.F_review boolValue]) {
                _bgView.hidden = YES;
                _tableView.frame = CGRectMake(0, 0, ScreenW, ScreenH - 64);
                UIView *headView = _tableView.tableHeaderView;
                CGRect frame = headView.frame;
                frame.size.height = 433;
                headView.frame = frame;
                [_tableView beginUpdates];
                _tableView.tableHeaderView = headView;
                [_tableView endUpdates];
            }else{
                _bgView.hidden = NO;
            }
        }else{
            if ([_detailModel.Ff_review boolValue]) {
                _bgView.hidden = YES;
                _tableView.frame = CGRectMake(0, 0, ScreenW, ScreenH - 64);
                UIView *headView = _tableView.tableHeaderView;
                CGRect frame = headView.frame;
                frame.size.height = 433;
                headView.frame = frame;
                [_tableView beginUpdates];
                _tableView.tableHeaderView = headView;
                [_tableView endUpdates];
            }else{
                _bgView.hidden = NO;
            }
        }
    }else{
        if (_detailModel.list.count == 0 || [_detailModel.Status integerValue] == 3 || [_detailModel.Status integerValue] == 4 || [_detailModel.F_review integerValue] == 0) {
            _bgView.hidden = YES;
            _tableView.frame = CGRectMake(0, 0, ScreenW, ScreenH - 64);
            UIView *headView = _tableView.tableHeaderView;
            CGRect frame = headView.frame;
            frame.size.height = 433;
            headView.frame = frame;
            [_tableView beginUpdates];
            _tableView.tableHeaderView = headView;
            [_tableView endUpdates];
        }else{
            _bgView.hidden = NO;
        }
    }
}

- (void)creatImgList{
    for (int i = 0; i < _detailModel.list.count; i++) {
        [_scrollView addSubview:({
            UIButton *btn = [UIButton buttonWithType:(UIButtonTypeCustom)];
            btn.layer.cornerRadius = 20;
            btn.layer.masksToBounds = YES;
            btn.frame = CGRectMake(15 + i * ((ScreenW - 30) / 7), 5, 40, 40);
            [btn setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageUrl([_detailModel.list[i] face])]]] forState:(UIControlStateNormal)];
            btn.tag = 100 + i;
            [btn addTarget:self action:@selector(showMessege:) forControlEvents:(UIControlEventTouchUpInside)];
            btn;
        })];
    }
}

- (void)showMessege:(UIButton *)btn{
    HelpDetailListModel *model = _detailModel.list[btn.tag - 100];
    _chooseID = model.Uid;
    [self.view addSubview:({
        _grayView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenW, ScreenH)];
        _grayView.backgroundColor = [UIColor blackColor];
        _grayView.alpha = 0;
        _grayView;
    })];

    [self.view addSubview:({
        _memberView = [[[NSBundle mainBundle] loadNibNamed:@"memberInfo" owner:nil options:nil] firstObject];
        _memberView.frame = CGRectMake(0, 0, ScreenW * 0.8, 300);
        _memberView.center = CGPointMake(ScreenW/2, -ScreenH/2);;
        _memberView.alpha = 0;
        [_memberView configureWithName:model.name icon:imageUrl(model.face) telphone:@"110" gener:@"男" age:@"18" type:@"电子信息服务"];
        [_memberView.sureBtn setTitle:@"合作" forState:(UIControlStateNormal)];
        _memberView;
    })];

    [UIView animateWithDuration:0.5 animations:^{
        _memberView.center = CGPointMake(ScreenW/2, ScreenH/2 -30);
        _grayView.alpha = 0.6;
        _memberView.alpha = 1;
    } completion:^(BOOL finished) {

    }];
}

- (void)cooperation:(NSNotification *)notification{
    if (notification.object) {
        [UIView animateWithDuration:0.5 animations:^{
            _memberView.center = CGPointMake(ScreenW/2, -ScreenH/2 -30);
            _grayView.alpha = 0;
            _memberView.alpha = 0;
        } completion:^(BOOL finished) {
            [_grayView removeFromSuperview];
            [_memberView removeFromSuperview];
        }];
        return;
    }
    [self.view loadingOnAnyView];
    [HYBNetworking postWithUrl:@"IosIndex/choose" refreshCache:NO params:@{@"p_id":_ID ,@"choose_id":_chooseID} success:^(id response) {
        SESSIONSTATE state = [Utils getStatus:response View:self showSuccessMsg:YES showErrorMsg:YES];
        if (state == SESSIONSUCCESS) {
            [UIView animateWithDuration:0.5 animations:^{
                _memberView.center = CGPointMake(ScreenW/2, -ScreenH/2 -30);
                _grayView.alpha = 0;
                _memberView.alpha = 0;
            } completion:^(BOOL finished) {
                [_grayView removeFromSuperview];
                [_memberView removeFromSuperview];
                [self loadData];
                for (UIButton *btn in _scrollView.subviews) {
                    btn.enabled = NO;
                }
            }];
        }
    } fail:^(NSError *error) {
        [self.view removeAnyView];
    }];

}

- (void)setUI{

    [self.view addSubview:({
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenW, ScreenH - 64 - 50) style:(UITableViewStylePlain)];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.backgroundColor = kMainGray;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        [_tableView registerNib:[UINib nibWithNibName:@"CheckingDetailTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"cell"];
        _tableView;
    })];

    [self.view addSubview:({
        _detailView = [[[NSBundle mainBundle] loadNibNamed:@"Helper_DetailV" owner:nil options:nil] firstObject];
        _detailView.frame = CGRectMake(0, 0, ScreenW, 432);
        _detailView;
    })];
    _tableView.tableHeaderView = _detailView;
    [_detailView.icon sd_setImageWithURL:[NSURL URLWithString:imageUrl(_img)] placeholderImage:[UIImage imageNamed:@"placeholder_person"]];

    [self.view addSubview:({
        _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, ScreenH - 64 - 50, ScreenW, 50)];
        _bgView.backgroundColor = [UIColor whiteColor];
        _bgView;
    })];

    if (!_flag) {
        [_bgView addSubview:({
            _agreeBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
            _agreeBtn.frame = CGRectMake(0, 0, ScreenW/2, 50);
            [_agreeBtn setTitle:@"同意" forState:(UIControlStateNormal)];
            [_agreeBtn setTitleColor:kMainColor forState:(UIControlStateNormal)];
            _agreeBtn.titleLabel.font = kFont(14);
            [_agreeBtn addTarget:self action:@selector(agree) forControlEvents:(UIControlEventTouchUpInside)];
            _agreeBtn;
        })];

        [_bgView addSubview:({
            _disAgreeBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
            _disAgreeBtn.frame = CGRectMake(ScreenW/2, 0, ScreenW/2, 50);
            [_disAgreeBtn setTitle:@"拒绝" forState:(UIControlStateNormal)];
            [_disAgreeBtn setTitleColor:kMainColor forState:(UIControlStateNormal)];
            _disAgreeBtn.titleLabel.font = kFont(14);
            [_disAgreeBtn addTarget:self action:@selector(disAgree) forControlEvents:(UIControlEventTouchUpInside)];
            _disAgreeBtn;
        })];
    }else{
        [_bgView addSubview:({
            _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(15, 0, ScreenW, 50)];
            _scrollView;
        })];
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    if ([_detailModel.F_review integerValue] == 1) {
        if ([_detailModel.Ff_id boolValue]) {
            if ([_detailModel.Tid boolValue]) {
                _index = 4;
            }else{
                _index = 3;
            }
        }else{
            if ([_detailModel.Tid boolValue]) {
                _index = 3;
            }else{
                _index = 2;
            }
        }
    }else{
        _index = 2;
    }
    if (!_detailModel) {
        _index = 0;
    }
    return _index;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    CheckingDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    if (indexPath.row == 0) {
        cell.topHeight.constant = 25;
        [cell.icon sd_setImageWithURL:[NSURL URLWithString:imageUrl(_img)] placeholderImage:[UIImage imageNamed:@"placeholder_person"]];
        cell.username.text = _detailModel.U_name;
        cell.time.text = [Utils TransformTimestampWith:_detailModel.Addtime dateDormate:@"yyyy.MM.dd HH:mm"];
    }else if (indexPath.row == 1){
        [cell.icon sd_setImageWithURL:[NSURL URLWithString:imageUrl(_detailModel.F_id_face)] placeholderImage:[UIImage imageNamed:@"placeholder_person"]];
        cell.username.text = _detailModel.F_id_name;
        if ([_detailModel.F_review integerValue] == 0) {
            cell.statusLabel.text = @"审批中";
            cell.statusLabel.textColor = [UIColor colorWithHex:0xff6d06];
            cell.statusImg.image = [UIImage imageNamed:@"owner_thking"];
            cell.line.hidden = YES;
            cell.time.textColor = [UIColor colorWithHex:0xff6d06];
            CGFloat time = [[NSDate new] timeIntervalSince1970] - [_detailModel.Addtime floatValue];
            cell.time.text = [self getIntervalTime:(NSInteger)time];
        }else if([_detailModel.F_review integerValue] == 1){
            cell.statusLabel.text = @"已同意";
            cell.statusLabel.textColor = [UIColor darkGrayColor];
            cell.statusImg.image = [UIImage imageNamed:@"owner_agree"];
            if ([_detailModel.Ff_id boolValue]) {
                cell.line.hidden = NO;
            }else{
                if ([_detailModel.Tid integerValue] == 0) {
                    cell.line.hidden = YES;
                }else{
                    cell.line.hidden = NO;
                }
            }
            [cell.contentView addSubview:({
                CGFloat height = [TXUtilsString AutoHeight:_detailModel.F_no font:14.0 andCGsize:CGSizeMake(ScreenW - 70, 1000)];
                UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(62, 90, ScreenW  - 90, height)];
                label.font = kFont(14.0);
                label.textColor = [UIColor colorWithHex:0x666666];
                label.text = _detailModel.F_no;
                label;
            })];
            cell.time.textColor = [UIColor darkGrayColor];
            cell.time.text = [Utils TransformTimestampWith:_detailModel.F_time dateDormate:@"yyyy.MM.dd HH:mm"];
        }else{
            [cell.contentView addSubview:({
                CGFloat height = [TXUtilsString AutoHeight:_detailModel.F_no font:14.0 andCGsize:CGSizeMake(ScreenW - 70, 1000)];
                UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(62, 90, ScreenW  - 90, height)];
                label.font = kFont(14.0);
                label.textColor = [UIColor colorWithHex:0x666666];
                label.text = _detailModel.F_no;
                label;
            })];
            cell.statusLabel.text = @"已拒绝";
            cell.statusLabel.textColor = [UIColor colorWithHex:0xff6d06];
            cell.statusImg.image = [UIImage imageNamed:@"owner_agree"];
            cell.line.hidden = YES;
            cell.time.textColor = [UIColor colorWithHex:0xff6d06];
            cell.time.text = [Utils TransformTimestampWith:_detailModel.F_time dateDormate:@"yyyy.MM.dd HH:mm"];
        }
    }
    if(indexPath.row == 2 && [_detailModel.Ff_id integerValue] != 0){
        [cell.icon sd_setImageWithURL:[NSURL URLWithString:imageUrl(_detailModel.Ff_id_face)] placeholderImage:[UIImage imageNamed:@"placeholder_person"]];
        cell.username.text = _detailModel.Ff_id_name;
        if ([_detailModel.Ff_review integerValue] == 0) {
            cell.statusLabel.text = @"审批中";
            cell.statusLabel.textColor = [UIColor colorWithHex:0xff6d06];
            cell.statusImg.image = [UIImage imageNamed:@"owner_thking"];
            cell.line.hidden = YES;
            cell.time.textColor = [UIColor colorWithHex:0xff6d06];
            CGFloat time = [[NSDate new] timeIntervalSince1970] - [_detailModel.F_time floatValue];
            cell.time.text = [self getIntervalTime:(NSInteger)time];
        }else if([_detailModel.Ff_review integerValue] == 1){
            if ([_detailModel.Tid integerValue] == 0) {
                cell.line.hidden = YES;
            }else{
                cell.line.hidden = NO;
            }
            cell.statusLabel.text = @"已同意";
            [cell.contentView addSubview:({
                CGFloat height = [TXUtilsString AutoHeight:_detailModel.Ff_no font:14.0 andCGsize:CGSizeMake(ScreenW - 70, 1000)];
                UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(62, 90, ScreenW  - 90, height)];
                label.font = kFont(14.0);
                label.textColor = [UIColor colorWithHex:0x666666];
                label.text = _detailModel.Ff_no;
                label;
            })];
            cell.statusLabel.textColor = [UIColor darkGrayColor];
            cell.statusImg.image = [UIImage imageNamed:@"owner_agree"];
            cell.time.textColor = [UIColor darkGrayColor];
            cell.time.text = [Utils TransformTimestampWith:_detailModel.Ff_time dateDormate:@"yyyy.MM.dd HH:mm"];
        }else{
            cell.line.hidden = YES;
            cell.statusLabel.text = @"已拒绝";
            [cell.contentView addSubview:({
                CGFloat height = [TXUtilsString AutoHeight:_detailModel.Ff_no font:14.0 andCGsize:CGSizeMake(ScreenW - 70, 1000)];
                UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(62, 90, ScreenW  - 90, height)];
                label.font = kFont(14.0);
                label.textColor = [UIColor colorWithHex:0x666666];
                label.text = _detailModel.Ff_no;
                label;
            })];
            cell.statusLabel.textColor = [UIColor colorWithHex:0xff6d06];
            cell.statusImg.image = [UIImage imageNamed:@"owner_agree"];
            cell.time.textColor = [UIColor colorWithHex:0xff6d06];
            cell.time.text = [Utils TransformTimestampWith:_detailModel.Ff_time dateDormate:@"yyyy.MM.dd HH:mm"];
        }
    }
    if(indexPath.row == 3 || (indexPath.row == 2 && [_detailModel.Ff_id integerValue] == 0)){
        cell.username.text = _detailModel.Tid_name;
        cell.statusLabel.text = [Utils getStatus:[_detailModel.Status integerValue]];
        cell.line.hidden = YES;
        cell.statusLabel.textColor = [UIColor darkGrayColor];
        cell.statusImg.image = [UIImage imageNamed:@"owner_agree"];
        [cell.icon sd_setImageWithURL:[NSURL URLWithString:imageUrl(_detailModel.Tid_face)] placeholderImage:[UIImage imageNamed:@"placeholder_person"]];
        if ([_detailModel.Status integerValue] == 4) {
            cell.time.hidden = NO;
            cell.comment.hidden = YES;
            cell.time.text = [Utils TransformTimestampWith:_detailModel.Finishtime dateDormate:@"yyyy.MM.dd HH:mm"];

            [cell.contentView addSubview:({
                CGFloat height = [TXUtilsString AutoHeight:_detailModel.Comment font:14.0 andCGsize:CGSizeMake(ScreenW - 70, 1000)];
                UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(62, 90, ScreenW  - 90, height)];
                label.font = kFont(14.0);
                label.textColor = [UIColor colorWithHex:0x666666];
                label.text = _detailModel.Comment;
                label;
            })];

        }else if([_detailModel.Status integerValue] == 3){
            cell.time.hidden = YES;
            cell.comment.hidden = NO;
            [cell.comment addTarget:self action:@selector(commentting) forControlEvents:(UIControlEventTouchUpInside)];
        }
    }
    if (_index == indexPath.row + 1) {
        cell.bottomHeight.constant = 25;
    }else{
        cell.bottomHeight.constant = 8;
    }
    [cell cellConfigureModel:nil];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0) {
        return 110;
    }else if (indexPath.row == 2){
        if ([_detailModel.Ff_id boolValue]) {
            if ([_detailModel.Ff_review integerValue] == 1) {
                CGFloat height = [TXUtilsString AutoHeight:_detailModel.F_no font:14.0 andCGsize:CGSizeMake(ScreenW - 90, 1000)];
                if (_index == 3) {
                    return 125 + height;
                }else{
                    return 105 + height;
                }
            }else{
                return 115;
            }
        }else{
            if ([_detailModel.Status integerValue] == 4) {
                CGFloat height = [TXUtilsString AutoHeight:_detailModel.Comment font:14.0 andCGsize:CGSizeMake(ScreenW - 90, 1000)];
                return 125 + height;
            }else{
                return 115;
            }
        }
    }else if (indexPath.row == 1){
        if ([_detailModel.F_review integerValue] == 1 || [_detailModel.F_review integerValue] == 2) {
            CGFloat height = [TXUtilsString AutoHeight:_detailModel.F_no font:14.0 andCGsize:CGSizeMake(ScreenW - 90, 1000)];
            if (_index == 2) {
                return 125 + height;
            }else{
                return 105 + height;
            }
        }else{
            return 115;
        }
    }else{
        if ([_detailModel.Status integerValue] == 4) {
            CGFloat height = [TXUtilsString AutoHeight:_detailModel.Comment font:14.0 andCGsize:CGSizeMake(ScreenW - 90, 1000)];
            return 125 + height;
        }else{
            return 115;
        }
    }
}

- (void)commentting{
    OwnerDecideViewController *decideVC = [[OwnerDecideViewController alloc] init];
    decideVC.tip = @"说点什么吧";
    decideVC.tid = _detailModel.Tid;
    decideVC.pid = _ID;
    [self.navigationController pushViewController:decideVC animated:YES];
}

- (void)agree{
    OwnerDecideViewController *decideVC = [[OwnerDecideViewController alloc] init];
    decideVC.tip = @"请输入同意理由";
    decideVC.pid = _ID;
    [self.navigationController pushViewController:decideVC animated:YES];
}

- (void)disAgree{
    OwnerDecideViewController *decideVC = [[OwnerDecideViewController alloc] init];
    decideVC.tip = @"请输入拒绝理由";
    decideVC.pid = _ID;
    [self.navigationController pushViewController:decideVC animated:YES];
}

- (NSString *)getIntervalTime:(NSInteger )time{
    NSInteger day;
    NSInteger hour;
    NSInteger min;
    day = time / 24 / 3600;
    hour = (time / 3600) % 24;
    min = (time / 60) % 60;
    if (day == 0) {
        if (hour == 0) {
            return [NSString stringWithFormat:@"已等待%ld分钟",(long)min];
        }else{
            return [NSString stringWithFormat:@"已等待%ld小时%ld分钟",(long)hour,min];
        }
    }else{
        return [NSString stringWithFormat:@"已等待%ld天%ld小时%ld分钟",(long)day,hour,min];
    }
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [UIView animateWithDuration:0.5 animations:^{
        _memberView.center = CGPointMake(ScreenW/2, -ScreenH/2 -30);
        _grayView.alpha = 0;
        _memberView.alpha = 0;
    } completion:^(BOOL finished) {
        [_grayView removeFromSuperview];
        [_memberView removeFromSuperview];
    }];
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"srollDown" object:@{@"height":[NSNumber numberWithInt:scrollView.contentOffset.y]}];
}

@end


text:
package integration

import (
	"testing"

	kclient "k8s.io/kubernetes/pkg/client/unversioned"
	"k8s.io/kubernetes/pkg/fields"
	"k8s.io/kubernetes/pkg/labels"

	"github.com/openshift/origin/pkg/cmd/util/tokencmd"
	testutil "github.com/openshift/origin/test/util"
	testserver "github.com/openshift/origin/test/util/server"
)

func TestOAuthDisabled(t *testing.T) {
	// Build master config
	masterOptions, err := testserver.DefaultMasterOptions()
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	// Disable OAuth
	masterOptions.OAuthConfig = nil

	// Start server
	clusterAdminKubeConfig, err := testserver.StartConfiguredMaster(masterOptions)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	client, err := testutil.GetClusterAdminKubeClient(clusterAdminKubeConfig)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	clientConfig, err := testutil.GetClusterAdminClientConfig(clusterAdminKubeConfig)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	// Make sure cert auth still works
	namespaces, err := client.Namespaces().List(labels.Everything(), fields.Everything())
	if err != nil {
		t.Fatalf("Unexpected error %v", err)
	}
	if len(namespaces.Items) == 0 {
		t.Errorf("Expected namespaces, got none")
	}

	// Use the server and CA info
	anonConfig := kclient.Config{}
	anonConfig.Host = clientConfig.Host
	anonConfig.CAFile = clientConfig.CAFile
	anonConfig.CAData = clientConfig.CAData

	// Make sure we can't authenticate using OAuth
	if _, err := tokencmd.RequestToken(&anonConfig, nil, "username", "password"); err == nil {
		t.Error("Expected error, got none")
	}

}


text:
require 'spec_helper'

module Neography
  describe Config do

    subject(:config) { Config.new }

    context "defaults" do

      describe '#protocol' do
        subject { super().protocol }
        it              { should == 'http://' }
      end

      describe '#server' do
        subject { super().server }
        it                { should == 'localhost' }
      end

      describe '#port' do
        subject { super().port }
        it                  { should == 7474 }
      end

      describe '#directory' do
        subject { super().directory }
        it             { should == '' }
      end

      describe '#cypher_path' do
        subject { super().cypher_path }
        it           { should == '/cypher' }
      end

      describe '#gremlin_path' do
        subject { super().gremlin_path }
        it          { should == '/ext/GremlinPlugin/graphdb/execute_script' }
      end

      describe '#log_file' do
        subject { super().log_file }
        it              { should == 'neography.log' }
      end

      describe '#log_enabled' do
        subject { super().log_enabled }
        it           { should == false }
      end

      describe '#logger' do
        subject { super().logger }
        it                { should == nil }
      end

      describe '#slow_log_threshold' do
        subject { super().slow_log_threshold }
        it    { should == 0 }
      end

      describe '#max_threads' do
        subject { super().max_threads }
        it           { should == 20 }
      end

      describe '#authentication' do
        subject { super().authentication }
        it        { should == nil }
      end

      describe '#username' do
        subject { super().username }
        it              { should == nil }
      end

      describe '#password' do
        subject { super().password }
        it              { should == nil }
      end

      describe '#parser' do
        subject { super().parser }
        it                { should == MultiJsonParser}
      end

      describe '#max_execution_time' do
        subject { super().max_execution_time }
        it    { should == 6000 }
      end

      describe '#proxy' do
        subject { super().proxy }
        it                 { should == nil }
      end

      describe '#http_send_timeout' do
        subject { super().http_send_timeout }
        it     { should == 1200 }
      end

      describe '#http_receive_timeout' do
        subject { super().http_receive_timeout }
        it  { should == 1200 }
      end

      it "has a hash representation" do
        expected_hash = {
          :protocol             => 'http://',
          :server               => 'localhost',
          :port                 => 7474,
          :directory            => '',
          :cypher_path          => '/cypher',
          :gremlin_path         => '/ext/GremlinPlugin/graphdb/execute_script',
          :log_file             => 'neography.log',
          :log_enabled          => false,
          :logger               => nil,
          :slow_log_threshold   => 0,
          :max_threads          => 20,
          :authentication       => nil,
          :username             => nil,
          :password             => nil,
          :parser               => MultiJsonParser,
          :max_execution_time   => 6000,
          :proxy                => nil,
          :http_send_timeout    => 1200,
          :http_receive_timeout => 1200

        }
        expect(config.to_hash).to eq(expected_hash)
      end

    end

  end
end


text:
var _ = require('lodash')
    , utils = require('../utils')
    , fs = require('fs');

function endsWith(str, substr) {
    return str.indexOf(substr) == str.length-substr.length;
}

var commandNames = _.map(_.filter(fs.readdirSync(__dirname), function(file) {
    return file.indexOf('.') !== 0 && file !== 'index.js';
}), function(name) {
    if (endsWith(name, '.js')) {
        return name.slice(0, name.length-3);
    }
    return name;
});

var commands = utils.zipObject(commandNames, _.map(commandNames, function(commandName) {
    var module = require('./' + commandName);
    module.commandName = commandName;
    return module;
}));

module.exports = commands;


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.security.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties;
import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Describes properties of a connector setting. */
@Fluent
public final class ConnectorSettingProperties {
    /*
     * Settings for hybrid compute management. These settings are relevant only for Arc autoProvision (Hybrid Compute).
     */
    @JsonProperty(value = "hybridComputeSettings")
    private HybridComputeSettingsProperties hybridComputeSettings;

    /*
     * Settings for authentication management, these settings are relevant only for the cloud connector.
     */
    @JsonProperty(value = "authenticationDetails")
    private AuthenticationDetailsProperties authenticationDetails;

    /** Creates an instance of ConnectorSettingProperties class. */
    public ConnectorSettingProperties() {
    }

    /**
     * Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only
     * for Arc autoProvision (Hybrid Compute).
     *
     * @return the hybridComputeSettings value.
     */
    public HybridComputeSettingsProperties hybridComputeSettings() {
        return this.hybridComputeSettings;
    }

    /**
     * Set the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only
     * for Arc autoProvision (Hybrid Compute).
     *
     * @param hybridComputeSettings the hybridComputeSettings value to set.
     * @return the ConnectorSettingProperties object itself.
     */
    public ConnectorSettingProperties withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) {
        this.hybridComputeSettings = hybridComputeSettings;
        return this;
    }

    /**
     * Get the authenticationDetails property: Settings for authentication management, these settings are relevant only
     * for the cloud connector.
     *
     * @return the authenticationDetails value.
     */
    public AuthenticationDetailsProperties authenticationDetails() {
        return this.authenticationDetails;
    }

    /**
     * Set the authenticationDetails property: Settings for authentication management, these settings are relevant only
     * for the cloud connector.
     *
     * @param authenticationDetails the authenticationDetails value to set.
     * @return the ConnectorSettingProperties object itself.
     */
    public ConnectorSettingProperties withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) {
        this.authenticationDetails = authenticationDetails;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (hybridComputeSettings() != null) {
            hybridComputeSettings().validate();
        }
        if (authenticationDetails() != null) {
            authenticationDetails().validate();
        }
    }
}


text:
/*

    Tree layout
    Based on basic tree skin

    @package      backend
    @subpackage   core

    @author       Johan Ronsse <johan@netlash.com>
    @since        2.0

*/

.tree ul {
	margin: 0;
	padding: 0;
	list-style-type:none;
	background: url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==);
	:background: url(separate/decoded_base64.gif);
	background-position: 10px 1px;
	background-repeat: repeat-y;
	min-height: 16px;
}
.tree li {
	display: block;
	min-height: 16px;
	line-height: 16px;
	padding: 0 0 0 21px;
	/* Background fix */
	clear: both;
}

.tree li ul {
	display: none;
}

.tree li a:link,
.tree li a:visited,
.tree li span {
	display: inline-block;
	line-height: 16px;
	height: 16px;
	padding: 1px 2px;
	color: #000;
	white-space: nowrap;
	text-decoration: none;
	margin: 0;
	border: none !important;
	outline: 0 !important;
}

.tree li a:focus {
	outline: none;
}

.tree li a input:not([class="xxx"]),
.tree li span input:not([class="xxx"]) {
	padding: 1px 0;
}

/* FOR DOTS */
.tree .ltr li.last {
	float:left;
}

.tree > ul li.last {
	overflow:visible;
}

/* OPEN OR CLOSE */
.tree li.open ul {
	display: block;
}

.tree li.closed ul {
	display:none !important;
}

/* FOR DRAGGING */
#jstree-dragged {
	position: absolute;
	top: -10px;
	left: -10px;
	margin: 0;
	padding: 0;
}

#jstree-marker {
	padding: 0;
	margin: 0;
	line-height: 5px;
	font-size: 1px;
	display: block;
	position: absolute;
	z-index: 2147483647;
	width: 16px;
	height: 16px;
	background: url(/src/Backend/Core/Layout/images/sprites/fork_icons.png) 0 -653px no-repeat;
}

#jstree-marker.marker_plus {
	background: url(/src/Backend/Core/Layout/images/sprites/fork_icons.png) 0 -3px no-repeat;
}

/* BACKGROUND DOTS */
.tree li li { overflow: hidden; }
.tree > .ltr > li { display:table; }

/* ICONS */
.tree ul ins {
	display:inline-block;
	text-decoration:none;
	width: 16px;
	height: 16px;
}

.tree .ltr ins {
	margin: 0;
}

/* DOTS */
.tree-fork li {
	display: block !important;
	font-size: 11px;
}

.tree-fork li {
	background-repeat: no-repeat;
	background-position: 0 0;
}

/* OPEN or CLOSED */

.tree-fork li.leaf {        background: url(separate/leaf.gif) no-repeat 0 0; }
.tree-fork li.closed {      background: url(separate/closed.gif) no-repeat 0 0; }
.tree-fork li.open {        background: url(separate/open.gif) no-repeat 0 0; }
.tree-fork li.closed.last { background: url(separate/closed_last.gif) no-repeat 0 0; }
.tree-fork li.open.last {   background: url(separate/open_last.gif) no-repeat 0 0; }
.tree-fork li.last {        background: url(separate/last.gif) no-repeat 0 0; }

.tree-fork li[rel="hidden"],
.tree-fork li.treeHidden {
	opacity: .5; /* Standard: FF gt 1.5, Opera, Safari */
	filter: alpha(opacity=50); /* IE lt 8 */
	-ms-filter: "alpha(opacity=50)"; /* IE 8 */
	-khtml-opacity: .50; /* Safari 1.x */
	-moz-opacity: .50; /* FF lt 1.5, Netscape */
}

.tree-fork li.dragged {
	outline: none;
}

#jstree-dragged.tree-fork li li.open {
	background-position: 0 -16px;
}

.tree-fork li a { width: 200px; }

/* DEFAULT, HOVER, CLICKED, LOADING STATES */
.tree-fork li a:hover,
.tree-fork li a.active,
.tree-fork li a.focus {
	background: #eee;
	/* @inc .rc */
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
}

.tree-fork li span,
.tree-fork li.selected > a {
	/* @inc .selectedBlue */
	background: #1a57ad;
	background: -webkit-gradient(linear, left top, left bottom, from(#5c93d5), to(#1a57ad));
	background: -moz-linear-gradient(top, #5c93d5, #1a57ad);

	/* @inc .rc */
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;

	color: #FFF;
}

.tree-fork li a.clicked,
.tree-fork li a.clicked:hover,
.tree-fork li span.clicked {
	background: #AAA;

	/* @inc .rc */
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;

	color: #FFF;
}

/*
	Icons
*/

/* Basic page */
.tree-fork ins {
	background: transparent url(icons.gif) no-repeat 0 -80px;
	padding-right: 2px;
}

.tree-fork ul li a.loading ins {
	background-image: url('throbber.gif') !important;
	background-position: 0 0 !important;
}

.tree-fork li a ins.forbidden {
	background-position: -16px -16px;
}

.tree-fork .locked li a ins {
	background-position: 0 -48px;
}

.tree-fork li span ins {
	background-position: -16px 0;
}

/*
	Dragged item
*/

#jstree-dragged {
	border: 1px dotted #000;
	background-color: #CCC;
}

#jstree-dragged.tree-fork ins {
	background: url(/src/Backend/Core/Layout/images/sprites/fork_icons.png) 0 -610px no-repeat;
}

#jstree-dragged.tree-fork ins.forbidden {
	background: url(/src/Backend/Core/Layout/images/sprites/fork_icons.png) 0 -631px no-repeat;
}

/* LOCKED */
/*
.tree-fork .locked li a {
	color: gray;
}
*/


text:
define({
  "addLayer": "Adicionar Camada",
  "layerName": "Camada",
  "layerRefresh": "Atualizar",
  "layerLabel": "Rótulo",
  "actions": "Ações",
  "mainPanelTextPlaceholder": "ex: Última Atualização:",
  "invalidInterval": "Somente inteiros positivos são permitidos",
  "uploadImage": "Transferir Imagem",
  "iconColumnText": "Exibir",
  "refreshInterval": "Tempo em Minutos",
  "refreshIntervalTitle": "Avaliado como tempo em Minutos",
  "mainPanelText": "Principal Texto do Painel",
  "mainPanelIcon": "Principal Imagem do Painel",
  "refreshIntervalInstruction": "Atualizar camadas a cada:",
  "optionsText": "Opções",
  "symbolOptionsText": "Simbologia do Mapa",
  "iconOptionsText": "Simbologia do Painel",
  "sympolPopupTitle": "Configurações de Visualização",
  "rdoLayer": "Símbolo padrão",
  "rdoCustom": "Utilizar uma Imagem",
  "chkCluster": "Habilitar Agrupamento",
  "defineClusterSymbol": "Especificar Símbolo de Agrupamento",
  "rdoEsri": "Selecione um símbolo",
  "rdoLayerIcon": "Utilizar símbolo de mapa",
  "rdoCustomIcon": "Usar uma imagem",
  "editCustomSymbol": "Editar Símbolo Personalizado",
  "editCustomIcon": "Editar Ícone Personalizado",
  "missingRefreshValue": "Forneça um valor do intervalo de atualização.",
  "panelIconOption": "Exibir Imagem do Logo",
  "enableRefresh": "Habilitar atualização da camada",
  "disableRefresh": "Atualização da camada somente suportada para coleções de feição.",
  "refreshUnit": "minutos.",
  "symbolOptions": "Símbolo",
  "panelFeatureDisplay": "Painel",
  "chkGroup": "Agrupar feições",
  "selectField": "Campo",
  "fieldLabel": "Rótulo",
  "addField": "Adicionar Campo",
  "featureOptionsText": "Opções da Camada",
  "groupOptionsText": "Opções de Agrupamento",
  "panelCountOption": "Exibir Contagens de Feição",
  "missingLayerInWebMap": "Nenhuma camada operacional encontrada.",
  "displayClusterCnt": "Exibir Contagem de Feição",
  "defineClusterFont": "Especificar Cor da Fonte",
  "max_records": "Limite de campo máximo alcançado",
  "hidePanel": "Ocultar Painel",
  "hidePanelHelp": "Habilitar/Desabilitar visualização do painel principal.",
  "continuousRefreshHelp": "Anotação: A atualização da coleção de feição ocorrerá continuamente.",
  "panelCountOptionHelp": "Habilitar/Desabilitar visualização da contagem de feições.",
  "panelIconOptionHelp": "Habilitar/Desabilitar visualização de um logo no painel principal.",
  "rdoGroupByField": "por campo",
  "rdoGroupByRenderer": "por renderizador",
  "expandList": "Expandir Lista na Inicialização",
  "expandListHelp": "Habilitar/Desabilitar expansão de lista padrão.",
  "chkFeatureDisplay": "Desabilitar Lista de Feição",
  "showAllFeaturesHelp": "Habilitar/Desabilitar a exibição de todas as feições, independentemente da extensão.",
  "showAllFeatures": "Mostrar Todas as Feições",
  "fieldsWarning": "Nenhum campo definido no pop-up. Opcional: Utilize a ação de edição para definir as opções de exibição do painel.",
  "displayClusterLayer": "Preservar Símbolos de Agrupamento após Fechar Widget",
  "invalidSymbolWidthMessage": "O seletor de símbolos contém um erro, corrija antes de aplicar."
});


text:
import codecs
from geopy import distance
import os
import  streamcorpus as sc

def get_geocache(cache_path=None):

    cache = {}
    if cache_path is None:
        rdir = os.path.join(os.path.dirname(__file__), 'resources')
        cache_path = os.path.join(rdir, 'geocache.txt')
    with codecs.open(cache_path, 'r', 'utf-8') as f:
        for line in f:
            items = line.strip().split(u'\t')
            cache[items[0]] = (float(items[1]), float(items[2]))
    return cache

def compute_distance_stats(cache, locs1, locs2):
    min_distance = 20037 #half the circumference of earth 40075km
    max_distance = -20037
    tot_distance = 0
    distances = 0
    for loc1 in locs1:
        if loc1 not in cache:
            continue
        for loc2 in locs2:
            if loc2 not in cache:
                continue # circumference of earth in km
            d = distance.distance(cache[loc1], cache[loc2]).kilometers
            if d < min_distance:
                min_distance = d
            if d > max_distance:
                max_distance = d
            tot_distance += d
            distances += 1

    if distances > 0:
        avg_distance = tot_distance / float(distances)
    else:
        avg_distance = 0

    return min_distance, max_distance, avg_distance

def get_loc_sequences(sentence):
    seqs = []
    buff = []
    for token in sentence.tokens:
        if is_loc(token):
            buff.append(token.token.decode('utf-8'))
        else:
            if len(buff) > 0:
                seqs.append(u' '.join(buff))
                buff = []
    if len(buff) > 0:
        seqs.append(u' '.join(buff))
        buff = []
    return seqs

def is_loc(token):
    netype = None
    if token.entity_type != 3 and token.entity_type != 4:
        netype = sc.get_entity_type(token)
    if netype == 'LOC':
        return True
    else:
        return False


text:
<?php

namespace OC\Preview;

class SVG extends Provider {
	/**
	 * {@inheritDoc}
	 */
	public function getMimeType() {
		return '/image\/svg\+xml/';
	}

	/**
	 * {@inheritDoc}
	 */
	public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
		try{
			$svg = new \Imagick();
			$svg->setBackgroundColor(new \ImagickPixel('transparent'));

			$content = stream_get_contents($fileview->fopen($path, 'r'));
			if(substr($content, 0, 5) !== '<?xml') {
				$content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $content;
			}

			// Do not parse SVG files with references
			if(stripos($content, 'xlink:href') !== false) {
				return false;
			}

			$svg->readImageBlob($content);
			$svg->setImageFormat('png32');
		} catch (\Exception $e) {
			\OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR);
			return false;
		}

		//new image object
		$image = new \OC_Image();
		$image->loadFromData($svg);
		//check if image object is valid
		return $image->valid() ? $image : false;
	}
}


text:
package org.xnio.management;

/**
 * @author David M. Lloyd
 */
public interface XnioWorkerMXBean {

    /**
     * Get the name of the provider.
     *
     * @return the name of the provider
     */
    String getProviderName();

    /**
     * Get the worker's name.
     *
     * @return the worker's name
     */
    String getName();

    /**
     * Determine whether shutdown has been requested for this worker.
     *
     * @return {@code true} if shutdown was requested, {@code false} otherwise
     */
    boolean isShutdownRequested();

    /**
     * Get the core worker thread pool size.
     *
     * @return the core worker pool size
     */
    int getCoreWorkerPoolSize();

    /**
     * Get the maximum worker thread pool size.
     *
     * @return the maximum worker pool size
     */
    int getMaxWorkerPoolSize();

    /**
     * Get the I/O thread count.
     *
     * @return the I/O thread count
     */
    int getIoThreadCount();

    /**
     * Get an estimate of the number of tasks in the worker queue.
     *
     * @return the task count estimate
     */
    int getWorkerQueueSize();
}


text:
'use strict';

var CoreError = require('libutil').Errors;

var handleNonceHeaders = function (req, res, next) {

}

var allowCrossDomain = function(req, res, next) {
  res.header('Access-Control-Allow-Origin', '*');
  res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
  res.header('Access-Control-Allow-Headers', '*');

  // intercept OPTIONS method
  if ('OPTIONS' == req.method) {
    res.send(200);
  }
  else {
    next();
  }
};

var allowMethodOverride = function(req, res, next) {
  if (req.method === 'POST' && req.body._method) {
    req.originalMethod = req.method;
    req.method = req.body._method;
    delete req.body._method;
  }
  next();
};

var handleNonceErrors = function (err, req, res, next) {
  if (err instanceof CoreError) {
    var httpStatus;

    // TODO: fill out this mapping
    switch (err.code) {
    case CoreError.INTERNAL_SERVER_ERROR:
      httpStatus = 500;
      break;
    case CoreError.OBJECT_NOT_FOUND:
      httpStatus = 404;
      break;
    default:
      httpStatus = 400;
    }

    res.status(httpStatus);
    res.json({code: err.code, error: err.message});
  } else {
    console.log('Uncaught internal server error.', err, err.stack);
    res.status(500);
    res.json({code: CoreError.INTERNAL_SERVER_ERROR,
              message: 'Internal server error.'});
  }
};

function invalidRequest(req, res) {
  res.status(403);
  res.end('{"error":"unauthorized"}');
};

module.exports = {
  allowCrossDomain: allowCrossDomain,
  allowMethodOverride: allowMethodOverride,
  handleNonceErrors: handleNonceErrors
};


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <predicate lemma="wish">
        <note>
            Frames file for 'wish' based on sentences in financial subcorpus.
            Verbnet entry 32.2, no other framed members.  Comparison with
            'want'.  Or not.
        </note>

        <roleset id="wish.01" name="wish" vncls="32.2">
            <roles>
                <role descr="wisher" n="0">

                    <vnrole vncls="32.2" vntheta="Experiencer"/>
                </role>

                <role descr="thing wished for" n="1">

                    <vnrole vncls="32.2" vntheta="Theme"/>
                </role>

                <role descr="benefactive" n="2"/>
            </roles>

            <example name="rarely with benefactive">
                <text>
                    Industry executives are wishing Mr. Achenbaum well.
                </text>
                <arg n="0">Industry executives</arg>
                <rel>wishing</rel>
                <arg n="2">Mr. Achenbaum</arg>
                <arg n="1">well</arg>
            </example>

            <note>
                Compare to "Industry executives are wishing Mr. Achenbaum the best."
            </note>

            <example name="sentential wish">
                <text>
                    A reinsurance company effectively insures insurance companies that
                    *trace* wish to spread the risk of a particular policy.
                </text>
                <arg n="m" f="RCL">that -> insurance companies</arg>
                <arg n="0">*trace*</arg>
                <rel>wish</rel>
                <arg n="1">to spread the risk of a particular policy</arg>
            </example>

            <note>
                Sentential wishes can also take full SBARs, in which case be sure to
                leave out the COMP.
            </note>

        </roleset>
    </predicate>
</frameset>


text:
<?php

namespace Quip;

use Quip\Entities\EmbedChain;
use Quip\Entities\Query;
use Quip\Entities\Sort;
use Quip\Exceptions\NoSuchSortException;
use Quip\Expressions\Expression;
use Quip\Expressions\ExpressionParser;

/**
 * Class Quip
 *
 * Main class for the Quip library. Constructed with a raw query string
 * or input array, with methods to parse into a Query object.
 *
 * @package Quip
 */
class Quip
{
    /**
     * @var Query
     */
    protected $query;

    /**
     * @var string|array
     */
    protected $queryString;

    public function __construct($queryString)
    {
        $this->queryString = $queryString;
    }

    /**
     * Parse a raw query into something more meaningful
     *
     * @return Query
     */
    public function parse()
    {
        $input = $this->queryString;

        // Parse string if it's not already parsed into an array
        if (is_string($this->queryString)) {
            $input = [];
            parse_str($this->queryString, $input);
        }

        $this->query = new Query($input);

        $this->parseQ();
        $this->parseEmbeds();
        $this->parseIncludes();
        $this->parseExcludes();
        $this->parseSorts();

        return $this->query;
    }

    /**
     * Parse the SQL queries (filters) from the query string
     */
    protected function parseQ()
    {
        if ($this->query->has('q')) {
            $exprs = explode(',', $this->query->getRaw('q'));

            foreach ($exprs as $expr) {
                $this->query->addExpression($this->parseExpression($expr));
            }
        }
    }

    /**
     * Parse the embeds from the query string
     */
    protected function parseEmbeds()
    {
        if ($this->query->has('embeds')) {
            $embeds = explode(',', $this->query->getRaw('embeds'));

            foreach ($embeds as $embed) {
                $this->query->addEmbed($this->parseEmbed($embed));
            }
        }
    }

    /**
     * Parse the includees from the query string
     */
    protected function parseIncludes()
    {
        if ($this->query->has('includes')) {
            $this->query->setIncludes(
                explode(',', $this->query->getRaw('includes'))
            );
        }
    }

    /**
     * Parse the excludes from the query string
     */
    protected function parseExcludes()
    {
        if ($this->query->has('excludes')) {
            $this->query->setExcludes(
                explode(',', $this->query->getRaw('excludes'))
            );
        }
    }

    /**
     * Parse the sorts from the query string
     *
     * @throws NoSuchSortException
     */
    protected function parseSorts()
    {
        if ($this->query->has('sort')) {
            $sorts = explode(',', $this->query->getRaw('sort'));

            foreach($sorts as $sort) {
                $this->query->addSort($this->parseSort($sort));
            }
        }
    }

    /**
     * Parse a single sort from a raw query string
     *
     * @param $sort
     *
     * @return Sort
     *
     * @throws NoSuchSortException
     */
    protected function parseSort($sort)
    {
        $type = substr($sort, 0, 1);
        $key = substr($sort, 1);

        switch ($type) {
            case '+': $type = Sort::TYPE_ASC; break;
            case '-': $type = Sort::TYPE_DESC; break;
            default:
                throw new NoSuchSortException();
        }

        return new Sort($type, $key);
    }

    /**
     * Parse a raw embed into a meaningful chain
     *
     * @param $embed
     *
     * @return EmbedChain
     */
    protected function parseEmbed($embed)
    {
        return new EmbedChain(explode('.', $embed));
    }

    /**
     * Parse a raw expression into an Expression
     *
     * @param $expr
     *
     * @return Expression
     *
     * @throws Expressions\Exceptions\InvalidExpressionException
     */
    protected function parseExpression($expr)
    {
        return (new ExpressionParser($expr))->parse();
    }
}


text:
package org.apache.ode.pmapi;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="instanceFilter" type="{http://www.w3.org/2001/XMLSchema}string" form="unqualified"/>
 *         <element name="eventFilter" type="{http://www.w3.org/2001/XMLSchema}string" form="unqualified"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "instanceFilter",
    "eventFilter"
})
@XmlRootElement(name = "getEventTimeline")
public class GetEventTimeline {

    @XmlElement(required = true)
    protected String instanceFilter;
    @XmlElement(required = true)
    protected String eventFilter;

    /**
     * Gets the value of the instanceFilter property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getInstanceFilter() {
        return instanceFilter;
    }

    /**
     * Sets the value of the instanceFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setInstanceFilter(String value) {
        this.instanceFilter = value;
    }

    /**
     * Gets the value of the eventFilter property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getEventFilter() {
        return eventFilter;
    }

    /**
     * Sets the value of the eventFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setEventFilter(String value) {
        this.eventFilter = value;
    }

}


text:
class QGlitterAppcastItemPrivate : public QGlitterObjectData
{
	QGLITTER_DECLARE_PUBLIC(QGlitterAppcastItem);
public:
	QGlitterAppcastItemPrivate();
	QGlitterAppcastItemPrivate(const QGlitterAppcastItemPrivate &other);

	void clone(const QGlitterAppcastItemPrivate &other);

	QString deltaFrom;
	QMap<QString, QString> descriptions;
	QString mimeType;
	QString minimumSystemVersion;
	QString operatingSystem;
	QDateTime publicationDate;
	QMap<QString, QString> releaseNotesUrls;
	QString shortVersionString;
	QString signature;
	int size;
	QString title;
	QString url;
	QString version;
};


text:
    {% block content %}
    {$ doc.description | marked $}
    {% endblock %}


text:
phase-0-gps-1
=============

git clone [URL]  Make sure to copy the clone URL from GitHub repo

git checkout -b [branch]  Make cd into the new directory