text:
package org.apache.felix.webconsole;

import java.io.*;
import java.lang.reflect.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;

import org.apache.commons.io.IOUtils;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;

/**
 * The Web Console can be extended by registering an OSGi service for the interface
 * {@link javax.servlet.Servlet} with the service property
 * felix.webconsole.label set to the label (last segment in the URL)
 * of the page. The respective service is called a Web Console Plugin or a plugin
 * for short.
 *
 * To help rendering the response the Apache Felix Web Console bundle provides two
 * options. One of the options is to extend the AbstractWebConsolePlugin overwriting
 * the {@link #renderContent(HttpServletRequest, HttpServletResponse)} method.
 */
public abstract class AbstractWebConsolePlugin extends HttpServlet
{

    /** Pseudo class version ID to keep the IDE quite. */
    private static final long serialVersionUID = 1L;

    /** The name of the request attribute containing the map of FileItems from the POST request */
    public static final String ATTR_FILEUPLOAD = "org.apache.felix.webconsole.fileupload"; //$NON-NLS-1$

    /**
     * Web Console Plugin typically consists of servlet and resources such as images,
     * scripts or style sheets.
     *
     * To load resources, a Resource Provider is used. The resource provider is an object,
     * that provides a method which name is specified by this constants and it is
     * 'getResource'.
     *
     *  @see #getResourceProvider()
     */
    public static final String GET_RESOURCE_METHOD_NAME = "getResource"; //$NON-NLS-1$

    /**
     * The header fragment read from the templates/main_header.html file
     */
    private static String HEADER;

    /**
     * The footer fragment read from the templates/main_footer.html file
     */
    private static String FOOTER;

    /**
     * The reference to the getResource method provided by the
     * {@link #getResourceProvider()}. This is null if there is
     * none or before the first check if there is one.
     *
     * @see #getGetResourceMethod()
     */
    private Method getResourceMethod;

    /**
     * flag indicating whether the getResource method has already been looked
     * up or not. This prevens the {@link #getGetResourceMethod()} method from
     * repeatedly looking up the resource method on plugins which do not have
     * one.
     */
    private boolean getResourceMethodChecked;

    private BundleContext bundleContext;

    private static BrandingPlugin brandingPlugin = DefaultBrandingPlugin.getInstance();

    private static int logLevel;

    //---------- HttpServlet Overwrites ----------------------------------------

    /**
     * Returns the title for this plugin as returned by {@link #getTitle()}
     *
     * @see javax.servlet.GenericServlet#getServletName()
     */
    public String getServletName()
    {
        return getTitle();
    }

    /**
     * Renders the web console page for the request. This consist of the
     * following five parts called in order:
     *

     *
Send back a requested resource
     *
{@link #startResponse(HttpServletRequest, HttpServletResponse)}

     *
{@link #renderTopNavigation(HttpServletRequest, PrintWriter)}

     *
{@link #renderContent(HttpServletRequest, HttpServletResponse)}

     *
{@link #endResponse(PrintWriter)}

     *

     *

     * Note: If a resource is sent back for the request only the first
     * step is executed. Otherwise the first step is a null-operation actually
     * and the latter four steps are executed in order.
     *

     * If the {@link #isHtmlRequest(HttpServletRequest)} method returns
     * false only the
     * {@link #renderContent(HttpServletRequest, HttpServletResponse)} method is
     * called.
     *
     * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest,
     *      javax.servlet.http.HttpServletResponse)
     */
    protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException,
        IOException
    {
        if ( !spoolResource( request, response ) )
        {
            // detect if this is an html request
            if ( isHtmlRequest(request) )
            {
                // start the html response, write the header, open body and main div
                PrintWriter pw = startResponse( request, response );

                // render top navigation
                renderTopNavigation( request, pw );

                // wrap content in a separate div
                pw.println( "
" ); //$NON-NLS-1$
                renderContent( request, response );
                pw.println( "
" ); //$NON-NLS-1$

                // close the main div, body, and html
                endResponse( pw );
            }
            else
            {
                renderContent( request, response );
            }
        }
    }

    /**
     * Detects whether this request is intended to have the headers and
     * footers of this plugin be rendered or not. This method always returns
     * true</true> and may be overwritten by plugins to detect
     * from the actual request, whether or not to render the header and
     * footer.
     *
     * @param request the original request passed from the HTTP server
     * @return true if the page should have headers and footers rendered
     */
    protected boolean isHtmlRequest( final HttpServletRequest request )
    {
        return true;
    }

    //---------- AbstractWebConsolePlugin API ----------------------------------

    /**
     * This method is called from the Felix Web Console to ensure the
     * AbstractWebConsolePlugin is correctly setup.
     *
     * It is called right after the Web Console receives notification for
     * plugin registration.
     *
     * @param bundleContext the context of the plugin bundle
     */
    public void activate( BundleContext bundleContext )
    {
        this.bundleContext = bundleContext;
    }

    /**
     * This method is called, by the Web Console to de-activate the plugin and release
     * all used resources.
     */
    public void deactivate()
    {
        this.bundleContext = null;
    }

    /**
     * This method is used to render the content of the plug-in. It is called internally
     * from the Web Console.
     *
     * @param req the HTTP request send from the user
     * @param res the HTTP response object, where to render the plugin data.
     * @throws IOException if an input or output error is
     *  detected when the servlet handles the request
     * @throws ServletException  if the request for the GET
     *  could not be handled
     */
    protected abstract void renderContent( HttpServletRequest req, HttpServletResponse res ) throws ServletException,
        IOException;

    /**
     * Retrieves the label. This is the last component in the servlet path.
     *
     * This method MUST be overridden, if the {@link #AbstractWebConsolePlugin()}
     * constructor is used.
     *
     * @return the label.
     */
    public abstract String getLabel();

    /**
     * Retrieves the title of the plug-in. It is displayed in the page header
     * and is also included in the title of the HTML document.
     *
     * This method MUST be overridden, if the {@link #AbstractWebConsolePlugin()}
     * constructor is used.
     *
     * @return the plugin title.
     */
    public abstract String getTitle();

    /**
     * Returns a list of CSS reference paths or null if no
     * additional CSS files are provided by the plugin.
     *

     * The result is an array of strings which are used as the value of
     * the href attribute of the <link> elements
     * placed in the head section of the HTML generated. If the reference is
     * a relative path, it is turned into an absolute path by prepending the
     * value of the {@link WebConsoleConstants#ATTR_APP_ROOT} request attribute.
     *
     * @return The list of additional CSS files to reference in the head
     *      section or null if no such CSS files are required.
     */
    protected String[] getCssReferences()
    {
        return null;
    }

    /**
     * Returns the BundleContext with which this plugin has been
     * activated. If the plugin has not be activated by calling the
     * {@link #activate(BundleContext)} method, this method returns
     * null.
     *
     * @return the bundle context or null if the bundle is not activated.
     */
    protected BundleContext getBundleContext()
    {
        return bundleContext;
    }

    /**
     * Returns the Bundle pertaining to the
     * {@link #getBundleContext() bundle context} with which this plugin has
     * been activated. If the plugin has not be activated by calling the
     * {@link #activate(BundleContext)} method, this method returns
     * null.
     *
     * @return the bundle or null if the plugin is not activated.
     */
    public final Bundle getBundle()
    {
        final BundleContext bundleContext = getBundleContext();
        return ( bundleContext != null ) ? bundleContext.getBundle() : null;
    }

    /**
     * Returns the object which might provide resources. The class of this
     * object is used to find the getResource method.
     *

     * This method may be overwritten by extensions. This base class
     * implementation returns this instance.
     *
     * @return The resource provider object or null if no
     *      resources will be provided by this plugin.
     */
    protected Object getResourceProvider()
    {
        return this;
    }

    /**
     * Returns a method which is called on the
     * {@link #getResourceProvider() resource provider} class to return an URL
     * to a resource which may be spooled when requested. The method has the
     * following signature:
     *

     * [modifier] URL getResource(String path);
     *

     * Where the [modifier] may be public, protected
     * or private (if the method is declared in the class of the
     * resource provider). It is suggested to use the private
     * modifier if the method is declared in the resource provider class or
     * the protected modifier if the method is declared in a
     * base class of the resource provider.
     *
     * @return The getResource(String) method or null
     *      if the {@link #getResourceProvider() resource provider} is
     *      null or does not provide such a method.
     */
    private final Method getGetResourceMethod()
    {
        // return what we know of the getResourceMethod, if we already checked
        if (getResourceMethodChecked) {
            return getResourceMethod;
        }

        Method tmpGetResourceMethod = null;
        Object resourceProvider = getResourceProvider();
        if ( resourceProvider != null )
        {
            try
            {
                Class cl = resourceProvider.getClass();
                while ( tmpGetResourceMethod == null && cl != Object.class )
                {
                    Method[] methods = cl.getDeclaredMethods();
                    for ( int i = 0; i < methods.length; i++ )
                    {
                        Method m = methods[i];
                        if ( GET_RESOURCE_METHOD_NAME.equals( m.getName() ) && m.getParameterTypes().length == 1
                            && m.getParameterTypes()[0] == String.class && m.getReturnType() == URL.class )
                        {
                            // ensure modifier is protected or public or the private
                            // method is defined in the plugin class itself
                            int mod = m.getModifiers();
                            if ( Modifier.isProtected( mod ) || Modifier.isPublic( mod )
                                || ( Modifier.isPrivate( mod ) && cl == resourceProvider.getClass() ) )
                            {
                                m.setAccessible( true );
                                tmpGetResourceMethod = m;
                                break;
                            }
                        }
                    }
                    cl = cl.getSuperclass();
                }
            }
            catch ( Throwable t )
            {
                tmpGetResourceMethod = null;
            }
        }

        // set what we have found and prevent future lookups
        getResourceMethod = tmpGetResourceMethod;
        getResourceMethodChecked = true;

        // now also return the method
        return getResourceMethod;
    }

    /**
     * Calls the ServletContext.log(String) method if the
     * configured log level is less than or equal to the given level.
     *

     * Note, that the level paramter is only used to decide whether
     * the GenericServlet.log(String) method is called or not. The
     * actual implementation of the GenericServlet.log method is
     * outside of the control of this method.
     *

     * If the servlet has not been initialized yet or has already been destroyed
     * the message is printed to stderr.
     *
     * @param level The log level at which to log the message
     * @param message The message to log
     */
    public void log( int level, String message )
    {
        if ( logLevel >= level )
        {
            ServletConfig config = getServletConfig();
            if ( config != null )
            {
                ServletContext context = config.getServletContext();
                if ( context != null )
                {
                    context.log( message );
                    return;
                }
            }

            System.err.println( message );
        }
    }

    /**
     * Calls the ServletContext.log(String, Throwable) method if
     * the configured log level is less than or equal to the given
     * level.
     *

     * Note, that the level paramter is only used to decide whether
     * the GenericServlet.log(String, Throwable) method is called
     * or not. The actual implementation of the GenericServlet.log
     * method is outside of the control of this method.
     *
     * @param level The log level at which to log the message
     * @param message The message to log
     * @param t The Throwable to log with the message
     */
    public void log( int level, String message, Throwable t )
    {
        if ( logLevel >= level )
        {
            ServletConfig config = getServletConfig();
            if ( config != null )
            {
                ServletContext context = config.getServletContext();
                if ( context != null )
                {
                    context.log( message, t );
                    return;
                }
            }

            System.err.println( message );
            if ( t != null )
            {
                t.printStackTrace( System.err );
            }
        }
    }

    /**
     * If the request addresses a resource which may be served by the
     * getResource method of the
     * {@link #getResourceProvider() resource provider}, this method serves it
     * and returns true. Otherwise false is returned.
     * false is also returned if the resource provider has no
     * getResource method.
     *

     * If true is returned, the request is considered complete and
     * request processing terminates. Otherwise request processing continues
     * with normal plugin rendering.
     *
     * @param request The request object
     * @param response The response object
     * @return true if the request causes a resource to be sent back.
     *
     * @throws IOException If an error occurs accessing or spooling the resource.
     */
    private final boolean spoolResource( HttpServletRequest request, HttpServletResponse response ) throws IOException
    {
        // no resource if no resource accessor
        Method getResourceMethod = getGetResourceMethod();
        if ( getResourceMethod == null )
        {
            return false;
        }

        String pi = request.getPathInfo();
        InputStream ins = null;
        try
        {

            // check for a resource, fail if none
            URL url = ( URL ) getResourceMethod.invoke( getResourceProvider(), new Object[]
                { pi } );
            if ( url == null )
            {
                return false;
            }

            // open the connection and the stream (we use the stream to be able
            // to at least hint to close the connection because there is no
            // method to explicitly close the conneciton, unfortunately)
            URLConnection connection = url.openConnection();
            ins = connection.getInputStream();

            // FELIX-2017 Equinox may return an URL for a non-existing
            // resource but then (instead of throwing) return null on
            // getInputStream. We should account for this situation and
            // just assume a non-existing resource in this case.
            if (ins == null) {
                return false;
            }

            // check whether we may return 304/UNMODIFIED
            long lastModified = connection.getLastModified();
            if ( lastModified > 0 )
            {
                long ifModifiedSince = request.getDateHeader( "If-Modified-Since" ); //$NON-NLS-1$
                if ( ifModifiedSince >= ( lastModified / 1000 * 1000 ) )
                {
                    // Round down to the nearest second for a proper compare
                    // A ifModifiedSince of -1 will always be less
                    response.setStatus( HttpServletResponse.SC_NOT_MODIFIED );

                    return true;
                }

                // have to send, so set the last modified header now
                response.setDateHeader( "Last-Modified", lastModified ); //$NON-NLS-1$
            }

            // describe the contents
            response.setContentType( getServletContext().getMimeType( pi ) );
            response.setIntHeader( "Content-Length", connection.getContentLength() ); //$NON-NLS-1$

            // spool the actual contents
            OutputStream out = response.getOutputStream();
            byte[] buf = new byte[2048];
            int rd;
            while ( ( rd = ins.read( buf ) ) >= 0 )
            {
                out.write( buf, 0, rd );
            }

            // over and out ...
            return true;
        }
        catch ( IllegalAccessException iae )
        {
            // log or throw ???
        }
        catch ( InvocationTargetException ite )
        {
            // log or throw ???
            // Throwable cause = ite.getTargetException();
        }
      finally
        {
            IOUtils.closeQuietly(ins);
        }

        return false;
    }

    /**
     * This method is responsible for generating the top heading of the page.
     *
     * @param request the HTTP request coming from the user
     * @param response the HTTP response, where data is rendered
     * @return the writer that was used for generating the response.
     * @throws IOException on I/O error
     * @see #endResponse(PrintWriter)
     */
    protected PrintWriter startResponse( HttpServletRequest request, HttpServletResponse response ) throws IOException
    {
        response.setCharacterEncoding( "utf-8" ); //$NON-NLS-1$
        response.setContentType( "text/html" ); //$NON-NLS-1$

        final PrintWriter pw = response.getWriter();

        final String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT );

        // support localization of the plugin title
        String title = getTitle();
        if ( title.startsWith( "%" ) ) //$NON-NLS-1$
        {
            title = "${" + title.substring( 1 ) + "}"; //$NON-NLS-1$ //$NON-NLS-2$
        }

        VariableResolver resolver = WebConsoleUtil.getVariableResolver(request);
        if (resolver instanceof DefaultVariableResolver) {
            DefaultVariableResolver r = (DefaultVariableResolver) resolver;
            r.put("head.title", title); //$NON-NLS-1$
            r.put("head.label", getLabel()); //$NON-NLS-1$
            r.put("head.cssLinks", getCssLinks(appRoot)); //$NON-NLS-1$
            r.put("brand.name", brandingPlugin.getBrandName()); //$NON-NLS-1$
            r.put("brand.product.url", brandingPlugin.getProductURL()); //$NON-NLS-1$
            r.put("brand.product.name", brandingPlugin.getProductName()); //$NON-NLS-1$
            r.put("brand.product.img", toUrl( brandingPlugin.getProductImage(), appRoot )); //$NON-NLS-1$
            r.put("brand.favicon", toUrl( brandingPlugin.getFavIcon(), appRoot )); //$NON-NLS-1$
            r.put("brand.css", toUrl( brandingPlugin.getMainStyleSheet(), appRoot )); //$NON-NLS-1$
        }
        pw.println( getHeader() );

        return pw;
    }

    /**
     * This method is called to generate the top level links with the available plug-ins.
     *
     * @param request the HTTP request coming from the user
     * @param pw the writer, where the HTML data is rendered
     */
    protected void renderTopNavigation( HttpServletRequest request, PrintWriter pw )
    {
        // assume pathInfo to not be null, else this would not be called
        boolean linkToCurrent = true;
        String current = request.getPathInfo();
        int slash = current.indexOf( "/", 1 ); //$NON-NLS-1$
        if ( slash < 0 )
        {
            slash = current.length();
            linkToCurrent = false;
        }
        current = current.substring( 1, slash );

        boolean disabled = false;
        String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT );
        Map labelMap = ( Map ) request.getAttribute( WebConsoleConstants.ATTR_LABEL_MAP );
        if ( labelMap != null )
        {

            // prepare the navigation
            SortedMap map = new TreeMap( String.CASE_INSENSITIVE_ORDER );
            for ( Iterator ri = labelMap.entrySet().iterator(); ri.hasNext(); )
            {
                Map.Entry labelMapEntry = ( Map.Entry ) ri.next();
                if ( labelMapEntry.getKey() == null )
                {
                    // ignore renders without a label
                }
                else if ( disabled || current.equals( labelMapEntry.getKey() ) )
                {
                    if ( linkToCurrent )
                    {
                        map.put( labelMapEntry.getValue(), "
" + labelMapEntry.getValue() + "
"); //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    else
                    {
                        map.put( labelMapEntry.getValue(), "
" + labelMapEntry.getValue() //$NON-NLS-1$
                            + "
"); //$NON-NLS-1$
                    }
                }
                else
                {
                    map.put( labelMapEntry.getValue(), "
" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        + labelMapEntry.getValue() + "
"); //$NON-NLS-1$
                }
            }

            // render the navigation
            pw.println("
"); //$NON-NLS-1$
            for ( Iterator li = map.values().iterator(); li.hasNext(); )
            {
                pw.print(' ');
                pw.println( li.next() );
            }
            pw.println( "
" ); //$NON-NLS-1$

        }

        // render lang-box
        Map langMap = (Map) request.getAttribute(WebConsoleConstants.ATTR_LANG_MAP);
        if (null != langMap && !langMap.isEmpty())
        {
            // determine the currently selected locale from the request and fail-back
            // to the default locale if not set
            // if locale is missing in locale map, the default 'en' locale is used
            Locale reqLocale = request.getLocale();
            String locale = null != reqLocale ? reqLocale.getLanguage()
                : Locale.getDefault().getLanguage();
            if (!langMap.containsKey(locale))
            {
                locale = Locale.getDefault().getLanguage();
            }
            if (!langMap.containsKey(locale))
            {
                locale = "en"; //$NON-NLS-1$
            }

            pw.println("
"); //$NON-NLS-1$
            pw.println(" "); //$NON-NLS-1$
            printLocaleElement(pw, appRoot, locale, langMap.get(locale));
            pw.println(" "); //$NON-NLS-1$
            pw.println(" "); //$NON-NLS-1$
            for (Iterator li = langMap.keySet().iterator(); li.hasNext();)
            {
                //
                final Object l = li.next();
                if (!l.equals(locale))
                {
                    printLocaleElement(pw, appRoot, l, langMap.get(l));
                }
            }

            pw.println(" "); //$NON-NLS-1$
            pw.println("
"); //$NON-NLS-1$
        }
    }

    private static final void printLocaleElement(PrintWriter pw, String appRoot,
        Object langCode, Object langName)
    {
        pw.print("  "); //$NON-NLS-1$
    }

    /**
     * This method is responsible for generating the footer of the page.
     *
     * @param pw the writer, where the HTML data is rendered
     * @see #startResponse(HttpServletRequest, HttpServletResponse)
     */
    protected void endResponse( PrintWriter pw )
    {
        pw.println(getFooter());
    }

    /**
     * An utility method, that is used to filter out simple parameter from file
     * parameter when multipart transfer encoding is used.
     *
     * This method processes the request and sets a request attribute
     * {@link #ATTR_FILEUPLOAD}. The attribute value is a {@link Map}
     * where the key is a String specifying the field name and the value
     * is a {@link org.apache.commons.fileupload.FileItem}.
     *
     * @param request the HTTP request coming from the user
     * @param name the name of the parameter
     * @return if not multipart transfer encoding is used - the value is the
     *  parameter value or null if not set. If multipart is used,
     *  and the specified parameter is field - then the value of the parameter
     *  is returned.
     * @deprecated use {@link WebConsoleUtil#getParameter(HttpServletRequest, String)}
     */
    public static final String getParameter( HttpServletRequest request, String name )
    {
        return WebConsoleUtil.getParameter(request, name);
    }

    /**
     * Utility method to handle relative redirects.
     * Some application servers like Web Sphere handle relative redirects differently
     * therefore we should make an absolute URL before invoking send redirect.
     *
     * @param request the HTTP request coming from the user
     * @param response the HTTP response, where data is rendered
     * @param redirectUrl the redirect URI.
     * @throws IOException If an input or output exception occurs
     * @throws IllegalStateException   If the response was committed or if a partial
     *  URL is given and cannot be converted into a valid URL
     * @deprecated use {@link WebConsoleUtil#sendRedirect(HttpServletRequest, HttpServletResponse, String)}
     */
    protected void sendRedirect(final HttpServletRequest request,
                                final HttpServletResponse response,
                                String redirectUrl) throws IOException {
        WebConsoleUtil.sendRedirect(request, response, redirectUrl);
    }

    /**
     * Returns the {@link BrandingPlugin} currently used for web console
     * branding.
     *
     * @return the brandingPlugin
     */
    public static BrandingPlugin getBrandingPlugin() {
        return AbstractWebConsolePlugin.brandingPlugin;
    }

    /**
     * Sets the {@link BrandingPlugin} to use globally by all extensions of
     * this class for branding.
     *

     * Note: This method is intended to be used internally by the Web Console
     * to update the branding plugin to use.
     *
     * @param brandingPlugin the brandingPlugin to set
     */
    public static final void setBrandingPlugin(BrandingPlugin brandingPlugin) {
        if(brandingPlugin == null){
            AbstractWebConsolePlugin.brandingPlugin = DefaultBrandingPlugin.getInstance();
        } else {
            AbstractWebConsolePlugin.brandingPlugin = brandingPlugin;
        }
    }

    /**
     * Sets the log level to be applied for calls to the {@link #log(int, String)}
     * and {@link #log(int, String, Throwable)} methods.
     *

     * Note: This method is intended to be used internally by the Web Console
     * to update the log level according to the Web Console configuration.
     *
     * @param logLevel the maximum allowed log level. If message is logged with
     *        lower level it will not be forwarded to the logger.
     */
    public static final void setLogLevel( int logLevel )
    {
        AbstractWebConsolePlugin.logLevel = logLevel;
    }

    private final String getHeader()
    {
        // MessageFormat pattern place holder
        //  0 main title (brand name)
        //  1 console plugin title
        //  2 application root path (ATTR_APP_ROOT)
        //  3 console plugin label (from the URI)
        //  4 branding favourite icon (BrandingPlugin.getFavIcon())
        //  5 branding main style sheet (BrandingPlugin.getMainStyleSheet())
        //  6 branding product URL (BrandingPlugin.getProductURL())
        //  7 branding product name (BrandingPlugin.getProductName())
        //  8 branding product image (BrandingPlugin.getProductImage())
        //  9 additional HTML code to be inserted into the  section
        //    (for example plugin provided CSS links)
        if ( HEADER == null )
        {
            HEADER = readTemplateFile( AbstractWebConsolePlugin.class, "/templates/main_header.html" ); //$NON-NLS-1$
        }
        return HEADER;
    }

    private final String getFooter()
    {
        if ( FOOTER == null )
        {
            FOOTER = readTemplateFile( AbstractWebConsolePlugin.class, "/templates/main_footer.html" ); //$NON-NLS-1$
        }
        return FOOTER;
    }

    /**
     * Reads the templateFile as a resource through the class
     * loader of this class converting the binary data into a string using
     * UTF-8 encoding.
     *

     * If the template file cannot read into a string and an exception is
     * caused, the exception is logged and an empty string returned.
     *
     * @param templateFile The absolute path to the template file to read.
     * @return The contents of the template file as a string or and empty
     *      string if the template file fails to be read.
     *
     * @throws NullPointerException if templateFile is
     *      null
     * @throws RuntimeException if an IOException is thrown reading
     *      the template file into a string. The exception provides the
     *      exception thrown as its cause.
     */
    protected final String readTemplateFile( final String templateFile ) {
        return readTemplateFile( getClass(), templateFile );
    }

    private final String readTemplateFile( final Class clazz, final String templateFile)
    {
        InputStream templateStream = clazz.getResourceAsStream( templateFile );
        if ( templateStream != null )
        {
            try
            {
                String str = IOUtils.toString( templateStream, "UTF-8" ); //$NON-NLS-1$
                switch ( str.charAt(0) )
                { // skip BOM
                    case 0xFEFF: // UTF-16/UTF-32, big-endian
                    case 0xFFFE: // UTF-16, little-endian
                    case 0xEFBB: // UTF-8
                        return str.substring(1);
                }
                return str;
            }
            catch ( IOException e )
            {
                // don't use new Exception(message, cause) because cause is 1.4+
                throw new RuntimeException( "readTemplateFile: Error loading " + templateFile + ": " + e ); //$NON-NLS-1$ //$NON-NLS-2$
            }
            finally
            {
                IOUtils.closeQuietly( templateStream );
            }
        }

        // template file does not exist, return an empty string
        log( LogService.LOG_ERROR, "readTemplateFile: File '" + templateFile + "' not found through class " + clazz ); //$NON-NLS-1$ //$NON-NLS-2$
        return ""; //$NON-NLS-1$
    }

    private final String getCssLinks( final String appRoot )
    {
        // get the CSS references and return nothing if there are none
        final String[] cssRefs = getCssReferences();
        if ( cssRefs == null )
        {
            return ""; //$NON-NLS-1$
        }

        // build the CSS links from the references
        final StringBuffer buf = new StringBuffer();
        for ( int i = 0; i < cssRefs.length; i++ )
        {
            buf.append( "<link href='" ); //$NON-NLS-1$
            buf.append( toUrl( cssRefs[i], appRoot ) );
            buf.append( "' rel='stylesheet' type='text/css' />" ); //$NON-NLS-1$
        }

        return buf.toString();
    }

    /**
     * If the url starts with a slash, it is considered an absolute
     * path (relative URL) which must be prefixed with the Web Console
     * application root path. Otherwise the url is assumed to
     * either be a relative path or an absolute URL, both must not be prefixed.
     *
     * @param url The url path to optionally prefix with the application root
     *          path
     * @param appRoot The application root path to optionally put in front of
     *          the url.
     * @throws NullPointerException if url is null.
     */
    private static final String toUrl( final String url, final String appRoot )
    {
        if ( url.startsWith( "/" ) ) //$NON-NLS-1$
        {
            return appRoot + url;
        }
        return url;
    }

}


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.lang.properties.codeInspection.unsorted;

import com.intellij.codeInspection.*;
import com.intellij.lang.properties.IProperty;
import com.intellij.lang.properties.PropertiesBundle;
import com.intellij.lang.properties.PropertiesImplUtil;
import com.intellij.lang.properties.ResourceBundle;
import com.intellij.lang.properties.psi.PropertiesElementFactory;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.lang.properties.psi.PropertiesList;
import com.intellij.lang.properties.psi.PropertyKeyValueFormat;
import com.intellij.lang.properties.psi.codeStyle.PropertiesCodeStyleSettings;
import com.intellij.lang.properties.psi.impl.PropertiesFileImpl;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * @author Dmitry Batkovich
 */
public class AlphaUnsortedPropertiesFileInspection extends LocalInspectionTool {
  private static final Logger LOG = Logger.getInstance(AlphaUnsortedPropertiesFileInspection.class);

  @NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
    return new PsiElementVisitor() {
      @Override
      public void visitFile(@NotNull PsiFile file) {
        final PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(file);
        if (!(propertiesFile instanceof PropertiesFileImpl)) {
          return;
        }
        for (AlphaUnsortedPropertiesFileInspectionSuppressor filter : AlphaUnsortedPropertiesFileInspectionSuppressor.EP_NAME.getExtensions()) {
          if (filter.suppressInspectionFor(propertiesFile)) {
            return;
          }
        }
        final ResourceBundle resourceBundle = propertiesFile.getResourceBundle();
        final String resourceBundleBaseName = resourceBundle.getBaseName();
        if (!isResourceBundleAlphaSortedExceptOneFile(resourceBundle, propertiesFile)) {
          final List<PropertiesFile> allFiles = resourceBundle.getPropertiesFiles();
          holder.registerProblem(file,
                                 PropertiesBundle.message("inspection.alpha.unsorted.properties.file.description1", resourceBundleBaseName),
                                 ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
                                 new PropertiesSorterQuickFix(allFiles.toArray(new PropertiesFile[0])));
          return;
        }
        if (!propertiesFile.isAlphaSorted()) {
          holder.registerProblem(file, PropertiesBundle.message("inspection.alpha.unsorted.properties.file.description"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new PropertiesSorterQuickFix(
            propertiesFile));
        }
      }
    };
  }

  private static boolean isResourceBundleAlphaSortedExceptOneFile(@NotNull final ResourceBundle resourceBundle,
                                                                  @NotNull final PropertiesFile exceptedFile) {
    for (PropertiesFile file : resourceBundle.getPropertiesFiles()) {
      if (!(file instanceof PropertiesFileImpl)) {
        return true;
      }
      if (!file.equals(exceptedFile) && !file.isAlphaSorted()) {
        return false;
      }
    }
    return true;
  }

  private static final class PropertiesSorterQuickFix implements LocalQuickFix {
    private final PropertiesFile[] myFilesToSort;

    private PropertiesSorterQuickFix(PropertiesFile... toSort) {
      myFilesToSort = toSort;
    }

    @NotNull
    @Override
    public String getFamilyName() {
      return PropertiesBundle.message("properties.sorter.quick.fix.family.name");
    }

    @Override
    public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
      final boolean force = myFilesToSort.length == 1;
      for (PropertiesFile file : myFilesToSort) {
        if (!force && file.isAlphaSorted()) {
          continue;
        }
        sortPropertiesFile(file);
      }
    }
  }

  private static void sortPropertiesFile(final PropertiesFile file) {
    final List<IProperty> properties = new ArrayList<>(file.getProperties());

    properties.sort(Comparator.comparing(IProperty::getKey, String.CASE_INSENSITIVE_ORDER));

    final PropertiesList propertiesList = PsiTreeUtil.findChildOfType(file.getContainingFile(), PropertiesList.class);
    if (propertiesList == null) return;

    final char delimiter = PropertiesCodeStyleSettings.getInstance(file.getProject()).getDelimiter();
    final StringBuilder rawText = new StringBuilder(propertiesList.getDocCommentText());
    for (int i = 0; i < properties.size(); i++) {
      IProperty property = properties.get(i);
      final String value = property.getValue();
      final String commentAboveProperty = property.getDocCommentText();
      if (commentAboveProperty != null) {
        rawText.append(commentAboveProperty);
      }
      final String key = property.getKey();
      final String propertyText;
      if (key != null) {
        propertyText = PropertiesElementFactory.getPropertyText(key, value != null ? value : "", delimiter, null, PropertyKeyValueFormat.FILE);
        rawText.append(propertyText);
        if (i != properties.size() - 1) {
          rawText.append("\n");
        }
      }
    }

    final PropertiesFile fakeFile = PropertiesElementFactory.createPropertiesFile(file.getProject(), rawText.toString());

    final PropertiesList fakePropertiesList = PsiTreeUtil.findChildOfType(fakeFile.getContainingFile(), PropertiesList.class);
    LOG.assertTrue(fakePropertiesList != null);

    propertiesList.replace(fakePropertiesList);
  }

  @Override
  @NotNull
  public String getShortName() {
    return "AlphaUnsortedPropertiesFile";
  }
}

redpajama_set_name: RedPajamaGithub


text:
package graph.SpectratypeVChart;

import java.util.*;

public class SpectratypeVChart {
    private List<SpectratypeVBar> chart;
    private int xMin = 1000;
    private int xMax = -1;

    public SpectratypeVChart() {
        this.chart = new ArrayList<>();
    }

    public List<SpectratypeVBar> getChart() {
        return chart;
    }

    public int getxMin() {
        return xMin;
    }

    public int getxMax() {
        return xMax;
    }

    public void setxMin(int xMin) {
        this.xMin = xMin;
    }

    public void setxMax(int xMax) {
        this.xMax = xMax;
    }

    public void addBar(SpectratypeVBar spectratypeVBar) {
        if (spectratypeVBar.key.equals("other")) {
            chart.add(0, spectratypeVBar);
        } else {
            chart.add(spectratypeVBar);
        }
    }

    public void sort() {
        Collections.sort(chart, new Comparator<SpectratypeVBar>() {
            @Override
            public int compare(SpectratypeVBar o1, SpectratypeVBar o2) {
                if (Objects.equals("other", o1.key)) return -1;
                if (Objects.equals("other", o2.key)) return 1;
                return o1.key.compareTo(o2.key);
            }
        });
    }
}


text:
require 'lib/utils/list'
require 'lib/utils/id_manager'
require 'lib/handlers/bsbi/store/bhash'
require 'config/index.rb'

module OpenIndex
  # The main concept is that it should
  # find only conjunctions ie. A & B & C
  # or disjunctions ie. X OR Y OR Z
  # where A..C,X..Z are one-word phrases
  class BSBISimpleIndex

    def initialize
        @dic = BHash.new "#{INDEX_DIR}/index"
        @term_dic = IdManager.new
    end

    def add term, file_id
      term_id = @term_dic.reg term
      @dic[term_id] = file_id
    end

    def find ind
      raise "TODO"
    end

    def finish
      puts "Saving term dict..."
      @term_dic.save "#{INDEX_DIR}/terms"
      puts "Merging..."
      @dic.merge
      puts "Merge finished" # Try jrubyc
    end
  end
end


text:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

DEBUG - 2014-12-22 13:09:10 --> Config Class Initialized
DEBUG - 2014-12-22 13:09:10 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:09:10 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:09:10 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:09:10 --> URI Class Initialized
DEBUG - 2014-12-22 13:09:10 --> Router Class Initialized
DEBUG - 2014-12-22 13:09:10 --> Output Class Initialized
DEBUG - 2014-12-22 13:09:10 --> Security Class Initialized
DEBUG - 2014-12-22 13:09:10 --> Input Class Initialized
DEBUG - 2014-12-22 13:09:10 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:09:10 --> Language Class Initialized
DEBUG - 2014-12-22 13:09:11 --> Loader Class Initialized
DEBUG - 2014-12-22 13:09:11 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:09:11 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/thunderbirds-hub-site/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:09:11 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:09:11 --> Controller Class Initialized
DEBUG - 2014-12-22 13:09:11 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:09:11 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:09:13 --> Model Class Initialized
DEBUG - 2014-12-22 13:09:13 --> Model Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Config Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:12:00 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:12:00 --> URI Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Router Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Output Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Security Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Input Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:12:00 --> Language Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Loader Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:12:00 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:12:00 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Controller Class Initialized
DEBUG - 2014-12-22 13:12:00 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:12:00 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:12:02 --> Model Class Initialized
DEBUG - 2014-12-22 13:12:02 --> Model Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Config Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:20:43 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:20:43 --> URI Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Router Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Output Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Security Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Input Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:20:43 --> Language Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Loader Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:20:43 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:20:43 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Controller Class Initialized
DEBUG - 2014-12-22 13:20:43 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:20:43 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:20:45 --> Model Class Initialized
DEBUG - 2014-12-22 13:20:45 --> Model Class Initialized
DEBUG - 2014-12-22 13:20:45 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:21:43 --> Config Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:21:43 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:21:43 --> URI Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Router Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Output Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Security Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Input Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:21:43 --> Language Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Loader Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:21:43 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:21:43 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Controller Class Initialized
DEBUG - 2014-12-22 13:21:43 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:21:43 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:21:44 --> Model Class Initialized
DEBUG - 2014-12-22 13:21:44 --> Model Class Initialized
DEBUG - 2014-12-22 13:21:47 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:22:43 --> Config Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:22:43 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:22:43 --> URI Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Router Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Output Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Security Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Input Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:22:43 --> Language Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Loader Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:22:43 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:22:43 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Controller Class Initialized
DEBUG - 2014-12-22 13:22:43 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:22:43 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:22:45 --> Model Class Initialized
DEBUG - 2014-12-22 13:22:45 --> Model Class Initialized
DEBUG - 2014-12-22 13:22:45 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:24:02 --> Config Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:24:02 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:24:02 --> URI Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Router Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Output Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Security Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Input Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:24:02 --> Language Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Loader Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:24:02 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:24:02 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Controller Class Initialized
DEBUG - 2014-12-22 13:24:02 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:24:02 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:24:03 --> Model Class Initialized
DEBUG - 2014-12-22 13:24:03 --> Model Class Initialized
DEBUG - 2014-12-22 13:24:03 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:24:03 --> Email Class Initialized
DEBUG - 2014-12-22 13:24:07 --> Language file loaded: language/english/email_lang.php
DEBUG - 2014-12-22 13:24:10 --> Final output sent to browser
DEBUG - 2014-12-22 13:24:10 --> Total execution time: 8.6068
DEBUG - 2014-12-22 13:25:32 --> Config Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:25:32 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:25:32 --> URI Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Router Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Output Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Security Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Input Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:25:32 --> Language Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Loader Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:25:32 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:25:32 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Controller Class Initialized
DEBUG - 2014-12-22 13:25:32 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:25:32 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:25:34 --> Model Class Initialized
DEBUG - 2014-12-22 13:25:34 --> Model Class Initialized
DEBUG - 2014-12-22 13:25:34 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:25:34 --> Final output sent to browser
DEBUG - 2014-12-22 13:25:34 --> Total execution time: 1.7390
DEBUG - 2014-12-22 13:25:57 --> Config Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:25:57 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:25:57 --> URI Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Router Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Output Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Security Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Input Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:25:57 --> Language Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Loader Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:25:57 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:25:57 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Controller Class Initialized
DEBUG - 2014-12-22 13:25:57 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:25:57 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:25:59 --> Model Class Initialized
DEBUG - 2014-12-22 13:25:59 --> Model Class Initialized
DEBUG - 2014-12-22 13:25:59 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:25:59 --> Final output sent to browser
DEBUG - 2014-12-22 13:25:59 --> Total execution time: 1.9797
DEBUG - 2014-12-22 13:29:00 --> Config Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:29:00 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:29:00 --> URI Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Router Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Output Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Security Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Input Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:29:00 --> Language Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Loader Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:29:00 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:29:00 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Controller Class Initialized
DEBUG - 2014-12-22 13:29:00 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:29:00 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:29:01 --> Model Class Initialized
DEBUG - 2014-12-22 13:29:01 --> Model Class Initialized
DEBUG - 2014-12-22 13:29:01 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:29:01 --> Final output sent to browser
DEBUG - 2014-12-22 13:29:01 --> Total execution time: 1.6208
DEBUG - 2014-12-22 13:29:43 --> Config Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:29:43 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:29:43 --> URI Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Router Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Output Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Security Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Input Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:29:43 --> Language Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Loader Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:29:43 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:29:43 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Controller Class Initialized
DEBUG - 2014-12-22 13:29:43 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:29:43 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:29:45 --> Model Class Initialized
DEBUG - 2014-12-22 13:29:45 --> Model Class Initialized
DEBUG - 2014-12-22 13:29:45 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:29:45 --> Email Class Initialized
DEBUG - 2014-12-22 13:29:46 --> Language file loaded: language/english/email_lang.php
DEBUG - 2014-12-22 13:29:49 --> Final output sent to browser
DEBUG - 2014-12-22 13:29:49 --> Total execution time: 6.2451
DEBUG - 2014-12-22 13:34:27 --> Config Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:34:27 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:34:27 --> URI Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Router Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Output Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Security Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Input Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:34:27 --> Language Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Loader Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:34:27 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:34:27 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Controller Class Initialized
DEBUG - 2014-12-22 13:34:27 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:34:27 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:34:29 --> Model Class Initialized
DEBUG - 2014-12-22 13:34:29 --> Model Class Initialized
DEBUG - 2014-12-22 13:34:29 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:34:29 --> Email Class Initialized
DEBUG - 2014-12-22 13:34:30 --> Language file loaded: language/english/email_lang.php
DEBUG - 2014-12-22 13:34:34 --> Final output sent to browser
DEBUG - 2014-12-22 13:34:34 --> Total execution time: 6.5670
DEBUG - 2014-12-22 13:34:37 --> Config Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Hooks Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Utf8 Class Initialized
DEBUG - 2014-12-22 13:34:37 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 13:34:37 --> URI Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Router Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Output Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Security Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Input Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 13:34:37 --> Language Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Loader Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Database Driver Class Initialized
ERROR - 2014-12-22 13:34:37 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 13:34:37 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Controller Class Initialized
DEBUG - 2014-12-22 13:34:37 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 13:34:37 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 13:34:39 --> Model Class Initialized
DEBUG - 2014-12-22 13:34:39 --> Model Class Initialized
DEBUG - 2014-12-22 13:34:39 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 13:34:39 --> Email Class Initialized
DEBUG - 2014-12-22 13:34:40 --> Language file loaded: language/english/email_lang.php
DEBUG - 2014-12-22 13:34:43 --> Final output sent to browser
DEBUG - 2014-12-22 13:34:43 --> Total execution time: 5.4983
DEBUG - 2014-12-22 14:27:57 --> Config Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:27:57 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:27:57 --> URI Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Router Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Output Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Security Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Input Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:27:57 --> Language Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Loader Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:27:57 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:27:57 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Controller Class Initialized
DEBUG - 2014-12-22 14:27:57 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:27:57 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:27:59 --> Model Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Config Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:28:22 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:28:22 --> URI Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Router Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Output Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Security Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Input Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:28:22 --> Language Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Loader Class Initialized
DEBUG - 2014-12-22 14:28:22 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:28:22 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:28:23 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:28:23 --> Controller Class Initialized
DEBUG - 2014-12-22 14:28:23 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:28:23 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:28:24 --> Model Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Config Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:28:30 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:28:30 --> URI Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Router Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Output Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Security Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Input Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:28:30 --> Language Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Loader Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:28:30 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:28:30 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Controller Class Initialized
DEBUG - 2014-12-22 14:28:30 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:28:30 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:28:31 --> Model Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Config Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:30:43 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:30:43 --> URI Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Router Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Output Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Security Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Input Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:30:43 --> Language Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Loader Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:30:43 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:30:43 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Controller Class Initialized
DEBUG - 2014-12-22 14:30:43 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:30:43 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:30:45 --> Model Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Config Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:32:26 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:32:26 --> URI Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Router Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Output Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Security Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Input Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:32:26 --> Language Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Loader Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:32:26 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:32:26 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:32:26 --> Controller Class Initialized
DEBUG - 2014-12-22 14:32:27 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:32:27 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:32:28 --> Model Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Config Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:35:17 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:35:17 --> URI Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Router Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Output Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Security Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Input Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:35:17 --> Language Class Initialized
DEBUG - 2014-12-22 14:35:17 --> Loader Class Initialized
DEBUG - 2014-12-22 14:35:18 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:35:18 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:35:18 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:35:18 --> Controller Class Initialized
DEBUG - 2014-12-22 14:35:18 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:35:18 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:35:20 --> Model Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Config Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:36:29 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:36:29 --> URI Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Router Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Output Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Security Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Input Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:36:29 --> Language Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Loader Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:36:29 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:36:29 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Controller Class Initialized
DEBUG - 2014-12-22 14:36:29 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:36:29 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:36:31 --> Model Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Config Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:37:25 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:37:25 --> URI Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Router Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Output Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Security Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Input Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:37:25 --> Language Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Loader Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:37:25 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:37:25 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Controller Class Initialized
DEBUG - 2014-12-22 14:37:25 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:37:25 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:37:27 --> Model Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Config Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:37:52 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:37:52 --> URI Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Router Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Output Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Security Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Input Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:37:52 --> Language Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Loader Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:37:52 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:37:52 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Controller Class Initialized
DEBUG - 2014-12-22 14:37:52 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:37:52 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:37:53 --> Model Class Initialized
DEBUG - 2014-12-22 14:37:53 --> Model Class Initialized
DEBUG - 2014-12-22 14:37:53 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 14:37:53 --> Email Class Initialized
DEBUG - 2014-12-22 14:37:55 --> Language file loaded: language/english/email_lang.php
DEBUG - 2014-12-22 14:37:58 --> Final output sent to browser
DEBUG - 2014-12-22 14:37:58 --> Total execution time: 6.8395
DEBUG - 2014-12-22 14:38:36 --> Config Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:38:36 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:38:36 --> URI Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Router Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Output Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Security Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Input Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:38:36 --> Language Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Loader Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:38:36 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:38:36 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Controller Class Initialized
DEBUG - 2014-12-22 14:38:36 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:38:36 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:38:38 --> Model Class Initialized
DEBUG - 2014-12-22 14:38:38 --> Model Class Initialized
DEBUG - 2014-12-22 14:38:38 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 14:38:38 --> Email Class Initialized
DEBUG - 2014-12-22 14:38:38 --> Language file loaded: language/english/email_lang.php
DEBUG - 2014-12-22 14:56:17 --> Config Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:56:17 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:56:17 --> URI Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Router Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Output Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Security Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Input Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:56:17 --> Language Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Loader Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:56:17 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:56:17 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Controller Class Initialized
DEBUG - 2014-12-22 14:56:17 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:56:17 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:56:19 --> Model Class Initialized
DEBUG - 2014-12-22 14:56:19 --> Model Class Initialized
DEBUG - 2014-12-22 14:56:19 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 14:56:19 --> Email Class Initialized
DEBUG - 2014-12-22 14:56:21 --> Language file loaded: language/english/email_lang.php
ERROR - 2014-12-22 14:56:33 --> Severity: Warning  --> Missing argument 1 for Users_model::updateSugarCRM(), called in /Volumes/Data/www/thunderbirds/server/application/controllers/api/users.php on line 62 and defined /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 75
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: sugarcrm_id /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 80
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: callname /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: firstname /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: lastname /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: gender /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: dob /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: password /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: type /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: status /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: newsletter /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: email /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:33 --> Severity: Notice  --> Undefined variable: parent_callname /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 87
ERROR - 2014-12-22 14:56:36 --> Severity: Notice  --> Undefined variable: email /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 92
ERROR - 2014-12-22 14:56:36 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /Volumes/Data/www/thunderbirds/server/system/core/Exceptions.php:185) /Volumes/Data/www/thunderbirds/server/application/libraries/REST_Controller.php 485
ERROR - 2014-12-22 14:56:36 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /Volumes/Data/www/thunderbirds/server/system/core/Exceptions.php:185) /Volumes/Data/www/thunderbirds/server/system/core/Common.php 442
ERROR - 2014-12-22 14:56:36 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /Volumes/Data/www/thunderbirds/server/system/core/Exceptions.php:185) /Volumes/Data/www/thunderbirds/server/application/libraries/REST_Controller.php 503
DEBUG - 2014-12-22 14:59:41 --> Config Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Hooks Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Utf8 Class Initialized
DEBUG - 2014-12-22 14:59:41 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 14:59:41 --> URI Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Router Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Output Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Security Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Input Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 14:59:41 --> Language Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Loader Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Database Driver Class Initialized
ERROR - 2014-12-22 14:59:41 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 14:59:41 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Controller Class Initialized
DEBUG - 2014-12-22 14:59:41 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 14:59:41 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 14:59:43 --> Model Class Initialized
DEBUG - 2014-12-22 14:59:43 --> Model Class Initialized
DEBUG - 2014-12-22 14:59:43 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 14:59:43 --> Email Class Initialized
DEBUG - 2014-12-22 14:59:44 --> Language file loaded: language/english/email_lang.php
ERROR - 2014-12-22 14:59:55 --> Severity: Notice  --> Undefined variable: email /Volumes/Data/www/thunderbirds/server/application/models/users_model.php 90
ERROR - 2014-12-22 14:59:55 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /Volumes/Data/www/thunderbirds/server/system/core/Exceptions.php:185) /Volumes/Data/www/thunderbirds/server/application/libraries/REST_Controller.php 485
ERROR - 2014-12-22 14:59:55 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /Volumes/Data/www/thunderbirds/server/system/core/Exceptions.php:185) /Volumes/Data/www/thunderbirds/server/system/core/Common.php 442
ERROR - 2014-12-22 14:59:55 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /Volumes/Data/www/thunderbirds/server/system/core/Exceptions.php:185) /Volumes/Data/www/thunderbirds/server/application/libraries/REST_Controller.php 503
DEBUG - 2014-12-22 15:00:50 --> Config Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Hooks Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Utf8 Class Initialized
DEBUG - 2014-12-22 15:00:50 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 15:00:50 --> URI Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Router Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Output Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Security Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Input Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 15:00:50 --> Language Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Loader Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Database Driver Class Initialized
ERROR - 2014-12-22 15:00:50 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 15:00:50 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Controller Class Initialized
DEBUG - 2014-12-22 15:00:50 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 15:00:50 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 15:00:52 --> Model Class Initialized
DEBUG - 2014-12-22 15:00:52 --> Model Class Initialized
DEBUG - 2014-12-22 15:00:52 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 15:00:52 --> Email Class Initialized
DEBUG - 2014-12-22 15:00:53 --> Language file loaded: language/english/email_lang.php
DEBUG - 2014-12-22 15:21:56 --> Config Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Hooks Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Utf8 Class Initialized
DEBUG - 2014-12-22 15:21:56 --> UTF-8 Support Enabled
DEBUG - 2014-12-22 15:21:56 --> URI Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Router Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Output Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Security Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Input Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Global POST and COOKIE data sanitized
DEBUG - 2014-12-22 15:21:56 --> Language Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Loader Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Database Driver Class Initialized
ERROR - 2014-12-22 15:21:56 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /Volumes/Data/www/thunderbirds/server/system/database/drivers/mysql/mysql_driver.php 91
DEBUG - 2014-12-22 15:21:56 --> XML-RPC Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Controller Class Initialized
DEBUG - 2014-12-22 15:21:56 --> Config file loaded: application/config/rest.php
DEBUG - 2014-12-22 15:21:56 --> Helper loaded: inflector_helper
DEBUG - 2014-12-22 15:21:58 --> Model Class Initialized
DEBUG - 2014-12-22 15:21:58 --> Model Class Initialized
DEBUG - 2014-12-22 15:21:58 --> File loaded: application/views/email/registration.php
DEBUG - 2014-12-22 15:21:58 --> Email Class Initialized
DEBUG - 2014-12-22 15:21:59 --> Language file loaded: language/english/email_lang.php


text:
/**
 * @module Rendering
 * @submodule Rendering
 * @for p5
 */

var p5 = require('./core');
var constants = require('./constants');
require('./p5.Graphics');
require('./p5.Renderer2D');
require('../webgl/p5.RendererGL');
var defaultId = 'defaultCanvas0'; // this gets set again in createCanvas

/**
 * Creates a canvas element in the document, and sets the dimensions of it
 * in pixels. This method should be called only once at the start of setup.
 * Calling createCanvas more than once in a sketch will result in very
 * unpredicable behavior. If you want more than one drawing canvas
 * you could use createGraphics (hidden by default but it can be shown).
 *

 * The system variables width and height are set by the parameters passed
 * to this function. If createCanvas() is not used, the window will be
 * given a default size of 100x100 pixels.
 *

 * For more ways to position the canvas, see the
 *
 * positioning the canvas wiki page.
 *
 * @method createCanvas
 * @param  {Number} w width of the canvas
 * @param  {Number} h height of the canvas
 * @param  {Constant} [renderer] P2D or WEBGL
 * @return {Object} canvas generated
 * @example
 *

 *
 * function setup() {
 *   createCanvas(100, 50);
 *   background(153);
 *   line(0, 0, width, height);
 * }
 *
 *

 *
 * @alt
 * Black line extending from top-left of canvas to bottom right.
 *
 */

p5.prototype.createCanvas = function(w, h, renderer) {
  //optional: renderer, otherwise defaults to p2d
  var r = renderer || constants.P2D;
  var isDefault, c;

  //4th arg (isDefault) used when called onLoad,
  //otherwise hidden to the public api
  if(arguments[3]){
    isDefault =
    (typeof arguments[3] === 'boolean') ? arguments[3] : false;
  }

  if(r === constants.WEBGL){
    c = document.getElementById(defaultId);
    if(c){ //if defaultCanvas already exists
      c.parentNode.removeChild(c); //replace the existing defaultCanvas
    }
    c = document.createElement('canvas');
    c.id = defaultId;
  }
  else {
    if (isDefault) {
      c = document.createElement('canvas');
      var i = 0;
      while (document.getElementById('defaultCanvas'+i)) {
        i++;
      }
      defaultId = 'defaultCanvas'+i;
      c.id = defaultId;
    } else { // resize the default canvas if new one is created
      c = this.canvas;
    }
  }

  // set to invisible if still in setup (to prevent flashing with manipulate)
  if (!this._setupDone) {
    c.dataset.hidden = true; // tag to show later
    c.style.visibility='hidden';
  }

  if (this._userNode) { // user input node case
    this._userNode.appendChild(c);
  } else {
    document.body.appendChild(c);
  }

  // Init our graphics renderer
  //webgl mode
  if (r === constants.WEBGL) {
    this._setProperty('_renderer', new p5.RendererGL(c, this, true));
    this._isdefaultGraphics = true;
  }
  //P2D mode
  else {
    if (!this._isdefaultGraphics) {
      this._setProperty('_renderer', new p5.Renderer2D(c, this, true));
      this._isdefaultGraphics = true;
    }
  }
  this._renderer.resize(w, h);
  this._renderer._applyDefaults();
  if (isDefault) { // only push once
    this._elements.push(this._renderer);
  }
  return this._renderer;
};

/**
 * Resizes the canvas to given width and height. The canvas will be cleared
 * and draw will be called immediately, allowing the sketch to re-render itself
 * in the resized canvas.
 * @method resizeCanvas
 * @example
 *

 * function setup() {
 *   createCanvas(windowWidth, windowHeight);
 * }
 *
 * function draw() {
 *  background(0, 100, 200);
 * }
 *
 * function windowResized() {
 *   resizeCanvas(windowWidth, windowHeight);
 * }
 *

 *
 * @alt
 * No image displayed.
 *
 */
p5.prototype.resizeCanvas = function (w, h, noRedraw) {
  if (this._renderer) {

    // save canvas properties
    var props = {};
    for (var key in this.drawingContext) {
      var val = this.drawingContext[key];
      if (typeof val !== 'object' && typeof val !== 'function') {
        props[key] = val;
      }
    }
    this._renderer.resize(w, h);
    // reset canvas properties
    for (var savedKey in props) {
      this.drawingContext[savedKey] = props[savedKey];
    }
    if (!noRedraw) {
      this.redraw();
    }
  }
};

/**
 * Removes the default canvas for a p5 sketch that doesn't
 * require a canvas
 * @method noCanvas
 * @example
 *

 *
 * function setup() {
 *   noCanvas();
 * }
 *
 *

 *
 * @alt
 * no image displayed
 *
 */
p5.prototype.noCanvas = function() {
  if (this.canvas) {
    this.canvas.parentNode.removeChild(this.canvas);
  }
};

/**
 * Creates and returns a new p5.Renderer object. Use this class if you need
 * to draw into an off-screen graphics buffer. The two parameters define the
 * width and height in pixels.
 *
 * @method createGraphics
 * @param  {Number} w width of the offscreen graphics buffer
 * @param  {Number} h height of the offscreen graphics buffer
 * @param  {Constant} [renderer] P2D or WEBGL
 * undefined defaults to p2d
 * @return {Object} offscreen graphics buffer
 * @example
 *

 *
 * var pg;
 * function setup() {
 *   createCanvas(100, 100);
 *   pg = createGraphics(100, 100);
 * }
 * function draw() {
 *   background(200);
 *   pg.background(100);
 *   pg.noStroke();
 *   pg.ellipse(pg.width/2, pg.height/2, 50, 50);
 *   image(pg, 50, 50);
 *   image(pg, 0, 0, 50, 50);
 * }
 *
 *

 *
 * @alt
 * 4 grey squares alternating light and dark grey. White quarter circle mid-left.
 *
 */
p5.prototype.createGraphics = function(w, h, renderer){
  return new p5.Graphics(w, h, renderer, this);
};

/**
 * Blends the pixels in the display window according to the defined mode.
 * There is a choice of the following modes to blend the source pixels (A)
 * with the ones of pixels already in the display window (B):
 *

 *
BLEND - linear interpolation of colours: C =
 * A*factor + B. This is the default blending mode.

 *
ADD - sum of A and B

 *
DARKEST - only the darkest colour succeeds: C =
 * min(A*factor, B).

 *
LIGHTEST - only the lightest colour succeeds: C =
 * max(A*factor, B).

 *
DIFFERENCE - subtract colors from underlying image.

 *
EXCLUSION - similar to DIFFERENCE, but less
 * extreme.

 *
MULTIPLY - multiply the colors, result will always be
 * darker.

 *
SCREEN - opposite multiply, uses inverse values of the
 * colors.

 *
REPLACE - the pixels entirely replace the others and
 * don't utilize alpha (transparency) values.

 *
OVERLAY - mix of MULTIPLY and SCREEN
 * . Multiplies dark values, and screens light values.

 *
HARD_LIGHT - SCREEN when greater than 50%
 * gray, MULTIPLY when lower.

 *
SOFT_LIGHT - mix of DARKEST and
 * LIGHTEST. Works like OVERLAY, but not as harsh.
 *

 *
DODGE - lightens light tones and increases contrast,
 * ignores darks.

 *
BURN - darker areas are applied, increasing contrast,
 * ignores lights.

 *

 *
 * @method blendMode
 * @param  {Constant} mode blend mode to set for canvas
 * @example
 *

 *
 * blendMode(LIGHTEST);
 * strokeWeight(30);
 * stroke(80, 150, 255);
 * line(25, 25, 75, 75);
 * stroke(255, 50, 50);
 * line(75, 25, 25, 75);
 *
 *

 *

 *
 * blendMode(MULTIPLY);
 * strokeWeight(30);
 * stroke(80, 150, 255);
 * line(25, 25, 75, 75);
 * stroke(255, 50, 50);
 * line(75, 25, 25, 75);
 *
 *

 * @alt
 * translucent image thick red & blue diagonal rounded lines intersecting center
 * Thick red & blue diagonal rounded lines intersecting center. dark at overlap
 *
 */
p5.prototype.blendMode = function(mode) {
  if (mode === constants.BLEND || mode === constants.DARKEST ||
    mode === constants.LIGHTEST || mode === constants.DIFFERENCE ||
    mode === constants.MULTIPLY || mode === constants.EXCLUSION ||
    mode === constants.SCREEN || mode === constants.REPLACE ||
    mode === constants.OVERLAY || mode === constants.HARD_LIGHT ||
    mode === constants.SOFT_LIGHT || mode === constants.DODGE ||
    mode === constants.BURN || mode === constants.ADD ||
    mode === constants.NORMAL) {
    this._renderer.blendMode(mode);
  } else {
    throw new Error('Mode '+mode+' not recognized.');
  }
};

module.exports = p5;


text:
class CB::Core::WebsiteChannelSerializer < ActiveModel::Serializer
  root false

  attributes :name, :url_prefix, :baseline, :css_url, :cover_url

  def css_url
    object.css.url
  end
end