text:
'''Tool to generate graphs of kmer spectra'''

import sys
import os
import argparse
import numpy as np
import matplotlib as mpl

from ksatools.ksatools import getmgrkmerspectrum, printstats, loadfile, makegraphs

def main(filename, opt=6, label=None, n=0, opts=None, colorlist=[],
         stylelist=None):
    '''loads file and invokes makegraphs and printstats.
    Appends graphics from each file onto the figure.
    opt is a symbol for the graph type;
    n is the serial number of successful traces.'''
    logfh = open(opts.logfile, "a")
    if opts.filetype.upper() == "MGM":
        spectrum = getmgrkmerspectrum(filename, mgrkey=MGRKEY)
    elif opts.filetype == "file":
        spectrum = loadfile(filename)
    else:
        raise ValueError(
            "%s is invalid type (valid types are mgm and file)"
            % opts.filetype)
    if spectrum == []:   # Abort this trace--but try to graph the others
        return n
    if label is None:
        label = filename
    if spectrum.shape[1] > 0:
        spectrum = spectrum[np.lexsort((spectrum[:, 1], spectrum[:, 0]))]
        sys.stderr.write("Making graphs for %s\n" % filename)
        try:
            makegraphs(
                spectrum, filename, option=opt, label=label, n=n,
                dump=opts.dump, opts=opts, colorlist=colorlist,
                stylelist=stylelist)
#            sys.stderr.write("Printing stats in logfile %s %d\n" %
#                (opts.logfile, n))
            printstats(spectrum, filename, filehandle=logfh, n=n)
            n += 1
        except ValueError as err:   # This catches no data or defective data
            sys.stderr.write("Error printing stats for %s\n" % filename)
    else:
        sys.stderr.write("Error with dataset %s\n" % filename)
    return n

if __name__ == '__main__':
    usage = '''usage: plotkmerspectrum.py [options] <datafile> [<datafile2> <datafile3>...]
       plotkmerspectrum.py [options] -l <file containing targets, labels> '''
    GRAPHNUMBERDESCRIPTION = '''-3: No graphs, produce stratify one-line summary
-2: No graphs, but produce stratify table
-1: no graphs, only append summary to kmers.log
0 : number of kmers vs. kmer abundance (basic spectrum)
1 : kmers observed vs. kmer abundance (scaled spectrum)
2 : kmer abundance vs. basepairs observed
3 : kmer abundance vs. fraction of observed data
4 : kmer abundance vs. fraction of distinct kmers
5 : fraction of observed vs. kmer rank  (kmer k-dominance curve)
6 : kmer abundance vs. kmer rank  (kmer rank-abundance)
24: band-colored variant
25: band-colored variant of kmer k-dominance curve
26: band-colored variant of kmer rank-abundance curve
30: Renyi entropy (transformation, function of lambda)
'''
    parser = argparse.ArgumentParser(description=usage)
    parser.add_argument(
        "files", type=str, nargs='*', help="List of files")
    parser.add_argument(
        "-d", "--dump", dest="dump", action="store_true",
        default=False, help="dump table with outputs")
    parser.add_argument(
        "-v", "--verbose", dest="verbose", action="store_true",
        default=False, help="verbose")
    parser.add_argument(
        "-o", "--outfile", dest="outfile", action="store",
        default=None, help="dump table with outputs ")
    parser.add_argument(
        "-g", "--graph", dest="option", action="store", type=int,
        default="6", help=GRAPHNUMBERDESCRIPTION)
    parser.add_argument(
        "-i", "--interactive", dest="interactive", action="store_true",
        default=False, help="interactive mode--draw window")
    parser.add_argument(
        "-l", "--list", dest="filelist",
        default=None, help="file containing list of targets and labels")
    parser.add_argument(
        "-t", "--type", dest="filetype",
        default="file", help="type for file list (file,mgm)")
    parser.add_argument(
        "-w", "--writetype", dest="writetype",
        default="pdf", help="file type for output (pdf,png)")
    parser.add_argument(
        "-a", "--appendlogfile", dest="logfile",
        default="kmers.log", help="logfile for summary statistics")
    parser.add_argument(
        "-s", "--suppresslegend", dest="suppress", action="store_true",
        default=False, help="supress display of legend")
    parser.add_argument(
        "-n", "--name", dest="name",
        default=None, help="Name for graph, graph title")
    parser.add_argument(
        "-x", "--xlabel", dest="xlabel",
        default=None, help="X label override")
    parser.add_argument(
        "-y", "--ylabel", dest="ylabel",
        default=None, help="Y label override")

    opts = parser.parse_args()
    graphtype = opts.option
    writetype = opts.writetype
    if len(opts.files) == 0 and not opts.filelist:
        sys.exit("Missing input file argument!\n" + usage)
    assert writetype == "png" or writetype == "pdf" or writetype == "eps"

    if opts.outfile:
        imagefilename = "%s.%d.%s" % (opts.outfile, graphtype, writetype)
    elif opts.filelist:
        imagefilename = "%s.%d.%s" % (opts.filelist, graphtype, writetype)
    else:
        imagefilename = "%s.%d.%s" % (opts.files[0], graphtype, writetype)
        sys.stderr.write("Warning, using default filename %s\n" %
                         (imagefilename,))
    # only invoke interactive backend if requested with -i
    # this stabilizes behavior on non-interactive terminals
    if not opts.interactive:
        mpl.use("Agg")
    else:
        mpl.use('TkAgg')
    import matplotlib.pyplot as plt
    fig = plt.figure()
    fig.patch.set_facecolor('white')
    if opts.filetype == "mgm":
        try:
            MGRKEY = os.environ["MGRKEY"]
        except KeyError:
            MGRKEY = ""

    graphcount = 0
    # Loop over input identifiers, and skip if main()
    # fails to produce some traces
    colorlist = []
    stylelist = []
    if opts.filelist is not None:
        assert os.path.isfile(
            opts.filelist), "File %s does not exist" % opts.filelist
        IN_FILE = open(opts.filelist, "r")
        for line in IN_FILE:
            if line[0] != "#":
                a = line.strip().split("\t")
                if len(a[0]) > 0:
                    if len(a) == 1:
                        a.append(a[0])  # use filename as label if nothing else
                    if len(a) >= 3:     # if three columns, last column is color
                        colorlist.append((a[2]))
                    if len(a) >= 4:     # if three columns, last column is color
                        stylelist.append((a[3]))
                    sys.stderr.write("%s\t%s\n" % (a[0], a[1]))
                    graphcount = main(
                        a[0], graphtype, label=a[1], n=graphcount,
                        opts=opts, colorlist=colorlist, stylelist=stylelist)
    else:
        for f in opts.files:
            filen = f
            graphcount = main(filen, graphtype, n=graphcount, opts=opts)
    # don't continue if all inputs fail
    assert graphcount > 0, "ERROR: unable to find any data to graph!"
    if graphtype >= 0:
        sys.stderr.write("Writing graph into file %s\n" % (imagefilename))
        plt.savefig(imagefilename)
    if opts.interactive:
        plt.show()
    else:
        sys.stderr.write("Use -i to open widow with graph\n")
    if graphcount == 0:
        sys.stderr.write("ERROR:  no data found!\n")


text:
'''Evaluates formulas in a Table.'''

from FileVersion.versioned_file import VersionedFile
from serialize_deserialize import serialize, deserialize
import mysite.settings as settings
import CommonUtil.util as ut
from CommonUtil.prune_nulls import pruneNulls
import cell_types

import collections
import numpy as np
import os

def readObjectFromFile(filepath, verify=False):
  """
  Get the object from the file
  :param str filepath: full path to file
  :param bool verify: checks the file path if the
      object has a getFilepath method
  :return object:
  :raises ValueError: Checks that the file path is set
  Notes: Handles legacy of accessing PCL files, which
         is mostly in tests.
  """
  if ut.getFileExtension(filepath).lower() == 'pcl':
    adj_filepath = ut.changeFileExtension(filepath,
        settings.SCISHEETS_EXT)
  else:
    adj_filepath = filepath
  with open(adj_filepath, "r") as fh:
    json_str = fh.read()
    new_object = deserialize(json_str)
  if 'getFilepath' in dir(new_object):
    if verify and new_object.getFilepath() != adj_filepath:
      if new_object.getFilepath() == filepath:
        new_object.setFilepath(adj_filepath)
      else:
        raise ValueError("File path is incorrect or missing.")
  return new_object

def writeObjectToFile(an_object, filepath=None):
  """
  Serializes and writes the object to the file
  :param object an_object:
  :param str filepath:
  :raises ValueError: if cannot find a filepath
  """
  if 'getFilepath' in dir(an_object):
    filepath = an_object.getFilepath()
  if filepath is None:
    raise ValueError("No way to find filepath")
  with open(filepath, "w") as fh:
    fh.write(serialize(an_object))

def _serializeTable(table):
  with open(table.getFilepath(), "w") as fh:
    fh.write(serialize(table))

def getTableCopyFilepath(filename, directory):
  """
  Returns the filepath of where the table will be copied
  :param str filename: name of the file for the table w/o extension
  :return str filepath: path to the table file
  """
  full_filename = "%s.%s" % (filename, settings.SCISHEETS_EXT)
  return os.path.join(directory, full_filename)

def copyTableToFile(table, filename, directory):
  """
  Writes the table to the directory specified
  :param Table table:
  :param str filename: name of the file for the table w/o extension
  :return str filepath: path to the table file
  :sideeffect: Sets the table written to its new filepath
  """
  filepath = getTableCopyFilepath(filename, directory)
  new_table = table.copy()
  versioned_file = table.getVersionedFile()
  if versioned_file is None:
    new_table.setVersionedFile(None)
  else:
    max_versions = table.getVersionedFile().getMaxVersions()
    directory = table.getVersionedFile().getDirectory()
    new_versioned_file = VersionedFile(filepath, directory, max_versions)
    new_table.setVersionedFile(new_versioned_file)
  try:
    _serializeTable(new_table)
  except Exception as e:
    import pdb; pdb.set_trace()
  return filepath

# TODO: Add test
def isEquivalentData(values1, values2):
  """
  Determines if two values are equivalent
  :param Iterable/object values1, values2:
  :return bool:
  """
  if cell_types.isStr(values1) and cell_types.isStr(values2):
    result = values1 == values2
  elif isinstance(values1, collections.Iterable)  \
      and isinstance(values2, collections.Iterable):
    result = compareIterables(values1, values2)
  elif type(values1) != type(values2):
    return False
  else:
    result = values1 == values2
  return result

def compareIterables(iter1, iter2):
  """
  Compares two iterables. Considered equal if different lengths
  but one iterable is filled with NaN or None.
  :param Iterable iter1: iterable possibly with None values
  :param Iterable iter2: iterable possibly with None values
  :return: True if equivalent; otherwise false
  """
  def makeList(val):
    result = cell_types.makeIterable(val)
    pruned_result = pruneNulls(result)
    if isinstance(pruned_result, list):
      return pruned_result
    else:
      return [v for v in pruned_result]

  # Make sure the inputs are iterables
  iter1 = makeList(iter1)
  iter2 = makeList(iter2)
  if len(iter1) != len(iter2):
    return False
  pairs = zip(iter1, iter2)
  try:
    if cell_types.isFloats(iter1):
      return all([cell_types.isEquivalentFloats(i1, i2) for i1, i2 in pairs])
  except TypeError as err:
    return False
  return all([i1 == i2 for i1, i2 in pairs])

def getFileNameWithoutExtension(file_path):
  """
  Input: file_path - full path to the file
  Output: file_name - just the name, without extension
  """
  if file_path is None:
    return None
  full_file_name = os.path.split(file_path)[1]
  pos = full_file_name.index(".")
  return full_file_name[:pos]

def coerceValuesForColumn(column, values):
  """
  Coerces the values to the type appropriate for the column
  :param Column column:
  :return: type appropriate for column
  :raises: ValueError
  """
  data_class = column.getDataClass()
  values = data_class.cons(values)
  values.name = column.getName(is_global_name=False)
  return values

redpajama_set_name: RedPajamaGithub


text:
module Minitest
  module RubyEventStore
    VERSION = "0.1.0"
  end
end


text:
import Ember from 'ember';

export default Ember.Route.extend({
  model(params) {
  		return Ember.$.getJSON("https://pokeapi.co/api/v2/generation/" + params.name);
	}
});


text:
package exception.notes;
public class InvalidStateException extends BaseException{
	/**
	 *
	 */
	private static final long serialVersionUID = -9029284015871590160L;

	public InvalidStateException(String msg) {
		super(msg);
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="description" content="">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>gulp demo</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="apple-touch-icon" href="apple-touch-icon.png">
  <link rel="shortcut icon" href="/favicon.ico">

  <link rel="stylesheet" href="../../bower_components/bootstrap/dist/css/bootstrap.css">

  <link rel="stylesheet" href="../../styles/main.css">

首页

关于

less demo

Sass Demo

Sass Demo

开启 Sass 之旅

Grunt

Grunt The JavaScript Task Runner

Sass

Sass is the most mature, stable, and powerful professional grade CSS extension language in the world.

Bootstrap

Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.


text:
package mapper

import (
	"fmt"

	omodel "github.com/ippoippo/fitbitdownloadconsolidator/exporter/model"
	imodel "github.com/ippoippo/fitbitdownloadconsolidator/importer/model"
)

// Map takes models build during JSON import, and generates models to be used to build output file
func Map(input []*imodel.JSONFile) *omodel.OutputFile {
	var dataPoints []*omodel.DataPoint

	for _, dayInput := range input {
		dateStr := dayInput.DateString
		for _, timeRateInput := range dayInput.ActivitiesHeartIntraday.Dataset {
			dateTimeStr := fmt.Sprintf("%s %s", dateStr, timeRateInput.Time)
			dataPoints = append(dataPoints, &omodel.DataPoint{
				DateTimeString: dateTimeStr,
				Rate:           timeRateInput.Value,
			})
		}
	}

	return &omodel.OutputFile{FitbitData: dataPoints}
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using OpenCover.Framework.Model;

namespace OpenCover.Framework.Utility
{
	/// <summary>
	/// Collection of CodeCoverageStringTextSources
	/// </summary>
	public class SourceRepository : IDictionary<uint, CodeCoverageStringTextSource>
	{
		private readonly IDictionary<uint, CodeCoverageStringTextSource> repo = new Dictionary<uint, CodeCoverageStringTextSource>();

		/// <summary>
		/// Default Constructor
		/// </summary>
		public SourceRepository()
		{
		}

        /// <summary>
        /// Get string Text Source by FileID
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        public CodeCoverageStringTextSource GetCodeCoverageStringTextSource (uint fileId) {
            CodeCoverageStringTextSource source = null;
            if (fileId != 0) {
                this.TryGetValue (fileId, out source);
            }
            return source;
        }

        /// <summary>
        /// SequencePoint source-string if available, else empty string
        /// </summary>
        /// <param name="sp">SequencePoint</param>
        /// <returns>string</returns>
        public string GetSequencePointText (SequencePoint sp) {
            if (sp != null) {
                CodeCoverageStringTextSource source = GetCodeCoverageStringTextSource (sp.FileId);
                return source != null ? source.GetText(sp) : "";
            }
            return "";
        }

        #region IDictionary implementation

        /// <summary>
		/// Implements IDictionary
		/// </summary>
		/// <param name="key"></param>
		/// <returns></returns>
		public bool ContainsKey(uint key)
		{
			return repo.ContainsKey(key);
		}

		/// <summary>
		/// Implements IDictionary
		/// </summary>
		/// <param name="key"></param>
		/// <param name="value"></param>
		public void Add(uint key, CodeCoverageStringTextSource value)
		{
			repo.Add(key, value);
		}

		/// <summary>
		/// Implements IDictionary
		/// </summary>
		/// <param name="key"></param>
		/// <returns></returns>
		public bool Remove(uint key)
		{
			return repo.Remove(key);
		}

		/// <summary>
		/// Implements IDictionary
		/// </summary>
		/// <param name="key"></param>
		/// <param name="value"></param>
		/// <returns></returns>
		public bool TryGetValue(uint key, out CodeCoverageStringTextSource value)
		{
			return repo.TryGetValue(key, out value);
		}

		/// <summary>
		/// Implements IDictionary
		/// </summary>
		public CodeCoverageStringTextSource this[uint key] {
			get {
				return repo[key];
			}
			set {
				repo[key] = value;
			}
		}

		/// <summary>
		/// Implements IDictionary
		/// </summary>
		public ICollection<uint> Keys {
			get {
				return repo.Keys;
			}
		}

		/// <summary>
		/// Implements IDictionary
		/// </summary>
		public ICollection<CodeCoverageStringTextSource> Values {
			get {
				return repo.Values;
			}
		}

		#endregion

		#region ICollection implementation

		/// <summary>
		/// Implements ICollection
		/// </summary>
		/// <param name="item"></param>
		public void Add(KeyValuePair<uint, CodeCoverageStringTextSource> item)
		{
			repo.Add(item);
		}

		/// <summary>
		/// Implements ICollection
		/// </summary>
		public void Clear()
		{
			repo.Clear();
		}

		/// <summary>
		/// Implements ICollection
		/// </summary>
		/// <param name="item"></param>
		/// <returns></returns>
		public bool Contains(KeyValuePair<uint, CodeCoverageStringTextSource> item)
		{
			return repo.Contains(item);
		}

		/// <summary>
		/// Implements ICollection
		/// </summary>
		/// <param name="array"></param>
		/// <param name="arrayIndex"></param>
		public void CopyTo(KeyValuePair<uint, CodeCoverageStringTextSource>[] array, int arrayIndex)
		{
			repo.CopyTo(array, arrayIndex);
		}

		/// <summary>
		/// Implements ICollection
		/// </summary>
		/// <param name="item"></param>
		/// <returns></returns>
		public bool Remove(KeyValuePair<uint, CodeCoverageStringTextSource> item)
		{
			return repo.Remove(item);
		}

		/// <summary>
		/// Implements ICollection
		/// </summary>
		public int Count {
			get {
				return repo.Count;
			}
		}

		/// <summary>
		/// Implements ICollection
		/// </summary>
		public bool IsReadOnly {
			get {
				return repo.IsReadOnly;
			}
		}

		#endregion

		#region IEnumerable implementation

		/// <summary>
		/// Implements IEnumerable
		/// </summary>
		/// <returns></returns>
		public IEnumerator<KeyValuePair<uint, CodeCoverageStringTextSource>> GetEnumerator()
		{
			return repo.GetEnumerator();
		}

		/// <summary>
		/// Implements IEnumerable
		/// </summary>
		/// <returns></returns>
		IEnumerator IEnumerable.GetEnumerator()
		{
			return ((IEnumerable)repo).GetEnumerator();
		}

		#endregion
	}
}


text:
// These two classes was copied from
// https://github.com/WebApiContrib/WebApiContrib.IoC.CastleWindsor/blob/master/src/WebApiContrib.IoC.CastleWindsor/WindsorResolver.cs

//The MIT License

//Copyright (c) 2012 Pedro Reys, Chris Missal, Headspring and other contributors

//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:

//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.

//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http.Dependencies;
using Castle.Windsor;

namespace WebApiContrib.IoC.CastleWindsor
{
    public class WindsorDependencyScope : IDependencyScope
    {
        protected readonly IWindsorContainer _container;

        private ConcurrentBag<object> _toBeReleased = new ConcurrentBag<object>();

        public WindsorDependencyScope(IWindsorContainer container)
        {
            _container = container;
        }

        public void Dispose()
        {
            if (_toBeReleased != null)
            {
                foreach (var o in _toBeReleased)
                {
                    _container.Release(o);
                }
            }
            _toBeReleased = null;
        }

        public object GetService(Type serviceType)
        {
            if (!_container.Kernel.HasComponent(serviceType))
                return null;

            var resolved = _container.Resolve(serviceType);
            if (resolved != null)
                _toBeReleased.Add(resolved);
            return resolved;

        }

        public IEnumerable<object> GetServices(Type serviceType)
        {
            if (!_container.Kernel.HasComponent(serviceType))
                return new object[0];

            var allResolved = _container.ResolveAll(serviceType).Cast<object>();
            if (allResolved != null)
            {
                allResolved.ToList()
                    .ForEach(x => _toBeReleased.Add(x));
            }
            return allResolved;
        }
    }

    public class WindsorResolver : IDependencyResolver
    {
        private readonly IWindsorContainer _container;

        public WindsorResolver(IWindsorContainer container)
        {
            _container = container;
        }

        public IDependencyScope BeginScope()
        {
            return new WindsorDependencyScope(_container);
        }

        public void Dispose()
        {
            _container.Dispose();
        }

        public object GetService(Type serviceType)
        {
            if (!_container.Kernel.HasComponent(serviceType))
                return null;

            return _container.Resolve(serviceType);
        }

        public IEnumerable<object> GetServices(Type serviceType)
        {
            if (!_container.Kernel.HasComponent(serviceType))
                return new object[0];

            return _container.ResolveAll(serviceType).Cast<object>();
        }
    }
}


text:
package com.joelapenna.foursquare.types;

/**
 * Auto-generated: 2009-11-12 21:45:34.909467
 *
 * @author Joe LaPenna (joe@joelapenna.com)
 */
public class City implements FoursquareType {

    private String mGeolat;
    private String mGeolong;
    private String mId;
    private String mName;
    private String mShortname;
    private String mTimezone;

    public City() {
    }

    public String getGeolat() {
        return mGeolat;
    }

    public void setGeolat(String geolat) {
        mGeolat = geolat;
    }

    public String getGeolong() {
        return mGeolong;
    }

    public void setGeolong(String geolong) {
        mGeolong = geolong;
    }

    public String getId() {
        return mId;
    }

    public void setId(String id) {
        mId = id;
    }

    public String getName() {
        return mName;
    }

    public void setName(String name) {
        mName = name;
    }

    public String getShortname() {
        return mShortname;
    }

    public void setShortname(String shortname) {
        mShortname = shortname;
    }

    public String getTimezone() {
        return mTimezone;
    }

    public void setTimezone(String timezone) {
        mTimezone = timezone;
    }

}


text:
namespace Lunchorder.Domain.Entities.DocumentDb
{
    /// <summary>
    /// The address of the menu vendor
    /// </summary>
    public class MenuVendorAddress : Address { }
}


text:
//
//  NSObject+Common.m
//  TACKit
//
//  Created by masato_arai on 2015/05/27.
//  Copyright (c) 2015年 Tea and Coffee. All rights reserved.
//

#import <objc/runtime.h>
#import "NSObject+Common.h"
#import "NSNull+Additions.h"
#import "TACRuntimeUtilities.h"

@implementation NSObject (Common)

+ (NSString *)identifier {
    return NSStringFromClass([self class]);
}

/** クラスで宣言されているプロパティー名一覧を取得する */
- (NSArray<NSString *> *)propertyNames {
    unsigned int outCount, i;
    objc_property_t *properties = class_copyPropertyList([self class], &outCount);
    NSMutableArray<NSString *> *m_propertyNames = [NSMutableArray array];

    for (i = 0; i < outCount; i++) {
        objc_property_t property = properties[i];
        const char *c_propertyName = property_getName(property);
        if (c_propertyName) {
            NSString *propertyName = @(c_propertyName);
            [m_propertyNames addObject:propertyName];
        }
    }
    free(properties);

    return [m_propertyNames copy];
}

/** クラスで宣言されているプロパティー名と型を連想配列で取得する */
- (NSDictionary<NSString *, NSString *> *)properties {
    unsigned int outCount, i;
    objc_property_t *properties = class_copyPropertyList([self class], &outCount);
    NSMutableDictionary *m_properties = [NSMutableDictionary dictionary];

    for (i = 0; i < outCount; i++) {
        objc_property_t property = properties[i];
        const char *c_propertyType = property_getType(property);
        const char *c_propertyName = property_getName(property);
        if (c_propertyType && c_propertyName) {
            NSString *propertyType = @(c_propertyType);
            NSString *propertyName = @(c_propertyName);
            if (propertyType != nil && [NSNull notNull:propertyName]) {
                m_properties[propertyName] = propertyType;
            }
        }
    }
    free(properties);

    return [m_properties copy];
}

@end


text:
/* eslint-disable @calm/react-intl/missing-attribute */
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import IconButton from '@material-ui/core/IconButton';
import ListItem from '@material-ui/core/ListItem';
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
import ListItemText from '@material-ui/core/ListItemText';
import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem';
import IconMoreVert from '@material-ui/icons/MoreVert';
import StatusLabel from './StatusLabel';
import StatusMessage from './StatusMessage';
import { FormattedGlobalMessage } from '../../MappedMessage';

const StatusListItem = ({
  defaultLanguage,
  isDefault,
  onDelete,
  onEdit,
  onMakeDefault,
  preventDelete,
  status,
}) => {
  const [anchorEl, setAnchorEl] = React.useState(null);
  const handleClose = () => setAnchorEl(null);

  const handleDelete = () => {
    handleClose();
    onDelete(status);
  };
  const handleEdit = () => {
    handleClose();
    onEdit(status);
  };
  const handleMakeDefault = () => {
    handleClose();
    onMakeDefault(status);
  };

  const localeStatus = status.locales[defaultLanguage];

  const statusLabel =
    localeStatus && localeStatus.label ? localeStatus.label : status.label;

  const statusDescription =
    localeStatus && localeStatus.description ? localeStatus.description : (
      <FormattedMessage
        id="statusListItem.noDescription"
        defaultMessage="No description"
      />
    );

  const statusMessage =
    localeStatus && localeStatus.message && status.should_send_message ?
      localeStatus.message : null;

  return (
    <ListItem className="status-list-item">
      <ListItemText
        primary={
          isDefault ? (
            <FormattedMessage
              id="statusListItem.default"
              defaultMessage="{statusLabel} (default)"
              values={{
                statusLabel: (
                  <StatusLabel color={status.style.color}>
                    {statusLabel}
                  </StatusLabel>
                ),
              }}
            />
          ) : (
            <StatusLabel color={status.style.color}>
              {statusLabel}
            </StatusLabel>
          )
        }
        secondary={
          <React.Fragment>
            {statusDescription}

            <StatusMessage message={statusMessage} />
          </React.Fragment>
        }
      />
      <ListItemSecondaryAction>
        <IconButton className="status-actions__menu" onClick={e => setAnchorEl(e.target)}>
          <IconMoreVert />
        </IconButton>
        <Menu
          anchorEl={anchorEl}
          open={Boolean(anchorEl)}
          onClose={handleClose}
        >
          <MenuItem className="status-actions__make-default" onClick={handleMakeDefault} disabled={isDefault}>
            <FormattedMessage id="statusListItem.makeDefault" defaultMessage="Make default" />
          </MenuItem>
          <MenuItem className="status-actions__edit" onClick={handleEdit}>
            <FormattedGlobalMessage messageKey="edit" />
          </MenuItem>
          <MenuItem className="status-actions__delete" onClick={handleDelete} disabled={preventDelete || isDefault}>
            <FormattedGlobalMessage messageKey="delete" />
          </MenuItem>
        </Menu>
      </ListItemSecondaryAction>
    </ListItem>
  );
};

StatusListItem.propTypes = {
  defaultLanguage: PropTypes.string.isRequired,
  isDefault: PropTypes.bool,
  onDelete: PropTypes.func.isRequired,
  onEdit: PropTypes.func.isRequired,
  onMakeDefault: PropTypes.func.isRequired,
  preventDelete: PropTypes.bool,
  status: PropTypes.shape({
    id: PropTypes.string.isRequired,
    locales: PropTypes.object.isRequired,
  }).isRequired,
};

StatusListItem.defaultProps = {
  isDefault: false,
  preventDelete: false,
};

export default StatusListItem;


text:
<?php

declare(strict_types=1);

namespace Sylius\Component\Core\Model;

use Sylius\Component\Customer\Model\CustomerAwareInterface;
use Sylius\Component\User\Model\UserInterface as BaseUserInterface;

interface ShopUserInterface extends BaseUserInterface, CustomerAwareInterface
{
}


text:
package cn.kanejin.webop;

import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.*;

/**
 * @version $Id: MultipartFormdataRequest.java 115 2016-03-15 06:34:36Z Kane $
 * @author Kane Jin
 */
public class MultipartRequestWrapper extends HttpServletRequestWrapper {
	private static final Logger log = LoggerFactory.getLogger(MultipartRequestWrapper.class);

	private Map<String, String[]> parameters;
	private Map<String, FileItem> fileItems;

	public MultipartRequestWrapper(HttpServletRequest request) {
		this(request, System.getProperty("java.io.tmpdir"), 1024*1024);
	}

	public MultipartRequestWrapper(HttpServletRequest request,
                                   String repositoryPath, long maxSize) {
		super(request);
		init(request, repositoryPath, maxSize);
	}

	private void init(HttpServletRequest request, String repositoryPath,
			long maxSize) {
		log.debug("Initializing MultipartFormdataRequest with repositoryPath : {}", repositoryPath);
	    if (!ServletFileUpload.isMultipartContent(request)) {
	        throw new RuntimeException(
	        	"ContentType is not multipart/form-data but '" + request.getContentType() + "'");
	    }
		this.parameters = new HashMap<String, String[]>();
		this.fileItems = new HashMap<String, FileItem>();
		DiskFileItemFactory factory = new DiskFileItemFactory();

		factory.setRepository(new File(repositoryPath));

		ServletFileUpload upload = new ServletFileUpload(factory);

		upload.setSizeMax(maxSize);
		upload.setHeaderEncoding("UTF-8");

		List<FileItem> itemList;
		try {
			itemList = upload.parseRequest(request);
		} catch (Exception e) {
			log.warn("Upload File Error : ", e);
			return ;
		}

		log.debug("Start Extracting Parameters");
		for (FileItem item : itemList) {
			String key = item.getFieldName();
			if (item.isFormField()) {
				String[] inStock = this.parameters.get(key);
				if (inStock == null) {
					String[] values;
					try {
						values = new String[] { item.getString("utf-8") };
					} catch (UnsupportedEncodingException e) {
						log.error(e.toString());
						values = new String[] { item.getString() };
					}
					this.parameters.put(key, values);

					log.debug("Extracting Paramter : [{}]=[{}]", key, values);
				} else {
					String[] values = new String[inStock.length + 1];
					System.arraycopy(inStock, 0, values, 0, inStock.length);
					try {
						values[inStock.length] = item.getString("UTF-8");
					} catch (UnsupportedEncodingException e) {
						log.error(e.toString());
						values[inStock.length] = item.getString();
					}
					this.parameters.put(key, values);
					log.debug("Extracting Paramter : [{}]=[{}]", key, values);
				}
			} else {
				this.fileItems.put(key, item);
				log.debug("Extracting File Uploaded : [{}]=[{}]", key, item.getName());
			}
		}
	}

	public Enumeration<String> getFileItemKeys() {
		return Collections.enumeration(this.fileItems.keySet());
	}

	public FileItem getFileItem(String key) {
		if (this.fileItems != null) {
			return this.fileItems.get(key);
		}
		return null;
	}

	@Override
	public String getParameter(String key) {
		String parameter = null;
		String[] values = this.parameters.get(key);
		if (values != null && values.length > 0) {
			parameter = values[0];
		}
		return parameter;
	}

	@Override
	public Enumeration<String> getParameterNames() {
		return Collections.enumeration(this.parameters.keySet());
	}

	@Override
	public String[] getParameterValues(String key) {
		return this.parameters.get(key);
	}

	@Override
	public Map<String, String[]> getParameterMap() {
		return this.parameters;
	}
}


text: I am a Connection that supports addition of head/tail styles and line styles.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<TITLE
>User-Defined Types</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 9.0.10 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Extending SQL"
HREF="extend.html"><LINK
REL="PREVIOUS"
TITLE="User-Defined Aggregates"
HREF="xaggr.html"><LINK
REL="NEXT"
TITLE="User-Defined Operators"
HREF="xoper.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2012-09-19T22:08:45">

PostgreSQL 9.0.10 Documentation

Prev	Up	Chapter 35. Extending <ACRONYM
CLASS="ACRONYM"
>SQL</ACRONYM
>	Next

35.11. User-Defined Types

   As described in Section 35.2,
   PostgreSQL can be extended to support new
   data types.  This section describes how to define new base types,
   which are data types defined below the level of the <ACRONYM
CLASS="ACRONYM"
>SQL</ACRONYM
>
   language.  Creating a new base type requires implementing functions
   to operate on the type in a low-level language, usually C.

   The examples in this section can be found in
   <TT
CLASS="FILENAME"
>complex.sql</TT
> and <TT
CLASS="FILENAME"
>complex.c</TT
>
   in the <TT
CLASS="FILENAME"
>src/tutorial</TT
> directory of the source distribution.
   See the <TT
CLASS="FILENAME"
>README</TT
> file in that directory for instructions
   about running the examples.

  A user-defined type must always have input and output
  functions.
  These functions determine how the type appears in strings (for input
  by the user and output to the user) and how the type is organized in
  memory.  The input function takes a null-terminated character string
  as its argument and returns the internal (in memory) representation
  of the type.  The output function takes the internal representation
  of the type as argument and returns a null-terminated character
  string.  If we want to do anything more with the type than merely
  store it, we must provide additional functions to implement whatever
  operations we'd like to have for the type.

  Suppose we want to define a type <TT
CLASS="TYPE"
>complex</TT
> that represents
  complex numbers. A natural way to represent a complex number in
  memory would be the following C structure:

typedef struct Complex {
    double      x;
    double      y;
} Complex;

  We will need to make this a pass-by-reference type, since it's too
  large to fit into a single <TT
CLASS="TYPE"
>Datum</TT
> value.

  As the external string representation of the type, we choose a
  string of the form <TT
CLASS="LITERAL"
>(x,y)</TT
>.

  The input and output functions are usually not hard to write,
  especially the output function.  But when defining the external
  string representation of the type, remember that you must eventually
  write a complete and robust parser for that representation as your
  input function.  For instance:

PG_FUNCTION_INFO_V1(complex_in);

Datum
complex_in(PG_FUNCTION_ARGS)
{
    char       *str = PG_GETARG_CSTRING(0);
    double      x,
                y;
    Complex    *result;

    if (sscanf(str, " ( %lf , %lf )", &x, &y) != 2)
        ereport(ERROR,
                (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
                 errmsg("invalid input syntax for complex: \"%s\"",
                        str)));

    result = (Complex *) palloc(sizeof(Complex));
    result->x = x;
    result->y = y;
    PG_RETURN_POINTER(result);
}

  The output function can simply be:

PG_FUNCTION_INFO_V1(complex_out);

Datum
complex_out(PG_FUNCTION_ARGS)
{
    Complex    *complex = (Complex *) PG_GETARG_POINTER(0);
    char       *result;

    result = (char *) palloc(100);
    snprintf(result, 100, "(%g,%g)", complex->x, complex->y);
    PG_RETURN_CSTRING(result);
}

  You should be careful to make the input and output functions inverses of
  each other.  If you do not, you will have severe problems when you
  need to dump your data into a file and then read it back in.  This
  is a particularly common problem when floating-point numbers are
  involved.

  Optionally, a user-defined type can provide binary input and output
  routines.  Binary I/O is normally faster but less portable than textual
  I/O.  As with textual I/O, it is up to you to define exactly what the
  external binary representation is.  Most of the built-in data types
  try to provide a machine-independent binary representation.  For
  <TT
CLASS="TYPE"
>complex</TT
>, we will piggy-back on the binary I/O converters
  for type <TT
CLASS="TYPE"
>float8</TT
>:

PG_FUNCTION_INFO_V1(complex_recv);

Datum
complex_recv(PG_FUNCTION_ARGS)
{
    StringInfo  buf = (StringInfo) PG_GETARG_POINTER(0);
    Complex    *result;

    result = (Complex *) palloc(sizeof(Complex));
    result->x = pq_getmsgfloat8(buf);
    result->y = pq_getmsgfloat8(buf);
    PG_RETURN_POINTER(result);
}

PG_FUNCTION_INFO_V1(complex_send);

Datum
complex_send(PG_FUNCTION_ARGS)
{
    Complex    *complex = (Complex *) PG_GETARG_POINTER(0);
    StringInfoData buf;

    pq_begintypsend(&buf);
    pq_sendfloat8(&buf, complex->x);
    pq_sendfloat8(&buf, complex->y);
    PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
}

  Once we have written the I/O functions and compiled them into a shared
  library, we can define the <TT
CLASS="TYPE"
>complex</TT
> type in SQL.
  First we declare it as a shell type:

CREATE TYPE complex;

  This serves as a placeholder that allows us to reference the type while
  defining its I/O functions.  Now we can define the I/O functions:

CREATE FUNCTION complex_in(cstring)
    RETURNS complex
    AS '<TT
CLASS="REPLACEABLE"
>filename</TT
>'
    LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION complex_out(complex)
    RETURNS cstring
    AS '<TT
CLASS="REPLACEABLE"
>filename</TT
>'
    LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION complex_recv(internal)
   RETURNS complex
   AS '<TT
CLASS="REPLACEABLE"
>filename</TT
>'
   LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION complex_send(complex)
   RETURNS bytea
   AS '<TT
CLASS="REPLACEABLE"
>filename</TT
>'
   LANGUAGE C IMMUTABLE STRICT;

  Finally, we can provide the full definition of the data type:

CREATE TYPE complex (
   internallength = 16,
   input = complex_in,
   output = complex_out,
   receive = complex_recv,
   send = complex_send,
   alignment = double
);

  When you define a new base type,
  PostgreSQL automatically provides support
  for arrays of that
  type.  The array type typically
  has the same name as the base type with the underscore character
  (<TT
CLASS="LITERAL"
>_</TT
>) prepended.

  Once the data type exists, we can declare additional functions to
  provide useful operations on the data type.  Operators can then be
  defined atop the functions, and if needed, operator classes can be
  created to support indexing of the data type.  These additional
  layers are discussed in following sections.

  If the values of your data type vary in size (in internal form), you should
  make the data type <ACRONYM
CLASS="ACRONYM"
>TOAST</ACRONYM
>-able (see Section 54.2). You should do this even if the data are always
  too small to be compressed or stored externally, because
  <ACRONYM
CLASS="ACRONYM"
>TOAST</ACRONYM
> can save space on small data too, by reducing header
  overhead.

  To do this, the internal representation must follow the standard layout for
  variable-length data: the first four bytes must be a <TT
CLASS="TYPE"
>char[4]</TT
>
  field which is never accessed directly (customarily named
  <TT
CLASS="STRUCTFIELD"
>vl_len_</TT
>). You
  must use SET_VARSIZE() to store the size of the datum
  in this field and VARSIZE() to retrieve it. The C
  functions operating on the data type must always be careful to unpack any
  toasted values they are handed, by using PG_DETOAST_DATUM.
  (This detail is customarily hidden by defining type-specific
  GETARG_DATATYPE_P macros.) Then, when running the
  <TT
CLASS="COMMAND"
>CREATE TYPE</TT
> command, specify the internal length as
  <TT
CLASS="LITERAL"
>variable</TT
> and select the appropriate storage option.

  If the alignment is unimportant (either just for a specific function or
  because the data type specifies byte alignment anyway) then it's possible
  to avoid some of the overhead of PG_DETOAST_DATUM. You can use
  PG_DETOAST_DATUM_PACKED instead (customarily hidden by
  defining a GETARG_DATATYPE_PP macro) and using the macros
  VARSIZE_ANY_EXHDR and VARDATA_ANY to access
  a potentially-packed datum.
  Again, the data returned by these macros is not aligned even if the data
  type definition specifies an alignment. If the alignment is important you
  must go through the regular PG_DETOAST_DATUM interface.

Note:    Older code frequently declares <TT
CLASS="STRUCTFIELD"
>vl_len_</TT
> as an
   <TT
CLASS="TYPE"
>int32</TT
> field instead of <TT
CLASS="TYPE"
>char[4]</TT
>.  This is OK as long as
   the struct definition has other fields that have at least <TT
CLASS="TYPE"
>int32</TT
>
   alignment.  But it is dangerous to use such a struct definition when
   working with a potentially unaligned datum; the compiler may take it as
   license to assume the datum actually is aligned, leading to core dumps on
   architectures that are strict about alignment.

  For further details see the description of the
  CREATE TYPE command.

Prev	Home	Next

User-Defined Aggregates	Up	User-Defined Operators


text:
cpp-algorithms
------------

![cpp-algorithms build status](https://api.travis-ci.org/SRombauts/cpp-algorithms.png "cpp-algorithms build status")

Experimenting with well known algorithms and data structures.

Copyright (c) 2013-2021 Sébastien Rombauts (sebastien.rombauts@gmail.com)

## Building & testing with CMake

### Get Google Test submodule

```bash
git submodule init
git submodule update
```

### Typical generic build (see also "build.bat" or "./build.sh")

```bash
mkdir build
cd build
cmake ..        # cmake .. -G "Visual Studio 10"    # for Visual Studio 2010
cmake --build . # make
ctest .         # make test
```

### Debug build for Unix Makefiles

```bash
mkdir Debug
cd Debug
cmake .. -DCMAKE_BUILD_TYPE=Debug   # -G "Unix Makefiles"
cmake --build . # make
ctest .         # make test
```

### Release build

```bash
mkdir Release
cd Release
cmake .. -DCMAKE_BUILD_TYPE=Release  # -G "Unix Makefiles"
cmake --build . # make
ctest .         # make test
```

### Continuous Integration

This project is continuously tested under Ubuntu Linux with the gcc and clang compilers
using the Travis CI community service with the above CMake building and testing procedure.

Detailed results can be seen online: https://travis-ci.org/SRombauts/cpp-algorithms


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.cmmn.test.event;

import static org.assertj.core.api.Assertions.assertThat;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;

import org.flowable.cmmn.api.event.FlowableCaseStartedEvent;
import org.flowable.cmmn.engine.test.CmmnDeployment;
import org.flowable.cmmn.engine.test.FlowableCmmnTestCase;
import org.flowable.common.engine.api.delegate.event.AbstractFlowableEventListener;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEventType;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * This test is using the event support on the CMMN runtime service level.
 *
 * @author Micha Kiener
 */
public class CmmnRuntimeEventListenerSupportTest extends FlowableCmmnTestCase {

    protected TestEventListener allEventListener;
    protected TestEventListener caseStartedEventListener;

    @Before
    public void setUp() {
        allEventListener = new TestEventListener();
        caseStartedEventListener = new TestEventListener();
        cmmnRuntimeService.addEventListener(allEventListener);
        cmmnRuntimeService.addEventListener(caseStartedEventListener, FlowableEngineEventType.CASE_STARTED);
    }

    @After
    public void tearDown() {
        if (allEventListener != null) {
            cmmnRuntimeService.removeEventListener(allEventListener);
            cmmnRuntimeService.removeEventListener(caseStartedEventListener);
        }
    }

    @Test
    @CmmnDeployment(resources = "org/flowable/cmmn/test/one-human-task-model.cmmn")
    public void testCaseInstanceStartEvents() {
        List<FlowableEvent> events = new ArrayList<>();
        allEventListener.eventConsumer = (flowableEvent) -> {
            // we need to check for a case started event, as this listener will receive all events
            if (flowableEvent instanceof FlowableCaseStartedEvent) {
                events.add(flowableEvent);
            }
        };
        caseStartedEventListener.eventConsumer = (flowableEvent) -> {
            // this listener will only receive case started events as it was registered using the event type
            events.add(flowableEvent);
        };

        cmmnRuntimeService.createCaseInstanceBuilder()
                .caseDefinitionKey("oneTaskCase")
                .businessKey("business key")
                .name("name")
                .start();

        assertThat(events)
            .extracting(FlowableEvent::getType)
            .containsExactly(FlowableEngineEventType.CASE_STARTED, FlowableEngineEventType.CASE_STARTED);
    }

    @Test
    public void testDispatchingEvent() {
        List<FlowableEvent> events = new ArrayList<>();
        allEventListener.eventConsumer = (flowableEvent) -> {
            events.add(flowableEvent);
        };
        caseStartedEventListener.eventConsumer = (flowableEvent) -> {
            // this listener must not catch the event, as it was registered using the case started event type
            events.add(flowableEvent);
        };

        cmmnRuntimeService.dispatchEvent(new TestEvent());

        assertThat(events).singleElement().isInstanceOf(TestEvent.class);
    }

    private static class TestEventListener extends AbstractFlowableEventListener {
        private Consumer<FlowableEvent> eventConsumer;

        @Override
        public void onEvent(FlowableEvent event) {
            if (eventConsumer != null) {
                eventConsumer.accept(event);
            }
        }

        @Override
        public boolean isFailOnException() {
            return true;
        }
    }

    private static class TestEvent implements FlowableEngineEvent {

        @Override
        public String getExecutionId() {
            return null;
        }
        @Override
        public String getProcessInstanceId() {
            return null;
        }
        @Override
        public String getProcessDefinitionId() {
            return null;
        }
        @Override
        public String getScopeType() {
            return null;
        }
        @Override
        public String getScopeId() {
            return null;
        }
        @Override
        public String getSubScopeId() {
            return null;
        }
        @Override
        public String getScopeDefinitionId() {
            return null;
        }
        @Override
        public FlowableEventType getType() {
            return () -> "TestEvent";
        }
    }

}