text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.analyticsreporting.v4.model;

/**
 * The segment definition, if the report needs to be segmented. A Segment is a subset of the
 * Analytics data. For example, of the entire set of users, one Segment might be users from a
 * particular country or city.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Analytics Reporting API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Segment extends com.google.api.client.json.GenericJson {

  /**
   * A dynamic segment definition in the request.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private DynamicSegment dynamicSegment;

  /**
   * The segment ID of a built-in or custom segment, for example `gaid::-3`.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String segmentId;

  /**
   * A dynamic segment definition in the request.
   * @return value or {@code null} for none
   */
  public DynamicSegment getDynamicSegment() {
    return dynamicSegment;
  }

  /**
   * A dynamic segment definition in the request.
   * @param dynamicSegment dynamicSegment or {@code null} for none
   */
  public Segment setDynamicSegment(DynamicSegment dynamicSegment) {
    this.dynamicSegment = dynamicSegment;
    return this;
  }

  /**
   * The segment ID of a built-in or custom segment, for example `gaid::-3`.
   * @return value or {@code null} for none
   */
  public java.lang.String getSegmentId() {
    return segmentId;
  }

  /**
   * The segment ID of a built-in or custom segment, for example `gaid::-3`.
   * @param segmentId segmentId or {@code null} for none
   */
  public Segment setSegmentId(java.lang.String segmentId) {
    this.segmentId = segmentId;
    return this;
  }

  @Override
  public Segment set(String fieldName, Object value) {
    return (Segment) super.set(fieldName, value);
  }

  @Override
  public Segment clone() {
    return (Segment) super.clone();
  }

}


text:
IF(CMAKE_HOST_UNIX)
  FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
  IF(CMAKE_UNAME)
    EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
    EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
    IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
      EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
        RETURN_VALUE val)
    ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
      EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
        RETURN_VALUE val)
      IF("${val}" GREATER 0)
        EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
          RETURN_VALUE val)
      ENDIF("${val}" GREATER 0)
    ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
    # check the return of the last uname -m or -p
    IF("${val}" GREATER 0)
        SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
    ENDIF("${val}" GREATER 0)
    SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
    # processor may have double quote in the name, and that needs to be removed
    STRING(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
    STRING(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
  ENDIF(CMAKE_UNAME)
ELSE(CMAKE_HOST_UNIX)
  IF(CMAKE_HOST_WIN32)
    SET (CMAKE_HOST_SYSTEM_NAME "Windows")
    SET (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
  ENDIF(CMAKE_HOST_WIN32)
ENDIF(CMAKE_HOST_UNIX)

# if a toolchain file is used, the user wants to cross compile.
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
# variables around so they can be used in CMakeLists.txt.
# In all other cases, the host and target platform are the same.
IF(CMAKE_TOOLCHAIN_FILE)
  # at first try to load it as path relative to the directory from which cmake has been run
  INCLUDE("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
  IF(NOT _INCLUDED_TOOLCHAIN_FILE)
     # if the file isn't found there, check the default locations
     INCLUDE("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
  ENDIF(NOT _INCLUDED_TOOLCHAIN_FILE)

  IF(_INCLUDED_TOOLCHAIN_FILE)
    SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
  ELSE(_INCLUDED_TOOLCHAIN_FILE)
    MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
    SET(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
  ENDIF(_INCLUDED_TOOLCHAIN_FILE)
ENDIF(CMAKE_TOOLCHAIN_FILE)

# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
# or it was set via -DCMAKE_SYSTEM_NAME=...
# if that's the case, assume we are crosscompiling
IF(CMAKE_SYSTEM_NAME)
  IF(NOT DEFINED CMAKE_CROSSCOMPILING)
    SET(CMAKE_CROSSCOMPILING TRUE)
  ENDIF(NOT DEFINED CMAKE_CROSSCOMPILING)
  SET(PRESET_CMAKE_SYSTEM_NAME TRUE)
ELSE(CMAKE_SYSTEM_NAME)
  SET(CMAKE_SYSTEM_NAME      "${CMAKE_HOST_SYSTEM_NAME}")
  SET(CMAKE_SYSTEM_VERSION   "${CMAKE_HOST_SYSTEM_VERSION}")
  SET(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
  SET(CMAKE_CROSSCOMPILING FALSE)
  SET(PRESET_CMAKE_SYSTEM_NAME FALSE)
ENDIF(CMAKE_SYSTEM_NAME)

MACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
  IF(NOT ${_PREFIX}_NAME)
    SET(${_PREFIX}_NAME "UnknownOS")
  ENDIF(NOT ${_PREFIX}_NAME)

  # fix for BSD/OS , remove the /
  IF(${_PREFIX}_NAME MATCHES BSD.OS)
    SET(${_PREFIX}_NAME BSDOS)
  ENDIF(${_PREFIX}_NAME MATCHES BSD.OS)

  # fix for CYGWIN which has windows version in it
  IF(${_PREFIX}_NAME MATCHES CYGWIN)
    SET(${_PREFIX}_NAME CYGWIN)
  ENDIF(${_PREFIX}_NAME MATCHES CYGWIN)

  # set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
  SET(${_PREFIX}  ${${_PREFIX}_NAME})
  # if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
  IF(${_PREFIX}_VERSION)
    SET(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
  ENDIF(${_PREFIX}_VERSION)

ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)

ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)

# this file is also executed from cpack, then we don't need to generate these files
# in this case there is no CMAKE_BINARY_DIR
IF(CMAKE_BINARY_DIR)
  # write entry to the log file
  IF(PRESET_CMAKE_SYSTEM_NAME)
    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
  ELSE(PRESET_CMAKE_SYSTEM_NAME)
    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
  ENDIF(PRESET_CMAKE_SYSTEM_NAME)

  # if a toolchain file is used, it needs to be included in the configured file,
  # so settings done there are also available if they don't go in the cache and in TRY_COMPILE()
  SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
  IF(DEFINED CMAKE_TOOLCHAIN_FILE)
    SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "INCLUDE(\"${CMAKE_TOOLCHAIN_FILE}\")")
  ENDIF(DEFINED CMAKE_TOOLCHAIN_FILE)

  # configure variables set in this file for fast reload, the template file is defined at the top of this file
  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
                IMMEDIATE @ONLY)

ENDIF(CMAKE_BINARY_DIR)

redpajama_set_name: RedPajamaGithub


text:
<?php

// Protect from unauthorized access
defined('_JEXEC') or die();

/**
 * MVC View for Profiles management
 *
 */
class AkeebaViewPostsetup extends FOFViewHtml
{
	public function onBrowse($tpl = null)
	{
		$this->_setSRPStatus();
		$this->_setAutoupdateStatus();
		$this->_setBackuponupdateStatus();
		$this->_setConfWizStatus();
		$this->assign('showsrp', $this->isMySQL());

		return true;
	}

	private function _setBackuponupdateStatus()
	{
		$db = JFactory::getDBO();

		$query = $db->getQuery(true)
			->select($db->qn('enabled'))
			->from($db->qn('#__extensions'))
			->where($db->qn('element').' = '.$db->q('backuponupdate'))
			->where($db->qn('folder').' = '.$db->q('system'));
		$db->setQuery($query);
		$enabledBOU = $db->loadResult();

		if(!AKEEBA_PRO) {
			$enabledBOU = false;
		}

		$this->assign('enablebackuponupdate', $enabledBOU);
	}

	private function _setAutoupdateStatus()
	{
		if($this->_setConfWizStatus()) {
			$this->assign('enableautoupdate', true);
			return;
		}

		$db = JFactory::getDBO();

		$query = $db->getQuery(true)
			->select($db->qn('enabled'))
			->from($db->qn('#__extensions'))
			->where($db->qn('element').' = '.$db->q('oneclickaction'))
			->where($db->qn('folder').' = '.$db->q('system'));
		$db->setQuery($query);
		$enabledOCA = $db->loadResult();

		$query = $db->getQuery(true)
			->select($db->qn('enabled'))
			->from($db->qn('#__extensions'))
			->where($db->qn('element').' = '.$db->q('akeebaupdatecheck'))
			->where($db->qn('folder').' = '.$db->q('system'));
		$db->setQuery($query);
		$enabledAUC = $db->loadResult();

		if(!AKEEBA_PRO) {
			$enabledAUC = false;
			$enabledOCA = false;
		}

		$this->assign('enableautoupdate', $enabledAUC && $enabledOCA);
	}

	private function _setSRPStatus()
	{
		if($this->_setConfWizStatus()) {
			$this->assign('enablesrp', $this->isMySQL());
			return;
		}

		$db = JFactory::getDBO();

		$query = $db->getQuery(true)
			->select($db->qn('enabled'))
			->from($db->qn('#__extensions'))
			->where($db->qn('element').' = '.$db->q('srp'))
			->where($db->qn('folder').' = '.$db->q('system'));
		$db->setQuery($query);
		$enableSRP = $db->loadResult();

		if(!AKEEBA_PRO) {
			$enableSRP = false;
		}
		if(!$this->isMySQL()) {
			$enableSRP = false;
			return;
		}

		$this->assign('enablesrp', $enableSRP ? true : false);
	}

	private function _setConfWizStatus()
	{
		static $enableconfwiz;

		$component = JComponentHelper::getComponent( 'com_akeeba' );
		if(is_object($component->params) && ($component->params instanceof JRegistry)) {
			$params = $component->params;
		} else {
			$params = new JParameter($component->params);
		}

		if(empty($enableconfwiz)) {
			$lv = $params->get( 'lastversion', '' );

			$enableconfwiz = empty($lv);
		}

		$minStability = $params->get( 'minstability', 'stable' );
		$acceptlicense = $params->get( 'acceptlicense', '0' );
		$acceptsupport = $params->get( 'acceptsupport', '0' );
		$acceptbackuptest = $params->get( 'acceptbackuptest', '0' );
		$angieupgrade = $params->get( 'angieupgrade', '0' );

		$this->assign('enableconfwiz', $enableconfwiz);
		$this->assign('minstability', $minStability);
		$this->assign('acceptlicense', $acceptlicense);
		$this->assign('acceptsupport', $acceptsupport);
		$this->assign('acceptbackuptest', $acceptbackuptest);
		$this->assign('showangieupgrade', ($angieupgrade == 0));

		return $enableconfwiz;
	}

	private function isMySQL()
	{
		$db = JFactory::getDbo();
		return strtolower(substr($db->name, 0, 5)) == 'mysql';
	}
}


text:
package lex

import (
	//u "github.com/araddon/gou"
	"github.com/bmizerany/assert"
	"testing"
)

func verifyJsonTokenTypes(t *testing.T, expString string, tokens []TokenType) {
	l := NewJsonLexer(expString)
	for _, goodToken := range tokens {
		tok := l.NextToken()
		//u.Debugf("%#v  %#v", tok, goodToken)
		assert.Equalf(t, tok.T, goodToken, "want='%v' has %v ", goodToken, tok)
	}
}

func verifyJsonTokens(t *testing.T, expString string, tokens []Token) {
	l := NewJsonLexer(expString)
	for i, goodToken := range tokens {
		tok := l.NextToken()
		//u.Debugf("%#v  %#v", tok, goodToken)
		assert.Equalf(t, tok.T, goodToken.T, "%d want token type ='%v' has %v ", i, goodToken.T, tok.T)
		assert.Equalf(t, tok.V, goodToken.V, "%d want token value='%v' has %v ", i, goodToken.V, tok.V)
	}
}

func TestLexJsonTokens(t *testing.T) {
	verifyJsonTokens(t, `["a",2,"b",true,{"name":"world"}]`,
		[]Token{
			tv(TokenLeftBracket, "["),
			tv(TokenValue, "a"),
			tv(TokenComma, ","),
			tv(TokenInteger, "2"),
			tv(TokenComma, ","),
			tv(TokenValue, "b"),
			tv(TokenComma, ","),
			tv(TokenBool, "true"),
			tv(TokenComma, ","),
			tv(TokenLeftBrace, "{"),
			tv(TokenIdentity, "name"),
			tv(TokenColon, ":"),
			tv(TokenValue, "world"),
			tv(TokenRightBrace, "}"),
			tv(TokenRightBracket, "]"),
		})
}

func TestLexJsonDialect(t *testing.T) {
	// The lexer should be able to parse json
	verifyJsonTokenTypes(t, `
		{
			"key1":"value2"
			,"key2":45,
			"key3":["a",2,"b",true],
			"key4":{"hello":"value","age":55}
		}
		`,
		[]TokenType{TokenLeftBrace,
			TokenIdentity, TokenColon, TokenValue,
			TokenComma,
			TokenIdentity, TokenColon, TokenInteger,
			TokenComma,
			TokenIdentity, TokenColon, TokenLeftBracket, TokenValue, TokenComma, TokenInteger, TokenComma, TokenValue, TokenComma, TokenBool, TokenRightBracket,
			TokenComma,
			TokenIdentity, TokenColon, TokenLeftBrace, TokenIdentity, TokenColon, TokenValue, TokenComma, TokenIdentity, TokenColon, TokenInteger, TokenRightBrace,
			TokenRightBrace,
		})
}


text:
class ModelGenerator < Rails::Generator::NamedBase
  default_options :skip_timestamps => false,
                  :skip_migration  => false,
                  :skip_factories  => false

  def manifest
    record do |m|
      # Check for class naming collisions.
      m.class_collisions class_name, "#{class_name}Test"

      # Model, test, and factories directories.
      m.directory File.join('app/models',     class_path)
      m.directory File.join('test/unit',      class_path)
      m.directory File.join('test/factories', class_path)

      # Model class, unit test, and factories.
      m.template 'model.rb',      File.join('app/models', class_path,
                                            "#{file_name}.rb")
      m.template 'unit_test.rb',  File.join('test/unit', class_path,
                                            "#{file_name}_test.rb")

      m.template 'factory.rb',  File.join('test/factories', "#{file_name}.rb")

      unless options[:skip_migration]
        m.migration_template 'migration.rb', 'db/migrate', :assigns => {
          :migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}"
        }, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
      end
    end
  end

  def factory_line(attribute, file_name)
    if attribute.reference?
      "#{file_name}.association(:#{attribute.name})"
    else
      "#{file_name}.#{attribute.name} #{attribute.default_for_factory}"
    end
  end

  protected

    def banner
      "Usage: #{$0} #{spec.name} ModelName [field:type, field:type]"
    end

    def add_options!(opt)
      opt.separator ''
      opt.separator 'Options:'
      opt.on("--skip-timestamps",
             "Don't add timestamps to the migration file for this model") { |v|
        options[:skip_timestamps] = v
      }
      opt.on("--skip-migration",
             "Don't generate a migration file for this model") { |v|
        options[:skip_migration] = v
      }
    end
end

module Rails
  module Generator
    class GeneratedAttribute
      def default_for_factory
        @default ||= case type
          when :integer                     then "{ 1 }"
          when :float                       then "{ 1.5 }"
          when :decimal                     then "{ 9.99 }"
          when :datetime, :timestamp, :time then "{ Time.now.to_s(:db) }"
          when :date                        then "{ Date.today.to_s(:db) }"
          when :string                      then "{ 'string' }"
          when :text                        then "{ 'text' }"
          when :boolean                     then "{ false }"
          else
            ""
        end
      end
    end
  end
end


text:
package com.emitrom.ti4j.mobile.client.contacts;

import com.emitrom.ti4j.core.client.JsoHelper;
import com.emitrom.ti4j.core.client.ProxyObject;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayString;

public class Url extends ProxyObject {

    public Url() {
        jsObj = JsoHelper.createObject();
    }

    protected Url(JavaScriptObject obj) {
        jsObj = obj;
    }

    public native JsArrayString getHome()/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.home;
    }-*/;

    public native void setHome(JsArrayString value)/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.home = value;
    }-*/;

    public native JsArrayString getHomePage()/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.homepage;
    }-*/;

    public native void setHomePage(JsArrayString value)/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.homepage = value;
    }-*/;

    public native JsArrayString getOther()/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.other;
    }-*/;

    public native void setOther(JsArrayString value)/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.other = value;
    }-*/;

    public native JsArrayString getWork()/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.work;
    }-*/;

    public native void setWork(JsArrayString value)/*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.work = value;
    }-*/;

}


text:
<?php
/**
 * This snippet demonstrates how to change the value of a hook. The content
 * passed into the hook is 'This is some Sample Content.'. After the two hook
 * handlers are done, the new content is 'This is some $@mple Content.'.
 */

// the output:page hook is triggered by elgg_view_page().
elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler', 600);
elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler_2', 601);

function example_plugin_hook_handler($hook, $type, $value, $params) {
	// change a to @
	$value = str_replace('a', '@', $value);

	return $value;
}

function example_plugin_hook_handler_2($hook, $type, $value, $params) {
	// change S to $
	$value = str_replace('S', '$', $value);

	return $value;
}

$content = 'This is some Sample Content.';

echo elgg_view_page('Title', $content);


text:
author: Rebecca Kindschi
category: General
date: 2017-04-10 00:00:01
layout: post
image: /static/img/blog/financial_aid.png
title: "Applications for Financial Aid Close Today"
---

Financial aid applications close on April 10th!

This is your friendly reminder that our [financial aid application](https://2017.djangocon.us/financial-aid/) closes on April 10th. We'll let you know in early May if your application for aid has been accepted. Be sure to get your application in ASAP!

We've had some questions from people who don't feel like they are the type of person we're looking for, but they still need financial help to attend DjangoCon US. Let us reassure you: we're not looking to give any particular person funding! If you're a member of an underrepresented group (whatever that means to you), if you have a lower income, or if your circumstances at this moment mean you need help to come to DjangoCon US, we want you to apply. You can ask for all or part of your costs to cover transportation, registration, or lodging. If you're not sure whether or not you should apply for financial aid…the answer is, yes, if you need aid, you should apply!


text:
<ion-header>
    <ion-navbar core-back-button>
        <ion-title><core-format-text [text]="title"></core-format-text></ion-title>

        <ion-buttons end>
            <!-- The buttons defined by the component will be added in here. -->
        </ion-buttons>
    </ion-navbar>
</ion-header>
<ion-content>
    <ion-refresher [enabled]="lessonComponent.loaded" (ionRefresh)="lessonComponent.doRefresh($event)">
        <ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
    </ion-refresher>

    <addon-mod-lesson-index [module]="module" [courseId]="courseId" [group]="group" [action]="action" (dataRetrieved)="updateData($event)"></addon-mod-lesson-index>
</ion-content>


text:
package com.amazonaws.services.gamelift.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * Represents the input for a request operation.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateFleetCapacityRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN value.
     *

     */
    private String fleetId;
    /**
     *

     * The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must fall
     * between the minimum and maximum size limits.
     *

     */
    private Integer desiredInstances;
    /**
     *

     * The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 0.
     *

     */
    private Integer minSize;
    /**
     *

     * The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 1.
     *

     */
    private Integer maxSize;
    /**
     *

     * The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services Region
     * code such as us-west-2.
     *

     */
    private String location;

    /**
     *

     * A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN value.
     *

     *
     * @param fleetId
     *        A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN
     *        value.
     */

    public void setFleetId(String fleetId) {
        this.fleetId = fleetId;
    }

    /**
     *

     * A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN value.
     *

     *
     * @return A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN
     *         value.
     */

    public String getFleetId() {
        return this.fleetId;
    }

    /**
     *

     * A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN value.
     *

     *
     * @param fleetId
     *        A unique identifier for the fleet to update capacity settings for. You can use either the fleet ID or ARN
     *        value.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateFleetCapacityRequest withFleetId(String fleetId) {
        setFleetId(fleetId);
        return this;
    }

    /**
     *

     * The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must fall
     * between the minimum and maximum size limits.
     *

     *
     * @param desiredInstances
     *        The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must
     *        fall between the minimum and maximum size limits.
     */

    public void setDesiredInstances(Integer desiredInstances) {
        this.desiredInstances = desiredInstances;
    }

    /**
     *

     * The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must fall
     * between the minimum and maximum size limits.
     *

     *
     * @return The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must
     *         fall between the minimum and maximum size limits.
     */

    public Integer getDesiredInstances() {
        return this.desiredInstances;
    }

    /**
     *

     * The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must fall
     * between the minimum and maximum size limits.
     *

     *
     * @param desiredInstances
     *        The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must
     *        fall between the minimum and maximum size limits.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateFleetCapacityRequest withDesiredInstances(Integer desiredInstances) {
        setDesiredInstances(desiredInstances);
        return this;
    }

    /**
     *

     * The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 0.
     *

     *
     * @param minSize
     *        The minimum number of instances that are allowed in the specified fleet location. If this parameter is not
     *        set, the default is 0.
     */

    public void setMinSize(Integer minSize) {
        this.minSize = minSize;
    }

    /**
     *

     * The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 0.
     *

     *
     * @return The minimum number of instances that are allowed in the specified fleet location. If this parameter is
     *         not set, the default is 0.
     */

    public Integer getMinSize() {
        return this.minSize;
    }

    /**
     *

     * The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 0.
     *

     *
     * @param minSize
     *        The minimum number of instances that are allowed in the specified fleet location. If this parameter is not
     *        set, the default is 0.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateFleetCapacityRequest withMinSize(Integer minSize) {
        setMinSize(minSize);
        return this;
    }

    /**
     *

     * The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 1.
     *

     *
     * @param maxSize
     *        The maximum number of instances that are allowed in the specified fleet location. If this parameter is not
     *        set, the default is 1.
     */

    public void setMaxSize(Integer maxSize) {
        this.maxSize = maxSize;
    }

    /**
     *

     * The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 1.
     *

     *
     * @return The maximum number of instances that are allowed in the specified fleet location. If this parameter is
     *         not set, the default is 1.
     */

    public Integer getMaxSize() {
        return this.maxSize;
    }

    /**
     *

     * The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set,
     * the default is 1.
     *

     *
     * @param maxSize
     *        The maximum number of instances that are allowed in the specified fleet location. If this parameter is not
     *        set, the default is 1.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateFleetCapacityRequest withMaxSize(Integer maxSize) {
        setMaxSize(maxSize);
        return this;
    }

    /**
     *

     * The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services Region
     * code such as us-west-2.
     *

     *
     * @param location
     *        The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services
     *        Region code such as us-west-2.
     */

    public void setLocation(String location) {
        this.location = location;
    }

    /**
     *

     * The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services Region
     * code such as us-west-2.
     *

     *
     * @return The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web
     *         Services Region code such as us-west-2.
     */

    public String getLocation() {
        return this.location;
    }

    /**
     *

     * The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services Region
     * code such as us-west-2.
     *

     *
     * @param location
     *        The name of a remote location to update fleet capacity settings for, in the form of an Amazon Web Services
     *        Region code such as us-west-2.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateFleetCapacityRequest withLocation(String location) {
        setLocation(location);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getFleetId() != null)
            sb.append("FleetId: ").append(getFleetId()).append(",");
        if (getDesiredInstances() != null)
            sb.append("DesiredInstances: ").append(getDesiredInstances()).append(",");
        if (getMinSize() != null)
            sb.append("MinSize: ").append(getMinSize()).append(",");
        if (getMaxSize() != null)
            sb.append("MaxSize: ").append(getMaxSize()).append(",");
        if (getLocation() != null)
            sb.append("Location: ").append(getLocation());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof UpdateFleetCapacityRequest == false)
            return false;
        UpdateFleetCapacityRequest other = (UpdateFleetCapacityRequest) obj;
        if (other.getFleetId() == null ^ this.getFleetId() == null)
            return false;
        if (other.getFleetId() != null && other.getFleetId().equals(this.getFleetId()) == false)
            return false;
        if (other.getDesiredInstances() == null ^ this.getDesiredInstances() == null)
            return false;
        if (other.getDesiredInstances() != null && other.getDesiredInstances().equals(this.getDesiredInstances()) == false)
            return false;
        if (other.getMinSize() == null ^ this.getMinSize() == null)
            return false;
        if (other.getMinSize() != null && other.getMinSize().equals(this.getMinSize()) == false)
            return false;
        if (other.getMaxSize() == null ^ this.getMaxSize() == null)
            return false;
        if (other.getMaxSize() != null && other.getMaxSize().equals(this.getMaxSize()) == false)
            return false;
        if (other.getLocation() == null ^ this.getLocation() == null)
            return false;
        if (other.getLocation() != null && other.getLocation().equals(this.getLocation()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getFleetId() == null) ? 0 : getFleetId().hashCode());
        hashCode = prime * hashCode + ((getDesiredInstances() == null) ? 0 : getDesiredInstances().hashCode());
        hashCode = prime * hashCode + ((getMinSize() == null) ? 0 : getMinSize().hashCode());
        hashCode = prime * hashCode + ((getMaxSize() == null) ? 0 : getMaxSize().hashCode());
        hashCode = prime * hashCode + ((getLocation() == null) ? 0 : getLocation().hashCode());
        return hashCode;
    }

    @Override
    public UpdateFleetCapacityRequest clone() {
        return (UpdateFleetCapacityRequest) super.clone();
    }

}


text:
<?php

namespace peckrob\Laravel5ImapAuthentication;

use Illuminate\Support\ServiceProvider;

class ImapAuthServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        $this->app['auth']->extend('imap', function ($app)
        {
           $model = $app['config']['auth.model'];

           return new ImapUserProvider(new $model, $app["config"]['imap']);
        });
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {

    }

    protected function registerAuthEvents()
    {
        $app = $this->app;
        $app->after(function ($request, $response) use ($app) {
            // If the authentication service has been used, we'll check for any cookies
            // that may be queued by the service. These cookies are all queued until
            // they are attached onto Response objects at the end of the requests.
            if (isset($app['auth.loaded'])) {
                foreach ($app['auth']->getDrivers() as $driver) {
                    foreach ($driver->getQueuedCookies() as $cookie) {
                        $response->headers->setCookie($cookie);
                    }
                }
            }
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return ['auth'];
    }
}


text:
require "clockwork_euler/version"

module ClockworkEuler
end


text:
namespace JEBTest
{
    class Indentation
    {
    public:
        Indentation() noexcept;

        const std::string& indentationString() const;
        void setIndentationString(const std::string& str);

        void clear();
        void pushIndent();
        void pushAlignment(unsigned pos);
        void pop();

        void write(std::ostream& os) const;
    private:
        std::string m_IndentationString;
        std::vector<int> m_Indents;
    };

    std::ostream& operator<<(std::ostream& os, const Indentation& i);
}


text:
layout: post
title: "challange"
date: "2016-07-04 16:36:00 +0300"
published: false
tag : "career"
category: blog
author: Lee Elenbaas
---
I got the challenge today.

"You are an engineer, prove it."

It took two months to get into my head what it is they are looking for, and it makes sense. Except that this particular challenge does not interest me one bit.

But i do like a good challenge, so perhaps.


text:
// Scintilla source code edit control
/** @file ContractionState.h
 ** Manages visibility of lines for folding and wrapping.
 **/
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.

#ifndef CONTRACTIONSTATE_H
#define CONTRACTIONSTATE_H

#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif

/**
 */
class ContractionState {
	// These contain 1 element for every document line.
	RunStyles *visible;
	RunStyles *expanded;
	RunStyles *heights;
	Partitioning *displayLines;
	int linesInDocument;

	void EnsureData();

	bool OneToOne() const {
		// True when each document line is exactly one display line so need for
		// complex data structures.
		return visible == 0;
	}

public:
	ContractionState();
	virtual ~ContractionState();

	void Clear();

	int LinesInDoc() const;
	int LinesDisplayed() const;
	int DisplayFromDoc(int lineDoc) const;
	int DocFromDisplay(int lineDisplay) const;

	void InsertLine(int lineDoc);
	void InsertLines(int lineDoc, int lineCount);
	void DeleteLine(int lineDoc);
	void DeleteLines(int lineDoc, int lineCount);

	bool GetVisible(int lineDoc) const;
	bool SetVisible(int lineDocStart, int lineDocEnd, bool visible);

	bool GetExpanded(int lineDoc) const;
	bool SetExpanded(int lineDoc, bool expanded);

	int GetHeight(int lineDoc) const;
	bool SetHeight(int lineDoc, int height);

	void ShowAll();
	void Check() const;
};

#ifdef SCI_NAMESPACE
}
#endif

#endif


text:
(function() {
  /** Find short URL in the page */
  function findShortUrl() {
    const url = new URL(document.location);

    if (url.pathname === '/watch' && url.searchParams.get('v')) {
      const title = document.title;
      const shortened = new URL(`/${url.searchParams.get('v')}`, 'https://youtu.be');

      return {
        short: true,
        url: shortened.href,
        hash: document.location.hash,
        title: title
      }
    }

    // Fall back to defaults.
    return {}
  }

  browser.runtime.sendMessage(findShortUrl());
}());


text:
/**
 *  Set up namespace
 */
namespace AMQP {

/**
 *  Class definition
 */
class BasicRecoverOKFrame : public BasicFrame {
protected:
    /**
     *  Encode a frame on a string buffer
     *
     *  @param  buffer  buffer to write frame to
     */
    virtual void fill(OutBuffer& buffer) const override
    {
        // call base then done, no other fields to encode
        BasicFrame::fill(buffer);
    }

public:
    /**
     *  Construct a basic recover ok frame from a received frame
     *
     *  @param frame    received frame
     */
    BasicRecoverOKFrame(ReceivedFrame &frame) :
        BasicFrame(frame)
    {}

    /**
     *  Construct a basic recover ok frame
     *
     *  @param  channel         channel id
     */
    BasicRecoverOKFrame(uint16_t channel) :
        BasicFrame(channel, 0)
    {}

    /**
     *  Destructor
     */
    virtual ~BasicRecoverOKFrame() {}

    /**
     * Return the method ID
     * @return  uint16_t
     */
    virtual uint16_t methodID() const override
    {
        return 111;
    }

    /**
     *  Process the frame
     *  @param  connection      The connection over which it was received
     *  @return bool            Was it succesfully processed?
     */
    virtual bool process(ConnectionImpl *connection) override
    {
        // we need the appropriate channel
        auto channel = connection->channel(this->channel());

        // channel does not exist
        if (!channel) return false;

        // report
        channel->reportSuccess();

        // done
        return true;
    }

};

/**
 *  End of namespace
 */
}


text:
package org.wso2.carbon.jndi.internal.util;

import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * A Utility which provides a way to throw checked exceptions from the lambda expressions.
 */
public final class LambdaExceptionUtils {

    /**
     * Represents a {@code Consumer} interface which can throw exceptions.
     *
     * @param <T> the type of the input to the operation
     * @param <E> the type of Exception
     */
    @FunctionalInterface
    public interface ConsumerWithExceptions<T, E extends Exception> {
        void accept(T t) throws E;
    }

    /**
     * Represents a {@code BiConsumer} interface which can throw exceptions.
     *
     * @param <T> the type of the first input to the operation
     * @param <U> the type of the second input to the operation
     * @param <E> the type of Exception
     */
    @FunctionalInterface
    public interface BiConsumerWithExceptions<T, U, E extends Exception> {
        void accept(T t, U u) throws E;
    }

    /**
     * Represents a {@code Function} interface which can throw exceptions.
     *
     * @param <T> the type of the input to the function
     * @param <R> the type of the result of the function
     * @param <E> the type of Exception
     */
    @FunctionalInterface
    public interface FunctionWithExceptions<T, R, E extends Exception> {
        R apply(T t) throws E;
    }

    /**
     * Represents a {@code Supplier} interface which can throw exceptions.
     *
     * @param <T> the type of results supplied by this supplier
     * @param <E> the type of Exception
     */
    @FunctionalInterface
    public interface SupplierWithExceptions<T, E extends Exception> {
        T get() throws E;
    }

    /**
     * Represents a {@code Runnable} interface which can throw exceptions.
     *
     * @param <E> the type of Exception
     */
    @FunctionalInterface
    public interface RunnableWithExceptions<E extends Exception> {
        void run() throws E;
    }

    public static <T, E extends Exception> Consumer<T> rethrowConsumer(ConsumerWithExceptions<T, E> consumer) {
        return t -> {
            try {
                consumer.accept(t);
            } catch (Exception exception) {
                throwAsUnchecked(exception);
            }
        };
    }

    public static <T, U, E extends Exception> BiConsumer<T, U> rethrowBiConsumer(
            BiConsumerWithExceptions<T, U, E> biConsumer) {
        return (t, u) -> {
            try {
                biConsumer.accept(t, u);
            } catch (Exception exception) {
                throwAsUnchecked(exception);
            }
        };
    }

    /**
     * .map(rethrowFunction(name -- Class.forName(name))) or .map(rethrowFunction(Class::forName))
     * @param <T>      Any Object.
     * @param <R>      Any Object
     * @param <E>      Any Exception.
     * @param function Function to apply for given arguments.
     *
     * @return     Any Object that result from the function passed.
     */
    public static <T, R, E extends Exception> Function<T, R> rethrowFunction(
            FunctionWithExceptions<T, R, E> function) {
        return t -> {
            try {
                return function.apply(t);
            } catch (Exception exception) {
                throwAsUnchecked(exception);
                return null;
            }
        };
    }

    /**
     * rethrowSupplier(() -- new StringJoiner(new String(new byte[]{77, 97, 114, 107}, "UTF-8"))),
     * @param <T>      Any Object.
     * @param <E>      Any Exception.
     * @param function Function to apply for given arguments.
     *
     * @return Supplier of the results.
     */
    public static <T, E extends Exception> Supplier<T> rethrowSupplier(SupplierWithExceptions<T, E> function) {
        return () -> {
            try {
                return function.get();
            } catch (Exception exception) {
                throwAsUnchecked(exception);
                return null;
            }
        };
    }

    /**
     * uncheck(() -- Class.forName("xxx"));
     * @param t RunnableException.
     */
    public static void uncheck(RunnableWithExceptions t) {
        try {
            t.run();
        } catch (Exception exception) {
            throwAsUnchecked(exception);
        }
    }

    /**
     * uncheck(() -- Class.forName("xxx"));
     * @param <R>    Any Object.
     * @param <E>    Any Exception.
     * @param supplier supplier interface which can throw exceptions.
     *
     * @return R     Any Object.
     */
    public static <R, E extends Exception> R uncheck(SupplierWithExceptions<R, E> supplier) {
        try {
            return supplier.get();
        } catch (Exception exception) {
            throwAsUnchecked(exception);
            return null;
        }
    }

    /**
     * uncheck(Class::forName, "xxx");
     * @param <T>     Any Object.
     * @param <R>     Any Object.
     * @param <E>     Any Exception.
     * @param function Any function which can throw an exception.
     * @param t       Any Object.
     *
     * @return R      Any Object.
     */
    public static <T, R, E extends Exception> R uncheck(FunctionWithExceptions<T, R, E> function, T t) {
        try {
            return function.apply(t);
        } catch (Exception exception) {
            throwAsUnchecked(exception);
            return null;
        }
    }

    @SuppressWarnings("unchecked")
    private static <E extends Throwable> void throwAsUnchecked(Exception exception) throws E {
        throw (E) exception;
    }

}


text:
package com.ags.my.template;

import javax.servlet.ServletContext;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.Map;

/**
 * @author Angel
 * @since 19/06/2014
 */
public interface ITemplateEngine {

    public void runTemplate(String templateName, Map<String, ?> model, ServletContext servletContext, PrintWriter writer, Locale locale);
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Menyanthes exaltata Sims

### Remarks
null


text:
package com.spectralogic.ds3client.networking;

import java.util.List;
import java.util.Set;

public interface Headers {
    /**
     * If the key is not a header then an empty list will be returned.
     */
    List<String> get(final String key);
    Set<String> keys();
}


text:
<md-toolbar class="md-table-toolbar md-default">

    <md-button id="main" class="md-icon-button md-primary" href="/#/apps" aria-label="{{ 'Settings' | translate }}">
      <md-icon md-font-icon="arrow_back" >arrow_back</md-icon>
    </md-button>

Back to Apps

    <md-button class="md-icon-button md-accent" href="/#/apps/new" aria-label="{{ 'Add App' | translate">
      <md-icon>add_circle</md-icon>
      <md-tooltip md-direction="bottom">
        <translate>Add a new app.</translate>
      </md-tooltip>
    </md-button>

  <md-divider></md-divider>
</md-toolbar>

    <md-card>
      <md-card-title>
        <md-card-title-text>

            {{ app.name }}

            {{ app.description | emptyFilter }}

        </md-card-title-text>
      </md-card-title>
      <md-card-content>

Scopes

          {{ app.scopes }}
          None

Callback URLs:

{{ a }}

Application URLs:

https://id.ctapp.io/oauth/authorize

https://id.ctapp.io/oauth/token

https://id.ctapp.io/oauth/revoke

Credentials

        <md-input-container class="md-block">

            <translate>App ID</translate>

          <input type="{{ showid == true ? 'text' : 'password' }}" ng-focus="showid = !showid" ng-blur="showid = !showid" type="text" ng-model="app.uid"></input>

        </md-input-container>
        <md-input-container class="md-block">

            <translate>App Secret</translate>

          <input type="{{ showsec == true ? 'text' : 'password' }}" ng-focus="showsec = !showsec" ng-blur="showsec = !showsec" type="text" ng-model="app.secret"></input>

        </md-input-container>
      </md-card-content>
      <md-divider ng-if="!$last"></md-divider>
      <md-card-actions layout="row" layout-align="end center">
        <md-button href="/#/apps/{{ app.id }}/edit"><translate>Edit</translate></md-button>
      </md-card-actions>
    </md-card>


text:
package com.galenframework.ide.model.profile;

import com.galenframework.ide.model.devices.DeviceRequest;
import com.galenframework.ide.model.settings.Settings;

import java.util.List;

public class ProfileContent {
    private Settings settings;
    private List<DeviceRequest> devices;

    public void setSettings(Settings settings) {
        this.settings = settings;
    }

    public Settings getSettings() {
        return settings;
    }

    public List<DeviceRequest> getDevices() {
        return devices;
    }

    public void setDevices(List<DeviceRequest> devices) {
        this.devices = devices;
    }
}


text: export default (token: string) => token[0] == '!';


text:
#ifndef __PAGINGCCTABLEVIEWCELL_H__
#define __PAGINGCCTABLEVIEWCELL_H__

#include "extensions/ExtensionMacros.h"
#include "2d/CCNode.h"

#include "cocos2d.h"
using namespace cocos2d;

/**
 * Abstract class for SWTableView cell node
 */
class PagingTableViewCell: public Node
{
public:
    CREATE_FUNC(PagingTableViewCell);

    PagingTableViewCell() {}
    /**
     * The index used internally by SWTableView and its subclasses
     */
    ssize_t getIdx() const;
    void setIdx(ssize_t uIdx);
    /**
     * Cleans up any resources linked to this cell and resets idx property.
     */
    void reset();

private:
    ssize_t _idx;
};

#endif /* __PAGINGCCTABLEVIEWCELL_H__ */


text:
from azure.cli.core.commands import CliCommandType
from ._client_factory import (get_devtestlabs_virtual_machine_operation,
                              get_devtestlabs_custom_image_operation,
                              get_devtestlabs_gallery_image_operation,
                              get_devtestlabs_artifact_operation,
                              get_devtestlabs_artifact_source_operation,
                              get_devtestlabs_lab_operation,
                              get_devtestlabs_virtual_network_operation,
                              get_devtestlabs_formula_operation,
                              get_devtestlabs_secret_operation,
                              get_devtestlabs_environment_operation,
                              get_devtestlabs_arm_template_operation)
from .validators import validate_lab_vm_create, validate_lab_vm_list, validate_claim_vm, validate_user_name
from ._format import (transform_artifact_source_list, transform_artifact_source, transform_arm_template_list,
                      transform_arm_template, transform_vm_list, transform_vm, export_artifacts)

# pylint: disable=too-many-locals, too-many-statements
def load_command_table(self, _):

    virtual_machine_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#VirtualMachinesOperations.{}',
        client_factory=get_devtestlabs_virtual_machine_operation
    )

    lab_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#LabsOperations.{}',
        client_factory=get_devtestlabs_lab_operation
    )

    custom_image_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#CustomImagesOperations.{}',
        client_factory=get_devtestlabs_custom_image_operation
    )

    gallery_image_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#GalleryImagesOperations.{}',
        client_factory=get_devtestlabs_gallery_image_operation
    )

    artifact_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#ArtifactsOperations.{}',
        client_factory=get_devtestlabs_artifact_operation
    )

    artifact_source_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#ArtifactSourcesOperations.{}',
        client_factory=get_devtestlabs_artifact_source_operation
    )

    virtual_network_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#VirtualNetworksOperations.{}',
        client_factory=get_devtestlabs_virtual_network_operation
    )

    formula_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#FormulasOperations.{}',
        client_factory=get_devtestlabs_formula_operation
    )

    secret_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#SecretsOperations.{}',
        client_factory=get_devtestlabs_secret_operation,
        validator=validate_user_name
    )

    environment_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#EnvironmentsOperations.{}',
        client_factory=get_devtestlabs_environment_operation,
        validator=validate_user_name
    )

    arm_template_operations = CliCommandType(
        operations_tmpl='azure.mgmt.devtestlabs.operations#ArmTemplatesOperations.{}',
        client_factory=get_devtestlabs_arm_template_operation
    )

    # Virtual Machine Operations Commands
    with self.command_group('lab vm', virtual_machine_operations,
                            client_factory=get_devtestlabs_virtual_machine_operation) as g:
        g.show_command('show', 'get', table_transformer=transform_vm)
        g.command('delete', 'delete')
        g.command('start', 'start')
        g.command('stop', 'stop')
        g.command('apply-artifacts', 'apply_artifacts')
        g.custom_command('list', 'list_vm', validator=validate_lab_vm_list, table_transformer=transform_vm_list)
        g.custom_command('claim', 'claim_vm', validator=validate_claim_vm)
        g.custom_command('create', 'create_lab_vm', client_factory=get_devtestlabs_lab_operation,
                         validator=validate_lab_vm_create)

    # Lab Operations Commands
    with self.command_group('lab', lab_operations) as g:
        g.command('get', 'get')
        g.command('delete', 'delete')

    # Custom Image Operations Commands
    with self.command_group('lab custom-image', custom_image_operations) as g:
        g.show_command('show', 'get')
        g.command('list', 'list')
        g.command('delete', 'delete')
        g.custom_command('create', 'create_custom_image', client_factory=get_devtestlabs_custom_image_operation)

    # Gallery Image Operations Commands
    with self.command_group('lab gallery-image', gallery_image_operations) as g:
        g.command('list', 'list')

    # Artifact Operations Commands
    with self.command_group('lab artifact', artifact_operations) as g:
        g.command('list', 'list')

    # Artifact Source Operations Commands
    with self.command_group('lab artifact-source', artifact_source_operations) as g:
        g.command('list', 'list', table_transformer=transform_artifact_source_list)
        g.show_command('show', 'get', table_transformer=transform_artifact_source)

    # Virtual Network Operations Commands
    with self.command_group('lab vnet', virtual_network_operations) as g:
        g.command('list', 'list')
        g.command('get', 'get')

    # Formula Operations Commands
    with self.command_group('lab formula', formula_operations) as g:
        g.show_command('show', 'get')
        g.command('list', 'list')
        g.command('delete', 'delete')
        g.command('export-artifacts', 'get', transform=export_artifacts)

    # Secret Operations Commands
    with self.command_group('lab secret', secret_operations) as g:
        g.command('set', 'create_or_update')
        g.show_command('show', 'get')
        g.command('list', 'list')
        g.command('delete', 'delete')

    # Environment Operations Commands
    with self.command_group('lab environment', environment_operations) as g:
        g.show_command('show', 'get')
        g.command('list', 'list')
        g.command('delete', 'delete')
        g.command('create', 'create_or_update')
        g.custom_command('create', 'create_environment', client_factory=get_devtestlabs_environment_operation)

    # ARM Templates Operations Commands
    with self.command_group('lab arm-template', arm_template_operations) as g:
        g.command('list', 'list', table_transformer=transform_arm_template_list)
        g.custom_show_command('show', 'show_arm_template', table_transformer=transform_arm_template,
                              client_factory=get_devtestlabs_arm_template_operation)

    with self.command_group('lab', is_preview=True):
        pass


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.viralpatel</groupId>
    <artifactId>spring-boot-freemarker-example</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>spring-boot-freemarker-example</name>
    <description>Spring Boot FreeMarker (FTL) Hello World example</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <!-- Compile -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>


text:
import React, {PropTypes} from 'react'

export class InputButton extends React.Component {
    static propTypes = {
        value: PropTypes.string
    };

    componentWillMount() {
        this.state = {
            value: this.props.value || ''
        };
    }

    render() {
        const {children, placeholder = ''} = this.props;

        return (
            <span>
                <input
                    value={this.state.value}
                    placeholder={placeholder}
                    onKeyPress={this.onKeyDown.bind(this)}
                    onChange={this.onInputChange.bind(this)}>
                </input>
                <button onClick={this.onButtonClick.bind(this)}>
                    {children}
                </button>
            </span>
        );
    }

    onInputChange(event) {
        this.setState({
            value: event.target.value
        });
    }

    onKeyDown(event) {
        const isEnter = event.charCode === 13;

        if (isEnter) {
            const {
                onEnter = () => {
                }
            } = this.props;
            onEnter(this.state.value);
        }
    }

    onButtonClick() {
        this.props.onButtonClick(this.state.value);
    }
}

InputButton.propTypes = {
    onButtonClick: PropTypes.func.isRequired
};


text:
<!DOCTYPE html>

<meta charset="utf-8">

<title>Table of Contents - Rails Application Documentation</title>

<link href="./css/fonts.css" rel="stylesheet">
<link href="./css/rdoc.css" rel="stylesheet">

Table of Contents - Rails Application Documentation

Pages

    README

README

Classes and Modules

    ApplicationController

    ApplicationController::DeviseLdapAuthenticatable

    ApplicationController::Net

    ApplicationController::Net::LDAP

    ApplicationHelper

    ApplicationResponder

    Credential

    CredentialsController

    CredentialsDatatable

    CredentialsHelper

    User

Methods

    ::key_info?
    —
    Credential

    ::key_valid?
    —
    Credential

    #action_dropdown_btn_for
    —
    ApplicationHelper

    #bs_alert
    —
    ApplicationHelper

    #bs_icon
    —
    ApplicationHelper

    #bs_icon_and_text
    —
    ApplicationHelper

    #create
    —
    CredentialsController

    #credential_status_class
    —
    CredentialsHelper

    #credential_status_label
    —
    CredentialsHelper

    #crud_btns_for
    —
    ApplicationHelper

    #destroy
    —
    CredentialsController

    #destroy_link_for
    —
    ApplicationHelper

    #dropdown_button_with_text
    —
    ApplicationHelper

    #dtg_span
    —
    ApplicationHelper

    #edit
    —
    CredentialsController

    #edit_link_for
    —
    ApplicationHelper

    #edit_multiple
    —
    CredentialsController

    #expired?
    —
    Credential

    #expiring?
    —
    Credential

    #field_with_value
    —
    ApplicationHelper

    #full_name
    —
    User

    #index
    —
    CredentialsController

    #key_info
    —
    CredentialsController

    #key_info
    —
    CredentialsHelper

    #ldap_entry
    —
    User

    #login
    —
    Credential

    #mail_to_user
    —
    ApplicationHelper

    #multiple_edit_checkbox
    —
    CredentialsHelper

    #new
    —
    CredentialsController

    #nonexpired?
    —
    Credential

    #searchable_columns
    —
    CredentialsDatatable

    #show
    —
    CredentialsController

    #show_ldap_error
    —
    ApplicationController

    #show_link_for
    —
    ApplicationHelper

    #sortable_columns
    —
    CredentialsDatatable

    #ssh_key_span
    —
    CredentialsHelper

    #status
    —
    Credential

    #update
    —
    CredentialsController

    #update_multiple
    —
    CredentialsController

Validate

Generated by RDoc 4.2.0.

Based on Darkfish by Michael Granger.


text:
package org.orekit.propagation.events;

import java.util.Arrays;

import org.hipparchus.ode.events.Action;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.events.handlers.EventHandler;
import org.orekit.time.AbsoluteDate;

/** Wrapper used to detect only increasing or decreasing events.
 *
 *
This class is heavily based on the class EventFilter from the
 * Hipparchus library. The changes performed consist in replacing
 * raw types (double and double arrays) with space dynamics types
 * ({@link AbsoluteDate}, {@link SpacecraftState}).

 *
 *
General {@link EventDetector events} are defined implicitly
 * by a {@link EventDetector#g(SpacecraftState) g function} crossing
 * zero. This function needs to be continuous in the event neighborhood,
 * and its sign must remain consistent between events. This implies that
 * during an orbit propagation, events triggered are alternately events
 * for which the function increases from negative to positive values,
 * and events for which the function decreases from positive to
 * negative values.
 *

 *
 *
Sometimes, users are only interested in one type of event (say
 * increasing events for example) and not in the other type. In these
 * cases, looking precisely for all events location and triggering
 * events that will later be ignored is a waste of computing time.

 *
 *
Users can wrap a regular {@link EventDetector event detector} in
 * an instance of this class and provide this wrapping instance to
 * a {@link org.orekit.propagation.Propagator}
 * in order to avoid wasting time looking for uninteresting events.
 * The wrapper will intercept the calls to the {@link
 * EventDetector#g(SpacecraftState) g function} and to the {@link
 * EventDetector#eventOccurred(SpacecraftState, boolean)
 * eventOccurred} method in order to ignore uninteresting events. The
 * wrapped regular {@link EventDetector event detector} will then see only
 * the interesting events, i.e. either only {@code increasing} events or
 * only {@code decreasing} events. The number of calls to the {@link
 * EventDetector#g(SpacecraftState) g function} will also be reduced.

 * @see EventEnablingPredicateFilter
 */

public class EventSlopeFilter<T extends EventDetector> extends AbstractDetector<EventSlopeFilter<T>> {

    /** Number of past transformers updates stored. */
    private static final int HISTORY_SIZE = 100;

    /** Wrapped event detector. */
    private final T rawDetector;

    /** Filter to use. */
    private final FilterType filter;

    /** Transformers of the g function. */
    private final Transformer[] transformers;

    /** Update time of the transformers. */
    private final AbsoluteDate[] updates;

    /** Indicator for forward integration. */
    private boolean forward;

    /** Extreme time encountered so far. */
    private AbsoluteDate extremeT;

    /** Wrap an {@link EventDetector event detector}.
     * @param rawDetector event detector to wrap
     * @param filter filter to use
     */
    public EventSlopeFilter(final T rawDetector, final FilterType filter) {
        this(rawDetector.getMaxCheckInterval(), rawDetector.getThreshold(),
             rawDetector.getMaxIterationCount(), new LocalHandler<T>(),
             rawDetector, filter);
    }

    /** Private constructor with full parameters.
     *

     * This constructor is private as users are expected to use the builder
     * API with the various {@code withXxx()} methods to set up the instance
     * in a readable manner without using a huge amount of parameters.
     *

     * @param maxCheck maximum checking interval (s)
     * @param threshold convergence threshold (s)
     * @param maxIter maximum number of iterations in the event time search
     * @param handler event handler to call at event occurrences
     * @param rawDetector event detector to wrap
     * @param filter filter to use
     * @since 6.1
     */
    private EventSlopeFilter(final double maxCheck, final double threshold,
                             final int maxIter, final EventHandler<? super EventSlopeFilter<T>> handler,
                             final T rawDetector, final FilterType filter) {
        super(maxCheck, threshold, maxIter, handler);
        this.rawDetector  = rawDetector;
        this.filter       = filter;
        this.transformers = new Transformer[HISTORY_SIZE];
        this.updates      = new AbsoluteDate[HISTORY_SIZE];
    }

    /** {@inheritDoc} */
    @Override
    protected EventSlopeFilter<T> create(final double newMaxCheck, final double newThreshold,
                                         final int newMaxIter, final EventHandler<? super EventSlopeFilter<T>> newHandler) {
        return new EventSlopeFilter<T>(newMaxCheck, newThreshold, newMaxIter, newHandler, rawDetector, filter);
    }

    /**  {@inheritDoc} */
    public void init(final SpacecraftState s0,
                     final AbsoluteDate t) {
        super.init(s0, t);

        // delegate to raw detector
        rawDetector.init(s0, t);

        // initialize events triggering logic
        forward  = t.compareTo(s0.getDate()) >= 0;
        extremeT = forward ? AbsoluteDate.PAST_INFINITY : AbsoluteDate.FUTURE_INFINITY;
        Arrays.fill(transformers, Transformer.UNINITIALIZED);
        Arrays.fill(updates, extremeT);

    }

    /**  {@inheritDoc} */
    public double g(final SpacecraftState s) {

        final double rawG = rawDetector.g(s);

        // search which transformer should be applied to g
        if (forward) {
            final int last = transformers.length - 1;
            if (extremeT.compareTo(s.getDate()) < 0) {
                // we are at the forward end of the history

                // check if a new rough root has been crossed
                final Transformer previous = transformers[last];
                final Transformer next     = filter.selectTransformer(previous, rawG, forward);
                if (next != previous) {
                    // there is a root somewhere between extremeT and t.
                    // the new transformer is valid for t (this is how we have just computed
                    // it above), but it is in fact valid on both sides of the root, so
                    // it was already valid before t and even up to previous time. We store
                    // the switch at extremeT for safety, to ensure the previous transformer
                    // is not applied too close of the root
                    System.arraycopy(updates,      1, updates,      0, last);
                    System.arraycopy(transformers, 1, transformers, 0, last);
                    updates[last]      = extremeT;
                    transformers[last] = next;
                }

                extremeT = s.getDate();

                // apply the transform
                return next.transformed(rawG);

            } else {
                // we are in the middle of the history

                // select the transformer
                for (int i = last; i > 0; --i) {
                    if (updates[i].compareTo(s.getDate()) <= 0) {
                        // apply the transform
                        return transformers[i].transformed(rawG);
                    }
                }

                return transformers[0].transformed(rawG);

            }
        } else {
            if (s.getDate().compareTo(extremeT) < 0) {
                // we are at the backward end of the history

                // check if a new rough root has been crossed
                final Transformer previous = transformers[0];
                final Transformer next     = filter.selectTransformer(previous, rawG, forward);
                if (next != previous) {
                    // there is a root somewhere between extremeT and t.
                    // the new transformer is valid for t (this is how we have just computed
                    // it above), but it is in fact valid on both sides of the root, so
                    // it was already valid before t and even up to previous time. We store
                    // the switch at extremeT for safety, to ensure the previous transformer
                    // is not applied too close of the root
                    System.arraycopy(updates,      0, updates,      1, updates.length - 1);
                    System.arraycopy(transformers, 0, transformers, 1, transformers.length - 1);
                    updates[0]      = extremeT;
                    transformers[0] = next;
                }

                extremeT = s.getDate();

                // apply the transform
                return next.transformed(rawG);

            } else {
                // we are in the middle of the history

                // select the transformer
                for (int i = 0; i < updates.length - 1; ++i) {
                    if (s.getDate().compareTo(updates[i]) <= 0) {
                        // apply the transform
                        return transformers[i].transformed(rawG);
                    }
                }

                return transformers[updates.length - 1].transformed(rawG);

            }
        }

    }

    /** Local handler. */
    private static class LocalHandler<T extends EventDetector> implements EventHandler<EventSlopeFilter<T>> {

        /** {@inheritDoc} */
        public Action eventOccurred(final SpacecraftState s, final EventSlopeFilter<T> ef, final boolean increasing) {
            return ef.rawDetector.eventOccurred(s, ef.filter.getTriggeredIncreasing());
        }

        /** {@inheritDoc} */
        @Override
        public SpacecraftState resetState(final EventSlopeFilter<T> ef, final SpacecraftState oldState) {
            return ef.rawDetector.resetState(oldState);
        }

    }

}


text:
<?php

/**
 * List Orders Sample
 */

require_once('.config.inc.php');

/************************************************************************
 * Instantiate Implementation of MarketplaceWebServiceOrders
 *
 * AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY constants
 * are defined in the .config.inc.php located in the same
 * directory as this sample
 ***********************************************************************/
// More endpoints are listed in the MWS Developer Guide
// North America:
//$serviceUrl = "https://mws.amazonservices.com/Orders/2013-09-01";
// Europe
//$serviceUrl = "https://mws-eu.amazonservices.com/Orders/2013-09-01";
// Japan
//$serviceUrl = "https://mws.amazonservices.jp/Orders/2013-09-01";
// China
//$serviceUrl = "https://mws.amazonservices.com.cn/Orders/2013-09-01";
$serviceUrl = "https://mws.amazonservices.in/Orders/2013-09-01";

$config = array(
    'ServiceURL' => $serviceUrl,
    'ProxyHost' => null,
    'ProxyPort' => -1,
    'ProxyUsername' => null,
    'ProxyPassword' => null,
    'MaxErrorRetry' => 3,
);

$service = new MarketplaceWebServiceOrders_Client(
    AWS_ACCESS_KEY_ID,
    AWS_SECRET_ACCESS_KEY,
    APPLICATION_NAME,
    APPLICATION_VERSION,
    $config);

/************************************************************************
 * Uncomment to try out Mock Service that simulates MarketplaceWebServiceOrders
 * responses without calling MarketplaceWebServiceOrders service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under MarketplaceWebServiceOrders/Mock tree
 *
 ***********************************************************************/
// $service = new MarketplaceWebServiceOrders_Mock();

/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for List Orders Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as MarketplaceWebServiceOrders_Model_ListOrders
$request = new MarketplaceWebServiceOrders_Model_ListOrdersRequest();
//$request->setSellerId(MERCHANT_ID);

$request->setSellerId('SELLER_ID');
$request->setMarketplaceId('MARKETPLACE_ID');
//$request->setLastUpdatedAfter('2017-10-09T18:12:21');
$request->setCreatedAfter("2017-01-01T18:12:21");
//$request->setSellerId('A160COOPCXNGTA');

//$mwsIdList = array( "Id" => array('A21TJRUUN4KGV') );

// object or array of parameters
invokeListOrders($service, $request);

/**
 * Get List Orders Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param MarketplaceWebServiceOrders_Interface $service instance of MarketplaceWebServiceOrders_Interface
 * @param mixed $request MarketplaceWebServiceOrders_Model_ListOrders or array of parameters
 */

function invokeListOrders(MarketplaceWebServiceOrders_Interface $service, $request)
{
    try {
        $response = $service->ListOrders($request);

//        echo("Service Response\n");
//        echo("=============================================================================\n");

        $dom = new DOMDocument();
        $dom->loadXML($response->toXML());
        $dom->preserveWhiteSpace = false;
        $dom->formatOutput = true;
//        echo $dom->saveXML();
        $xml = simplexml_load_string($dom->saveXML());
        $json = json_encode($xml);
        $array = json_decode($json, TRUE);
        echo "<pre>";
        print_r($array['ListOrdersResult']['Orders']['Order']);

//        echo("ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n");

    } catch (MarketplaceWebServiceOrders_Exception $ex) {
        echo "<pre>";
        echo("Caught Exception: " . $ex->getMessage() . "\n");
        echo("Response Status Code: " . $ex->getStatusCode() . "\n");
        echo("Error Code: " . $ex->getErrorCode() . "\n");
        echo("Error Type: " . $ex->getErrorType() . "\n");
        echo("Request ID: " . $ex->getRequestId() . "\n");
        echo("XML: " . $ex->getXML() . "\n");
        echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n");
    }
}


text:
from Module import AbstractModule

class Module(AbstractModule):
    def __init__(self):
        AbstractModule.__init__(self)

    def run(
        self, network, antecedents, out_attributes, user_options, num_cores,
        outfile):
        """generate a heatmap of input file"""
        from genomicode import graphlib
        from genomicode import filelib
        import subprocess
        import arrayio
        from Betsy import module_utils
        from genomicode import config
        in_data = antecedents
        Heatmap_path = config.arrayplot
        Heatmap_BIN = module_utils.which(Heatmap_path)
        assert Heatmap_BIN, 'cannot find the %s' % Heatmap_path

        command = ['python', Heatmap_BIN, in_data.identifier, '-o', outfile,
                   "--label_arrays", "--label_genes"]
        if 'color' in out_attributes.keys():
            color = ['--color', out_attributes['color'].replace('_', '-')]
            command.extend(color)

        M = arrayio.read(in_data.identifier)
        nrow = M.nrow()
        ncol = M.ncol()
        ratio = float(nrow) / ncol
        max_box_height = 20
        max_box_width = 60
        if 'hm_width' in user_options:
            max_box_width = user_options['hm_width']

        if 'hm_height' in user_options:
            max_box_height = user_options['hm_height']

        if ratio >= 4:
            x, y = graphlib.find_tall_heatmap_size(nrow, ncol,
                                                   max_box_height=max_box_height,
                                                   max_box_width=max_box_width,
                                                   min_box_height=20,
                                                   min_box_width=20,
                                                   max_megapixels=128)
        else:
            x, y = graphlib.find_wide_heatmap_size(nrow, ncol,
                                                   max_box_height=max_box_height,
                                                   max_box_width=max_box_width,
                                                   min_box_height=20,
                                                   min_box_width=20,
                                                   max_megapixels=128)

        command.extend(['-x', str(x), '-y', str(y)])
        process = subprocess.Popen(command,
                                   shell=False,
                                   stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE)
        error_message = process.communicate()[1]
        if error_message:
            raise ValueError(error_message)

        assert filelib.exists_nz(outfile), (
            'the output file %s for plot_signature_prediction_comparison fails' %
            outfile)

    def name_outfile(self, antecedents, user_options):
        from Betsy import module_utils
        original_file = module_utils.get_inputid(antecedents.identifier)
        filename = 'heatmap_' + original_file + '.png'
        return filename


text:
void window_date_update();
void window_time_update();
void window_step_update();
void window_bpm_update();
void main_window_push();
void main_window_destroy();


text:
<?php
/**
 * Taxonomy API: Walker_CategoryDropdown class
 *
 * @package WordPress
 * @subpackage Template
 * @since 4.4.0
 */

/**
 * Core class used to create an HTML dropdown list of Categories.
 *
 * @since 2.1.0
 *
 * @see Walker
 */
class Walker_CategoryDropdown extends Walker {

	/**
	 * What the class handles.
	 *
	 * @since 2.1.0
	 * @var string
	 *
	 * @see Walker::$tree_type
	 */
	public $tree_type = 'category';

	/**
	 * Database fields to use.
	 *
	 * @since 2.1.0
	 * @todo Decouple this
	 * @var array
	 *
	 * @see Walker::$db_fields
	 */
	public $db_fields = array ('parent' => 'parent', 'id' => 'term_id');

	/**
	 * Starts the element output.
	 *
	 * @since 2.1.0
	 *
	 * @see Walker::start_el()
	 *
	 * @param string $output   Passed by reference. Used to append additional content.
	 * @param object $category Category data object.
	 * @param int    $depth    Depth of category. Used for padding.
	 * @param array  $args     Uses 'selected', 'show_count', and 'value_field' keys, if they exist.
	 *                         See wp_dropdown_categories().
	 * @param int    $id       Optional. ID of the current category. Default 0 (unused).
	 */
	public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
		$pad = str_repeat(' ', $depth * 3);

		/** This filter is documented in wp-includes/category-template.php */
		$cat_name = apply_filters( 'list_cats', $category->name, $category );

		if ( isset( $args['value_field'] ) && isset( $category->{$args['value_field']} ) ) {
			$value_field = $args['value_field'];
		} else {
			$value_field = 'term_id';
		}

		$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . "\"";

		// Type-juggling causes false matches, so we force everything to a string.
		if ( (string) $category->{$value_field} === (string) $args['selected'] )
			$output .= ' selected="selected"';
		$output .= '>';
		$output .= $pad.$cat_name;
		if ( $args['show_count'] )
			$output .= '  ('. number_format_i18n( $category->count ) .')';
		$output .= "</option>\n";
	}
}


text:
import gensim
from gensim import models, corpora
import pandas as pd
import nltk

#makes csv of phi matrix and unique words in order
def phi_words(corpus, lda, filename1, filename2):
	lda_corpus = lda[corpus]
	#get topics
	pairs = lda.show_topics(10, topn=lda.num_terms, formatted = False);
	#sort by tokens
	sorted_pairs = [sorted(pair, key=lambda pairr: int(pairr[1])) for pair in pairs]
	#get data for phi matrix
	probs = [[word[0] for word in topic] for topic in sorted_pairs]
	dict = {}
	for i in range(1,11):
		dict[i] = probs[i-1]
	df = pd.DataFrame(dict)
	df.to_csv(filename1)
	#Get the tokens
	d = corpus.dictionary.token2id
        fr = pd.DataFrame(data = d, index=[0])
        frame = fr.T
	#sort tokens
        sorted_frame = frame.sort([0])
	sorted_frame.to_csv(filename2)

#makes a vector with frequency of token in text
def token_freq(textfile, csv, output_file):

	#pull in the word list from a csv file produced
	#by phi_words. Takes a little reformatting, so
	#we should probably get this straight from LDA
	df = pd.DataFrame.from_csv(csv)
	df.reset_index( level=0, inplace=True )
	list_words = df.values.tolist()

	#create freq_dist object for text to create
	#frequency vector
	raw = open(textfile).read()
	tokens = gensim.utils.simple_preprocess(raw)
	text = nltk.Text(tokens)
	vocab = text.vocab()
	freqs = []
	for i in range(0, len(list_words)):
		freqs.append(vocab[list_words[i][0]])
	output = pd.DataFrame(freqs)
	output.to_csv(output_file)


text:
.file_upload {
  position: relative;
  overflow: hidden;
  direction: ltr;
  cursor: pointer;
  text-align: center;
  color: #333;
  font-weight: bold;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  width: 200px;
  height: 30px;
  line-height: 30px;
  background: palegreen;
  border: 1px solid limegreen;
}

.file_upload_small {
  width: 200px;
  height: 30px;
  line-height: 30px;
  font-size: auto;
  background: palegreen;
  border: 1px solid limegreen;
}

.file_upload_large {
  width: 100%;
  height: 150px;
  line-height: 150px;
  font-size: 20px;
  background: palegreen;
  border: 1px solid limegreen;
}

.file_upload_highlight {
  background: lawngreen;
}

.file_upload input {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  border: 300px solid transparent;
  opacity: 0;
  -ms-filter: 'alpha(opacity=0)';
  filter: alpha(opacity=0);
  -o-transform: translate(-300px, -300px) scale(10);
  -moz-transform: translate(-800px, 0) scale(10);
  cursor: pointer;
}

.file_upload iframe, .file_upload button {
  display: none;
}

.file_upload_progress .ui-progressbar-value {
  background: url(/images/pbar-ani.gif);
}

.file_upload_progress div {
  width: 150px;
  height: 15px;
}

.file_upload_cancel div {
  cursor: pointer;
}


text:
FROM ruby:2.3.0
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN apt-get update -qq && apt-get install -y imagemagick
RUN mkdir /vanGogh
WORKDIR /vanGogh
ADD Gemfile /vanGogh/Gemfile
ADD Gemfile.lock /vanGogh/Gemfile.lock
RUN bundle install
ADD . /vanGogh