text:
package org.apache.drill;

import com.google.common.base.Joiner;
import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.apache.drill.common.config.DrillConfig;
import org.apache.drill.common.expression.PathSegment;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.expression.parser.ExprLexer;
import org.apache.drill.common.expression.parser.ExprParser;
import org.apache.drill.common.types.TypeProtos;
import org.apache.drill.common.types.Types;
import org.apache.drill.exec.memory.BufferAllocator;
import org.apache.drill.exec.proto.UserBitShared;

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

public class TestBuilder {

  // test query to run
  private String query;
  // the type of query for the test
  private UserBitShared.QueryType queryType;
  // should the validation enforce ordering
  private Boolean ordered;
  private boolean approximateEquality;
  private BufferAllocator allocator;
  // Used to pass the type information associated with particular column names rather than relying on the
  // ordering of the columns in the CSV file, or the default type inferences when reading JSON, this is used for the
  // case where results of the test query are adding type casts to the baseline queries, this saves a little bit of
  // setup in cases where strict type enforcement is not necessary for a given test
  protected Map<SchemaPath, TypeProtos.MinorType> baselineTypeMap;
  // queries to run before the baseline or test queries, can be used to set options
  private String baselineOptionSettingQueries;
  private String testOptionSettingQueries;
  // two different methods are available for comparing ordered results, the default reads all of the records
  // into giant lists of objects, like one giant on-heap batch of 'vectors'
  // this flag enables the other approach which iterates through a hyper batch for the test query results and baseline
  // while this does work faster and use less memory, it can be harder to debug as all of the elements are not in a
  // single list
  private boolean highPerformanceComparison;

  public TestBuilder(BufferAllocator allocator) {
    this.allocator = allocator;
    reset();
  }

  public TestBuilder(BufferAllocator allocator, String query, UserBitShared.QueryType queryType, Boolean ordered,
                     boolean approximateEquality, Map<SchemaPath, TypeProtos.MinorType> baselineTypeMap,
                     String baselineOptionSettingQueries, String testOptionSettingQueries, boolean highPerformanceComparison) {
    this(allocator);
    if (ordered == null) {
      throw new RuntimeException("Ordering not set, you must explicitly call the ordered() or unOrdered() method on the " + this.getClass().getSimpleName());
    }
    this.query = query;
    this.queryType = queryType;
    this.ordered = ordered;
    this.approximateEquality = approximateEquality;
    this.baselineTypeMap = baselineTypeMap;
    this.baselineOptionSettingQueries = baselineOptionSettingQueries;
    this.testOptionSettingQueries = testOptionSettingQueries;
    this.highPerformanceComparison = highPerformanceComparison;
  }

  protected TestBuilder reset() {
    query = "";
    ordered = null;
    approximateEquality = false;
    highPerformanceComparison = false;
    testOptionSettingQueries = "";
    baselineOptionSettingQueries = "";
    return this;
  }

  public DrillTestWrapper build() throws Exception {
    if ( ! ordered && highPerformanceComparison ) {
      throw new Exception("High performance comparison only available for ordered checks, to enforce this restriction, ordered() must be called first.");
    }
    String validationQuery = null;
    if (typeInfoSet()) {
      validationQuery = getValidationQuery();
    }
    return new DrillTestWrapper(this, allocator, query, queryType, baselineOptionSettingQueries, testOptionSettingQueries,
        validationQuery, getValidationQueryType(), ordered, approximateEquality, highPerformanceComparison);
  }

  public TestBuilder sqlQuery(String query) {
    this.query = query;
    this.queryType = UserBitShared.QueryType.SQL;
    return this;
  }

  public TestBuilder physicalPlan(String query) {
    this.query = query;
    this.queryType = UserBitShared.QueryType.PHYSICAL;
    return this;
  }

  public TestBuilder ordered() {
    this.ordered = true;
    return this;
  }

  public TestBuilder unOrdered() {
    this.ordered = false;
    return this;
  }

  // this can only be used with ordered verifications, it does run faster and use less memory but may be
  // a little harder to debug as it iterates over a hyper batch rather than reading all of the values into
  // large on-heap lists
  public TestBuilder highPerformanceComparison() throws Exception {
    this.highPerformanceComparison = true;
    return this;
  }

  // list of queries to run before the baseline query, can be used to set several options
  // list takes the form of a semi-colon separated list
  public TestBuilder optionSettingQueriesForBaseline(String queries) {
    this.baselineOptionSettingQueries = queries;
    return this;
  }

  // list of queries to run before the test query, can be used to set several options
  // list takes the form of a semi-colon separated list
  public TestBuilder optionSettingQueriesForTestQuery(String queries) {
    this.testOptionSettingQueries = queries;
    return this;
  }
  public TestBuilder approximateEquality() {
    this.approximateEquality = true;
    return this;
  }

  public static SchemaPath parsePath(String path) {
    try {
      // logger.debug("Parsing expression string '{}'", expr);
      ExprLexer lexer = new ExprLexer(new ANTLRStringStream(path));
      CommonTokenStream tokens = new CommonTokenStream(lexer);
      ExprParser parser = new ExprParser(tokens);

      //TODO: move functionregistry and error collector to injectables.
      //ctxt.findInjectableValue(valueId, forProperty, beanInstance)
      ExprParser.parse_return ret = parser.parse();

      // ret.e.resolveAndValidate(expr, errorCollector);
      if (ret.e instanceof SchemaPath) {
        return (SchemaPath) ret.e;
      } else {
        throw new IllegalStateException("Schema path is not a valid format.");
      }
    } catch (RecognitionException e) {
      throw new RuntimeException(e);
    }
  }

  String getValidationQuery() throws Exception {
    throw new RuntimeException("Must provide some kind of baseline, either a baseline file or another query");
  }

  protected UserBitShared.QueryType getValidationQueryType() throws Exception {
    throw new RuntimeException("Must provide some kind of baseline, either a baseline file or another query");
  }

  public JSONTestBuilder jsonBaselineFile(String filePath) {
    return new JSONTestBuilder(filePath, allocator, query, queryType, ordered, approximateEquality,
        baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries, highPerformanceComparison);
  }

  public CSVTestBuilder csvBaselineFile(String filePath) {
    return new CSVTestBuilder(filePath, allocator, query, queryType, ordered, approximateEquality,
        baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries, highPerformanceComparison);
  }

  public TestBuilder baselineTypes(Map<SchemaPath, TypeProtos.MinorType> baselineTypeMap) {
    this.baselineTypeMap = baselineTypeMap;
    return this;
  }

  boolean typeInfoSet() {
    if (baselineTypeMap != null) {
      return true;
    } else {
      return false;
    }
  }

  // provide a SQL query to validate against
  public BaselineQueryTestBuilder sqlBaselineQuery(String baselineQuery) {
    return new BaselineQueryTestBuilder(baselineQuery, UserBitShared.QueryType.SQL, allocator, query, queryType, ordered, approximateEquality,
        baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries, highPerformanceComparison);
  }

  // provide a path to a file containing a SQL query to use as a baseline
  public BaselineQueryTestBuilder sqlBaselineQueryFromFile(String baselineQueryFilename) throws IOException {
    String baselineQuery = BaseTestQuery.getFile(baselineQueryFilename);
    return new BaselineQueryTestBuilder(baselineQuery, UserBitShared.QueryType.SQL, allocator, query, queryType, ordered, approximateEquality,
        baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries, highPerformanceComparison);
  }

  // as physical plans are verbose, this is the only option provided for specifying them, we should enforce
  // that physical plans, or any large JSON strings do not live in the Java source as literals
  public BaselineQueryTestBuilder physicalPlanBaselineQueryFromFile(String baselinePhysicalPlanPath) throws IOException {
    String baselineQuery = BaseTestQuery.getFile(baselinePhysicalPlanPath);
    return new BaselineQueryTestBuilder(baselineQuery, UserBitShared.QueryType.PHYSICAL, allocator, query, queryType, ordered, approximateEquality,
        baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries, highPerformanceComparison);
  }

  public class CSVTestBuilder extends TestBuilder {

    // path to the baseline file that will be inserted into the validation query
    private String baselineFilePath;
    // aliases for the baseline columns, only used in CSV where column names are not known
    private String[] baselineColumnNames;
    // use to cast the baseline file columns, if not set the types
    // that come out of the test query drive interpretation of baseline
    private TypeProtos.MinorType[] baselineTypes;

    CSVTestBuilder(String baselineFile, BufferAllocator allocator, String query, UserBitShared.QueryType queryType, Boolean ordered,
                     boolean approximateEquality, Map<SchemaPath, TypeProtos.MinorType> baselineTypeMap,
                     String baselineOptionSettingQueries, String testOptionSettingQueries, boolean highPerformanceComparison) {
      super(allocator, query, queryType, ordered, approximateEquality, baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries,
          highPerformanceComparison);
      this.baselineFilePath = baselineFile;
    }

    public CSVTestBuilder baselineColumnNames(String... baselineColumnNames) {
      this.baselineColumnNames = baselineColumnNames;
      return this;
    }

    public CSVTestBuilder baselineTypes(TypeProtos.MinorType... baselineTypes) {
      this.baselineTypes = baselineTypes;
      this.baselineTypeMap = null;
      return this;
    }

    public CSVTestBuilder baselineTypes(Map<SchemaPath, TypeProtos.MinorType> baselineTypeMap) {
      super.baselineTypes(baselineTypeMap);
      this.baselineTypes = null;
      return this;
    }

    protected TestBuilder reset() {
      super.reset();
      baselineColumnNames = null;
      baselineTypeMap = null;
      baselineTypes = null;
      baselineFilePath = null;
      return this;
    }

    boolean typeInfoSet() {
      if (super.typeInfoSet() || baselineTypes != null) {
        return true;
      } else {
        return false;
      }
    }

    String getValidationQuery() throws Exception {
      if (baselineColumnNames.length == 0) {
        throw new Exception("Baseline CSV files require passing column names, please call the baselineColumnNames() method on the test builder.");
      }

      String[] aliasedExpectedColumns = new String[baselineColumnNames.length];
      for (int i = 0; i < baselineColumnNames.length; i++) {
        aliasedExpectedColumns[i] = "columns[" + i + "] ";
        if (baselineTypes != null) {
          aliasedExpectedColumns[i] = "cast(" + aliasedExpectedColumns[i] + " as " + Types.getNameOfMajorType(baselineTypes[i]) + " ) ";
        } else if (baselineTypeMap != null) {
          aliasedExpectedColumns[i] = "cast(" + aliasedExpectedColumns[i] + " as " + Types.getNameOfMajorType(baselineTypeMap.get(parsePath(baselineColumnNames[i]))) + " ) ";
        }
        aliasedExpectedColumns[i] += baselineColumnNames[i];
      }
      String query = "select " + Joiner.on(", ").join(aliasedExpectedColumns) + " from cp.`" + baselineFilePath + "`";
//    System.out.println(query);
      return query;
    }

    protected UserBitShared.QueryType getValidationQueryType() throws Exception {
      return UserBitShared.QueryType.SQL;
    }

  }

  public class JSONTestBuilder extends TestBuilder {

    // path to the baseline file that will be inserted into the validation query
    private String baselineFilePath;

    JSONTestBuilder(String baselineFile, BufferAllocator allocator, String query, UserBitShared.QueryType queryType, Boolean ordered,
                   boolean approximateEquality, Map<SchemaPath, TypeProtos.MinorType> baselineTypeMap,
                   String baselineOptionSettingQueries, String testOptionSettingQueries, boolean highPerformanceComparison) {
      super(allocator, query, queryType, ordered, approximateEquality, baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries,
          highPerformanceComparison);
      this.baselineFilePath = baselineFile;
    }

    String getValidationQuery() {
      return "select * from cp.`" + baselineFilePath + "`";
    }

    protected UserBitShared.QueryType getValidationQueryType() throws Exception {
      return UserBitShared.QueryType.SQL;
    }

  }

  public class BaselineQueryTestBuilder extends TestBuilder {

    private String baselineQuery;
    private UserBitShared.QueryType baselineQueryType;

    BaselineQueryTestBuilder(String baselineQuery, UserBitShared.QueryType baselineQueryType, BufferAllocator allocator,
                             String query, UserBitShared.QueryType queryType, Boolean ordered,
                             boolean approximateEquality, Map<SchemaPath, TypeProtos.MinorType> baselineTypeMap,
                             String baselineOptionSettingQueries, String testOptionSettingQueries, boolean highPerformanceComparison) {
      super(allocator, query, queryType, ordered, approximateEquality, baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries,
          highPerformanceComparison);
      this.baselineQuery = baselineQuery;
      this.baselineQueryType = baselineQueryType;
    }

    String getValidationQuery() {
      return baselineQuery;
    }

    protected UserBitShared.QueryType getValidationQueryType() throws Exception {
      return baselineQueryType;
    }

    // This currently assumes that all explicit baseline queries will have fully qualified type information
    // if this changes, the baseline query can be run in a sub query with the implicit or explicit type passing
    // added on top of it, as is currently when done when reading a baseline file
    boolean typeInfoSet() {
      return true;
    }

  }
}


text:
#import "SDWebImageCompat.h"
#import "SDWebImageManager.h"

/**
 * Integrates SDWebImage async downloading and caching of remote images with UIImageView.
 *
 * Usage with a UITableViewCell sub-class:
 *
 * @code

#import <SDWebImage/UIImageView+WebCache.h>

...

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *MyIdentifier = @"MyIdentifier";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];

    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier]
                 autorelease];
    }

    // Here we use the provided sd_setImageWithURL: method to load the web image
    // Ensure you use a placeholder image otherwise cells will be initialized with no image
    [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"]
                      placeholderImage:[UIImage imageNamed:@"placeholder"]];

    cell.textLabel.text = @"My Text";
    return cell;
}

 * @endcode
 */
@interface UIImageView (WebCache)

/**
 * Get the current image URL.
 *
 * Note that because of the limitations of categories this property can get out of sync
 * if you use sd_setImage: directly.
 */
- (NSURL *)sd_imageURL;

/**
 * Set the imageView `image` with an `url`.
 *
 * The download is asynchronous and cached.
 *
 * @param url The url for the image.
 */
- (void)sd_setImageWithURL:(NSURL *)url;

/**
 * Set the imageView `image` with an `url` and a placeholder.
 *
 * The download is asynchronous and cached.
 *
 * @param url         The url for the image.
 * @param placeholder The image to be set initially, until the image request finishes.
 * @see sd_setImageWithURL:placeholderImage:options:
 */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder;

/**
 * Set the imageView `image` with an `url`, placeholder and custom options.
 *
 * The download is asynchronous and cached.
 *
 * @param url         The url for the image.
 * @param placeholder The image to be set initially, until the image request finishes.
 * @param options     The options to use when downloading the image. @see SDWebImageOptions for the possible values.
 */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options;

/**
 * Set the imageView `image` with an `url`.
 *
 * The download is asynchronous and cached.
 *
 * @param url            The url for the image.
 * @param completedBlock A block called when operation has been completed. This block has no return value
 *                       and takes the requested UIImage as first parameter. In case of error the image parameter
 *                       is nil and the second parameter may contain an NSError. The third parameter is a Boolean
 *                       indicating if the image was retrived from the local cache or from the network.
 *                       The fourth parameter is the original image url.
 */
- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock;

/**
 * Set the imageView `image` with an `url`, placeholder.
 *
 * The download is asynchronous and cached.
 *
 * @param url            The url for the image.
 * @param placeholder    The image to be set initially, until the image request finishes.
 * @param completedBlock A block called when operation has been completed. This block has no return value
 *                       and takes the requested UIImage as first parameter. In case of error the image parameter
 *                       is nil and the second parameter may contain an NSError. The third parameter is a Boolean
 *                       indicating if the image was retrived from the local cache or from the network.
 *                       The fourth parameter is the original image url.
 */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock;

/**
 * Set the imageView `image` with an `url`, placeholder and custom options.
 *
 * The download is asynchronous and cached.
 *
 * @param url            The url for the image.
 * @param placeholder    The image to be set initially, until the image request finishes.
 * @param options        The options to use when downloading the image. @see SDWebImageOptions for the possible values.
 * @param completedBlock A block called when operation has been completed. This block has no return value
 *                       and takes the requested UIImage as first parameter. In case of error the image parameter
 *                       is nil and the second parameter may contain an NSError. The third parameter is a Boolean
 *                       indicating if the image was retrived from the local cache or from the network.
 *                       The fourth parameter is the original image url.
 */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock;

/**
 * Set the imageView `image` with an `url`, placeholder and custom options.
 *
 * The download is asynchronous and cached.
 *
 * @param url            The url for the image.
 * @param placeholder    The image to be set initially, until the image request finishes.
 * @param options        The options to use when downloading the image. @see SDWebImageOptions for the possible values.
 * @param progressBlock  A block called while image is downloading
 * @param completedBlock A block called when operation has been completed. This block has no return value
 *                       and takes the requested UIImage as first parameter. In case of error the image parameter
 *                       is nil and the second parameter may contain an NSError. The third parameter is a Boolean
 *                       indicating if the image was retrived from the local cache or from the network.
 *                       The fourth parameter is the original image url.
 */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock;

/**
 * Set the imageView `image` with an `url` and a optionaly placeholder image.
 *
 * The download is asynchronous and cached.
 *
 * @param url            The url for the image.
 * @param placeholder    The image to be set initially, until the image request finishes.
 * @param options        The options to use when downloading the image. @see SDWebImageOptions for the possible values.
 * @param progressBlock  A block called while image is downloading
 * @param completedBlock A block called when operation has been completed. This block has no return value
 *                       and takes the requested UIImage as first parameter. In case of error the image parameter
 *                       is nil and the second parameter may contain an NSError. The third parameter is a Boolean
 *                       indicating if the image was retrived from the local cache or from the network.
 *                       The fourth parameter is the original image url.
 */
- (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url andPlaceholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock;

/**
 * Download an array of images and starts them in an animation loop
 *
 * @param arrayOfURLs An array of NSURL
 */
- (void)sd_setAnimationImagesWithURLs:(NSArray *)arrayOfURLs;

/**
 * Cancel the current download
 */
- (void)sd_cancelCurrentImageLoad;

- (void)sd_cancelCurrentAnimationImagesLoad;

/**
 *  Mr.Geng 于14.11.12新增的方法
 *
 *  @param url         <#url description#>
 *  @param placeholder <#placeholder description#>
 */
- (void)setImageWithoutBorderWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder;

@end

redpajama_set_name: RedPajamaGithub


text:
package com.nicefontaine.seanachie.ui.forms;

import com.nicefontaine.seanachie.data.models.Form;
import com.nicefontaine.seanachie.ui.BasePresenter;
import com.nicefontaine.seanachie.ui.BaseView;

import java.util.List;

public interface FormsContract {

    interface View extends BaseView<Presenter> {

        void loadForms(List<Form> forms);

        void noData();

        void initRecycler();

        void updateRecycler();
    }

    interface Presenter extends BasePresenter {

        void itemMoved(List<Form> forms);

        void itemRemoved(Integer formId);
    }
}


text:
class UsersController < ApplicationController
  skip_before_action :authorize, only: [:new, :create]

  before_action :set_user, only: [:update, :destroy]
  before_action :ensure_permission, only: [:update, :destroy]

  def new
    @user = User.new().with_params(params)
  end

  def create
    @user = User.new(user_params).with_params(user_params)
    if @user.save
      Librato.increment('user.trial.signup')
      @analytics_event = {eventCategory: 'customer', eventAction: 'new', eventLabel: 'trial', eventValue: 0}
      flash[:analytics_event] = render_to_string(partial: "shared/analytics_event")
      flash[:one_time_content] = render_to_string(partial: "shared/register_protocol_handlers")
      sign_in @user
      redirect_to root_url
    else
      render "new"
    end
  end

  def update
    old_plan_name = @user.plan.stripe_id
    @user.update_auth_token = true
    @user.old_password_valid = @user.authenticate(params[:user][:old_password])
    @user.attributes = user_params
    if params[:user] && params[:user][:password]
      @user.password_confirmation = params[:user][:password]
    end
    if @user.save
      new_plan_name = @user.plan.stripe_id
      if old_plan_name == 'trial' && new_plan_name != 'trial'
        Librato.increment('user.paid.signup')
        @analytics_event = {eventCategory: 'customer', eventAction: 'upgrade', eventLabel: @user.plan.stripe_id, eventValue: @user.plan.price.to_i}
        flash[:analytics_event] = render_to_string(partial: "shared/analytics_event")
      end
      sign_in @user
      if params[:redirect_to]
        redirect_to params[:redirect_to], notice: 'Account updated.'
      else
        redirect_to settings_account_path, notice: 'Account updated.'
      end
    else
      if params[:redirect_to]
        redirect_to params[:redirect_to], alert: @user.errors.full_messages.join('. ')
      else
        redirect_to settings_account_path, alert: @user.errors.full_messages.join('. ')
      end
    end
  end

  def destroy
    UserDeleter.perform_async(@user.id)
    sign_out
    redirect_to account_closed_public_settings_url
  end

  private

  def set_user
    @user = current_user
  end

  def ensure_permission
    unless @user.id == current_user.id
      render_404
    end
  end

  def user_params
    params.require(:user).permit(:email, :password, :stripe_token, :coupon_code, :plan_id)
  end

end


text:
/* Generated By:JJTree: Do not edit this line. ASTMethodDeclarator.java Version 6.0 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=*,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package uk.ac.open.crc.jim.parser.java14;

public
class ASTMethodDeclarator extends SimpleNode {
  public ASTMethodDeclarator(int id) {
    super(id);
  }

  public ASTMethodDeclarator(Java14Parser p, int id) {
    super(p, id);
  }

  public static Node jjtCreate(int id) {
    return new ASTMethodDeclarator(id);
  }

  public static Node jjtCreate(Java14Parser p, int id) {
    return new ASTMethodDeclarator(p, id);
  }

  /** Accept the visitor. **/
  public Object jjtAccept(Java14ParserVisitor visitor, Object data) {

    return
    visitor.visit(this, data);
  }
}
/* JavaCC - OriginalChecksum=4e9a05504607de7c83f6caba1003c8d0 (do not edit this line) */


text:
	@interface UIColor (CPAdditions)
#else
	@interface NSColor (CPAdditions)
#endif

@property (nonatomic, readonly) CGFloat cp_redComponent;
@property (nonatomic, readonly) CGFloat cp_greenComponent;
@property (nonatomic, readonly) CGFloat cp_blueComponent;
@property (nonatomic, readonly) CGFloat cp_alphaComponent;

@end


text:
layout: post
section-type: post
title: Patterns in Software
date: '2005-09-27T08:14:00.000+02:00'
author: Jørn Ølmheim
category: tech
tags: [ 'patterns' ]
modified_time: '2005-09-27T08:27:25.756+02:00'
blogger_id: tag:blogger.com,1999:blog-16320608.post-112780244567011972
blogger_orig_url: http://joelmheim.blogspot.com/2005/09/patterns-in-software.html
---

I spent the rest of the day yesterday listening to different talks about patterns. Most of them talked about what has
happend since the GoF book (Design Patterns, 1995), and what they think will be the future of patterns.

The track started with a talk from Ralph Johnson (one of the Gang of Four). He gave us his personal take on the history
of patterns up to today. After him, Dragos Marinescu from ThoughtWorks talked about the new book Pattern-Languages of
Program Development volume 5, where a new collection of Pattern Languages will be published later this year.

Markus Völter then talked about Patterns in Modern Software, Klaus Marquardt talked about how to improve the usability
of patterns, and finally Kevlin Henney and Frank Buschmann talked about their take on the past, present and future of
patterns.

The main trend in the pattern community is the move of focus from single patterns to pattern languages (interconnected
patterns). Kevlin and Frank will publish a new book in Frank's series Pattern-Oriented Software Architecture, volume 5,
later this year. In this book they will connect patterns from the GoF book, patterns from Fowlers EA Patterns book and
other new pattern languages.

Those of you more interessted in patterns can check out the Hillside Group. They are
the group that run the PLoP conferences.

To me patterns is a little bit off in my peripheral vision at the moment, especially when I'm still so geared up from
the agile stuff on Sunday. I do however think that there are some ideas in the patterns movement that we should embrace
in Statoil as well and start to use for better communication both internally and externally.


text:
'use strict';

var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    BaseSchema = require('../base/model.js');
//WorkTimeEntrySchema = require('../workTimeEntry/workTimeEntry.model'),
//TimeOffSchema = require('../timeOff/timeOff.model');

/**
 * Organization's Member schema
 * it's not inheriting from base model, cause it's not a db entity
 */
var MemberSchema = new Schema({
    _user: {
        type: Schema.ObjectId,
        ref: 'User'
    },
    role: {
        type: String,
        enum: ['admin', 'user']
    },
    active: {
        type: Boolean,
        required: true,
        default: false
    },
    hours: {
      type: Number,
      default: 8
    },
    nfc_uid: String
});

module.exports = MemberSchema;


text:
@extends('webshop-cms::app')

@section('title', trans('webshop-cms::dashboard.title'))

@section('content')

{{ trans('webshop-cms::dashboard.title') }}

@endsection


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>TCC: Índice dos Componentes</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

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

TCC
    1.0

Página Principal

Páginas relacionadas

Pacotes

Classes

Arquivos

          <input type="text" id="MSearchField" value="Busca" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Lista de Componentes

Índice dos Componentes

Hierarquia de Classes

Componentes Membros

 Todos Classes Namespaces Arquivos Funções Variáveis Páginas

Índice dos Componentes

A | C | D | F | G | M | P | R | S | T | U

  A

	DistribuicaoVazao (usina)

  P

	Simulacao (tcc)

  U

  F

  T

Algoritmo (tcc)   	PopulacaoDeDistribuicoes (usina)   	Usina (usina)

  C

	Fluxo (usina)

  R

	TubinaDAOFactory (usina.DAO.turbina)   	UsinaFactory (usina.factory)

  G

	TuboCilindricoReto (usina.tubulacao)   	UsinaFactory.Usinas (usina.factory)

Conduto (usina.tubulacao)   	Recombinacao (usina.operadores)   	Turbina (usina)

ConectorCilindricoCurvoPoligonal (usina.tubulacao)   	Geracao (usina.operadores)

  S

	TurbinaCSVFileDAO (usina.DAO.turbina)

ConectorCilindricoCurvoSuave (usina.tubulacao)

  M

	TurbinaDAO (usina.DAO.turbina)

  D

	Selecao (usina.operadores)   	TurbinaTransfer (usina.DAO.turbina)

Mutacao (usina.operadores)

TubinaDAOFactory.DAOTypes (usina.DAO.turbina)

A | C | D | F | G | M | P | R | S | T | U

Gerado em Segunda, 7 de Julho de 2014 14:15:04 para TCC por

     1.8.6


text:
export const magicWord = 'Try this:';
export const regex = '^' + magicWord + '((.*\n )*.*)$';
export const regexGM = new RegExp(regex, 'gm');
export const regexM = new RegExp(regex, 'm');


text:
@interface LCIMCacheStore ()

@property (copy, readwrite) NSString *clientId;

@end

@implementation LCIMCacheStore {
    LCDatabaseQueue *_databaseQueue;
}

+ (NSString *)databasePathWithName:(NSString *)name {
    return [AVPersistenceUtils messageCacheDatabasePathWithName:name];
}

- (instancetype)initWithClientId:(NSString *)clientId {
    self = [super init];

    if (self) {
        _clientId = [clientId copy];
    }

    return self;
}

- (LCDatabaseQueue *)databaseQueue {
    @synchronized(self) {
        if (_databaseQueue)
            return _databaseQueue;

        if (self.clientId) {
            NSString *path = [[self class] databasePathWithName:self.clientId];
            _databaseQueue = [LCDatabaseQueue databaseQueueWithPath:path];

            if (_databaseQueue) {
                [self databaseQueueDidLoad];
                [self migrateDatabaseIfNeeded:path];
            }
        }
    }

    return _databaseQueue;
}

- (void)databaseQueueDidLoad {
    LCIM_OPEN_DATABASE(db, ({
        db.logsErrors = LCIM_SHOULD_LOG_ERRORS;

        [db executeUpdate:LCIM_SQL_CREATE_MESSAGE_TABLE];
        [db executeUpdate:LCIM_SQL_CREATE_MESSAGE_UNIQUE_INDEX];

        [db executeUpdate:LCIM_SQL_CREATE_CONVERSATION_TABLE];
    }));
}

- (void)migrateDatabaseIfNeeded:(NSString *)databasePath {
    LCDatabaseMigrator *migrator = [[LCDatabaseMigrator alloc] initWithDatabasePath:databasePath];

    [migrator executeMigrations:@[
        [LCDatabaseMigration migrationWithBlock:^(LCDatabase *db) {
            [db executeUpdate:@"ALTER TABLE conversation ADD COLUMN muted INTEGER"];
        }],

        [LCDatabaseMigration migrationWithBlock:^(LCDatabase *db) {
            [db executeUpdate:@"ALTER TABLE conversation ADD COLUMN last_message BLOB"];
        }],

        [LCDatabaseMigration migrationWithBlock:^(LCDatabase *db) {
            [db executeUpdate:@"ALTER TABLE message ADD COLUMN read_timestamp REAL"];
        }],

        [LCDatabaseMigration migrationWithBlock:^(LCDatabase *db) {
            [db executeUpdate:@"ALTER TABLE message ADD COLUMN patch_timestamp REAL"];
        }]
    ]];
}

- (void)dealloc {
    [_databaseQueue close];
}

@end


text:
import {
    EventEmitterLike,
    UniqueIDGenerator,
} from "../../models/ipc.models";
import { IpcId } from "./ipc-id";
import { IpcListeners } from "./ipc-listeners";

/**
 * Object for sharing data between sender and listener objects.
 */
export class IpcShared {
    /**
     * IPC id manager.
     */
    public id: IpcId;

    /**
     * IPC listener manager.
     */
    public listener: IpcListeners;

    /**
     * @param source Event emitter like object that acts as a source.
     * @param uidGenerator Generator function used to generate ids.
     * @param customChannelGenerator Optional custom channel string generator.
     */
    constructor(
        source: EventEmitterLike,
        uidGenerator: UniqueIDGenerator,
        private customChannelGenerator?: IpcShared["generateChannel"],
    ) {
        this.id = new IpcId(uidGenerator);
        this.listener = new IpcListeners(source);
    }

    /**
     * Generates channel from method and event combination.
     * @param method Method for channel.
     * @param event Event for channel.
     * @returns Generated channel string.
     */
    public generateChannel(method: string, event: string): string {
        return this.customChannelGenerator ? this.customChannelGenerator(method, event) : `[${method}](${event})`;
    }
}


text:
New Shift Entry

            Home

            ShiftEntry

            New Shift Entry

        <form data-ng-submit="create()" novalidate>
          <fieldset>

                Date

                  <input type="Date" data-ng-model="date" id="date" class="form-control" placeholder="" required />

                Shift

                  <input type="Text" data-ng-model="shift" id="shift" class="form-control" placeholder="" required />

                Code

                  <input type="Text" data-ng-model="code" id="code" class="form-control" placeholder="" required />

                Employee Name

                  <input type="Text" data-ng-model="employeeName" id="employeeName" class="form-control" placeholder="" required />

                Number Of Shifts

                  <input type="Number" data-ng-model="numberOfShifts" id="numberOfShifts" class="form-control" placeholder="" required />

                Over Time Hours

                  <input type="Number" data-ng-model="overTimeHours" id="overTimeHours" class="form-control" placeholder="" required />

                <input type="submit" class="btn btn-primary" />

          </fieldset>
        </form>


text: java -classpath jedis-2.4.2.jar:. jedistest


text:
package com.bbd.dafei.common.modal.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;

/**
 * Created by wish on 2017/4/24.
 */
@ApiModel("企业关联信息")
public class RelationInfoVO {
    @ApiModelProperty(value = "一度关联关键自然人(与3.5KPI定义不同)")
    private List<String> pivotalNaturalPersonsTop1d;
    @ApiModelProperty(value = "二度关联关键自然人(与3.5KPI定义不同)")
    private  List<String> pivotalNaturalPersonsTop2d;
    @ApiModelProperty(value = "三度关联关键自然人(与3.5KPI定义不同)")
    private  List<String> pivotalNaturalPersonsTop3d;
    @ApiModelProperty(value = "一度关联关键非自然人(新增)")
    private  List<String> pivotalNonNaturalPersonsTop1d;
    @ApiModelProperty(value = "二度关联关键非自然人(新增)")
    private  List<String> pivotalNonNaturalPersonsTop2d;
    @ApiModelProperty(value = "三度关联关键非自然人(新增)")
    private  List<String> pivotalNonNaturalPersonsTop3d;
    @ApiModelProperty(value = "一度关联方行业")
    private List<String> industrySpanTop1d;
    @ApiModelProperty(value = "二度关联方行业")
    private List<String> industrySpanTop2d;
    @ApiModelProperty(value = "三度关联方行业")
    private List<String> industrySpanTop3d;

    public List<String> getPivotalNaturalPersonsTop1d() {
        return pivotalNaturalPersonsTop1d;
    }

    public void setPivotalNaturalPersonsTop1d(List<String> pivotalNaturalPersonsTop1d) {
        this.pivotalNaturalPersonsTop1d = pivotalNaturalPersonsTop1d;
    }

    public List<String> getPivotalNaturalPersonsTop2d() {
        return pivotalNaturalPersonsTop2d;
    }

    public void setPivotalNaturalPersonsTop2d(List<String> pivotalNaturalPersonsTop2d) {
        this.pivotalNaturalPersonsTop2d = pivotalNaturalPersonsTop2d;
    }

    public List<String> getPivotalNaturalPersonsTop3d() {
        return pivotalNaturalPersonsTop3d;
    }

    public void setPivotalNaturalPersonsTop3d(List<String> pivotalNaturalPersonsTop3d) {
        this.pivotalNaturalPersonsTop3d = pivotalNaturalPersonsTop3d;
    }

    public List<String> getPivotalNonNaturalPersonsTop1d() {
        return pivotalNonNaturalPersonsTop1d;
    }

    public void setPivotalNonNaturalPersonsTop1d(List<String> pivotalNonNaturalPersonsTop1d) {
        this.pivotalNonNaturalPersonsTop1d = pivotalNonNaturalPersonsTop1d;
    }

    public List<String> getPivotalNonNaturalPersonsTop2d() {
        return pivotalNonNaturalPersonsTop2d;
    }

    public void setPivotalNonNaturalPersonsTop2d(List<String> pivotalNonNaturalPersonsTop2d) {
        this.pivotalNonNaturalPersonsTop2d = pivotalNonNaturalPersonsTop2d;
    }

    public List<String> getPivotalNonNaturalPersonsTop3d() {
        return pivotalNonNaturalPersonsTop3d;
    }

    public void setPivotalNonNaturalPersonsTop3d(List<String> pivotalNonNaturalPersonsTop3d) {
        this.pivotalNonNaturalPersonsTop3d = pivotalNonNaturalPersonsTop3d;
    }

    public List<String> getIndustrySpanTop1d() {
        return industrySpanTop1d;
    }

    public void setIndustrySpanTop1d(List<String> industrySpanTop1d) {
        this.industrySpanTop1d = industrySpanTop1d;
    }

    public List<String> getIndustrySpanTop2d() {
        return industrySpanTop2d;
    }

    public void setIndustrySpanTop2d(List<String> industrySpanTop2d) {
        this.industrySpanTop2d = industrySpanTop2d;
    }

    public List<String> getIndustrySpanTop3d() {
        return industrySpanTop3d;
    }

    public void setIndustrySpanTop3d(List<String> industrySpanTop3d) {
        this.industrySpanTop3d = industrySpanTop3d;
    }

}


text:
<?php

namespace CultuurNet\UDB3\Offer;

use PHPUnit\Framework\TestCase;
use ValueObjects\Person\Age;

class AgeRangeTest extends TestCase
{
    /**
     * @test
     * @dataProvider ageRangeStringProvider
     * @param string $ageRangeString
     * @param AgeRange $expectedRange
     */
    public function it_should_create_ranges_from_strings(
        $ageRangeString,
        AgeRange $expectedRange
    ) {
        $ageRange = AgeRange::fromString($ageRangeString);

        $this->assertEquals($expectedRange, $ageRange);
    }

    /**
     * @test
     * @dataProvider ageRangeStringProvider
     * @param string $ageRangeString
     * @param AgeRange $expectedRange
     * @param string $expectedAgeRangeString
     */
    public function it_should_return_a_string_representation_when_casted_to_string(
        string $ageRangeString,
        AgeRange $expectedRange,
        string $expectedAgeRangeString
    ) {
        $actualAgeRangeString = (string) $expectedRange;

        $this->assertEquals($expectedAgeRangeString, $actualAgeRangeString);
    }

    /**
     * @return array
     */
    public function ageRangeStringProvider()
    {
        return [
            'ALL' =>
            [
                'ageRangeString' => '-',
                'expectedRange' => new AgeRange(),
                'expectedRangeString' => '0-',
            ],
            'TODDLERS' =>
            [
                'ageRangeString' => '0-2',
                'expectedRange' => new AgeRange(new Age(0), new Age(2)),
                'expectedRangeString' => '0-2',
            ],
            'PRESCHOOLERS' =>
            [
                'ageRangeString' => '3-5',
                'expectedRange' => new AgeRange(new Age(3), new Age(5)),
                'expectedRangeString' => '3-5',
            ],
            'KIDS' =>
            [
                'ageRangeString' => '6-11',
                'expectedRange' => new AgeRange(new Age(6), new Age(11)),
                'expectedRangeString' => '6-11',
            ],
            'YOUNGSTERS' =>
            [
                'ageRangeString' => '12-17',
                'expectedRange' => new AgeRange(new Age(12), new Age(17)),
                'expectedRangeString' => '12-17',
            ],
            'ADULTS' =>
            [
                'ageRangeString' => '18-',
                'expectedRange' => new AgeRange(new Age(18)),
                'expectedRangeString' => '18-',
            ],
            'SENIORS' =>
            [
                'ageRangeString' => '65-',
                'expectedRange' => new AgeRange(new Age(65)),
                'expectedRangeString' => '65-',
            ],
            'CUSTOM' =>
            [
                'ageRangeString' => '5-55',
                'expectedRange' => new AgeRange(new Age(5), new Age(55)),
                'expectedRangeString' => '5-55',
            ],
            'EIGHTEEN' =>
            [
                'ageRangeString' => '18-18',
                'expectedRange' => new AgeRange(new Age(18), new Age(18)),
                'expectedRangeString' => '18-18',
            ],
        ];
    }

    /**
     * @test
     * @dataProvider invalidAgeRangeStringProvider
     * @param string $ageRangeString
     * @param string $exception
     * @param string $exceptionMessage
     */
    public function it_should_throw_an_exception_on_unexpected_age_range_strings(
        $ageRangeString,
        $exception,
        $exceptionMessage
    ) {
        $this->expectException($exception);
        $this->expectExceptionMessage($exceptionMessage);
        AgeRange::fromString($ageRangeString);
    }

    /**
     * @return array
     */
    public function invalidAgeRangeStringProvider()
    {
        return [
            'not a string' => [
                'ageRangeString' => 5-6,
                'exception' => InvalidAgeRangeException::class,
                'Date-range should be of type string.',
            ],
            'dat boi' => [
                'ageRangeString' => '🐸-🚲',
                'exception' => InvalidAgeRangeException::class,
                'The "from" age should be a natural number or empty.',
            ],
            'limitless' => [
                'ageRangeString' => '9999999',
                'exception' => InvalidAgeRangeException::class,
                'Date-range string is not valid because it is missing a hyphen.',
            ],
            'words' => [
                'ageRangeString' => '1 to 18',
                'exception' => InvalidAgeRangeException::class,
                'Date-range string is not valid because it is missing a hyphen.',
            ],
            'en dash' => [
                'ageRangeString' => '1–18',
                'exception' => InvalidAgeRangeException::class,
                'Date-range string is not valid because it is missing a hyphen.',
            ],
            'horizontal bar' => [
                'ageRangeString' => '1―18',
                'exception' => InvalidAgeRangeException::class,
                'Date-range string is not valid because it is missing a hyphen.',
            ],
            'tilde' => [
                'ageRangeString' => '1~18',
                'exception' => InvalidAgeRangeException::class,
                'Date-range string is not valid because it is missing a hyphen.',
            ],
            'triple trouble' => [
                'ageRangeString' => '1---18',
                'exception' => InvalidAgeRangeException::class,
                'Date-range string is not valid because it has too many hyphens.',
            ],
            '😐' => [
                'ageRangeString' => '----',
                'exception' => InvalidAgeRangeException::class,
                'Date-range string is not valid because it has too many hyphens.',
            ],
            'non numeric upper-bound' => [
                'ageRangeString' => '0-Z',
                'exception' => InvalidAgeRangeException::class,
                'The "to" age should be a natural number or empty.',
            ],
        ];
    }

    /**
     * @test
     */
    public function it_expects_from_age_to_not_exceed_to_age()
    {
        $this->expectException(InvalidAgeRangeException::class);
        new AgeRange(new Age(9), new Age(5));
    }

    /**
     * @test
     */
    public function it_should_provide_access_to_from_and_to_age()
    {
        $ageRange = new AgeRange(new Age(0), new Age(18));

        $this->assertEquals(new Age(0), $ageRange->getFrom());
        $this->assertEquals(new Age(18), $ageRange->getTo());
    }

    /**
     * @test
     */
    public function it_should_default_from_to_zero(): void
    {
        $ageRange = new AgeRange(null, new Age(18));

        $this->assertEquals(new Age(0), $ageRange->getFrom());
        $this->assertEquals(new Age(18), $ageRange->getTo());
    }

    /**
     * @test
     */
    public function it_can_compare_age_ranges()
    {
        $typicalAgeRange = new AgeRange(new Age(8), new Age(11));
        $sameAgeRange = new AgeRange(new Age(8), new Age(11));
        $otherAgeRange = new AgeRange(new Age(1), new Age(99));
        $allAges = new AgeRange();

        $this->assertTrue($typicalAgeRange->sameAs($sameAgeRange));
        $this->assertFalse($typicalAgeRange->sameAs($otherAgeRange));
        $this->assertFalse($typicalAgeRange->sameAs($allAges));
    }

    /**
     * @test
     */
    public function it_should_be_creatable_from_a_restricted_udb3_model_age_range()
    {
        $udb3ModelAgeRange = new \CultuurNet\UDB3\Model\ValueObject\Audience\AgeRange(
            new \CultuurNet\UDB3\Model\ValueObject\Audience\Age(8),
            new \CultuurNet\UDB3\Model\ValueObject\Audience\Age(12)
        );

        $expected = new AgeRange(new Age(8), new Age(12));
        $actual = AgeRange::fromUbd3ModelAgeRange($udb3ModelAgeRange);

        $this->assertEquals($expected, $actual);
    }

    /**
     * @test
     */
    public function it_should_be_creatable_from_an_open_udb3_model_age_range()
    {
        $udb3ModelAgeRange = new \CultuurNet\UDB3\Model\ValueObject\Audience\AgeRange();

        $expected = new AgeRange(null, null);
        $actual = AgeRange::fromUbd3ModelAgeRange($udb3ModelAgeRange);

        $this->assertEquals($expected, $actual);
    }
}


text:
layout: post
title: Release Notes for 2019-02-20
---

Latest release notes for 2019-02-20 at 1255-UTC.

#### Legend

All changes are available immediately unless labeled as internal or dark code:

- {:.legend} [internal] changes are only visible or applicable to Clockwise.MD staff.
- {:.legend} [dark code] changes are hidden from general use until made visible at a later date.

#### Fixes

- {:.fix} [internal] Hospital's organization can be changed in Team Admin


text:
<?php

defined('_JEXEC') or die;

// Create the copy/move options.
$options = array(
	JHtml::_('select.option', 'add', JText::_('COM_USERS_BATCH_ADD')),
	JHtml::_('select.option', 'del', JText::_('COM_USERS_BATCH_DELETE')),
	JHtml::_('select.option', 'set', JText::_('COM_USERS_BATCH_SET'))
);

// Create the reset password options.
$resetOptions = array(
	JHtml::_('select.option', '', JText::_('COM_USERS_NO_ACTION')),
	JHtml::_('select.option', 'yes', JText::_('JYES')),
	JHtml::_('select.option', 'no', JText::_('JNO'))
);
JHtml::_('formbehavior.chosen', 'select');
?>

			<?php echo JText::_('COM_USERS_BATCH_GROUP') ?>

			<select name="batch[group_id]" id="batch-group-id">
				<option value=""><?php echo JText::_('JSELECT') ?></option>
				<?php echo JHtml::_('select.options', JHtml::_('user.groups')); ?>
			</select>

		<?php echo JHtml::_('select.radiolist', $options, 'batch[group_action]', '', 'value', 'text', 'add') ?>

<?php echo JText::_('COM_USERS_REQUIRE_PASSWORD_RESET'); ?>

	<?php echo JHtml::_('select.radiolist', $resetOptions, 'batch[reset_id]', '', 'value', 'text', '') ?>


text:
<?php
	/****
		views	: marketing/data/marketingPerusahaan_data
		created	: 28-12-2015 01:19:09
		By		: Gunawan Wibisono
		Using 	: CI3 Main Model
	****/
	defined('BASEPATH') OR exit('No direct script access allowed');


text:
!#################################################################################################!
!BSD 3-Clause License
!
!Copyright (c) 2017, Ricardo Torres
!All rights reserved.
!
!Redistribution and use in source and binary forms, with or without
!modification, are permitted provided that the following conditions are met:
!
!* Redistributions of source code must retain the above copyright notice, this
!  list of conditions and the following disclaimer.

!* Redistributions in binary form must reproduce the above copyright notice,
!  this list of conditions and the following disclaimer in the documentation
!  and/or other materials provided with the distribution.

!* Neither the name of the copyright holder nor the names of its
!  contributors may be used to endorse or promote products derived from
!  this software without specific prior written permission.
!
!THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
!AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
!IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
!DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
!FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
!DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
!SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
!CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
!OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
!OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!#################################################################################################!

module Strings_Func_mod
    use Types_mod
    implicit none

    contains
!##################################################################################################################################!
!------------------------------------------------------------------------
! ...Functions to change case of letters...
!------------------------------------------------------------------------
    elemental function To_upper(str)
      character(*), intent(in) :: str
      character(len=len(str))  :: To_upper
      integer :: i

      To_upper=str
      do i = 1, len(str)
        select case(str(i:i))
        case("a":"z")
          To_upper(i:i) = achar(iachar(str(i:i))-32)
        end select
      end do
    end function To_upper
!------------------------------------------------------------------------
    elemental function To_lower(str)
      character(*), intent(in) :: str
      character(len=len(str))  :: To_lower
      integer :: i

      To_lower=str
      do i = 1, len(str)
        select case(str(i:i))
        case("A":"Z")
          To_lower(i:i) = achar(iachar(str(i:i))+32)
        end select
      end do
    end function To_lower
!##################################################################################################################################!
!------------------------------------------------------------------------
! ...function N_Lines: Count number of lines of input file...
!------------------------------------------------------------------------
    integer(kind=I32) function N_Lines(filein)
      character(len=*), intent(in) :: filein
      integer(kind=I8)  :: io, nunit

      open (newunit=nunit,file=trim(filein),iostat=io)
      N_Lines=-1

      do while (io==0)
        N_Lines = N_Lines + 1
        read(nunit,*,iostat=io)
      end do

      close(nunit)
    end function N_Lines
!##################################################################################################################################!
!------------------------------------------------------------------------
! ...subroutine reportLog: Print a message to display...
!------------------------------------------------------------------------
    subroutine ReportLog(logmessage)
      character(len=*), intent(in)  :: logmessage
      write(*,*)trim(logmessage)
    end subroutine ReportLog
!##################################################################################################################################!
!------------------------------------------------------------------------
! ...subroutine Decomp_Names: decompose the filenamein array in fields...
!------------------------------------------------------------------------
    pure subroutine Decomp_Names(filenamein,field_names)
      character(len=*), intent(out)  :: field_names(:)    !string containing the names of the filenamein
      character(len=*),  intent(in)  :: filenamein        !input string to be decomposed
      integer(kind=I16)              :: reset             !position of first slash (/)
      integer(kind=I16), allocatable :: position_under(:) !positions of the found underscores
      integer(kind=I16)              :: name_len, name_spaces
      integer(kind=I16)              :: i
      !-----------------------------------------------------------------------------------------------

      name_spaces=size(field_names)
      allocate(position_under(name_spaces))
      reset=scan(trim(filenamein), '/',back=.true.)      !To find the last slash
      name_len=len(trim(filenamein))

      position_under(1) = scan(trim(filenamein(reset+1:name_len)), '_')
      position_under(1) = reset + position_under(1)
      if( name_spaces > 2 ) then
        do i=2,name_spaces-1
          position_under(i) = scan(trim(filenamein(sum(position_under(1:i-1))+1:name_len)), '_')
        end do
      end if
      position_under(name_spaces) = scan(trim(filenamein(sum(position_under(1:name_spaces-1))+1:name_len)), '.')
      if (position_under(name_spaces) == 0) then
          position_under(name_spaces) = len_trim(filenamein) - position_under(name_spaces-1)
      end if

      field_names(1)=filenamein(reset+1:position_under(1)-1)
      if( name_spaces > 1 ) then
        do i=2,name_spaces
          field_names(i)=filenamein(sum(position_under(1:i-1))+1:sum(position_under(1:i))-1)
        end do
      end if

      deallocate(position_under)
    end subroutine Decomp_Names
!##################################################################################################################################!
end module Strings_Func_mod


text:
package jobs

import (
	"fmt"

	"github.com/hashicorp/nomad/api"
	"github.com/jippi/hashi-ui/backend/nomad/helper"
	"github.com/jippi/hashi-ui/backend/structs"
)

const (
	fetchedList         = "NOMAD_FETCHED_JOBS"
	fetchedListFiltered = "NOMAD_FETCHED_JOBS_FILTERED"
	UnwatchList         = "NOMAD_UNWATCH_JOBS"
	UnwatchListFiltered = "NOMAD_UNWATCH_JOBS_FILTERED"
	WatchList           = "NOMAD_WATCH_JOBS"
	WatchListFiltered   = "NOMAD_WATCH_JOBS_FILTERED"
)

type list struct {
	action structs.Action
	client *api.Client
	query  *api.QueryOptions
}

func NewList(action structs.Action, client *api.Client, query *api.QueryOptions) *list {
	return &list{
		action: action,
		client: client,
		query:  query,
	}
}

func (w *list) Do() (structs.Response, error) {
	w.filter(w.query)

	jobs, meta, err := w.client.Jobs().List(w.query)
	if err != nil {
		return structs.NewErrorResponse(err)
	}

	if !helper.QueryChanged(w.query, meta) {
		return structs.NewNoopResponse()
	}

	actionType := fetchedList

	if w.query.Prefix != "" {
		actionType = fetchedListFiltered
	}

	return structs.NewResponseWithIndex(actionType, jobs, meta.LastIndex)
}

func (w *list) Key() string {
	path := "/jobs/list"

	if payload, ok := w.action.Payload.(map[string]interface{}); ok {
		if prefix, ok := payload["prefix"]; ok {
			path = fmt.Sprintf("%s?prefix=%s", path, prefix)
		}
	}

	return path
}

func (w *list) IsMutable() bool {
	return false
}

func (w *list) BackendType() string {
	return "nomad"
}

func (w *list) filter(q *api.QueryOptions) {
	if payload, ok := w.action.Payload.(map[string]interface{}); ok {
		if prefix, ok := payload["prefix"]; ok {
			q.Prefix = prefix.(string)
		}
	}
}


text:
#pragma once

#include "baseinterface.h"
#include "color.h"
// forward declarations
class INode;

#ifndef __D3DX9_H__
#  include <d3d9.h>
#  include <d3dx9.h>
#endif

#define IHARDWARE_MATERIAL_INTERFACE_ID Interface_ID(0x40c926b7, 0x7b3a66b7)
#define IHARDWARE_MATERIAL2_INTERFACE_ID Interface_ID(0x43d32666, 0x3a4467b1)
#define IHARDWARE_MATERIAL3_INTERFACE_ID Interface_ID(0x63d72368, 0xcc4859e3)

/*! \brief This enum type tells the viewport rendering system the usage of each texture.
This enum type tells the viewport rendering system  the usage of each texture while the
viewport display is in best quality mode. Currently we don't support MAPUSAGE_BUMP,
MAPUSAGE_FILTER_COLOR,MAPUSAGE_REFLECTION, MAPUSAGE_REFRACTION and MAPUSAGE_DISPLACEMENT.
NOTE: Set MAPUSAGE_SUPPORT_PROGRAMMABLE_PIPELINE flag at least for texture stage 0, if you want to use
the programmable pipeline to render this material, else it will be degraded to fixed pipeline even
viewport is in the good or best quality mode.
*/
enum MapUsageType
{
	MAPUSAGE_UNDEFINED = 0,
	MAPUSAGE_DIFFUSE = (1 << 0),
	MAPUSAGE_OPACITY = (1 << 1),
	MAPUSAGE_SPECULAR_COLOR = (1 << 2),
	MAPUSAGE_SPECULAR_LEVEL = (1 << 3),
	MAPUSAGE_GLOSSINESS = (1 << 4),
	MAPUSAGE_BUMP = (1 << 5),
	MAPUSAGE_SELF_ILLUM = (1 << 6),
	MAPUSAGE_FILTER_COLOR = (1 << 7),
	MAPUSAGE_REFLECTION = (1 << 8),
	MAPUSAGE_REFRACTION = (1 << 9),
	MAPUSAGE_DISPLACEMENT = (1 << 10),
	MAPUSAGE_DIFFUSE_OPACITY = MAPUSAGE_DIFFUSE|MAPUSAGE_OPACITY,
	MAPUSAGE_SPECULAR_COLOR_GLOSS = MAPUSAGE_SPECULAR_COLOR|MAPUSAGE_GLOSSINESS,
	MAPUSAGE_SPECULAR_LEVEL_GLOSS = MAPUSAGE_SPECULAR_LEVEL|MAPUSAGE_GLOSSINESS,
	MAPUSAGE_BUMP_GLOSS = MAPUSAGE_BUMP|MAPUSAGE_GLOSSINESS,
	MAPUSAGE_SELF_ILLUM_GLOSS = MAPUSAGE_SELF_ILLUM|MAPUSAGE_GLOSSINESS,
	MAPUSAGE_OPACITY_SPLEVEL = MAPUSAGE_OPACITY|MAPUSAGE_SPECULAR_LEVEL,
	MAPUSAGE_SUPPORT_PROGRAMMABLE_PIPELINE = (1 << 31),
};

/*! \sa  Class IDXDataBridge\n\n
\par Description:
This class is only available in release 5 or later.\n\n
A pointer to this class is provided by IDXDataBridge::SetDXData(). The
GFX layer will implement all these methods. Most of the methods are direct
replicas of the DirectX API for SetRenderState and SetTextureStageState.\n\n
The reason for this is that only one thread can access the graphics hardware at
any one time. Using this interface means that the GFX driver can have its
database initialized with the DirectX states required for this object, when it
comes to access the graphics device.\n\n
To use this class good knowledge of DirectX is needed, a copy of the DirectX
documentation is also recommended.\n\n
For an example usage of this class see
MAXSDK/SAMPLES/HardwareShaders/LightMap/Lightmap.cpp\n\n
   */
class IHardwareMaterial : public BaseInterface
{
public:
	/*! \remarks The returns the unique ID for this interface. By default it
	will return IHARDWARE_MATERIAL_INTERFACE_ID */
	virtual Interface_ID	GetID() { return IHARDWARE_MATERIAL_INTERFACE_ID; }

	// Interface Lifetime
	virtual LifetimeType	LifetimeControl() { return noRelease; }

	// Information provided from a Custom Attribute?
	virtual void	SetCustomFlag(bool bVal) = 0;

	// Render States
	/*! \remarks This is equivalent to the DirectX method
	SetRenderState(FILLMODE,mode)\n\n

	\par Parameters:
	DWORD mode\n\n
	A member of D3DFILLMODE\n\n
	  */
	virtual void	SetFillMode(DWORD mode) = 0;
	/*! \remarks This is equivalent to DirectX method
	SetRenderState(SHADEMODE,mode)\n\n

	\par Parameters:
	DWORD mode\n\n
	A member of D3DSHADEMODE\n\n
	  */
	virtual void	SetShadeMode(DWORD mode) = 0;

	// Material Colors
	/*! \remarks Please see the DirectX documentation for more information on
	this method\n\n
	  */
	virtual void	SetMaterial(LPD3DXMATERIAL pMtl) = 0;

	/*! \remarks Specifies Diffuse color to be set by using the DirectX data
	structure LPD3DXCOLOR.\n\n
	  */
	virtual void	SetDiffuseColor(LPD3DXCOLOR pClr) = 0;
	/*! \remarks Allows the Diffuse color to be set\n\n

	\par Parameters:
	Color c\n\n
	The diffuse color\n\n
	float alpha\n\n
	The colors alpha\n\n
	  */
	virtual void	SetDiffuseColor(Color c, float alpha = 1.0f) = 0;
	/*! \remarks Allows the Diffuse color to be set\n\n

	\par Parameters:
	Point3 c\n\n
	The diffuse color\n\n
	float alpha\n\n
	The colors alpha */
	virtual void	SetDiffuseColor(Point3 c, float alpha = 1.0f) = 0;

	/*! \remarks Specifies the Ambient color to set by using a DirectX data
	structure.\n\n
	  */
	virtual void	SetAmbientColor(LPD3DXCOLOR pClr) = 0;
	/*! \remarks Allows the Ambient color to be set
	\par Parameters:
	Color c\n\n
	The ambient color\n\n
	float alpha\n\n
	The colors alpha\n\n
	  */
	virtual void	SetAmbientColor(Color c, float alpha = 1.0f) = 0;
	/*! \remarks Allows the Ambient color to set
	\par Parameters:
	Point3 c\n\n
	The ambient color\n\n
	float alpha\n\n
	The colors alpha\n\n
	  */
	virtual void	SetAmbientColor(Point3 c, float alpha = 1.0f) = 0;

	/*! \remarks Specifies the Specular color to set by using a DirectX data
	structure.\n\n
	  */
	virtual void	SetSpecularColor(LPD3DXCOLOR pClr) = 0;
	/*! \remarks Allows the Specular color to be set
	\par Parameters:
	Color c\n\n
	The specular color\n\n
	float alpha\n\n
	The colors alpha\n\n
	  */
	virtual void	SetSpecularColor(Color c, float alpha = 1.0f) = 0;
	/*! \remarks Allows the Specular color to set
	\par Parameters:
	Point3 c\n\n
	The specular color\n\n
	float alpha\n\n
	The colors alpha\n\n
	  */
	virtual void	SetSpecularColor(Point3 c, float alpha = 1.0f) = 0;

	/*! \remarks Allows the Emissive color to set by using a DirectX data
	structure.\n\n
	  */
	virtual void	SetEmissiveColor(LPD3DXCOLOR pClr) = 0;
	/*! \remarks Allows the Emissive color to be set\n\n

	\par Parameters:
	Color c\n\n
	The emissive color\n\n
	float alpha\n\n
	The colors alpha\n\n
	  */
	virtual void	SetEmissiveColor(Color c, float alpha = 1.0f) = 0;
	/*! \remarks Allows the Emissive color to be set\n\n

	\par Parameters:
	Point3 c\n\n
	The emissive color\n\n
	float alpha\n\n
	The colors alpha\n\n
	  */
	virtual void	SetEmissiveColor(Point3 c, float alpha = 1.0f) = 0;

	/*! \remarks Allows the specular exponent of the material to be set
	\par Parameters:
	float power\n\n
	The specular amount\n\n
	  */
	virtual void	SetSpecularPower(float power) = 0;

	// Texture States
	/*! \remarks This sets the internal size for the table that will hold the
	Texture information for the material. If you are not using any Texture stages
	then this should be set to zero, otherwise it should match exactly the number
	of textures being used.
	\par Parameters:
	DWORD numStages\n\n
	The number of Texture stages */
	virtual bool	SetNumTexStages(DWORD numStages) = 0;
	/*! \remarks This allows a texture to be loaded to the graphics device. In
	this case the texture is loaded/created by the GFX via calls to
	IHardwareRenderer::BuildTexture() which will return a DWORD_PTR, which is
	an internal representation of the texture. The texture was allocated it
	will return true.\n\n

	\par Parameters:
	DWORD stage\n\n
	The stage to hold the texture\n\n
	DWORD_PTR pTexture\n\n
	A texture pointer returned by IHardwareRenderer::BuildTexture()\n\n
	  */
	virtual bool	SetTexture(DWORD stage, DWORD_PTR pTexture) = 0;
	/*! \remarks This allows a texture to be loaded to the graphics device.
	The file is assumed to exist. If successful it will return true.
	\par Parameters:
	DWORD stage\n\n
	The stage to hold the texture\n\n
	LPCSTR filename\n\n
	A string containing the filename of the texture to load \n\n
	  */
	virtual bool	SetTexture(DWORD stage, LPCSTR filename) = 0;
	/*! \remarks This allows a texture to be loaded to the graphics device. In
	this case the texture is loaded/created by the GFX via calls to
	IHardwareRenderer::BuildTexture() which will return a DWORD_PTR, which is
	an internal representation of the texture. The texture was allocated it
	will return true.\n\n
	NOTE:If you want to take advantage of the new viewport display mechanism
	,you should pass a valid MapUsageType other than MAPUSAGE_UNDEFINED for stage 0.
	Otherwise, it will use the old display mechanism.
	\param[in] stage - The stage to hold the texture
	\param[in] pTexture - A texture pointer returned by IHardwareRenderer::BuildTexture()
	\param[in] usage - A enum type that tell the rendering system the usage of the texture
	\return TRUE if successful, FALSE otherwise.
	*/
	virtual bool	SetTexture(DWORD stage, DWORD_PTR pTexture, MapUsageType usage) = 0;
	/*! \brief This method allows a texture to be loaded to the graphics device.\n
	The file is assumed to exist. If successful it will return true.
	NOTE:If you want to take advantage of the new viewport display mechanism
	,you should pass a valid MapUsageType other than MAPUSAGE_UNDEFINED for stage 0.
	Otherwise, it will use the old display mechanism.
	\param[in] stage - The stage to hold the texture\n
	\param[in] filename - A string containing the filename of the texture to load \n
	\param[in] usage - A enum type that tell the rendering system the usage of this texture\n
	\return TRUE if successful, FALSE otherwise.
	*/
	virtual bool	SetTexture(DWORD stage, LPCSTR filename, MapUsageType usage) = 0;

	/*! \remarks This specifies where the Texture Coordinates will be
	retrieved. Most of the time the mesh will supply them so the type would be
	UVSOURCE_HWGEN. However a Viewport Shader could create them dynamically so
	would supply. If successful it will return true.
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD type\n\n
	The UVW Source. It can be any of the following :- \n\n
	UVSOURCE_MESH\n\n
	UVSOURCE_XYZ\n\n
	UVSOURCE_MESH2\n\n
	UVSOURCE_WORLDXYZ\n\n
	UVSOURCE_FACEMAP\n\n
	UVSOURCE_HWGEN\n\n
	  */
	virtual bool	SetTextureUVWSource(DWORD stage, DWORD type) = 0;
	/*! \remarks This specifies what mapping channel from the mesh the Texture
	Coordinates will be retrieved. This is used in the stripping code so that
	the VertexBuffer is populated with the correct TVs. If successful it will
	return true.
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD type\n\n
	The mapping channel to use  */
	virtual bool	SetTextureMapChannel(DWORD stage, DWORD numChan) = 0;
	/*! \remarks This specifies what texture coordinate the stage will use.
	This value is used in the DirectX call SetTextureStageState(stage,
	D3DTSS_TEXCOORDINDEX, index). If successful it will return true.
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD index\n\n
	The texture coordinate index to use */
	virtual bool	SetTextureCoordIndex(DWORD stage, DWORD index) = 0;

	// Texture Transforms
	/*! \remarks This specifies what texture flag the stage will use. This
	value is used in the DirectX call SetTextureStageState(stage,
	D3DTSS_TEXTURETRANSFORMFLAGS, flag). If successful it will return true.
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD flag\n\n
	The DirectX flag to set */
	virtual bool	SetTextureTransformFlag(DWORD stage, DWORD flag) = 0;
	/*! \remarks This specifies what texture flag the stage will use. This
	value is used in the DirectX call
	SetTransform((D3DTRANSFORMSTATETYPE)(D3DTS_TEXTURE0+stage),
	pTransform). If successful it will return true.
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	LPD3DXMATRIX pTransform\n\n
	The DirectX matrix to set  */
	virtual bool	SetTextureTransform(DWORD stage, LPD3DXMATRIX pTransform) = 0;

	// Texture Stage States
	/*! \remarks This method is a direct replica if the DirectX color
	operators used with D3DTSS_COLOROP. Please refer to the DirectX
	documentation for further information
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD colorOp\n\n
	A member of the DirectX enumerated type D3DTEXTUREOP\n\n
	  */
	virtual bool	SetTextureColorOp(DWORD stage, DWORD colorOp) = 0;
	/*! \remarks This method is a direct replica if the DirectX Texture Argument
	flag used with D3DTSS_COLOROPARG. The argNum defines which argument to set.
	Please refer to the DirectX documentation for further information
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD argNum\n\n
	The argument index to set. If this is set to 1 then D3DTSS_COLORPARG1
	will be addressed\n\n
	DWORD colorArg\n\n
	The Argument to set. \n\n
	  */
	virtual bool	SetTextureColorArg(DWORD stage, DWORD argNum, DWORD colorArg) = 0;
	/*! \remarks This method is a direct replica if the DirectX alpha blending
	operators used with D3DTSS_ALPHAOP. Please refer to the DirectX
	documentation for further information
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD alphaArg\n\n
	A member of the DirectX enumerated type D3DTEXTUREOP */
	virtual bool	SetTextureAlphaOp(DWORD stage, DWORD alphaArg) = 0;
	/*! \remarks This method is a direct replica if the DirectX Texture Alpha
	Argument flag used with D3DTSS_APLHAPARG. The argNum defines which argument
	to set. Please refer to the DirectX documentation for further
	information
	\par Parameters:
	DWORD stage\n\n
	The stage to set\n\n
	DWORD argNum\n\n
	The alpha argument index to set. If this is set to 1 then
	D3DTSS_ALPHAARG1 will be addressed\n\n
	DWORD colorArg\n\n
	The Alpha Argument to set. */
	virtual bool	SetTextureAlphaArg(DWORD stage, DWORD argNum, DWORD alphaArg) = 0;
	virtual bool	SetTextureAddressMode(DWORD stage, DWORD coordNum, DWORD mode) = 0;

	// Shaders
	/*! \remarks This method allows a DirectX vertex shader to be loaded. It
	is used in conjunction with IHardwareRenderer::LoadVertexShader which will
	return a DWORD_PTR of internal storage for the shader. There are methods in
	Class IHardwareRenderer that provide
	a means to supply the constants used in the shader.\n\n

	\par Parameters:
	DWORD_PTR pVertexShader\n\n
	The vertex shader to load.\n\n
	  */
	virtual bool	SetVertexShader(DWORD_PTR pVertexShader) = 0;
	/*! \remarks This method allows a DirectX pixel shader to be loaded. It is
	used in conjunction with IHardwareRenderer::LoadPixelShader which will
	return a DWORD_PTR of internal storage for the shader. There are methods
	Class IHardwareRenderer that provide
	a means to supply the constants used in the shader.\n\n

	\par Parameters:
	DWORD_PTR pPixelShader\n\n
	The vertex shader to load */
	virtual bool	SetPixelShader(DWORD_PTR pPixelShader) = 0;

	// Effects
	/*! \remarks This method allows a DirectX effect. It is used in
	conjunction with IHardwareRenderer::LoadEffectFile which will return a
	DWORD_PTR of internal storage for the file. There are methods in
	Class IHardwareRenderer that provide
	a means to connect the application to the effects file.\n\n

	\par Parameters:
	DWORD_PTR pEffect\n\n
	The effect file to load */
	virtual bool	SetEffect(DWORD_PTR pEffect) = 0;

	// User Plugin
	virtual bool	SetPlugin(BaseInterface *pPlugin) = 0;

	// Current Associated INode
	virtual bool	SetINode(INode *pINode) = 0;

	/*! \remarks This method sets color used for multiple-texture blending with the D3DTA_TFACTOR\n\n
	texture-blending argument or the D3DTOP_BLENDFACTORALPHA texture-blending operation.\n\n
	\par Parameters:
	DWORD factor\n\n
	"factor" is a D3DCOLOR variable. The default value is opaque white(0xFFFFFFFF). */
	virtual void SetTextureFactor(DWORD factor) = 0;

	/*! \brief This method sets the specular level.\n
	This method sets the specular level value. The specular level information is used \n
	to adjust the specular color when viewport is in best quality mode.\n
	NOTE:If specular level map exists, this value will be ignored.
	\param[in] level - The specular level value.
	*/
	virtual void SetSpecularLevel(float level) = 0;

};

/*! \brief Extension of IHardwareMaterial Interface.
This class extends the functionality of IHardwareMaterial. To acquire this interface, simply call
GetInterface(IHARDWARE_MATERIAL2_INTERFACE_ID). If failed, it will return NULL.
*/
class IHardwareMaterial2 : public IHardwareMaterial
{
public:
	/*! \brief This method sets the self illumination mode.
	\param[in] bOn - If FALSE, the SelfIllumColor is off.Otherwise, the SelfIllumColor is on.
	*/
	virtual void SetSelfIllumColorOn(BOOL bOn) = 0;
};

/*! \brief Extension of IHardwareMaterial2 Interface.
This class extends the functionality of IHardwareMaterial2. To acquire this interface, simply call
GetInterface(IHARDWARE_MATERIAL3_INTERFACE_ID). If failed, it will return NULL.
*/
class IHardwareMaterial3 : public IHardwareMaterial2
{
public:
	/*! \brief This method sets the border color for the specified stage.
	\param[in] stage - The sampler stage whose border color you want to set
	\param[in] borderColor - The border color value
	\return true if successful, otherwise false
	*/
	virtual bool SetSamplerBorderColor(int stage, DWORD borderColor) = 0;
};


text:
/**
 * (CC) 2013 Kernellstudios. Some rights reserved.
 * User: David Morabito
 * Date: 10/8/13
 */

exports.index = function (req, res) {
    res.send("Login page")
}


text:
<?php

/**
 * DmRecordPermissionGroupTable
 *
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class DmRecordPermissionGroupTable extends PluginDmRecordPermissionGroupTable
{
    /**
     * Returns an instance of this class.
     *
     * @return object DmRecordPermissionGroupTable
     */
    public static function getInstance()
    {
        return Doctrine_Core::getTable('DmRecordPermissionGroup');
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

using ESRI.ArcGIS.esriSystem;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Wave.Extensions.Esri.Tests
{
    [TestClass]
    public class EsriRuntimeAuthorizationTests
    {
        [TestMethod]
        public void EsriRuntimeAuthorization_GetInitializationStatus()
        {
            using (var lic = new EsriRuntimeAuthorization())
            {
                var status = lic.GetInitializationStatus();
                Assert.AreEqual("Product: No licenses were requested", status);

                var extensionCodes = Enum.GetValues(typeof (esriLicenseExtensionCode));
                lic.Initialize(esriLicenseProductCode.esriLicenseProductCodeStandard, extensionCodes.OfType<esriLicenseExtensionCode>().ToArray());

                status = lic.GetInitializationStatus();
                Assert.IsNotNull(status);
            }
        }
    }
}


text:
module.exports = function (io, config) {
    io.on('connection', function (socket) {
        console.log('a user connected');

        socket.on('disconnect', function () {
            console.log('user disconnected');
        });

        socket.on('chat', function (msg) {
            socket.broadcast.emit('chat', msg);
        });
    });
};


text: For the moment, only private_key and certificate are required


text:
<?php
/**
 * Elgg footer
 * The standard HTML footer that displays across the site
 *
 * @package Elgg
 * @subpackage Core
 *
 */

echo elgg_view_menu('footer', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz'));

$powered_url = elgg_get_site_url() . "_graphics/powered_by_elgg_badge_drk_bckgnd.gif";

echo '
';
echo elgg_view('output/url', array(
	'href' => 'http://elgg.org',
	'text' => "",
	'class' => '',
	'is_trusted' => true,
));
echo '
';


text:
Ext.define('Ozone.components.widget.DeleteWidgetsPanel', {
    extend: 'Ext.panel.Panel',
    alias: ['widget.deletewidgetspanel', 'widget.Ozone.components.widget.DeleteWidgetsPanel'],

    delWidgets: null,
    dashboardContainer: null,
    delTitlePanel: null,
    delView: null,
    reqTitlePanel: null,
    reqGrid: null,

    mixins: {
        circularFocus: 'Ozone.components.focusable.CircularFocus'
    },

    id: 'topdeletepanel',
    width: 600,
    height: 300,
    layout: {
        type: 'vbox',
        align: 'stretch'
    },

    // private
    initComponent: function() {

        this.delTitlePanel = Ext.create('Ext.panel.Panel', {
            layout: 'fit',
            border: false,
            html: 'You have selected to delete 0 widgets:'
        });

        this.delView = Ext.create('Ext.grid.Panel', {
            cls: 'delView',
            columns: [{
                xtype: 'templatecolumn',
                sortable: false,
                hideable: false,
                tpl: '',
                width: 36
            },
            {
                header: 'Name',
                dataIndex: 'name',
                flex: 1,
                hideable: false
            }],
            store: Ext.create('Ext.data.Store', {
                autoDestroy: true,
                storeId: 'deleteStore',
                idIndex: 0,
                sortInfo: {
                    field: 'name',
                    direction: 'ASC'
                },
                fields: [
                    {name: 'guid'},
                    {name: 'name'},
                    {name: 'headerIcon'},
                    {name: 'image'}
                ]
            })
        });

        this.reqTitlePanel = Ext.create('Ext.panel.Panel', {
            itemId: 'reqTitlePanel',
            layout: 'fit',
            hidden: true,
            border: false,
            html: 'These widgets are required by other widgets in OWF. Deleting these widgets will additionally delete the widgets listed below.'
        });

        this.reqGrid = Ext.create('Ext.grid.Panel', {
            itemId: 'reqGrid',
            hidden: true,
            store: Ext.create('Ext.data.Store', {
                autoDestroy: true,
                storeId: 'requiredStore',
                idIndex: 0,
                sortInfo: {
                    field: 'name',
                    direction: 'ASC'
                },
                fields: [
                    {name: 'id'},
                    {name: 'name'},
                    {name: 'version'},
                    {name: 'url'},
                    {name: 'headerIcon'},
                    {name: 'image'},
                    {name: 'width'},
                    {name: 'height'},
                    {name: 'widgetGuid'},
                    {name: 'maximized'},
                    {name: 'minimized'},
                    {name: 'x'},
                    {name: 'y'},
                    {name: 'visible'},
                    {name: 'tags'},
                    {name: 'totalUsers'},
                    {name: 'totalGroups'},
                    {name: 'singleton'}
                ]
            }),
            columns: [
            {
                dataIndex: 'headerIcon',
                width: 36,
                sortable: false,
                hideable: false,
                menuDisabled: true,
                renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                    var url = null;
                    var contextPath = Ozone.util.contextPath();
                    if (!value.match(new RegExp('^/?' + contextPath + '/.*$','i')) && !value.match(new RegExp('^https?://.*','i'))) {
                        //url is not relative to the contextPath
                        if (value.indexOf('/') == 0) {
                            url = contextPath + value;
                        } else {
                            url = contextPath + '/' + value;
                        }
                    }
                    else {
                      //value is a full url
                      url = value;
                    }
                    return '';
                }
            },
            {
                header: 'Name',
                dataIndex: 'name',
                flex: 1,
                sortable: false,
                hideable: false,
                menuDisabled: true
            },
            {
                header: 'Version',
                dataIndex: 'version',
                width: 121,
                sortable: false,
                hideable: false,
                menuDisabled: true
            },
            {
                header: 'Tags',
                dataIndex: 'tags',
                //width: 150,
                flex: 1, //fill the rest of the space
                sortable: false,
                hideable: false,
                menuDisabled: true,
                renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                    var strTags = "";
                    if (value != null) {
                        for (var i = 0; i < value.length; i++) {
                            strTags += value[i].name;
                            if (i < value.length - 1) {
                                strTags += ", ";
                            }
                        }
                    }
                    return strTags;
                }
            }
            ],
            viewConfig: {
                emptyText: 'No additional widgets to delete'
            },
            autoScroll: true,
            foreceFilt: true,
            flex: 1,
            border: false,
            iconCls: 'icon-grid'
        });

        this.items  = [
            this.delTitlePanel,
            this.delView,
            this.reqTitlePanel,
            this.reqGrid
        ];

        this.okBtn = Ext.create('Ext.button.Button', {
            text: Ozone.layout.DialogMessages.ok,
            //iconCls: 'okSaveBtnIcon',
            handler: function(button) {
                this.del();
            },
            scope: this
        });
        this.cancelBtn = Ext.create('Ext.button.Button', {
            xtype: 'button',
            text: 'Cancel',
            //iconCls: 'cancelBtnIcon',
            handler: function(button) {
                this.cancel();
            },
            scope: this
        });

        this.buttons = [this.okBtn, this.cancelBtn];

        var scope = this;

        var ids = [];
        var r = [];
        var w = this.delWidgets;
        for (var i = 0; i < w.length; i++) {
            ids.push(w[i].guid);
            r.push([
                w[i].guid,
                Ext.htmlEncode(w[i].name),
                w[i].headerIcon,
                w[i].image
            ]);
        }

        var delStore = this.delView.getStore();
        if (delStore) {
            delStore.removeAll();
            delStore.loadData(r, true);
        }

        this.delTitlePanel.update('You have selected to delete ' + delStore.getCount() + ' widgets:');

        Ozone.pref.PrefServer.getDependentPersonWidgets({
            content: {'ids': ids},
            onSuccess: function(ret) {
                var d = [];
                var data = ret.data;

                var delStore = scope.delView.getStore();

                if (data) {
                    for (var i = 0; i < data.length; i++) {
                        if (-1 == delStore.find('guid', data[i].path)) {
                            d.push({
                                id: data[i].path,
                                name: data[i].value.namespace,
                                version: data[i].value.widgetVersion,
                                url: data[i].value.url,
                                headerIcon: data[i].value.headerIcon,
                                image: data[i].value.image,
                                width: data[i].value.width,
                                height: data[i].value.height,
                                widgetGuid: data[i].path,
                                maximized: data[i].value.maximized,
                                minimized: data[i].value.minimized,
                                x: data[i].value.x,
                                y: data[i].value.y,
                                visible: data[i].value.visible,
                                tags: data[i].value.tags,
                                totalUsers: data[i].value.totalUsers,
                                totalGroups: data[i].value.totalGroups,
                                singleton: data[i].value.singleton
                            });
                        }
                    }
                }

                var reqTitlePanel = scope.reqTitlePanel;
                var reqGrid = scope.reqGrid;
                var reqStore = scope.reqGrid.getStore();
                if (reqStore) {
                  reqStore.removeAll();
                  if (d.length > 0) {
                    reqTitlePanel.show();
                    reqGrid.show();
                    reqStore.loadData(d);
                    scope.doLayout();
                  }
                  else {
                    reqTitlePanel.hide();
                    reqGrid.hide();
                    scope.doLayout();
                  }
                }
            },
            onFailure: function() {
                alert('Error');
            }
        });

//        this.on('show', function() {
//            this.focus();
//        }, okBtn);

        this.callParent();

        this.on('afterrender', function(cmp) {
            cmp.setupFocus(cmp.okBtn.getFocusEl(), cmp.cancelBtn.getFocusEl());
        });
    },

    del: function() {
        var delStore = this.delView.getStore();
        var delRecs = delStore.getRange();
        var reqStore = this.reqGrid.getStore();
        var reqRecs = reqStore.getRange();
        var allRecs = [];
        for (var i = 0; i < delRecs.length; i++) {
            allRecs.push(delRecs[i].data.guid);
        }
        for (var i = 0; i < reqRecs.length; i++) {
            allRecs.push(reqRecs[i].data.widgetGuid);
        }

        var scope = this;

        Ozone.pref.PrefServer.updateAndDeleteWidgets({
            widgetsToUpdate: [],
            widgetGuidsToDelete: allRecs,
            updateOrder: false,
            onSuccess: function(ret) {
                //Call method to refresh the 'widget launch menu' widgets.
                scope.dashboardContainer.retrieveUpdatedWidgets();
            },
            onFailure: function() {
                Ozone.Msg.alert(Ozone.util.ErrorMessageString.saveUpdatedWidgets, Ozone.util.ErrorMessageString.saveUpdatedWidgetsMsg,
                    null, null, null, scope.dashboardContainer.modalWindowManager);
            }
        });

        this.cancel();
    },

    cancel: function() {
        this.ownerCt.close();
    }

});


text:
import React, { PropTypes } from 'react'
import {
  avatar, replyContainer, header,
  cushion, center, author,
} from './styles.css'
import { formatTimeStamp } from 'helpers/utils'
import { errorMsg, subHeader } from 'sharedStyles/styles.css'
const { bool, string, object } = PropTypes

Reply.propTypes = {
  comment: object.isRequired,
}

function Reply ({comment}) {
  return (

{comment.name}

{formatTimestamp(comment.timestamp)}

{comment.reply}

  )
}

Replies.propTypes = {
  isFetching: bool.isRequired,
  error: string.isRequired,
  replies: object,
}

function Replies ({isFetching, error, replies}) {
  const replyIds = Object.keys(replies) // Ids of each reply we're supposed to render
  console.log('replyIds', replyIds)
  return (

      {error ?
{error}
 : null}
      {isFetching === true
        ?
{`Fetching Replies`}

        :

{`Replies`}

          {replyIds.map((replyId) => {
            <Reply key={replyId} comment={replies[replyId]} />
          })}

}
      {replyIds.length === 0 ?
{`Be the first to comment.`}
 : null}

  )
}

export default Replies


text:
In this first step, we'll construct the [Trie](https://en.wikipedia.org/wiki/Trie)
data structure, which is used for grouping sequences into OTUs.

```python
>>> from q2d2 import build_trie
>>> import skbio
>>> seq_gen = skbio.io.read('{0}', format='fasta',)
>>> trie, sequence_summary = build_trie(seq_gen)
>>> sample_count = len(sequence_summary['sample_ids'])
>>> sequence_count = sequence_summary['count']
>>> print("%d sequences from %d samples were used to build the Trie." % (sequence_count, sample_count))
```

Next, we'll group our sequences, computing counts using the ``{1}`` method that you passed in on the command line.

```python
>>> from q2d2 import biom_from_trie, count_fs
>>> seq_gen = skbio.io.read('{0}', format='fasta',)
>>> biom = biom_from_trie(trie, sequence_summary['sample_ids'], seq_gen, count_f=count_fs['{1}'])
```

Then, we'll get summary statistics on our table.

```python
>>> from q2d2 import table_summary
>>> table_summary(biom)
```

Finally, we'll store the table so we can use it again another time.

```python
>>> from q2d2 import store_table
>>> store_table(biom)
```


text:
package com.microsoft.azure.management.datalake.analytics.models;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Azure Storage account information.
 */
public class StorageAccountInfo {
    /**
     * the account name associated with the Azure storage account.
     */
    @JsonProperty(required = true)
    private String name;

    /**
     * the properties associated with this storage account.
     */
    @JsonProperty(required = true)
    private StorageAccountProperties properties;

    /**
     * Get the name value.
     *
     * @return the name value
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name value.
     *
     * @param name the name value to set
     * @return the StorageAccountInfo object itself.
     */
    public StorageAccountInfo withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the properties value.
     *
     * @return the properties value
     */
    public StorageAccountProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties value.
     *
     * @param properties the properties value to set
     * @return the StorageAccountInfo object itself.
     */
    public StorageAccountInfo withProperties(StorageAccountProperties properties) {
        this.properties = properties;
        return this;
    }

}


text:
using System;

namespace Gumbo.Wrappers
{
    internal class DisposalAwareLazyFactory
    {
        private readonly Func<bool> _IsDisposed;

        private readonly string _ObjectName;

        public DisposalAwareLazyFactory(Func<bool> isDisposed, string objectName)
        {
            if (isDisposed == null)
            {
                throw new ArgumentNullException(nameof(isDisposed));
            }

            if (objectName == null)
            {
                throw new ArgumentNullException(nameof(objectName));
            }

            _IsDisposed = isDisposed;
            _ObjectName = objectName;
        }

        public Lazy<T> Create<T>(Func<T> factoryMethod)
        {
            return new Lazy<T>(() =>
            {
                if (_IsDisposed())
                {
                    throw new ObjectDisposedException(_ObjectName);
                }

                return factoryMethod();
            });
        }
    }
}


text:
{% extends "base.html" %}
{% block title %}Please log in{% endblock %}

{% block content %}
{% include "auth/login_form.html" %}
{% endblock %}


text:
package cinspect.web;

/**
 * An enum class which specifies the current crawling status of the URL. Used to make sure we don't double-crawl or run into multithreading issues.
 * @author ROTP
 *
 */
public enum ResourceCrawlStatus {
	IS_NOT_CRAWLED,
	IS_CRAWLING,
	IS_CRAWLED
}


text:
package hip.util;

import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*;

import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

/**
 * Utilities to help with HDFS activities.
 */
public class HdfsIoUtils {

  public static final PathFilter hiddenFileFilter = new PathFilter() {
    public boolean accept(Path p) {
      String name = p.getName();
      return !name.startsWith("_") && !name.startsWith(".");
    }
  };

  /**
   * Glob-able mapping of String paths to Path objects, and in the process
   * expanding path patterns allowing for inputs such as "/some/path*".
   *
   * @param conf  Hadoop config
   * @param paths paths to convert and glob
   * @return globbed paths
   * @throws IOException if something goes wrong
   */
  public static Iterable<Path> stringsToPaths(Configuration conf, Iterable<String> paths) throws IOException {
    Iterable<Path> pathIterable = Iterables.transform(paths, new Function<String, Path>() {
      @Nullable
      @Override
      public Path apply(String path) {
        return new Path(path);
      }
    });

    List<Path> result = Lists.newArrayList();
    for (Path p : pathIterable) {
      FileSystem fs = p.getFileSystem(conf);
      FileStatus[] matches = fs.globStatus(p, hiddenFileFilter);
      if (matches != null && matches.length > 0) {
        for (FileStatus globStat : matches) {
          if (globStat.isDirectory()) {
            RemoteIterator<LocatedFileStatus> iter =
                fs.listLocatedStatus(globStat.getPath());
            while (iter.hasNext()) {
              LocatedFileStatus stat = iter.next();
              if (hiddenFileFilter.accept(stat.getPath())) {
                if (stat.isDirectory()) {
                  addInputPathRecursively(result, fs, stat.getPath(), hiddenFileFilter);
                } else {
                  result.add(stat.getPath());
                }
              }
            }
          } else {
            result.add(globStat.getPath());
          }
        }
      }
    }
    return result;
  }

  /**
   * Add files in the input path recursively into the results.
   *
   * @param result      The List to store all files.
   * @param fs          The FileSystem.
   * @param path        The input path.
   * @param inputFilter The input filter that can be used to filter files/dirs.
   * @throws IOException if something goes wrong
   */
  public static void addInputPathRecursively(List<Path> result,
                                             FileSystem fs, Path path, PathFilter inputFilter)
      throws IOException {
    RemoteIterator<LocatedFileStatus> iter = fs.listLocatedStatus(path);
    while (iter.hasNext()) {
      LocatedFileStatus stat = iter.next();
      if (inputFilter.accept(stat.getPath())) {
        if (stat.isDirectory()) {
          addInputPathRecursively(result, fs, stat.getPath(), inputFilter);
        } else {
          result.add(stat.getPath());
        }
      }
    }
  }

  public static Iterable<Path> stringsToPaths(Configuration conf, String... paths) throws IOException {
    return stringsToPaths(conf, Arrays.asList(paths));
  }
}