text:
package com.voc.jira.plugins.jira.workflow;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.fields.CustomField;
import com.voc.jira.plugins.jira.customfield.SelectSeverityField;
import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.workflow.Validator;
import com.opensymphony.workflow.InvalidInputException;

import java.util.ArrayList;
import java.util.Map;

public class SeverityNotNoneValidator implements Validator
{
    private static final Logger log = LoggerFactory.getLogger(SeverityNotNoneValidator.class);
	//private static SelectSeverityField<?,? > selectSeverityField;
    private final CustomFieldManager customFieldManager;

    public static final String SEVERITY_DEFAULT="None";
    public static final String SEVERITY=SelectSeverityField.getSeverityFieldName();
    public static final String ISSUE="issue";
    private ArrayList<String> defectTypes = new ArrayList<String>();

    public SeverityNotNoneValidator(CustomFieldManager customFieldManager){
      this.customFieldManager = customFieldManager;
      defectTypes.add("Bug");
      defectTypes.add("Defect");
    }

    @SuppressWarnings("rawtypes")
	public void validate(Map transientVars, Map args, PropertySet ps) throws InvalidInputException {
      Issue issue = (Issue) transientVars.get(ISSUE);
      CustomField customField = customFieldManager.getCustomFieldObjectByName(SEVERITY);
      String errorMsg = SEVERITY + " must be changed from the default value '"
          + SEVERITY_DEFAULT + "' for all 'Defect' issues.";
      if(defectTypes.contains(issue.getIssueTypeObject().getName())){
	    log.info(issue.getIssueTypeObject().getName()
	        + " IssueType is one of the known defect issue types collection.");
	    if (customField == null) {
	        throw new IllegalArgumentException("customField \"" + SEVERITY + "\" (case sensitive) not found");
	    }
	    InvalidInputException ex = new InvalidInputException();
		if(null == issue.getCustomFieldValue(customField)) {
		  ex.addError(errorMsg);
		  ex.addError(SEVERITY,errorMsg);
		  if ( ex.getErrors() != null ) {
			throw ex;
		  }
		}
	  }
    }
}


text:
# apply-transform [![build status](https://secure.travis-ci.org/thlorenz/apply-transform.png)](http://travis-ci.org/thlorenz/apply-transform)

[![testling badge](https://ci.testling.com/thlorenz/apply-transform.png)](https://ci.testling.com/thlorenz/apply-transform)

Applies a transform to an input string and calls back with result, mostly useful for testing transforms

```js
var applyTransform = require('apply-transform')
  , assert = require('assert')
  , through = require('through2');

function toUpper() {
  return through(
    function (chunk, enc, cb) {
      this.push(chunk.toUpperCase());
      cb();
    }
  )
}

var tx = toUpper();
tx._writableState.decodeStrings = false;

applyTransform(tx, 'hello world', function (err, res) {
  if (err) return assert.fail(err);
  assert.equal(res, 'HELLO WORLD', 'calls back with transformed result')
})
```

## Installation

    npm install apply-transform

## API

```
/**
 * Applies the given transform to the input and calls back with result.
 *
 * @name
 * @function
 * @param {TransformStream} transform to apply to the @see input
 * @param {String} input to transform
 * @param {Function} cb function(err, output) { }
 *  - {Error} err: is set if an error occurred
 *  - {String} output: the result of applying the @see transform to the @see input
 * @return {ReadableStream} that streams the input string char by char, useful for debugging failing transforms
 */
```

## License

MIT

redpajama_set_name: RedPajamaGithub


text:
heroku-sso-generator
====================

Generate a SSO token against a add-on


text:
namespace base {
class TimeDelta;
}  // namespace base

namespace feed {

class FeedSchedulerHost;

// Native counterpart of FeedSchedulerBridge.java. Holds non-owning pointers to
// native implementation, to which operations are delegated. Also capable of
// calling back into Java half.
class FeedSchedulerBridge {
 public:
  FeedSchedulerBridge(const base::android::JavaRef<jobject>& j_this,
                      FeedSchedulerHost* scheduler_host);
  ~FeedSchedulerBridge();

  void Destroy(JNIEnv* env, const base::android::JavaRef<jobject>& j_this);

  jint ShouldSessionRequestData(JNIEnv* env,
                                const base::android::JavaRef<jobject>& j_this,
                                const jboolean j_has_content,
                                const jlong j_content_creation_date_time_ms,
                                const jboolean j_has_outstanding_request);

  void OnReceiveNewContent(JNIEnv* env,
                           const base::android::JavaRef<jobject>& j_this,
                           const jlong j_content_creation_date_time_ms);

  void OnRequestError(JNIEnv* env,
                      const base::android::JavaRef<jobject>& j_this,
                      jint j_network_response_code);

  void OnForegrounded(JNIEnv* env,
                      const base::android::JavaRef<jobject>& j_this);

  void OnFixedTimer(JNIEnv* env,
                    const base::android::JavaRef<jobject>& j_this,
                    const base::android::JavaRef<jobject>& j_callback);

  void OnSuggestionConsumed(JNIEnv* env,
                            const base::android::JavaRef<jobject>& j_this);

  bool OnArticlesCleared(JNIEnv* env,
                         const base::android::JavaRef<jobject>& j_this,
                         jboolean j_suppress_refreshes);

 private:
  // Callable by native code to invoke Java code. Sends a request to the Feed
  // library to make the refresh call.
  void TriggerRefresh();

  // Calls into Java logic to schedule a background task to wake up Chrome and
  // call back into the FeedHostScheduler.
  void ScheduleWakeUp(base::TimeDelta threshold_ms);

  // Cancels previously scheduled background task.
  void CancelWakeUp();

  void FixedTimerHandlingDone(
      base::android::ScopedJavaGlobalRef<jobject> j_callback);

  // Reference to the Java half of this bridge. Always valid.
  base::android::ScopedJavaGlobalRef<jobject> j_this_;

  // Object to which all Java to native calls are delegated.
  FeedSchedulerHost* scheduler_host_;

  base::WeakPtrFactory<FeedSchedulerBridge> weak_factory_{this};

  DISALLOW_COPY_AND_ASSIGN(FeedSchedulerBridge);
};

}  // namespace feed

#endif  // CHROME_BROWSER_ANDROID_FEED_FEED_SCHEDULER_BRIDGE_H_


text:
import re
from typing import Dict, Text
from .base import BaseParser

class OpenGraphParser(BaseParser):
    def extract_data(self):
        # type: () -> Dict[str, Text]
        meta = self._soup.findAll('meta')
        content = {}
        for tag in meta:
            if tag.has_attr('property') and 'og:' in tag['property']:
                content[re.sub('og:', '', tag['property'])] = tag['content']
        return content


text:
package uk.trainwatch.rabbitmq;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.QueueingConsumer;
import com.rabbitmq.client.QueueingConsumer.Delivery;
import com.rabbitmq.client.ShutdownSignalException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.logging.Level;
import java.util.logging.Logger;
import uk.trainwatch.util.BlockingSupplier;
import uk.trainwatch.util.BlockingSupplierConsumer;
import uk.trainwatch.util.DaemonThreadFactory;

/**
 * A {@link Supplier} which will provide received messages from a RabbitMQ Queue
 *

 * @author Peter T Mount
 */
public class RabbitSupplier
        implements BlockingSupplier<byte[]>
{

    /**
     * When durable, enforce a 5 minute ttl for all messages unless specified. This is a safety net so that we don't cause the server to fill up with messages
     * on a dead durable queue.
     *

     * NB: Since 2015/10/27 default to 20 minutes to allow certain queues to hold data during heavy load, especially the daily darwin snapshot import
     */
    private static final int DEFAULT_TTL = 300000;

    private static final Logger LOG = Logger.getLogger( RabbitSupplier.class.getName() );
    private final RabbitConnection connection;
    private final String queueName;
    private final String bindTopic;
    private final String bindRoutingKey;
    private final boolean durable;
    private final boolean parked;
    private final long parkDelay;
    private final String parkQueueName;
    private final Map<String, Object> queueProperties;
    private Channel channel;
    private QueueingConsumer consumer;
    private volatile boolean running;
    /**
     * Only allow a single message to be queued
     */
    private final BlockingSupplierConsumer<byte[]> supplier;
    private final Consumer<Delivery> optionalConsumer;
    private Thread thread;

    RabbitSupplier( RabbitConnection connection, String queueName, String bindTopic, String bindRoutingKey,
                    Consumer<Delivery> optionalConsumer,
                    boolean durable,
                    Map<String, Object> queueProperties )
    {
        this.connection = Objects.requireNonNull( connection );
        this.queueName = Objects.requireNonNull( queueName );
        this.bindTopic = bindTopic;
        this.bindRoutingKey = bindRoutingKey;
        this.durable = durable;

        this.optionalConsumer = optionalConsumer;
        supplier = optionalConsumer == null ? new BlockingSupplierConsumer<>( 1 ) : null;

        if( durable ) {
            this.queueProperties = queueProperties == null ? new HashMap<>() : queueProperties;

            this.queueProperties.putIfAbsent( "x-message-ttl", DEFAULT_TTL );
        }
        else {
            // queue properties are optiona, so null is valid. If empty then replace with null
            this.queueProperties = (queueProperties == null || queueProperties.isEmpty()) ? null : queueProperties;
        }

        // Enable parking
        if( this.queueProperties != null && this.queueProperties.containsKey( "internal-park-queue" ) ) {
            parked = true;
            parkDelay = (Long) this.queueProperties.remove( "internal-park-queue" );
            parkQueueName = queueName + "$park";
        }
        else {
            parked = false;
            parkDelay = 0L;
            parkQueueName = null;
        }
    }

    @Override
    public void setInvalid()
    {
        supplier.setInvalid();
        closeImpl();
    }

    protected final Channel getChannel()
            throws IOException
    {
        if( channel == null || !channel.isOpen() ) {
            closeImpl();
            connect();
        }
        return channel;
    }

    public final synchronized QueueingConsumer getQueueingConsumer()
            throws IOException
    {
        if( channel == null || !channel.isOpen() ) {
            closeImpl();
            connect();
        }
        return consumer;
    }

    @SuppressWarnings("UseSpecificCatch")
    public final void start()
    {
        thread = DaemonThreadFactory.INSTANCE.newThread( () -> {
            running = true;
            while( running ) {
                try {
                    processNextMessage();
                }
                catch( InterruptedException ex ) {
                    running = false;
                    LOG.log( Level.INFO, "Interrupted so terminating" );
                }
                catch( IOException ex ) {
                    if( running ) {
                        LOG.log( Level.SEVERE, "IOException, attempting to recover", ex );
                        closeImpl();
                    }
                }
                catch( ShutdownSignalException ex ) {
                    LOG.log( Level.WARNING, "Shutting down" );
                    running = false;
                }
                catch( Throwable ex ) {
                    // Catch all others so the thread doesn't terminate but try to recover by reconnecting.
                    // Reconnecting will automatically nack the message and requeue it
                    if( running ) {
                        LOG.log( Level.WARNING, "Error whilst processing message, attempting to recover", ex );
                        closeImpl();
                    }
                    else {
                        LOG.log( Level.SEVERE, "Error whilst processing message, appears to be fatal?", ex );
                    }
                }
            }
            LOG.log( Level.FINE, () -> "Worker " + queueName + " terminated" );
            closeImpl();

        } );
        thread.start();
    }

    public final void stop()
    {
        running = false;
        if( thread != null ) {
            thread.interrupt();
        }
        closeImpl();
    }

    private void closeImpl()
    {
        if( channel != null ) {
            LOG.log( Level.INFO, () -> "Closing channel " + queueName );
            connection.close( this, channel );
            channel = null;
        }
    }

    private void connect()
            throws IOException
    {
        LOG.log( Level.INFO, () -> "Connecting to " + queueName );

        channel = connection.getChannel( this );

        LOG.log( Level.INFO, () -> "Creating " + queueName );

        // When declaring the queue, if we are durable then don't auto-delete, but auto-delete when we're not
        channel.queueDeclare( queueName, durable, false, !durable, queueProperties );
        channel.basicQos( 1 );

        LOG.log( Level.FINE, () -> "Creating consumer on " + queueName );
        consumer = new QueueingConsumer( channel );

        if( bindTopic != null ) {
            // Create the parking queue
            if( parked ) {
                Map<String, Object> props = new HashMap<>();
                props.put( "x-message-ttl", parkDelay );
                props.put( "x-dead-letter-exchange", "" );
                props.put( "x-dead-letter-routing-key", queueName );

                channel.queueDeclare( parkQueueName, durable, false, !durable, props );
            }

            // Bind to the correct queue so if parked then it receives from the exchange
            for( String routingKey: bindRoutingKey.split( "," ) ) {
                channel.queueBind( parked ? parkQueueName : queueName, bindTopic, routingKey );
            }
        }

        // Now consume the main queue
        channel.basicConsume( queueName, consumer );

        LOG.log( Level.INFO, () -> "Connected to " + queueName );
    }

    private void processNextMessage()
            throws IOException,
                   InterruptedException
    {
        final QueueingConsumer.Delivery delivery = getQueueingConsumer().
                nextDelivery();

        try {
            if( optionalConsumer == null ) {
                supplier.accept( delivery.getBody() );
            }
            else {
                optionalConsumer.accept( delivery );
            }

            // ack as we have handled it safely
            channel.basicAck( delivery.getEnvelope().
                    getDeliveryTag(), false );

        }
        catch( Exception ex ) {
            // nack and don't requeue
            getChannel().
                    basicNack( delivery.getEnvelope().
                            getDeliveryTag(), false, false );
        }
    }

    /**
     * Return a supplier for this queue
     *

     * @return
     */
    @Override
    public byte[] get()
    {

        return supplier.get();
    }

    @Override
    public int hashCode()
    {
        int hash = 3;
        hash = 17 * hash + Objects.hashCode( this.queueName );
        return hash;
    }

    @Override
    public boolean equals( Object obj )
    {
        if( obj == null ) {
            return false;
        }
        if( getClass() != obj.getClass() ) {
            return false;
        }
        final RabbitSupplier other = (RabbitSupplier) obj;
        return Objects.equals( this.queueName, other.queueName );
    }

}


text:
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');
const jwt = require('jsonwebtoken');

var userSchema = new mongoose.Schema({
  username: { type: String, unique: true, require: true },
  email: { type: String },
  password: { type: String, require: true },
  zipcode: { type: Number }
});

userSchema.methods.generateHash = function(password) {
  return this.password = bcrypt.hashSync(password, 8);
};

userSchema.methods.compareHash = function(password) {
  return bcrypt.compareSync(password, this.password);
};

userSchema.methods.generateToken = function() {
  return jwt.sign({ idd: this._id }, process.env.APP_SECRET);
};

module.exports = exports = mongoose.model('User', userSchema);


text:
package org.nutz.lang.util;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import org.nutz.lang.meta.Pair;

public class HtmlToken {

    private static final Pattern BLOCK = Pattern.compile(    "^(head|div|p|ul|ol|blockquote|pre|title|h[1-9]|li|hr|table|tr|td)$",
                                                            Pattern.CASE_INSENSITIVE);

    private static final Pattern INLINE = Pattern.compile(    "^(span|b|i|u|em|strong|sub|sup|code|font)$",
                                                            Pattern.CASE_INSENSITIVE);

    private static final Pattern NOCHILD = Pattern.compile(    "^(br|img|link|hr|meta)$",
                                                            Pattern.CASE_INSENSITIVE);

    HtmlToken() {
        attributes = new ArrayList<Pair<String>>();
    }

    private String name;
    private String value;
    private List<Pair<String>> attributes;

    public String getName() {
        return name;
    }

    public HtmlToken setName(String name) {
        this.name = name;
        return this;
    }

    public String getValue() {
        return value;
    }

    public HtmlToken setValue(String value) {
        this.value = value;
        return this;
    }

    public boolean isElement() {
        return null != name;
    }

    public boolean isText() {
        return null == name && value != null;
    }

    public boolean isBlock() {
        if (null == name)
            return false;
        return BLOCK.matcher(name).find();
    }

    public boolean isInline() {
        if (null == name)
            return false;
        return INLINE.matcher(name).find();
    }

    public boolean isNoChild() {
        if (null == name)
            return true;
        return NOCHILD.matcher(name).find();
    }

    public boolean isHtml() {
        if (null == name)
            return false;
        return name.equalsIgnoreCase("html");
    }

    public boolean isBody() {
        if (null == name)
            return false;
        return name.equalsIgnoreCase("body");
    }

    public HtmlToken attr(String name, String value) {
        Pair<String> attr = getAttr(name);
        if (null == attr) {
            attr = new Pair<String>(name, value);
            attributes.add(attr);
        } else {
            attr.setValue(value);
        }
        return this;
    }

    public HtmlToken attr(String name, int value) {
        return attr(name, String.valueOf(value));
    }

    public Pair<String> getAttr(String name) {
        for (Pair<String> attr : attributes)
            if (attr.getName().equals(name))
                return attr;
        return null;
    }

    public String getAttrVal(String name) {
        Pair<String> p = getAttr(name);
        return p == null ? null : p.getValueString();
    }

    public List<Pair<String>> getAttributes() {
        return attributes;
    }

}


text:
package com.aspose.gridweb.demo.web;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping({"/gridwebdemo"})
public class HelloController {

    @GetMapping({"/sheets"})
    public ModelAndView getSheets()
    {
      ModelAndView mv = new ModelAndView();
      mv.setViewName("sheets");
      return mv;
    }
    @GetMapping({"/createcontent"})
    public ModelAndView getCreateContent()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.setViewName("createcontent");
    	return mv;
    }

    @GetMapping({"/chartrefresh"})
    public ModelAndView getChartrefresh()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.setViewName("chartrefresh");
    	return mv;
    }
    @GetMapping({"/modes"})
    public ModelAndView getModes()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.setViewName("modes");
    	return mv;
    }
    @GetMapping({"/conditionformat"})
    public ModelAndView getCondtionformat()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.setViewName("conditionformat");
    	return mv;
    }
    @GetMapping({"/group"})
    public ModelAndView getGroup()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.setViewName("group");
    	return mv;
    }
    @GetMapping({"/controls"})
    public ModelAndView getDisplaycontrols()
    {
      ModelAndView mv = new ModelAndView();
      mv.addObject("servletname", "FeatureServlet");
      mv.addObject("method", "loadControls");
      mv.addObject("title", "displaycontrols");
      mv.addObject("info", "display kind of controls");
      mv.setViewName("general");
      return mv;
    }

    @GetMapping({"/sort"})
    public ModelAndView getSort()
    {
      ModelAndView mv = new ModelAndView();
      mv.addObject("servletname", "FeatureServlet");
      mv.addObject("method", "sort");
      mv.addObject("title", "sort");
      mv.addObject("info", "The Demo represents the sorting capabilities of GriWeb Control.click the hyperlink on the A1,B1,C1,D1 to do cells sort. ");
      mv.setViewName("general");
      return mv;
    }

    @GetMapping({"/autofilter"})
    public ModelAndView getAutofilter()
    {
      ModelAndView mv = new ModelAndView();
      mv.addObject("servletname", "FunctionServlet");
      mv.addObject("method", "autoFilter");
      mv.addObject("title", "auto filter");
      mv.addObject("info", "This Demo Imports an Excel File from a source and Set the AutoFilter feature. ");
      mv.setViewName("general");
      return mv;
    }
    @GetMapping({"/largerows"})
    public ModelAndView getLargerows()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "loadLargeRows");
    	mv.addObject("title", "loadLargeRows");
    	mv.addObject("info", " This demo loads  a file with many rows,every time scroll it will load piece of rows for rendering. ");
    	mv.setViewName("general");
    	return mv;
    }

    @GetMapping({"/events"})
    public ModelAndView getEvents()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "events");
    	mv.addObject("title", "events");
    	mv.addObject("info", " This Demo Demonstrates Event Handling related to GridWeb Control. ");
    	mv.setViewName("general");
    	return mv;
    }
    @GetMapping({"/clientfunc"})
    public ModelAndView getClientFunc()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "clientfunc");
    	mv.addObject("title", "clientfunc");
    	mv.addObject("info", " trigger client js call back on ajax after cell select,check console out put. ");
    	mv.setViewName("clientfunction");
    	return mv;
    }
    @GetMapping({"/validation"})
    public ModelAndView getValidation()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FunctionServlet");
    	mv.addObject("method", "validation");
    	mv.addObject("title", "validation");
    	mv.addObject("info", " Click Reload to see how demo reloads data and applies validation rules so\r\n" +
    			"            that invalid (not matching certain RegExp) values could not be entered in the GridWeb\r\n" +
    			"            Control.");
    	mv.setViewName("validation");
    	return mv;
    }
    @GetMapping({"/webcells"})
    public ModelAndView getWebcells()
    {
    	ModelAndView mv = new ModelAndView();

    	mv.addObject("title", "webcells");

    	mv.setViewName("webcells");
    	return mv;
    }
    @GetMapping({"/commandbutton"})
    public ModelAndView getCommandbutton()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("title", "commandbutton");
    	mv.setViewName("commandbutton");
    	return mv;
    }
    @GetMapping({"/freezepane"})
    public ModelAndView getFreezepane()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "loadFreezePaneFile");
    	mv.addObject("title", "loadFreezePaneFile");
    	mv.addObject("info", "  Click Reload to see how demo loads document, freezes a part of the worksheet\r\n" +
    			"            so that it remains visible while scrolling and displays data in the GridWeb Control.");
    	mv.setViewName("general");
    	return mv;
    }

    @GetMapping({"/freezepane_custom"})
    public ModelAndView getFreezepaneCustom()
    {
    	ModelAndView mv = new ModelAndView();

    	mv.setViewName("freezepane_custom");
    	return mv;
    }

    @GetMapping({"/hyperlink"})
    public ModelAndView getHyperlink()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FunctionServlet");
    	mv.addObject("method", "loadHyperlinkFile");
    	mv.addObject("title", "hyperlink");
    	mv.addObject("info", " Click Reload to see how demo demonstrates how to hyperlink table cells so\r\n" +
    			"            that browser windows would be opened when clicked and displays data in the GridWeb\r\n" +
    			"            Control.");
    	mv.setViewName("general");
    	return mv;
    }
    @GetMapping({"/pivot"})
    public ModelAndView getPivot()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "loadPivotFile");
    	mv.addObject("title", "pivot");
    	mv.addObject("info", " this demo shows load pivot file ");
    	mv.setViewName("general");
    	return mv;
    }

    @GetMapping({"/customheader"})
    public ModelAndView getCustomheaders()
    {
    	ModelAndView mv = new ModelAndView();

    	mv.setViewName("customheader");
    	return mv;
    }

     @GetMapping({"/math"})
    public ModelAndView getMath()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "loadMathFile");
    	mv.addObject("title", "loadMathFile");
    	mv.addObject("info", "  This demo loads an existing file into an empty WebWorksheet to demonstrate how GridWeb\r\n" +
    			"            applies typical Math formulas to grid cells and calculates formula values.\r\n" +
    			"            Click Reload to reload initial data for the grid. You can also Save/Open\r\n" +
    			"            the output in XLSFormat by clicking the Save Button on GridWeb Control Bar.");
    	mv.setViewName("general");
    	return mv;
    }

     @GetMapping({"/textdata"})
     public ModelAndView getTextData()
     {
    	 ModelAndView mv = new ModelAndView();
    	 mv.addObject("servletname", "FeatureServlet");
    	 mv.addObject("method", "loadTextAndDataFile");
    	 mv.addObject("title", "loadTextAndDataFile");
    	 mv.addObject("info", "  This demo loads an existing file into an empty WebWorksheet to demonstrate how GridWeb\r\n" +
    	 		"            applies typical Text and Data formulas to grid cells and calculates\r\n" +
    	 		"            formula values. Click Reload to reload initial data for the grid. You can\r\n" +
    	 		"            also Save/Open the output in XLSFormat by clicking the Save Button on GridWeb\r\n" +
    	 		"            Control Bar.");
    	 mv.setViewName("general");
    	 return mv;
     }
     @GetMapping({"/statistical"})
     public ModelAndView getStatistical()
     {
    	 ModelAndView mv = new ModelAndView();
    	 mv.addObject("servletname", "FeatureServlet");
    	 mv.addObject("method", "loadStatisticalFile");
    	 mv.addObject("title", "loadStatisticalFile");
    	 mv.addObject("info", " This demo loads an existing file into an empty WebWorksheet to\r\n" +
    	 		"			demonstrate how GridWeb applies typical Statistical formulas\r\n" +
    	 		"			to grid cells and calculates formula values. Click Reload to\r\n" +
    	 		"			reload initial data for the grid. You can also Save/Open the output\r\n" +
    	 		"			in XLSFormat by clicking the Save Button on GridWeb Control\r\n" +
    	 		"			Bar.");
    	 mv.setViewName("general");
    	 return mv;
     }
     @GetMapping({"/datetime"})
     public ModelAndView getDatetime()
     {
    	 ModelAndView mv = new ModelAndView();
    	 mv.addObject("servletname", "FeatureServlet");
    	 mv.addObject("method", "loadDateTimeFile");
    	 mv.addObject("title", "loadDateTimeFile");
    	 mv.addObject("info", "This demo loads an existing file into an empty WebWorksheet to demonstrate how GridWeb\r\n" +
    	 		"            applies typical Date formulas to grid cells and calculates formula values.\r\n" +
    	 		"            Click Reload to reload initial data for the grid. You can also Save/Open\r\n" +
    	 		"            the output in XLSFormat by clicking the Save Button on GridWeb Control Bar.");
    	 mv.setViewName("general");
    	 return mv;
     }
     @GetMapping({"/logical"})
     public ModelAndView getLogical()
     {
    	 ModelAndView mv = new ModelAndView();
    	 mv.addObject("servletname", "FeatureServlet");
    	 mv.addObject("method", "loadLogicalFile");
    	 mv.addObject("title", "loadLogicalFile");
    	 mv.addObject("info", " This demo loads an existing file into an empty WebWorksheet to demonstrate how GridWeb\r\n" +
    	 		"            applies typical Logical formulas to grid cells and calculates formula values.\r\n" +
    	 		"            Click Reload to reload initial data for the grid. You can also Save/Open\r\n" +
    	 		"            the output in XLSFormat by clicking the Save Button on GridWeb Control Bar.");
    	 mv.setViewName("general");
    	 return mv;
     }
     @GetMapping({"/pagination"})
     public ModelAndView getPagination()
     {
    	 ModelAndView mv = new ModelAndView();
    	 mv.addObject("servletname", "FeatureServlet");
    	 mv.addObject("method", "pagination");
    	 mv.addObject("title", "pagination");
    	 mv.addObject("info", " Click Reload to see how demo loads data from data source and\r\n" +
    	 		"			divides it into several pages to improve performance or support\r\n" +
    	 		"			logical data division for subsequent data preview in the GridWeb\r\n" +
    	 		"			Control.");
    	 mv.setViewName("general");
    	 return mv;
     }
     @GetMapping({"/customformat"})
     public ModelAndView getCustomformat()
     {
     	ModelAndView mv = new ModelAndView();

     	mv.setViewName("customformat");
     	return mv;
     }
     @GetMapping({"/dateandtime"})
     public ModelAndView getDateandtime()
     {
    	 ModelAndView mv = new ModelAndView();

    	 mv.setViewName("dateandtime");
    	 return mv;
     }
     @GetMapping({"/changestyle"})
     public ModelAndView getChangestyle()
     {
    	 ModelAndView mv = new ModelAndView();

    	 mv.setViewName("changestyle");
    	 return mv;
     }
    @GetMapping({"/index"})
    public ModelAndView getIndexPage()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.setViewName("index");
    	return mv;
    }
    //test
    @GetMapping({"/testlarge"})
    public ModelAndView getTestLarge()
    {
   	 ModelAndView mv = new ModelAndView();
   	 mv.addObject("servletname", "FeatureServlet");
   	 mv.addObject("method", "loadTestLargeFile");
   	 mv.addObject("title", "loadTestLargeFile");
   	 mv.addObject("info", "  load large file for memory test.");
   	 mv.setViewName("general");
   	 return mv;
    }
    //test2
    @GetMapping({"/testlasync"})
    public ModelAndView getTestLAsync()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "loadLargeFileAsync");
    	mv.addObject("title", "loadLargeFileAsync");
    	mv.addObject("info", "  load large file async for memory test.");
    	mv.setViewName("general");
    	return mv;
    }
    @GetMapping({"/testload47349"})
    public ModelAndView getTestload47349()
    {
    	ModelAndView mv = new ModelAndView();
    	mv.addObject("servletname", "FeatureServlet");
    	mv.addObject("method", "load47349");
    	mv.addObject("title", "load47349");
    	mv.addObject("info", "  load many image shapes.");
    	mv.setViewName("general");
    	return mv;
    }
}


text:
#pragma once

#include "api/replay/renderdoc_replay.h"
#include "driver/dx/official/d3dcommon.h"
#include "driver/dx/official/dxgi1_5.h"

ResourceFormat MakeResourceFormat(DXGI_FORMAT fmt);
DXGI_FORMAT MakeDXGIFormat(ResourceFormat fmt);

UINT GetByteSize(int Width, int Height, int Depth, DXGI_FORMAT Format, int mip);

// returns block size for block-compressed formats
UINT GetFormatBPP(DXGI_FORMAT f);

DXGI_FORMAT GetTypelessFormat(DXGI_FORMAT f);
DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f);
DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f, FormatComponentType hint);
DXGI_FORMAT GetDepthTypedFormat(DXGI_FORMAT f);
DXGI_FORMAT GetFloatTypedFormat(DXGI_FORMAT f);
DXGI_FORMAT GetUnormTypedFormat(DXGI_FORMAT f);
DXGI_FORMAT GetSnormTypedFormat(DXGI_FORMAT f);
DXGI_FORMAT GetUIntTypedFormat(DXGI_FORMAT f);
DXGI_FORMAT GetSIntTypedFormat(DXGI_FORMAT f);
DXGI_FORMAT GetSRGBFormat(DXGI_FORMAT f);
DXGI_FORMAT GetNonSRGBFormat(DXGI_FORMAT f);
bool IsBlockFormat(DXGI_FORMAT f);
bool IsDepthFormat(DXGI_FORMAT f);

bool IsUIntFormat(DXGI_FORMAT f);
bool IsTypelessFormat(DXGI_FORMAT f);
bool IsIntFormat(DXGI_FORMAT f);
bool IsSRGBFormat(DXGI_FORMAT f);

// not technically DXGI, but makes more sense to have it here common between D3D versions
PrimitiveTopology MakePrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY Topo);
D3D_PRIMITIVE_TOPOLOGY MakeD3DPrimitiveTopology(PrimitiveTopology Topo);


text:
package com.heaven7.plugin.idea.data_mediator.test;

import com.heaven7.java.data.mediator.*;
import com.heaven7.java.data.mediator.internal.SharedProperties;

/**
 * Created by heaven7 on 2018/6/27.
 */
@Fields(value = {
        @Field(propName = "state", type = int.class)
}, groups = {
        @GroupDesc(prop = "state", focusVal = 1, oppositeVal = -1)
})
public interface TestGroupProperty extends DataPools.Poolable {
    Property PROP_state = SharedProperties.get("int", "state", 0);

    TestGroupProperty setState(int state1);

    int getState();/*
================== start methods from super properties ===============
======================================================================= */
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<tileset name="arrows" tilewidth="32" tileheight="32">
 <image source="../graphics/tiles/arrows.png" width="128" height="128"/>
</tileset>


text:
package demo;
import utils.GeneralConstants;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;

public class Phases extends JPanel implements GeneralConstants{
	public int actual;
	public JPanel panels[];
	public JLabel labels[];
	public String imageNames[] = {"setup","draw11.png", "action2.png", "attack2.png", "reAction2.png", "end2.png"};

	public Phases(int x,int y) {
		actual=0;
		setOpaque(false);
		setBounds(x,y-30,600,80);
		setLayout(null);

		panels = new JPanel[6];
		labels = new JLabel[6];

// TODO: 26/7/2016 definir lo que se debe hacer con las fases restantes
//		panels[PHASES_SETUP] = getCustomPanel(new Rectangle(?,?,?,?), imageNames[PHASES_SETUP], PHASES_SETUP);
//		add(panels[PHASES_SETUP]);
		panels[PHASES_DRAW] = getCustomPanel(new Rectangle(55, 35, 70, 40), imageNames[PHASES_DRAW], PHASES_DRAW);
		add(panels[PHASES_DRAW]);
		panels[PHASES_ACTION] = getCustomPanel(new Rectangle(155, 35, 70, 40), imageNames[PHASES_ACTION], PHASES_ACTION);
		add(panels[PHASES_ACTION]);
		panels[PHASES_ATTACK] = getCustomPanel(new Rectangle(249, 35, 70, 40), imageNames[PHASES_ATTACK], PHASES_ATTACK);
		add(panels[PHASES_ATTACK]);
		panels[PHASES_REACTION] = getCustomPanel(new Rectangle(349, 35, 70, 40), imageNames[PHASES_REACTION], PHASES_REACTION);
		add(panels[PHASES_REACTION]);
		panels[PHASES_END] = getCustomPanel(new Rectangle(449, 35, 70, 40), imageNames[PHASES_END], PHASES_END);
		add(panels[PHASES_END]);

		changeTurn(PHASES_SETUP);
	}

	public JPanel getCustomPanel(Rectangle rectangle, String image, int posLabel){
		JPanel panel = new JPanel();
		panel.setLayout(null);
		panel.setOpaque(false);
		panel.setBounds(rectangle);
		try {
			labels[posLabel] = new JLabel(new ImageIcon(ImageIO.read(new File(image))));
		} catch (IOException e) {
			e.printStackTrace();
		}
		labels[posLabel].setBounds(0,0,70,40);
		panel.add(labels[posLabel]);
		return panel;
	}

	public JLabel getLabel(int posLabel){
		return labels[posLabel];
	}

	public int getActualTurn(){
		return actual;
	}

	public void changeTurn(int phase){
		actual=phase;
		// TODO: 26/7/2016 definir comportamiento del cambio de phases
		switch(actual){
			case 0:
				break;

			case 1:
				labels[PHASES_ACTION].setIcon(new ImageIcon("action.png"));
				labels[PHASES_END].setIcon(new ImageIcon("end.png"));
				break;

			case 2:
				labels[PHASES_DRAW].setIcon(new ImageIcon("draw22.png"));
				labels[PHASES_ATTACK].setIcon(new ImageIcon("attack.png"));
				break;

			case 3:
				labels[PHASES_ACTION].setIcon(new ImageIcon("action2.png"));
				break;

			case 4:
				labels[PHASES_ATTACK].setIcon(new ImageIcon("attack2.png"));
				labels[PHASES_END].setIcon(new ImageIcon("end2.png"));
				break;
		}
	}
}