text:
/* $Id: EnumDisplayTag.java,v 1.1 2006/01/12 17:16:45 greese Exp $ */
/* Copyright (c) 2006 Valtira Corporation, All Rights Reserved */
package org.dasein.net.jsp.util;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import org.dasein.net.jsp.ELParser;

/**
 *

 *   Provides the result of {@link Enum#toString()} method for the specified enum.
 *

 *

 *   Last modified: $Date: 2006/01/12 17:16:45 $
 *

 * @version $Revision: 1.1 $
 * @author George Reese
 */
public class EnumDisplayTag extends TagSupport {
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 3257291344119346487L;

    private Enum   value = null;
    private String var       = null;

    public int doEndTag() throws JspException {
        try {
            pageContext.setAttribute(var, value.toString());
            return EVAL_PAGE;
        }
        finally {
            value = null;
            var = null;
        }
    }

    public void setEnum(String val) throws JspException {
        value = (Enum)(new ELParser(val)).getValue(pageContext);
    }

    public void setVar(String v) {
        var = v;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>NuGetHelper - FAKE - F# Make</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Steffen Forkmann, Mauricio Scheffer, Colin Bull">

    <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">

    <link type="text/css" rel="stylesheet" href="http://fsharp.github.io/FAKE/content/style.css" />

fsharp.org

github page

FAKE - F# Make

NuGetHelper

Contains helper functions and task which allow to inspect, create and publish NuGet packages.
There is also a tutorial about nuget package creating available.

Nested types and modules

Type	Description

            NuGetParams

Nuget parameter type

            NuSpecPackage

NuSpec metadata type

            NugetDependencies

            NugetFrameworkAssemblyReferences

            NugetFrameworkDependencies

            NugetFrameworkReferences

            NugetReferences

            NugetSymbolPackage

Functions and values

Function or value	Description

            feedUrl

            Signature: string

Default NuGet feed

            getDependencies packagesFile

            Signature: packagesFile:string -> (string * string) list

Returns the dependencies from specified packages.config file

            GetMetaDataFromPackageFile (...)

            Signature: packageFileName:string -> NuSpecPackage

Returns the NuGet meta data from the given package file name.

Parameters

packageFileName - The .nuspec package file name.

            getNuspecProperties nuspec

            Signature: nuspec:string -> NuSpecPackage

Parses nuspec metadata from a nuspec file.

Parameters

nuspec - The .nuspec file content.

            GetPackageVersion deploymentsDir package

            Signature: deploymentsDir:string -> package:string -> string

Gets the version no. for a given package in the deployments folder

            NuGet setParams nuspecOrProjectFile

            Signature: setParams:(NuGetParams -> NuGetParams) -> nuspecOrProjectFile:string -> unit

Creates a new NuGet package.

Parameters

setParams - Function used to manipulate the default NuGet parameters.

nuspecFile - The .nuspec file name.

            NuGetDefaults ()

            Signature: unit -> NuGetParams

NuGet default parameters

            NuGetPack setParams nuspecOrProjectFile

            Signature: setParams:(NuGetParams -> NuGetParams) -> nuspecOrProjectFile:string -> unit

Creates a new NuGet package based on the given .nuspec file.

Parameters

setParams - Function used to manipulate the default NuGet parameters.

nuspecOrProjectFile - The .nuspec or project file name.

            NuGetPackDirectly (...)

            Signature: setParams:(NuGetParams -> NuGetParams) -> nuspecOrProjectFile:string -> unit

Creates a new NuGet package based on the given .nuspec file.

Parameters

setParams - Function used to manipulate the default NuGet parameters.

nuspecOrProjectFile - The .nuspec or project file name.

            NuGetPublish setParams

            Signature: setParams:(NuGetParams -> NuGetParams) -> unit

Publishes a NuGet package to the nuget server.

Parameters

setParams - Function used to manipulate the default NuGet parameters.

            RequireExactly version

            Signature: version:string -> string

Creates a string which tells NuGet that you require exactly this package version.

FAKE - F# Make

Home page

Get FAKE - F# Make via NuGet

Source Code on GitHub

License (Apache 2)

Release Notes

Contributing to FAKE - F# Make

Who is using FAKE?

Ask a question

Tutorials

Getting started

Build script caching

NuGet package restore

Using FxCop in a build

Generating AssemblyInfo

Create NuGet packages

Running specific targets

Running FAKE from command line

Running targets in parallel

Using the F# compiler from FAKE

Creating custom tasks

Soft dependencies

TeamCity integration

Running canopy tests

Octopus Deploy

TypeScript support

Azure WebJobs support

Azure Cloud Services support

FluentMigrator support

Android publisher

File Watcher

WiX Setup Generation

Using Chocolatey

Using Slack

Using SonarQube

Fake.Deploy

Fake.IIS

Reference

API Reference

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Sabertooth\Tests\Iterators;

use PHPUnit\Framework\TestCase;
use Sabertooth\Iterators\CallbackMapIterator;

class CallbackMapIteratorTest extends TestCase
{
    private $values = [1,2,3,4,5];

    private $sut;

    public function setUp()
    {
        $callback = function ($value) {
            return $value + 1;
        };
        $this->sut = new CallbackMapIterator(new \ArrayIterator($this->values), $callback);
    }

    public function test()
    {
        foreach ($this->sut as $key => $val) {
            $this->assertEquals($this->values[$key]+1, $val);
        }
    }
}


text:
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_FRAME_GENERATOR_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_FRAME_GENERATOR_H_

#include <memory>
#include <utility>

#include "base/memory/scoped_refptr.h"
#include "base/synchronization/lock.h"
#include "cc/paint/paint_image.h"
#include "third_party/blink/renderer/platform/image-decoders/image_decoder.h"
#include "third_party/blink/renderer/platform/image-decoders/segment_reader.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/ref_counted.h"
#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h"
#include "third_party/blink/renderer/platform/wtf/threading_primitives.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkSize.h"
#include "third_party/skia/include/core/SkTypes.h"
#include "third_party/skia/include/core/SkYUVAInfo.h"
#include "third_party/skia/include/core/SkYUVAPixmaps.h"

namespace blink {

class ImageDecoder;

class PLATFORM_EXPORT ImageDecoderFactory {
  USING_FAST_MALLOC(ImageDecoderFactory);

 public:
  ImageDecoderFactory() = default;
  ImageDecoderFactory(const ImageDecoderFactory&) = delete;
  ImageDecoderFactory& operator=(const ImageDecoderFactory&) = delete;
  virtual ~ImageDecoderFactory() = default;
  virtual std::unique_ptr<ImageDecoder> Create() = 0;
};

class PLATFORM_EXPORT ImageFrameGenerator final
    : public ThreadSafeRefCounted<ImageFrameGenerator> {
 public:
  static scoped_refptr<ImageFrameGenerator> Create(
      const SkISize& full_size,
      bool is_multi_frame,
      const ColorBehavior& color_behavior,
      Vector<SkISize> supported_sizes) {
    return base::AdoptRef(new ImageFrameGenerator(
        full_size, is_multi_frame, color_behavior, std::move(supported_sizes)));
  }

  ImageFrameGenerator(const ImageFrameGenerator&) = delete;
  ImageFrameGenerator& operator=(const ImageFrameGenerator&) = delete;
  ~ImageFrameGenerator();

  // Decodes and scales the specified frame at |index|. The dimensions and
  // output format are given in SkImageInfo. Decoded pixels are written into
  // |pixels| with a stride of |rowBytes|. Returns true if decoding was
  // successful.
  bool DecodeAndScale(SegmentReader*,
                      bool all_data_received,
                      wtf_size_t index,
                      const SkImageInfo&,
                      void* pixels,
                      size_t row_bytes,
                      ImageDecoder::AlphaOption,
                      cc::PaintImage::GeneratorClientId);

  // Decodes YUV components directly into the provided memory planes. Must not
  // be called unless GetYUVAInfo has been called and returned true.
  // TODO(crbug.com/943519): In order to support incremental YUV decoding,
  // ImageDecoder needs something analogous to its ImageFrame cache to hold
  // partial planes, and the GPU code needs to handle them.
  bool DecodeToYUV(SegmentReader*,
                   wtf_size_t index,
                   SkColorType color_type,
                   const SkISize component_sizes[cc::kNumYUVPlanes],
                   void* planes[cc::kNumYUVPlanes],
                   const wtf_size_t row_bytes[cc::kNumYUVPlanes]);

  const SkISize& GetFullSize() const { return full_size_; }

  SkISize GetSupportedDecodeSize(const SkISize& requested_size) const;

  bool IsMultiFrame() const { return is_multi_frame_; }
  bool DecodeFailed() const {
    base::AutoLock lock(generator_lock_);
    return decode_failed_;
  }

  bool HasAlpha(wtf_size_t index);

  // TODO(crbug.com/943519): Do not call unless the SkROBuffer has all the data.
  bool GetYUVAInfo(
      SegmentReader*,
      const SkYUVAPixmapInfo::SupportedDataTypes& supported_data_types,
      SkYUVAPixmapInfo* info);

 private:
  class ClientAutoLock {
    STACK_ALLOCATED();

   public:
    ClientAutoLock(ImageFrameGenerator* generator,
                   cc::PaintImage::GeneratorClientId client_id);
    ~ClientAutoLock();

   private:
    ImageFrameGenerator* generator_;
    cc::PaintImage::GeneratorClientId client_id_;
    base::Lock* lock_;
  };

  ImageFrameGenerator(const SkISize& full_size,
                      bool is_multi_frame,
                      const ColorBehavior&,
                      Vector<SkISize> supported_sizes);

  friend class ImageFrameGeneratorTest;
  friend class DeferredImageDecoderTest;
  // For testing. |factory| will overwrite the default ImageDecoder creation
  // logic if |factory->create()| returns non-zero.
  void SetImageDecoderFactory(std::unique_ptr<ImageDecoderFactory> factory) {
    image_decoder_factory_ = std::move(factory);
  }

  void SetHasAlpha(wtf_size_t index, bool has_alpha);

  const SkISize full_size_;
  // Parameters used to create internal ImageDecoder objects.
  const ColorBehavior decoder_color_behavior_;
  const bool is_multi_frame_;
  const Vector<SkISize> supported_sizes_;

  mutable base::Lock generator_lock_;
  bool decode_failed_ GUARDED_BY(generator_lock_) = false;
  bool yuv_decoding_failed_ GUARDED_BY(generator_lock_) = false;
  wtf_size_t frame_count_ GUARDED_BY(generator_lock_) = 0u;
  Vector<bool> has_alpha_ GUARDED_BY(generator_lock_);

  struct ClientLock {
    int ref_count = 0;
    base::Lock lock;
  };

  // Note that it is necessary to use HashMap here to ensure that references
  // to entries in the map, stored in ClientAutoLock, remain valid across
  // insertions into the map.
  HashMap<cc::PaintImage::GeneratorClientId,
          std::unique_ptr<ClientLock>,
          WTF::IntHash<cc::PaintImage::GeneratorClientId>,
          WTF::UnsignedWithZeroKeyHashTraits<cc::PaintImage::GeneratorClientId>>
      lock_map_ GUARDED_BY(generator_lock_);

  std::unique_ptr<ImageDecoderFactory> image_decoder_factory_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_FRAME_GENERATOR_H_


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>DbAccess</title>
<meta name="date" content="2018-09-08">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.dev.yvgenijsharovskij.n5kanjiandkanjistoryquiz.database

Class DbAccess

java.lang.Object

com.dev.yvgenijsharovskij.n5kanjiandkanjistoryquiz.database.DbAccess

public class DbAccess
extends java.lang.Object

DbAccess provides access to the db, with some read and write methods. This class is constructed
 as a singleton, whereby a single instance of DbAccess is handled throughout the entire
 application life-cycle via the BaseActivity class, thus making it thread-safe and
 avoiding the need for synchronization.

Since:

1.0

Author:

Yvgenij Sharovskij

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
close()

Close the database.

boolean
doesColumnExistsInTable(java.lang.String db_table,
                       java.lang.String db_column)

Checks if a column exists in the table by querying a row with getColumnIndex().

boolean
doesTableExist(java.lang.String db_table)

Checks if a table exists in the db.

void
dropTableIfExist(java.lang.String db_table)

Drops a table if it exists in the db.

java.util.ArrayList<java.lang.String>
getDbQueryAsArrayList(java.lang.String db_column,
                     java.lang.String db_table)

Gets a raw SQL query from the database:
 get one table column into one array with the native order: ORDER BY _id.

java.lang.String[]
getDbQueryAsRandomArray(java.lang.String db_column,
                       java.lang.String db_table,
                       int db_limit)

java.lang.Object[]
getFourDbColumnsAsTwoRandomArrayLists(java.lang.String db_column1,
                                     java.lang.String db_column2,
                                     java.lang.String db_column3,
                                     java.lang.String db_column4,
                                     java.lang.String db_table,
                                     int db_limit)

Gets a raw SQL query from the database:
 get four table columns into two arrays,
 where the isIncluded column is '1' with the random order: ORDER BY RANDOM() LIMIT.

static DbAccess
getInstance(android.content.Context context)

If the instance already exists, then getInstance(Context) simply returns the instance.

java.lang.Object[]
getTwoDbColumnsAsOneArrayList(java.lang.String db_column1,
                             java.lang.String db_column2,
                             java.lang.String db_table)

Gets a raw SQL query from the database:
 get two table columns into one array with the native order: ORDER BY _id.

java.lang.Object[]
getTwoDbColumnsAsOneRandomArray(java.lang.String db_column1,
                               java.lang.String db_column2,
                               java.lang.String db_table,
                               int db_limit)

void
open()

Opens the database.

void
updateKanji(java.util.LinkedList<Kanji> kanjiList,
           Kanji kanji)

Updates the given Kanji in the SQL datebase using execSQL(),
 specifically the isIncluded column in the QNA table.

void
updateKanjiStory(java.util.List<Kanji> kanjiList,
                Kanji kanji,
                java.lang.String updateValueString)

Updates the given Kanji in the SQL datebase using execSQL(),
 specifically the kanjiStory column in the QNA table.

void
updateRadicalKeyList(java.util.List<Kanji> kanjiList,
                    Kanji kanji,
                    java.lang.String updateValueString)

Updates the given Kanji in the SQL datebase using execSQL(),
 specifically the radicalKeySet column in the QNA table.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getInstance

public static DbAccess getInstance(android.content.Context context)

If the instance already exists, then getInstance(Context) simply returns the instance. If the instance
 does not exist yet, then getInstance(Context) will call the constructor to create it.

 Uses lazy initialization, whereby the instance is created when the static method is first invoked.

Parameters:

context - Context

Returns:

instance of DbAccess

open

public void open()
          throws android.database.SQLException

Opens the database.

Throws:

android.database.SQLException - throws a default SQLException

close

public void close()

Close the database.

getDbQueryAsArrayList

public java.util.ArrayList<java.lang.String> getDbQueryAsArrayList(java.lang.String db_column,
                                                                   java.lang.String db_table)

Gets a raw SQL query from the database:
 get one table column into one array with the native order: ORDER BY _id.

Parameters:

db_column - the db table column name

db_table - the db table name

Returns:

ArrayList<String> of the selected rawQuery

getDbQueryAsRandomArray

public java.lang.String[] getDbQueryAsRandomArray(java.lang.String db_column,
                                                  java.lang.String db_table,
                                                  int db_limit)

getTwoDbColumnsAsOneArrayList

public java.lang.Object[] getTwoDbColumnsAsOneArrayList(java.lang.String db_column1,
                                                        java.lang.String db_column2,
                                                        java.lang.String db_table)

Gets a raw SQL query from the database:
 get two table columns into one array with the native order: ORDER BY _id.

Parameters:

db_column1 - the db table column name

db_column2 - the db table column name

db_table - the db table name

Returns:

ArrayList<String> of the selected rawQuery

getTwoDbColumnsAsOneRandomArray

public java.lang.Object[] getTwoDbColumnsAsOneRandomArray(java.lang.String db_column1,
                                                          java.lang.String db_column2,
                                                          java.lang.String db_table,
                                                          int db_limit)

getFourDbColumnsAsTwoRandomArrayLists

public java.lang.Object[] getFourDbColumnsAsTwoRandomArrayLists(java.lang.String db_column1,
                                                                java.lang.String db_column2,
                                                                java.lang.String db_column3,
                                                                java.lang.String db_column4,
                                                                java.lang.String db_table,
                                                                int db_limit)

Gets a raw SQL query from the database:
 get four table columns into two arrays,
 where the isIncluded column is '1' with the random order: ORDER BY RANDOM() LIMIT.

 The number of retrieved db columns varies between 2 and 4, depending on the QNA type selection,
 c.f. QNAManager.setDbDataToSettings().

 The isIncluded table column is set to '1' by default, which can be changed by the user in
 the KanjiListFragment.

Parameters:

db_column1 - the db table column name

db_column2 - the db table column name

db_column3 - the db table column name

db_column4 - the db table column name

db_table - the db table name

db_limit - the db LIMIT

Returns:

ArrayList<String> of the selected rawQuery

doesColumnExistsInTable

public boolean doesColumnExistsInTable(java.lang.String db_table,
                                       java.lang.String db_column)

Checks if a column exists in the table by querying a row with getColumnIndex().

Parameters:

db_table - the db table name

db_column - the db table column name

Returns:

true, if the column exists in the table

doesTableExist

public boolean doesTableExist(java.lang.String db_table)

Checks if a table exists in the db.

Parameters:

db_table - the db table name

Returns:

Boolean: true, if the column exists in the table

dropTableIfExist

public void dropTableIfExist(java.lang.String db_table)

Drops a table if it exists in the db.

Parameters:

db_table - the db table name

updateKanji

public void updateKanji(java.util.LinkedList<Kanji> kanjiList,
                        Kanji kanji)

Updates the given Kanji in the SQL datebase using execSQL(),
 specifically the isIncluded column in the QNA table.

Parameters:

kanjiList - List<Kanji> of Kanji

kanji - Kanji object to be updated

updateRadicalKeyList

public void updateRadicalKeyList(java.util.List<Kanji> kanjiList,
                                 Kanji kanji,
                                 java.lang.String updateValueString)

Updates the given Kanji in the SQL datebase using execSQL(),
 specifically the radicalKeySet column in the QNA table.

Parameters:

kanjiList - List<Kanji> of Kanji

kanji - Kanji object to be updated

updateValueString - String value to update

updateKanjiStory

public void updateKanjiStory(java.util.List<Kanji> kanjiList,
                             Kanji kanji,
                             java.lang.String updateValueString)

Updates the given Kanji in the SQL datebase using execSQL(),
 specifically the kanjiStory column in the QNA table.

Parameters:

kanjiList - List<Kanji> of Kanji

kanji - Kanji object to be updated

updateValueString - String value to update

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Azure.Core;

namespace Azure.Analytics.Synapse.Artifacts.Models
{
    [JsonConverter(typeof(SparkJobDefinitionConverter))]
    public partial class SparkJobDefinition : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Optional.IsDefined(Description))
            {
                writer.WritePropertyName("description");
                writer.WriteStringValue(Description);
            }
            writer.WritePropertyName("targetBigDataPool");
            writer.WriteObjectValue(TargetBigDataPool);
            if (Optional.IsDefined(RequiredSparkVersion))
            {
                writer.WritePropertyName("requiredSparkVersion");
                writer.WriteStringValue(RequiredSparkVersion);
            }
            if (Optional.IsDefined(Language))
            {
                writer.WritePropertyName("language");
                writer.WriteStringValue(Language);
            }
            writer.WritePropertyName("jobProperties");
            writer.WriteObjectValue(JobProperties);
            foreach (var item in AdditionalProperties)
            {
                writer.WritePropertyName(item.Key);
                writer.WriteObjectValue(item.Value);
            }
            writer.WriteEndObject();
        }

        internal static SparkJobDefinition DeserializeSparkJobDefinition(JsonElement element)
        {
            Optional<string> description = default;
            BigDataPoolReference targetBigDataPool = default;
            Optional<string> requiredSparkVersion = default;
            Optional<string> language = default;
            SparkJobProperties jobProperties = default;
            IDictionary<string, object> additionalProperties = default;
            Dictionary<string, object> additionalPropertiesDictionary = new Dictionary<string, object>();
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("targetBigDataPool"))
                {
                    targetBigDataPool = BigDataPoolReference.DeserializeBigDataPoolReference(property.Value);
                    continue;
                }
                if (property.NameEquals("requiredSparkVersion"))
                {
                    requiredSparkVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("language"))
                {
                    language = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("jobProperties"))
                {
                    jobProperties = SparkJobProperties.DeserializeSparkJobProperties(property.Value);
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return new SparkJobDefinition(description.Value, targetBigDataPool, requiredSparkVersion.Value, language.Value, jobProperties, additionalProperties);
        }

        internal partial class SparkJobDefinitionConverter : JsonConverter<SparkJobDefinition>
        {
            public override void Write(Utf8JsonWriter writer, SparkJobDefinition model, JsonSerializerOptions options)
            {
                writer.WriteObjectValue(model);
            }
            public override SparkJobDefinition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
            {
                using var document = JsonDocument.ParseValue(ref reader);
                return DeserializeSparkJobDefinition(document.RootElement);
            }
        }
    }
}


text:
#include "Phoenix.h"

using namespace phoenix;

class VectorTest
{
    public:

        VectorTest() :
			system()
        {
            system.setResizeBehavior(RZB_EXPAND);
        }

        virtual ~VectorTest()
        {
        }

        int run()
        {

            //! Vector of Vectors.
            std::vector<Vector2d> vectorlist;

            //! Add some vectors backwards.
            for( int i = 360; i>0; i-=45 )
            {
                vectorlist.push_back( Vector2d( 100, 0 ).rotate( DegreesToRadians( (float) i ) ) );
            }

            //! Sort them.
            std::sort( vectorlist.begin(), vectorlist.end(), &Vector2d::AngleSort );

            //! Now just draw some stuff.
            while( system.run() )
            {

                //! Events

                if(EventReceiver::Instance()->getMouseButtonPressed(PHK_MB_LEFT) )
                {
                    vectorlist.push_back(EventReceiver::Instance()->getMousePosition() - Vector2d(320,240) );
                    std::sort( vectorlist.begin(), vectorlist.end(), &Vector2d::AngleSort );
                }

                //! Draw stuff
                Vector2d MouseVector = EventReceiver::Instance()->getMousePosition() -  Vector2d(320,240);

                system.drawRay( Vector2d(320,240), MouseVector );

                //! Draw the vector of vectors
                for( unsigned int i = 0; i < vectorlist.size(); ++i )
                {
					system.drawRay( Vector2d(320,240), vectorlist[i], Color(255,255,255).interpolate( Color(255,127,127), (float)i*4 ), Color(127,255,127).interpolate( Color(127,127,255), (float)i*4 ) );
                    char tbuffer[32];
                    sprintf(tbuffer,"%i",i);
                    system.drawText( tbuffer, Vector2d(320,240)+vectorlist[i] * 1.1f - Vector2d(8,8), Color(127,255,127).interpolate( Color(127,127,255), (float)i*4 ) );
                }

                //! Draw some info.
                system.drawText( "Vector Test", Vector2d(16,16) );

                system.getDebugConsole()<<"\nNumber of Vectors: "<<vectorlist.size();
                system.getDebugConsole()<<"\nFrames Per Second: "<<system.getFPS();

            }

            return 0;

        }// Run

    protected:
        RenderSystem system;
    private:
};


text:
/*
 * DGSStreamParser.cpp
 *
 *  Created on: 23.12.2013
 *      Author: cls
 */

#include "DGSStreamParser.h"
#include "../auxiliary/StringTools.h"
#include "../auxiliary/Log.h"

namespace NetworKit {

DGSStreamParser::DGSStreamParser(std::string path, bool mapped, node baseIndex) : dgsFile(path), mapped(mapped), baseIndex(baseIndex), nextNode(0) {

}

std::vector<GraphEvent> NetworKit::DGSStreamParser::getStream() {
	if (! dgsFile.is_open()) {
		throw std::runtime_error("DGS input file could not be opened.");
	}

	std::vector<GraphEvent> stream; // stream containing the events

	std::string line;
	count lc = 0; // line count

	std::string cookie = "DGS004";
	std::getline(dgsFile, line); // get DGS version
	lc++;
	if (line.compare(0, cookie.size(), cookie)) {
		ERROR("found " , line , " instead of " , cookie , " in first line");
		throw std::runtime_error("expected cookie in first line");
	}

	std::getline(dgsFile, line);
	lc++;
	INFO("DGS stream description: ", line);

	if (mapped) {
		// mapped format

		/**
		 * Maps key string to consecutive, 0-based node id.
		 */
		auto map = [&](std::string key) {
			auto iter = this->key2id.find(key);
			if (iter == key2id.end()) {
				key2id[key] = nextNode;
				nextNode++;
				return key2id[key];
			} else {
				return iter->second;
			}
		};

		while (std::getline(dgsFile, line)) {
			// TRACE(line);
			lc++;
			std::vector<std::string> split = Aux::StringTools::split(line);
			// TRACE("split line: ", split);
			std::string tag = split[0];

			// TODO: remove TRACE

			// parse commands
			if (tag.compare("st") == 0) { // clock
				stream.push_back(GraphEvent(GraphEvent::TIME_STEP));
			} else if (tag.compare("an") == 0) { // add node
				node u = map(split[1]);
				auto ev = GraphEvent(GraphEvent::NODE_ADDITION, u);
				// TRACE(ev.toString());
				stream.push_back(ev);
			} else if (tag.compare("ae") == 0) { // add edge
				node u = map(split[2]);
				node v = map(split[3]);
				edgeweight w = 1.0;
				if (split.size() >= 5) {
					w = std::stod(Aux::StringTools::split(split[4], '=')[1]); // weight=<w>
				}
				auto ev = GraphEvent(GraphEvent::EDGE_ADDITION, u, v, w);
				// TRACE(ev.toString());
				stream.push_back(ev);
			} else if (tag.compare("ce") == 0) { // update edge. Only the "weight" attribute is supported so far
				std::vector<std::string> uvs = Aux::StringTools::split(split[1], '-');
				node u = map(uvs[0]);
				node v = map(uvs[1]);
				edgeweight w = std::stod(Aux::StringTools::split(split[2], '=')[1]); // weight=<w>
				auto ev = GraphEvent(GraphEvent::EDGE_WEIGHT_UPDATE, u, v, w);
				// TRACE(ev.toString());
				stream.push_back(ev);
			} else if (tag.compare("ie") == 0) { // update edge. Only the "weight" attribute is supported so far
				std::vector<std::string> uvs = Aux::StringTools::split(split[1], '-');
				node u = map(uvs[0]);
				node v = map(uvs[1]);
				edgeweight w = std::stod(Aux::StringTools::split(split[2], '=')[1]); // weight=<w>
				auto ev = GraphEvent(GraphEvent::EDGE_WEIGHT_INCREMENT, u, v, w);
				// TRACE(ev.toString());
				stream.push_back(ev);
			} else if (tag.compare("de") == 0) {
				std::vector<std::string> uvs = Aux::StringTools::split(split[1], '-');
				node u = map(uvs[0]);
				node v = map(uvs[1]);
				auto ev = GraphEvent(GraphEvent::EDGE_REMOVAL, u, v);
				// TRACE(ev.toString());
				stream.push_back(ev);
			} else if (tag.compare("dn") == 0) {
				node u = map(split[1]);
				auto ev = GraphEvent(GraphEvent::NODE_REMOVAL, u);
				// TRACE(ev.toString());
				stream.push_back(ev);
			} else if (tag.compare("rn") == 0) {
				node u = map(split[1]);
				auto ev = GraphEvent(GraphEvent::NODE_RESTORATION, u);
				// TRACE(ev.toString());
				stream.push_back(ev);
			}

				else {
				ERROR("malformed line (" , lc , ") : " , line);
				throw std::runtime_error("malformed line in .DGS file");
			}
		}

	} else {
		// direct format
		auto offset = [&](node u) {
			return (u - baseIndex);
		};

		while (std::getline(dgsFile, line)) {
			// TRACE(line);
			lc++;
			std::vector<std::string> split = Aux::StringTools::split(line);
			std::string tag = split[0];

			// parse commands
			if (tag.compare("st") == 0) { // clock
				stream.push_back(GraphEvent(GraphEvent::TIME_STEP));
				// TRACE("read: st ");
			} else if (tag.compare("an") == 0) { // add node
				node u = offset(std::stoul(split[1]));
				stream.push_back(GraphEvent(GraphEvent::NODE_ADDITION, u));
				// TRACE("read: an ", u);
			} else if (tag.compare("ae") == 0) { // add edge
				node u = offset(std::stoul(split[2]));
				node v = offset(std::stoul(split[3]));
				edgeweight w = std::stod(Aux::StringTools::split(split[4], '=')[1]); // weight=<w>
				stream.push_back(GraphEvent(GraphEvent::EDGE_ADDITION, u, v, w));
				// TRACE("read: ae ", u, ",", v, ",", w);
			} else if (tag.compare("ce") == 0) { // update edge. Only the "weight" attribute is supported so far
				std::vector<std::string> uvs = Aux::StringTools::split(split[1], '-');
				node u = offset(std::stoul(uvs[0]));
				node v = offset(std::stoul(uvs[1]));
				edgeweight w = std::stod(Aux::StringTools::split(split[2], '=')[1]); // weight=<w>
				stream.push_back(GraphEvent(GraphEvent::EDGE_WEIGHT_UPDATE, u, v, w));
				// TRACE("read: ce ", u, ",", v, ",", w);
			} else if (tag.compare("ie") == 0) { // update edge. Only the "weight" attribute is supported so far
				std::vector<std::string> uvs = Aux::StringTools::split(split[1], '-');
				node u = offset(std::stoul(uvs[0]));
				node v = offset(std::stoul(uvs[1]));
				edgeweight w = std::stod(Aux::StringTools::split(split[2], '=')[1]); // weight=<w>
				stream.push_back(GraphEvent(GraphEvent::EDGE_WEIGHT_INCREMENT, u, v, w));
				// TRACE("read: ce ", u, ",", v, ",", w);
			} else if (tag.compare("de") == 0) {
				std::vector<std::string> uvs = Aux::StringTools::split(split[1], '-');
				node u = offset(std::stoul(uvs[0]));
				node v = offset(std::stoul(uvs[1]));
				stream.push_back(GraphEvent(GraphEvent::EDGE_REMOVAL, u, v));
				// TRACE("read: de ", u, ",", v);
			} else if (tag.compare("dn") == 0) {
				node u = offset(std::stoul(split[1]));
				stream.push_back(GraphEvent(GraphEvent::NODE_REMOVAL, u));
				// TRACE("read: dn ", u);
			} else if (tag.compare("rn") == 0) {
				node u = offset(std::stoul(split[1]));
				stream.push_back(GraphEvent(GraphEvent::NODE_RESTORATION, u));
				TRACE("read: rn ", u);
			}
			  else {
				ERROR("malformed line (" , lc , ") : " , line);
				throw std::runtime_error("malformed line in .DGS file");
			}
		}

	}

	return stream;
}

} /* namespace NetworKit */


text:
package main

import (
	"bytes"
	"fmt"
	"log"
	"net/smtp"
	"strconv"
	"text/template"
)

const (
	emailTemplate = `From: {{.From}}
To: {{.To}}
Subject: {{.Subject}}

{{.Secret}}
`
)

// Holds the user configured Gmail configuration.
type GmailConf struct {
	Server   string `json:"gmail_server_address"`
	Port     int    `json:"gmail_server_port"`
	Address  string `json:"gmail_address"`
	Username string `json:"gmail_user"`
	Password string `json:"gmail_password"`
}

// Send sends the message that has been setup.
func (m *Message) Send(c *Configuration) {
	emailUser := &GmailConf{c.Username, c.Password, c.Server, c.Port}
	auth := smtp.PlainAuth("", emailUser.Username, emailUser.Password, emailUser.EmailServer)

	var err error
	var doc bytes.Buffer

	err = smtp.SendMail(fmt.Sprintf("%s:%s", emailUser.EmailServer, strconv.Itoa(emailUser.Port)),
		auth,
		emailUser.Username,
		[]string{"brian.downs@gmail.com"},
		doc.Bytes())
	if err != nil {
		log.Fatalln(err)
	}

	t, err := template.New("emailTemplate").Parse(emailTemplate)
	if err != nil {
		log.Fatalln("error trying to parse mail template")
	}

	err = t.Execute(&doc, m)
	if err != nil {
		log.Fatalln(err)
	}
}


text:
local icons_mt = {}
icons_mt.__tostring = function(i)
   local result = "Icon Set\n\n"

   -- TODO: what if there are no icons in the dock? Is the first page still
   --       at index 2?

   result = result .. "Dock " .. tostring(i[1])

   for idx = 2,#i do
      result = result .. "Page " .. idx - 1 .. " " .. tostring(i[idx])
   end

   result = result .. "\n"
   return result
end

local icons = {}
icons.__meta = icons_mt

icons.flatten = function(tab)
   local insert = table.insert
   local result = {}

   local function flatten(tab)
      for _,v in pairs(tab) do
         local vt = type(v)
         if vt == 'icon' then
            insert(result, v)
         elseif vt == 'page' then
            flatten(v)
         elseif vt == 'folder' then
            flatten(v.icons)
         end
      end
   end

   flatten(tab)
   return result
end

icons.dock = function(tab)
   return tab[1]
end

icons.find_all = function(tab, pat)
   local strfind = string.find
   local insert = table.insert
   local result = {}
   local all_icons = tab:flatten()

   for _,v in pairs(all_icons) do
      if strfind(v.name or '', pat) then
         insert(result, v)
      end
   end

   return result
end

icons.find = function(tab, pat)
   local strfind = string.find
   local all_icons = tab:flatten()

   for _,v in pairs(all_icons) do
      if strfind(v.name or '', pat) then
         return v
      end
   end

   return nil
end

icons.find_id = function(tab, pat)
   local strfind = string.find
   local all_icons = tab:flatten()

   for _,v in pairs(all_icons) do
      if strfind(v.id or '', pat) then
         return v
      end
   end

   return nil
end

icons.visit = function(tab, visitor)
   assert(type(visitor) == 'function', 'visitor must be a function')
   for _,v in pairs(tab) do
      local vt = type(v)
      if vt == 'folder' then
         icons.visit(v.icons, visitor)
      elseif vt == 'page' then
         icons.visit(v, visitor)
      elseif vt == 'icon' then
         visitor(v)
      end
   end
end

local dockMax = 4
local pageMax = 9
-- TODO: handle fillPercent
-- TODO: pass in page size as a parameter with a default (x = x or default)
icons.reshape = function(tab, fillPercent)
   local result = {}
   local page = {}
   local count = 1
   local insert = table.insert

   for i,v in ipairs(tab) do
      if i < dockMax then
         insert(page, v)
      elseif i == dockMax then
         insert(page, v)
         insert(result, page)
         page = {}
         count = 1
      elseif count % pageMax ~= 0 then
         insert(page, v)
         count = count + 1
      else
         insert(page, v)
         insert(result, page)
         page = {}
         count = 1
      end
   end

   return result
end

return icons


text:
package org.eclipse.jdt.internal.junit.wizards;

import java.text.Collator;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;

import org.eclipse.core.runtime.CoreException;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;

import org.eclipse.jdt.internal.junit.launcher.JUnit3TestFinder;
import org.eclipse.jdt.internal.junit.launcher.JUnit4TestFinder;
import org.eclipse.jdt.internal.junit.ui.JUnitPlugin;

public class SuiteClassesContentProvider implements IStructuredContentProvider {

	private boolean fIncludeJunit4Tests;

	public SuiteClassesContentProvider() {
		this(false);
	}

	public SuiteClassesContentProvider(boolean includeJunit4Tests) {
		this.fIncludeJunit4Tests = includeJunit4Tests;
	}

	public Object[] getElements(Object parent) {
		if (! (parent instanceof IPackageFragment))
			return new Object[0];
		IPackageFragment pack= (IPackageFragment) parent;
		if (! pack.exists())
			return new Object[0];
		Set<IType> tests= getTests(pack);
		IType[] result= tests.toArray(new IType[tests.size()]);
		Arrays.sort(result, new Comparator<IType>() {
			private Collator fCollator= Collator.getInstance();
			public int compare(IType t1, IType t2) {
				return fCollator.compare(t1.getElementName(), t2.getElementName());
			}
		});
		return result;
	}

	public Set<IType> getTests(IPackageFragment pack) {
		try {
			HashSet<IType> result= new HashSet<IType>();

			if (isIncludeJunit4Tests()) {
				new JUnit4TestFinder().findTestsInContainer(pack, result, null);
			} else {
				new JUnit3TestFinder().findTestsInContainer(pack, result, null);
			}

			return result;
		} catch (CoreException e) {
			JUnitPlugin.log(e);
			return Collections.emptySet();
		}
	}

	public void dispose() {
	}

	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
	}

	public void setIncludeJunit4Tests(boolean includeJunit4Tests) {
		fIncludeJunit4Tests= includeJunit4Tests;
	}

	public boolean isIncludeJunit4Tests() {
		return fIncludeJunit4Tests;
	}
}


text:
"use strict";

const defaultRulesLoader = require('./redirect-rules-loader.js');
const Cache = require('./cache.js');
const applyRules = require('./apply-rules.js');

const DEFAULT_RULES_CACHE_TTL = 60 * 1000;

module.exports = class RedirectHandler {
    constructor({
                    defaultHost = null,
                    redirectRulesLoader = defaultRulesLoader,
                    cacheTTL = DEFAULT_RULES_CACHE_TTL,
                }) {
        this.defaultHost = defaultHost;
        this.redirectRulesLoader = redirectRulesLoader;

        this.cache = new Cache({ttl: cacheTTL});
    }

    async handleRequest(request) {
        const uri = request.uri;

        console.log('incoming request to', uri);

        const host = resolveHostForRequest(request, this.defaultHost, true);

        const rules = await this.cache.get(() => this.redirectRulesLoader({host}));

        const pathParts = uri.split('/').filter(it => it.length > 0);

        const redirect = applyRules(rules, pathParts);

        if (redirect) {
            console.log('Got a redirect from ', redirect.from, 'to', redirect.to);
            const file = uri.replace(redirect.from, '');
            const destination = uri.replace(redirect.from, redirect.to);
            return {
                status: String(redirect.status),
                headers: getHeadersForRedirect(file, destination, redirect),
            }
        } else {
            console.log('No redirect');
            return request;
        }
    }

};

function getHeadersForRedirect(file, destination, redirect) {
    const headers = {
        Location: destination,
        'Cache-Control': redirect.cache,
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Methods': 'GET, HEAD',
        'Access-Control-Max-Age': '86400',
        'Timing-Allow-Origin': '*'
    };

    if (redirect.preload) {
        console.log('Computing preload headers for', file);
        const preload = buildPreload(file, redirect.preload);
        if (preload) {
            console.log('Sending Link header', preload);
            headers.Link = preload;
        }
    }

    return toAmzHeaders(headers);
}

function buildPreload(file, preload) {
    return preload[file];
}

function toAmzHeaders(headers) {
    return Object.entries(headers)
        .reduce((agg, [key, value]) => {
            agg[key.toLowerCase()] = [{
                key, value
            }];
            return agg;
        }, {});
}

const S3_WEBSITE_HOST = 's3-website-us-east-1.amazonaws.com';
const S3_SECURE_HOST = 's3.dualstack.us-east-1.amazonaws.com';

function resolveHostForRequest(request, defaultHost, canUseCloudfront) {
    if (canUseCloudfront && defaultHost) {
        return defaultHost;
    }
    const host = request.headers.host[0].value;
    if (host.includes(S3_WEBSITE_HOST)) {
        return host.replace(S3_WEBSITE_HOST, S3_SECURE_HOST);
    }
    return host;
}


text:
package com.traits.struts.main;

import com.opensymphony.xwork2.ActionSupport;
import com.traits.struts.authority.User;
import org.apache.struts2.ServletActionContext;
import org.omg.CORBA.Object;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by yefeng on 16/7/30.
 */
public class LoginAction extends ActionSupport {
    HttpServletRequest request = ServletActionContext.getRequest();

    public String target = "";
    public String email = "";
    public String password = "";

    public String login() {

        return "login";
    }

    public String check() {

        if (request.getSession().getAttribute("user") != null) {
            if (target.equals("")) {
                return SUCCESS;
            } else {
                return "success_target";
            }
        } else {
            User user = new User();
            user.setId(1);
            user.setUserName("test");
            user.setPwd("test");
            request.getSession().setAttribute("user", user);
            if (target.equals("")) {
                return SUCCESS;
            } else {
                return "success_target";
            }
        }

    }

}


text:
SELECT rowid, offsets(email) FROM email
WHERE body MATCH '"child product"'


text:
/*	$OpenBSD: autrivar.h,v 1.2 2001/11/26 18:10:52 mickey Exp $	*/

/*
 * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _DEV_PCI_AUTRIVAR_H_
#define	_DEV_PCI_AUTRIVAR_H_

/*
 * softc
 */
struct autri_dma {
	bus_dmamap_t		map;
	caddr_t			addr;		/* VA */
	bus_dma_segment_t	segs[1];
	int			nsegs;
	size_t			size;
	struct autri_dma	*next;
};

struct autri_codec_softc {
	struct device		sc_dev;		/* base device */
	struct autri_softc	*sc;
	int			id;
	int			status_data;
	int			status_addr;
	struct ac97_host_if	host_if;
	struct ac97_codec_if	*codec_if;
};

struct autri_chstatus {
	void		(*intr)(void *); /* rint/pint */
	void		*intr_arg;	/* arg for intr */
	u_int		offset;		/* filled up to here */
	u_int		blksize;
	u_int		factor;		/* byte per sample */
	u_int		length;		/* ring buffer length */
	struct autri_dma *dma;		/* DMA handle for ring buf */

	int		ch;
	int		ch_intr;
#if 0
	u_int		csoint;
	u_int		count;
#endif
};

struct autri_softc {
	struct device		sc_dev;		/* base device */
	pci_chipset_tag_t	sc_pc;
	pcitag_t		sc_pt;
	pcireg_t		sc_devid;
	void			*sc_ih;		/* interrupt vectoring */
	bus_space_tag_t		memt;
	bus_space_handle_t	memh;
	bus_space_tag_t		iot;
	bus_space_handle_t	ioh;
	bus_dma_tag_t		sc_dmatag;	/* DMA tag */
	u_int			sc_flags;

	struct autri_codec_softc sc_codec;
	struct autri_dma	*sc_dmas;	/* List of DMA handles */

	u_int32_t		sc_class;
	int			sc_revision;

	int			sc_old_power;

	/*
	 * Play/record status
	 */
	struct autri_chstatus	sc_play, sc_rec;

#if NMIDI > 0
	void	(*sc_iintr)(void *, int);	/* midi input ready handler */
	void	(*sc_ointr)(void *);		/* midi output ready handler */
	void	*sc_arg;
#endif

};

#endif /* _DEV_PCI_AUTRIVAR_H_ */


text:
awesome-ios-ui [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)
==============

A curated list of awesome iOS UI/UX libraries.
Inspired by [wasabeef]'s excellent [Android Version].

### Contributing

Found a UI/UX library that you think is _awesome_?? Want to share it with the world? Add your repo's information to my [awesome-creator], where I keep the library metadata!

### Index
[[LINKS]]

[[CONTENT]]

[wasabeef]: https://github.com/wasabeef
[Android Version]: https://github.com/wasabeef/awesome-android-ui
[awesome-creator]: https://github.com/cjwirth/awesome-creator
[[LICENSES]]


text:
import java.io.*;
import java.util.*;

class FindTheHighestAltitude
{
    public static void main(String[] args)
    {
        System.out.println("=== 1732. Find the Highest Altitude ===");
        Solution solution = new Solution();
        int[][] input = {{-5,1,5,0,-7}, {-4,-3,-2,-1,4,3,2}};
        for (int[] gain: input) {
            System.out.println("gain = "+Arrays.toString(gain));
            System.out.println("largest altitude = "+solution.largestAltitude(gain));
        }
    }
}

class Solution
{
    public int largestAltitude(int[] gain) {
        int ret = 0;
        int max = 0;

        for (int i : gain) {
            ret += i;
            max = (ret > max)?ret:max;
        }

        return max;
    }
}


text:
var ycommSSEBase = function (workgroup, user, dataLocation, pollTimeout, preferredGateway, dbgSSEDiv) {
    var that = {

      /* pollTimeout must be between 1 and 60 seconds */
      pollTimeout: Math.min(60000, Math.max(typeof pollTimeout=='number'?pollTimeout:1000, 1000)),
      prefGateway: (preferredGateway || 'SSE').toUpperCase(),
      dbgDiv: y$(dbgSSEDiv),
      debugEnabled: false,

      debug: function() {
        var d=(new Date()),
            line,
            dbgClass,
            isError=false,
            isWarning=false;
        if (that.debugEnabled) {
          line=pad(d.getHours(),2)+':'+pad(d.getMinutes(),2)+':'+pad(d.getSeconds(),2)+' SSE: ';

          for (var i=0; i < arguments.length; i++) {
            line+=arguments[i].trim()+" ";
            if (arguments[i].toUpperCase().indexOf('ERROR')>=0)
              isError=true;
            if (arguments[i].toUpperCase().indexOf('STATUS')>=0)
              isWarning=true;
            if (arguments[i].toUpperCase().indexOf('WARN')>=0)
              isWarning=true;
          }
          if (isError) {
            console.error(line);
            dbgClass='label-danger';
          } else if (isWarning) {
            console.warn(line);
            dbgClass='label-warning';
          } else {
            console.log(line);
            dbgClass='';
          }
          if ('undefined' != typeof that.dbgDiv) {
            that.dbgDiv.innerHTML+="
{1}
".format(dbgClass, line);
          }
        }
      },

      getLocation: function() {
        return (typeof document=='object' && document.location && document.location.href)?document.location.href:'';
      },

      getFolder: function(location) {
        var b=location.lastIndexOf('/');
        return location.substr(0,b+1);
      },

      rpc: function(a, params) {
        params = params || {};
        if (typeof that.sse_session_id!="undefined")
          params.sse_session_id = that.sse_session_id;

        var p = new Promise(
          function(resolve, reject) {
            that.debug("OUT: "+a);
            that.rpcMethod(
              "_sse", a, params,
              function(status, error, data) {
                if (status==200) {
                  resolve(data);
                } else {
                  reject(status);
                }
              },
              false
            );
          }
        );
        return p;
      },

      poll: function () {
        if (that.pollEnabled) {
          that.rpc("peekMessage").then( function(data) {
              if (data) {
                that.debug("IN: data: "+JSON.stringify(data));
                var eventName;
                for(var i=0; i<data.length; i++) {
                  if (!that.dispatchEvent(data[i].event, { data: data[i].data } )) {
                    that.message({
                      'data' : data[i].data
                    });
                  }
                }
              }
              setTimeout(that.poll, that.pollTimeout);
            });
        }
      },

      userAlive: function () {
        clearTimeout(that._userAliveScheduler);

        var _userAlive = function(data) {
          var toClose=false;
          if (data && data[0]) {
            toClose = (data[0].event || '').toUpperCase() == 'CLOSE';
          }
          if (toClose) {
            _userOffline();
          } else {
            that.debug("IN: User is alive");
            if (that.state==1) {
              setTimeout(that.userAlive, that.userAliveInterval*3/4);
            } else {
              that.debug("Unexpected SSE state: "+that.state);
            }
          }
        };

        var _userOffline = function(e) {
          that.debug("STATUS: User logged out");
          that.close(e);
        };

        if (that.state==1) {
          var p = that.rpc("userAlive");
          p.then(_userAlive).catch(_userOffline);
        }
      },

      scheduleUserAlive: function (timeout_ms) {
        timeout_ms = timeout_ms || that.userAliveInterval;
        clearTimeout(that._userAliveScheduler);
        that._userAliveScheduler = setTimeout(that.userAlive, timeout_ms);
      },

      attachUser: function (callback) {
        that.rpc(
          "attachUser",
          {
            "w": workgroup,
            "user": that.user
          }).then(function(data) {
            that.debug("IN: attach info");
            if (data && data[0] && data[0].ok) {
              that.w                 = workgroup;
              that.sse_session_id    = data[0].sse_session_id;
              that.userAliveInterval = Math.min(30000, Math.max(5000,data[0].userAliveInterval * 1000));
              that.debug("userAliveInterval: "+that.userAliveInterval);
              callback();
            }
          });
      },

      sendPing: function(callback) {
        if (that.state==1) {
          that.rpc(
            "ping",
            {w: workgroup, user: that.user}
          ).then(callback);
        }
      },

      addEventListener: function (eventName, func) {
        /* save the event in the internal list */
        if (typeof that.events == "undefined") {
          that.events={};
        }
        if ("undefined" == typeof that.events[eventName])
          that.events[eventName] = [];
        that.events[eventName].push([that.state, func]);

        if (that.state==1) {
          if (!that.pollEnabled)
            that.evtSource.addEventListener(eventName, func);
          if (trim(eventName.toLowerCase()) == "ready") {
            that.dispatchEvent("ready");
          }
        }
        return that;
      },

      dispatchEvent: function (eventName, params) {
        var ret=false;
        if (that.state==1) {
          if (typeof that.events !== "undefined") {
            for(var implementations=0; implementations<(that.events[eventName] || []).length; implementations++) {
              var eventDef = that.events[eventName][implementations];
              eventDef[1](params);
              ret |= true;
            }
          }

          eventName1=eventName;
          eventName2="on_"+eventName;
          if (typeof that[eventName1] == "function") {
            that[eventName1](params);
            ret |= true;
          } else if (typeof that[eventName2] == "function") {
            that[eventName2](params);
            ret |= true;
          } else
            ret |= false;
        }
        return ret;
      },

      startPolling : function() {
        clearTimeout(that.evtGuardian);
        that.pollEnabled=true;
        that.state=1;
        that.dispatchEvent("ready", {"gateway": "Polling"});
        setTimeout(that.poll, 125);
        that.debug("STATUS: polling for messages. pollTimeout: {0}ms".format(that.pollTimeout));
      },

      guardianTimeout: function (e) {
        that.debug("Guardian Timeout! Let's use polling mode");
        /* if SSE.PHP don't answer up to guardian timeout, use poll version */
        clearTimeout(that.evtGuardian);
        that.__destroy__();
        that.startPolling();
      },

      __destroy__: function() {
          that.closing=true;
          clearTimeout(that.evtGuardian);
          that.debug('DESTROYING');
          that.state=-1;
          that.evtSource=null;
          that.GUID=null;
      },

      close: function(e) {
        clearTimeout(that.evtGuardian);
        if (!that.closing) {
          that.closing=true;
          that.state=0;
          that.debug("STATUS: CLOSE");
          that.rpc(
            "detachUser",
            {
              w: workgroup,
              user: that.user
            }).then(function() {
              that.state=-1;
              that.pollEnabled = false;
              that.__destroy__();
              that.closing=false;
            }).catch(function() {
              that.closing=false; setTimeout(that.close, 1500);
            });
        }
      },

      closeEvent: function(e) {
        clearTimeout(that.evtGuardian);
        that.__destroy__();
      },

      error: function(e) {
        clearTimeout(that.evtGuardian);
        that.debug("ERROR: while using SSE");
        that.dispatchEvent('onerror');
      },

      openEvent: function (e) {
        clearTimeout(that.evtGuardian);
        that.debug("STATUS: OPEN");
        /* the first UAI happens in 1/100th after OPEN */
        that.scheduleUserAlive(that.userAliveInterval/100);
        that.dispatchEvent('onopen');

        if ((ycomm.msg) && (typeof ycomm.msg.notifyServerOnline =='function'))
          ycomm.msg.notifyServerOnline();
      },

      message: function (e) {
        /* as connected, clear guardian timeout */
        clearTimeout(that.evtGuardian);
        if ((!e) || (e.target.readyState==2)) {
          that.close();
        } else {
          that.debug("MESSAGE");
          if (that.state===0) {
            /* firs message just synchro the message table */
            that.state=1;
            that.debug("userAliveInterval: {0}ms".format(that.userAliveInterval));

            for(var eventName in that.events) {
              if (that.events.hasOwnProperty(eventName)) {
                for(var implementations=0; implementations<that.events[eventName].length; implementations++) {
                  var eventDef = that.events[eventName][implementations];
                  if (eventDef[0]<1) {
                    eventDef[0]=1;
                    that.evtSource.addEventListener(eventName, eventDef[1]);
                  }
                }
              }
            }
            that.dispatchEvent("onready", {"gateway": "SSE"});
          }

          if (that.state>0) {
            if (typeof that.onmessage=="function") {
              that.onmessage(e.data);
            }
          }
        }
      },

      startup: function(gateway) {
        gateway = (gateway || that.prefGateway || 'SSE').toUpperCase();
        that.prefGateway = gateway;
        if (that.evtGuardian) {
          clearTimeout(that.evtGuardian);
        }
        if (typeof that.GUID != "string") {
          that.GUID=generateUUID();
          that.attachUser(
            function() {
              that.state=0;
              /* first try to use EventSource() */
              if ((that.prefGateway=='SSE') && (typeof window.EventSource == "function")) {
                that.debug("INFO: Attaching events");
                if (!that.evtSource) {
                  that.debug("INFO: All new evtSource");
                  that.evtSource = new EventSource(that._dataLocation_+"?si="+md5(that.sse_session_id));
                  that.evtSource.addEventListener("error",   that.error,   false);
                } else {
                  that.debug("INFO: Reusing component");
                }

                that.evtSource.onopen    = that.openEvent;
                that.evtSource.onclose   = that.closeEvent;
                that.evtSource.onmessage = that.message;

                that.debug("INFO: Configuring guardianTimeout");
                that.evtGuardian = setTimeout(that.guardianTimeout, 30000);
              } else {
                that.startPolling();
              }
            }
          );
        } else {
          that.debugEnabled=true;
          that.debug("ERROR: SSE object already initialized");
        }
      },

      reset: function() {
        that.close();
        that.__destroy__();
        setTimeout(that.startup, 3500);
      },

      init: function() {
        that.state = -1;
        if ((typeof dataLocation=="undefined") || (dataLocation === null)) {
          /* default data location is current location/sse.php */
          that._dataLocation_ = (
            function() {
              var a = that.getLocation();
              var b = a.lastIndexOf('/');
              return a.substr(0,b+1)+'sse.php';
            }
          )();
        } else {
          that._dataLocation_=dataLocation;
        }

        if (that._dataLocation_.substr(0,5)=="file:") {
          that.debug("ERROR: '"+that._dataLocation_+"' is not a correct data location");
        } else {
          /* create user id */
          that.user = ((user !==null) && (typeof user != "undefined"))?user:generateUUID();

          /* check same-source */
          var l1=that.getFolder(that.getLocation()),
              l2=that.getFolder(that._dataLocation_);

          /* chose better way to communicate with server */
          if (l1==l2) {
            that.rpcMethod = ycomm.invoke;
          } else {
            that.rpcMethod = ycomm.crave;
          }

          that.startup();

        }

        return that;
      }
    };

    return that.init();
  };


text:
This is a prototype ML-like language compiler written in python.

The core type system is a standard Hindley-Milner, which will serve as
 a basis for trying out fun stuff:

- row polymorphism
- typeclassses
- typed closure conversion
- substructural type systems (affine)
- mutable references

This is a rewrite of a similar c++ project of mine in python to ease
experimentation. The syntax uses s-expressions for simplicity.

# DONE

## Hindley-Milner Type Inference

```clojure

;; empty list is nil
()
;; - : unit

;; arithmetic operations
(+ 1 3)
;; - : int

;; lambda functions
(fn (x y) (fn (z) x))
;; - : 'a -> 'b -> 'c -> 'a

;; let-polymorphism
(let use2 (fn (x y) ())
	 (let id (fn (x) x)
	 	 (use2 (id true) (id 3.14))))
;; - : unit

;; let shorthand for functions
(let (id (x) x) id)
;; - : 'a -> 'a
```

## Toplevel Definitions

```clojure
(def (id (x) x))
;; id : 'a -> 'a

(id "hello")
;; - : string
```

## Currying

```clojure
+
;; + : int -> int -> int

(+ 1)
;; - : int -> int

(+ 1 3)
;; - : int
```
## Recursive Functions

```clojure
;; factorial
(def (fact (n)
		   (if (= n 0) 1
			 (* n (fact (- n 1))))))
;; fact : int -> int
```
## Row Polymorphism

(a la [Extensible Records with Scoped Labels](https://www.microsoft.com/en-us/research/publication/extensible-records-with-scoped-labels/) [Leijen 2005])

```clojure
;; record creation
(def my-record (struct (foo "hello")))
;; my-record : {foo : string}

;; attribute selection
(@foo my-record)
;; - : string

;; attribute selection is row-polymorphic
@foo
;; - : {foo : 'a, ...} -> 'a

(@foo (struct (bar 1) (foo false)))
;; - : bool

(def (foo-else-bar (pred x)
		(if pred (@foo x) (@bar x))))
;; foo-else-bar : bool -> {foo : 'a, bar : 'a, ...} -> 'a
```

## IO monad + do notation

During type checking, `do` notation for sequences desugars to monadic bindings in the
builtin `io` monad:

```clojure
(do
	(def x (return 3))
	(print x)
	(return x))
;; - : io int
```
in particular, variable bindings remain monomorphic during the
whole sequence, which (seemingly?) removes ML's value restriction.

# INPROGRESS

## Code Generation using LLVM

Requires `llvmlite`. To enable code generation, run with `-c`:

```
max@macbook:~/Documents/hm.py$ ./repl.py -c test/fib.hm -i
> fib
fib : int -> int
> (fib 40)
- : int = 102334155
> (exit 0) ;; calls std::exit
```

## Typeclasses

manually built classes `eq`, `num` and `print` for now. need a
language for types.

## Typed Closure Conversion

Instead of the classical use of existential types [Minamide96], `slip`
performs (or at least tries to) typed closure conversion using
polymorphic records. It is still at early stage, but it is able to
correctly compile and run the following code:

```clojure
;; a simple closure over function args
(def (adder (y) (fn (x) (+ x y))))
;; adder : (num => 'a) -> (num => 'a) -> (num => 'a)

(def add-2 (adder 2))
;; add-2 : int -> int

(add-2 40)
;; - : int = 42

;; this one is trickier
(def (fun (pred y)
		  (if pred (fn (x) (+ x y))
			(fn (z) z))))
;; fun : bool -> (num => 'a) -> (num => 'a) -> (num => 'a)

((fun false 1) 2)
;; - : int = 2

((fun true 1.5) 3.2)
;; - : real = 4.700000
```

In the latter example, the following happens:

1. the `if` branch produces a closure with environment type `{+: (num
   => 'a) -> (num => 'a) -> (num => 'a), y: (num => 'a), ...}`

2. the `else` branch produces a closure with environment type `{...}`

3. both branches unify to `{+: (num => 'a) -> (num => 'a) -> (num =>
   'a), y: (num => 'a), ...}`

4. upon closure application, the environment type is sealed and
   codegen proceeds with monomorphization.

# TODO

## Code Generation

- closures: skip unneeded environment types
- builtins ops instead of functions (arithmetic)
- records mutation
- (mutable) cell references

## Type System

- language for types
- better error reporting
- ADT + pattern matching (or is row polymorphism sufficient?)
- runST-like safe monad escape?
- mutable references?
- some form of substructural typing for ownership tracking


text:
package org.apache.camel.component.hazelcast.replicatedmap;

import java.util.Map;

import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.replicatedmap.ReplicatedMap;
import org.apache.camel.Exchange;
import org.apache.camel.component.hazelcast.HazelcastComponentHelper;
import org.apache.camel.component.hazelcast.HazelcastConstants;
import org.apache.camel.component.hazelcast.HazelcastDefaultEndpoint;
import org.apache.camel.component.hazelcast.HazelcastDefaultProducer;
import org.apache.camel.component.hazelcast.HazelcastOperation;

public class HazelcastReplicatedmapProducer extends HazelcastDefaultProducer {

    private final ReplicatedMap<Object, Object> cache;

    public HazelcastReplicatedmapProducer(HazelcastInstance hazelcastInstance, HazelcastDefaultEndpoint endpoint, String cacheName) {
        super(endpoint);
        this.cache = hazelcastInstance.getReplicatedMap(cacheName);
    }

    @Override
    public void process(Exchange exchange) throws Exception {

        Map<String, Object> headers = exchange.getIn().getHeaders();

        // GET header parameters
        Object oid = null;

        if (headers.containsKey(HazelcastConstants.OBJECT_ID)) {
            oid = headers.get(HazelcastConstants.OBJECT_ID);
        }

        final HazelcastOperation operation = lookupOperation(exchange);

        switch (operation) {
            case PUT:
                this.put(oid, exchange);
                break;

            case GET:
                this.get(oid, exchange);
                break;

            case DELETE:
                this.delete(oid);
                break;

            case CLEAR:
                this.clear(exchange);
                break;

            case CONTAINS_KEY:
                this.containsKey(oid, exchange);
                break;

            case CONTAINS_VALUE:
                this.containsValue(exchange);
                break;

            default:
                throw new IllegalArgumentException(String.format("The value '%s' is not allowed for parameter '%s' on the MULTIMAP cache.", operation, HazelcastConstants.OPERATION));
        }

        // finally copy headers
        HazelcastComponentHelper.copyHeaders(exchange);
    }

    private void put(Object oid, Exchange exchange) {
        Object body = exchange.getIn().getBody();
        this.cache.put(oid, body);
    }

    private void get(Object oid, Exchange exchange) {
        exchange.getMessage().setBody(this.cache.get(oid));
    }

    private void delete(Object oid) {
        this.cache.remove(oid);
    }

    private void clear(Exchange exchange) {
        this.cache.clear();
    }

    private void containsKey(Object oid, Exchange exchange) {
        exchange.getMessage().setBody(this.cache.containsKey(oid));
    }

    private void containsValue(Exchange exchange) {
        Object body = exchange.getIn().getBody();
        exchange.getMessage().setBody(this.cache.containsValue(body));
    }
}


text:
<#
.SYNOPSIS
    Create a new Eventbrite ticket type for an event using the v1 API.

.DESCRIPTION
    Creates new ticket types for an event, returning the ID of the newly
    created ticket type. Ticket purchases result in new attendee records.

.PARAMETER Id
    A numeric event ID is required for each ticket type.

.PARAMETER IsDonation
    0 for fixed-price tickets, 1 for donations. 0 will be used by default if not provided.

.PARAMETER Name
    The ticket name. (required)

.PARAMETER Description
    The ticket description.

.PARAMETER Price
    The ticket price. Enter 0.00 for free tickets. Leave blank for a donation amount.

.PARAMETER Quantity
    The number of tickets available. Not required for donations.

.PARAMETER Start
    The date and time when ticket sales start, in ISO 8601 format (e.g., "2007-12-31 23:59:59").

.PARAMETER End
    The date and time when ticket sales stop, in ISO 8601 format (e.g., "2007-12-31 23:59:59").

.PARAMETER IncludeFee
    0 to add the Eventbrite service fee on top of ticket price, or 1 to include it in the ticket price.
    0 will be used by default if not provided.

.PARAMETER Minimum
    The minimum number of tickets per order.

.PARAMETER Maximum
    The maximum number of tickets per order.

.PARAMETER AccessToken
    Your Eventbrite API oAuth token.

    See: https://www.eventbrite.com/myaccount/apps/

.EXAMPLE

    $TicketParams=@{
        Id       = $event.id
        Start    = (Get-Date)    # Sales start now!
        End      = $EndDate      # can get a ticket up until the event end time.
        Quantity = 40            # 40 seats available
        Name     = "In Person"   #
    }
    $ticket = New-EventbriteTicket @TicketParams -Verbose

.LINK
    http://developer.eventbrite.com/doc/tickets/ticket_new/

#>
function New-EventbriteTicket
{
    [CmdletBinding()]
    Param (

        [Parameter(Mandatory,ValueFromPipelineByPropertyName)]
        [Alias("Id")]
        [int64]
        $EventId,

        [Parameter(Mandatory)]
        [string]
        $Name,

        [Parameter()]
        [string]
        $Description,

        [Parameter(Mandatory)]
        [DateTime]
        $Start,

        [Parameter(Mandatory)]
        [DateTime]
        $End,

        [Parameter()]
        [double]
        $Price,

        [Parameter()]
        [int]
        $Quantity,

        [Parameter()]
        [int]
        $Minimum,

        [Parameter()]
        [int]
        $Maximum,

        [Parameter()]
        [ValidateSet(0,1)]
        [int]
        $IncludeFee,

        [Parameter()]
        [ValidateSet(0,1)]
        [int]
        $IsDonation,

        [Parameter()]
        [string]
        $AccessToken = (Get-EventbriteConnection).access_token

    )

    Begin
    {
        $root   = "https://www.eventbrite.com"
        $format = "json"
        $method = "ticket_new"
        $uri    = "$root/$format/$method`?"

        $RequestParameters = @{
            Uri = $uri
            Headers = @{
                Authorization = 'Bearer ' + $AccessToken
            }
        }
    }
    Process
    {
        foreach($event_id in $EventId)
        {
            Write-Verbose "[$($MyInvocation.MyCommand.Name)] :: Building URI from bound parameters"

            Remove-PSBoundCommonParameters $PSBoundParameters | foreach {

                Write-Verbose "$($MyInvocation.MyCommand.Name) :: Adding `'$($_.Key)`' to URI with value `'$($_.Value)`'"

                switch($_)
                {
                    {$_.Key -eq 'EventId'} {$RequestParameters.Uri += "&$(Format-Parameter $_.Key)=$event_id"}
                    {$_.Key -eq 'Start'}   {$RequestParameters.Uri += "&$(Format-Parameter $_.Key)=$(Format-Date $_.Value)"}
                    {$_.Key -eq 'End'}     {$RequestParameters.Uri += "&$(Format-Parameter $_.Key)=$(Format-Date $_.Value)"}
                    Default                {$RequestParameters.Uri += "&$(Format-Parameter $_.Key)=$($_.Value)"}
                }
            }

            try
            {
                $result = Invoke-RestMethod @RequestParameters -ErrorAction Stop
            }
            catch
            {
                Write-Error $_.exception.message
                continue
            }

            if($result.error)
            {
                Write-Error $result.error.error_message
                continue
            }
            elseif($result.process)
            {
                $PsResult = $result.process
                $PsResult.PSTypeNames.Clear()
                $PsResult.PSTypeNames.Add('Eventbrite.Ticket.Response')
                $PsResult
            }
            else
            {
                Write-Error $result
                continue
            }
        }
    }
}


text:
WorklistSelectedStudies = new Meteor.Collection(null);
WorklistSelectedStudies._debugName = 'WorklistSelectedStudies';

function handleShiftClick(studyRow, data) {
    //log.info('shiftKey');
    var studyInstanceUid = studyRow.attr('studyInstanceUid');

    // Select all rows in between these two rows
    if (Worklist.previouslySelected) {
        var previous = $(Worklist.previouslySelected);
        var rowsInBetween;
        if (previous.index() < studyRow.index()) {
            // The previously selected row is above (lower index) the
            // currently selected row.

            // Fill in the rows upwards from the previously selected row
            rowsInBetween = previous.nextAll('tr');
        } else if (previous.index() > studyRow.index()) {
            // The previously selected row is below the currently
            // selected row.

            // Fill in the rows upwards from the previously selected row
            rowsInBetween = previous.prevAll('tr');
        } else {
            // The rows are the same, deselect the current row.
            // TODO: CHECK THIS, pretty sure this is the wrong behaviour
            WorklistSelectedStudies.remove({});
            Worklist.previouslySelected = undefined;
            return;
        }

        // Loop through the rows in between current and previous selected studies
        rowsInBetween.each(function() {
            var row = $(this);

            if (row.hasClass('active')) {
                // If we find one that is already selected, do nothing
                return;
            }

            // Get the relevant studyInstanceUid
            var studyInstanceUid = row.attr('studyInstanceUid');

            // Retrieve the data context through Blaze
            var data = Blaze.getData(this);

            // Set the current study as selected
            WorklistSelectedStudies.insert(data);
            row.addClass('active');

            // When we reach the currently clicked-on row, stop the loop
            return !row.is(studyRow);
        });
    } else {
        // Set the current study as selected
        WorklistSelectedStudies.insert(data);
        studyRow.addClass('active');
    }
}

function handleCtrlClick(studyRow, data) {
    //log.info('ctrlKey');
    var studyInstanceUid = studyRow.attr('studyInstanceUid');

    if (studyRow.hasClass('active')) {
        studyRow.removeClass('active');

        // Find the current studyInstanceUid in the stored list and remove it
        WorklistSelectedStudies.remove({
            studyInstanceUid: data.studyInstanceUid
        });
    } else {
        // Set the current study as selected
        WorklistSelectedStudies.insert(data);
        studyRow.addClass('active');

        // Set this as the previously selected row, so the user can
        // use Shift to select from this point onwards
        Worklist.previouslySelected = studyRow;
        log.info('Worklist PreviouslySelected set: ' + studyRow.index());
    }
}

Template.worklistStudy.onRendered(function() {
    var instance = this;
    var elem = instance.$('tr.worklistStudy').get(0);

    // Enable HammerJS to allow touch support
    var mc = new Hammer.Manager(elem);
    var doubleTapRecognizer = new Hammer.Tap({
        event: 'doubletap',
        taps: 2,
        interval: 500,
        threshold: 30,
        posThreshold: 30
    });

    mc.add(doubleTapRecognizer);
});

Template.worklistStudy.events({
    'click tr.worklistStudy': function(e) {
        var studyRow = $(e.currentTarget);
        var data = this;

        // Remove the ID so we can directly insert this into our client-side collection
        delete data._id;

        if (e.shiftKey) {
            handleShiftClick(studyRow, data);
        } else if (e.ctrlKey || e.metaKey) {
            handleCtrlClick(studyRow, data);
        } else {
            // Select a single study
            //log.info('Regular click');

            // Clear all selected studies
            WorklistSelectedStudies.remove({});
            $('tr.worklistStudy').removeClass('active');

            // Set the previous study to the currently clicked-on study
            Worklist.previouslySelected = studyRow;
            //log.info('Worklist PreviouslySelected set: ' + studyRow.index());

            // Set the current study as selected
            WorklistSelectedStudies.insert(data);
            studyRow.addClass('active');
        }
    },
    'mousedown tr.worklistStudy': function(e) {
        // This event handler is meant to handle middle-click on a study
        if (e.which !== 2) {
            return;
        }

        var data = this;
        var middleClickOnStudy = Worklist.callbacks.middleClickOnStudy;
        if (middleClickOnStudy && typeof middleClickOnStudy === 'function') {
            middleClickOnStudy(data);
        }
    },
    'dblclick tr.worklistStudy, doubletap tr.worklistStudy': function(e) {
        if (e.which !== undefined && e.which !== 1) {
            return;
        }

        var data = this;
        var dblClickOnStudy = Worklist.callbacks.dblClickOnStudy;

        if (dblClickOnStudy && typeof dblClickOnStudy === 'function') {
            dblClickOnStudy(data);
        }
    },
    'contextmenu tr.worklistStudy, press tr.worklistStudy': function(e, template) {
        $(e.currentTarget).addClass('active');

        if (openStudyContextMenu && typeof openStudyContextMenu === 'function') {
            e.preventDefault();

            openStudyContextMenu(e, template);
            return false;
        }
    }

});


text:
<?php
/**
 * User: Zachary Tong
 * Date: 3/7/13
 * Time: 8:09 PM
 */

namespace Sherlock\components;

/**
 * Interface for sort components, always used in conjunction with the BaseComponent class
 */
interface SortInterface
{
    public function toArray();

    public function toJSON();
}


text:
namespace Microsoft.Data.OData.Query
{
    #region Namespaces
    using System.Collections.Generic;
    using Microsoft.Data.Edm;
    #endregion Namespaces

    /// <summary>
    /// Query node representing a key lookup on a collection.
    /// </summary>
#if INTERNAL_DROP
    internal sealed class KeyLookupQueryNode : SingleValueQueryNode
#else
    public sealed class KeyLookupQueryNode : SingleValueQueryNode
#endif
    {
        /// <summary>
        /// The collection to apply the key lookup to.
        /// </summary>
        public CollectionQueryNode Collection
        {
            get;
            set;
        }

        /// <summary>
        /// The values of key properties for the lookup.
        /// </summary>
        public IEnumerable<KeyPropertyValue> KeyPropertyValues
        {
            get;
            set;
        }

        /// <summary>
        /// The resouce type of the single value this node represents.
        /// </summary>
        public override IEdmTypeReference TypeReference
        {
            get
            {
                if (this.Collection == null)
                {
                    return null;
                }
                else
                {
                    return this.Collection.ItemType;
                }
            }
        }

        /// <summary>
        /// The kind of the query node.
        /// </summary>
        public override QueryNodeKind Kind
        {
            get
            {
                return QueryNodeKind.KeyLookup;
            }
        }
    }
}


text:
param(
    [hashtable] $sConfig
)

$dirSetup = $sConfig["DIRSCRIPT"]
$setupLog = $sConfig["SETUPLOG"]
$sqlServerName = $sConfig["SQLSERVERNAME"]

."$dirSetup\scriptFunctions.ps1"

# [Microsoft.SqlServer.Management.SMO.ServerLoginMode]::Integrated

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
# Connect to the specified instance
$server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $sqlServerName

[string] $sqlMode = $server.Settings.LoginMode

Write-Log -logfile $setupLog -level "Info" -message "Previous SQL Server Authentication Mode was $sqlMode"

$server.Settings.LoginMode = [Microsoft.SqlServer.Management.SMO.ServerLoginMode]::Mixed
$server.Alter()
$sqlMode = $server.Settings.LoginMode

Write-Log -logfile $setupLog -level "Info" -message "Current SQL Server Authentication Mode is set to $sqlMode"


text:
<!doctype html>

{% include head.html %}

{% include browser-upgrade.html %}
{% include navigation.html %}

  {% if page.image %}

  {% endif %}

Tech

Stream

{{ page.title }}

  {{ content }}

    {% include footer.html %}

{% include scripts.html %}


text:
/* KidDemo.java
 * 2009/2/18
 */

public class KidDemo {
    public static void main(String[] args) {
        ExaggeratingKid k1, k2, k3;
        k1 = new ExaggeratingKid("Dave","Mr. Barkhouse",5,"Hi, I Can Bike.");
        k2 = new ExaggeratingKid("Allan","Mr. Barkhouse",6);
        k3 = new ExaggeratingKid("Jacon","Mr. Teacher",5);

        System.out.println(k1+"\n\n"+k2+"\n\n"+k3);
    }
}
/*
--------------------Configuration: <Default>--------------------
Hi, I Can Bike. I am the Best!
Did I tell you that, My name is: Dave?!
And that I am: 7 years old!
My teacher is Mr. Barkhouse

HI I'm Allan. I am 6!  I am the Best!
Did I tell you that, My name is: Allan?!
And that I am: 8 years old!
My teacher is Mr. Barkhouse

HI I'm Jacon. I am 5!  I am the Best!
Did I tell you that, My name is: Jacon?!
And that I am: 7 years old!
My teacher is Mr. Teacher

Process completed.
*/


text:
namespace crashpad {
namespace test {

//! \brief Manages an `exec()`-based multiprocess test.
//!
//! These tests are based on `fork()` and `exec()`. The parent process is able
//! to communicate with the child in the same manner as a base-class
//! Multiprocess parent. The read and write pipes appear in the child process on
//! stdin and stdout, respectively.
//!
//! Subclasses are expected to implement the parent in the same was as a
//! base-class Multiprocess parent. The child must be implemented in an
//! executable to be set by SetChildCommand().
class MultiprocessExec : public Multiprocess {
 public:
  MultiprocessExec();

  //! \brief Sets the command to `exec()` in the child.
  //!
  //! This method must be called before the test can be Run().
  //!
  //! \param[in] command The executable's pathname.
  //! \param[in] arguments The command-line arguments to pass to the child
  //!     process in its `argv[]` vector. This vector must begin at `argv[1]`,
  //!     as \a command is implicitly used as `argv[0]`. This argument may be
  //!     `nullptr` if no command-line arguments are to be passed.
  void SetChildCommand(const std::string& command,
                       const std::vector<std::string>* arguments);

 protected:
  ~MultiprocessExec();

  // Multiprocess:
  void PreFork() override;

 private:
  // Multiprocess:
  void MultiprocessChild() override;

  std::string command_;
  std::vector<std::string> arguments_;
#if defined(OS_POSIX)
  std::vector<const char*> argv_;
#elif defined(OS_WIN)
  std::wstring command_line_;
#endif  // OS_POSIX

  DISALLOW_COPY_AND_ASSIGN(MultiprocessExec);
};

}  // namespace test
}  // namespace crashpad

#endif  // CRASHPAD_UTIL_TEST_MULTIPROCESS_EXEC_H_


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

    <artifactId>poe4j-web</artifactId>

    <parent>
        <groupId>com.swandiggy</groupId>
        <artifactId>poe4j-parent</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

</project>


text:
#
#
# /* See http://www.boost.org for most recent version. */
#
# include <ndnboost/preprocessor/slot/detail/shared.hpp>
#
# undef NDNBOOST_PP_ITERATION_START_5
#
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_1
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_2
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_3
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_4
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_5
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_6
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_7
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_8
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_9
# undef NDNBOOST_PP_ITERATION_START_5_DIGIT_10
#
# if NDNBOOST_PP_SLOT_TEMP_3 == 0
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 0
# elif NDNBOOST_PP_SLOT_TEMP_3 == 1
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 1
# elif NDNBOOST_PP_SLOT_TEMP_3 == 2
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 2
# elif NDNBOOST_PP_SLOT_TEMP_3 == 3
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 3
# elif NDNBOOST_PP_SLOT_TEMP_3 == 4
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 4
# elif NDNBOOST_PP_SLOT_TEMP_3 == 5
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 5
# elif NDNBOOST_PP_SLOT_TEMP_3 == 6
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 6
# elif NDNBOOST_PP_SLOT_TEMP_3 == 7
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 7
# elif NDNBOOST_PP_SLOT_TEMP_3 == 8
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 8
# elif NDNBOOST_PP_SLOT_TEMP_3 == 9
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_3 9
# endif
#
# if NDNBOOST_PP_SLOT_TEMP_2 == 0
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 0
# elif NDNBOOST_PP_SLOT_TEMP_2 == 1
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 1
# elif NDNBOOST_PP_SLOT_TEMP_2 == 2
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 2
# elif NDNBOOST_PP_SLOT_TEMP_2 == 3
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 3
# elif NDNBOOST_PP_SLOT_TEMP_2 == 4
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 4
# elif NDNBOOST_PP_SLOT_TEMP_2 == 5
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 5
# elif NDNBOOST_PP_SLOT_TEMP_2 == 6
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 6
# elif NDNBOOST_PP_SLOT_TEMP_2 == 7
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 7
# elif NDNBOOST_PP_SLOT_TEMP_2 == 8
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 8
# elif NDNBOOST_PP_SLOT_TEMP_2 == 9
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_2 9
# endif
#
# if NDNBOOST_PP_SLOT_TEMP_1 == 0
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 0
# elif NDNBOOST_PP_SLOT_TEMP_1 == 1
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 1
# elif NDNBOOST_PP_SLOT_TEMP_1 == 2
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 2
# elif NDNBOOST_PP_SLOT_TEMP_1 == 3
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 3
# elif NDNBOOST_PP_SLOT_TEMP_1 == 4
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 4
# elif NDNBOOST_PP_SLOT_TEMP_1 == 5
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 5
# elif NDNBOOST_PP_SLOT_TEMP_1 == 6
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 6
# elif NDNBOOST_PP_SLOT_TEMP_1 == 7
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 7
# elif NDNBOOST_PP_SLOT_TEMP_1 == 8
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 8
# elif NDNBOOST_PP_SLOT_TEMP_1 == 9
#    define NDNBOOST_PP_ITERATION_START_5_DIGIT_1 9
# endif
#
# if NDNBOOST_PP_ITERATION_START_5_DIGIT_3
#    define NDNBOOST_PP_ITERATION_START_5 NDNBOOST_PP_SLOT_CC_3(NDNBOOST_PP_ITERATION_START_5_DIGIT_3, NDNBOOST_PP_ITERATION_START_5_DIGIT_2, NDNBOOST_PP_ITERATION_START_5_DIGIT_1)
# elif NDNBOOST_PP_ITERATION_START_5_DIGIT_2
#    define NDNBOOST_PP_ITERATION_START_5 NDNBOOST_PP_SLOT_CC_2(NDNBOOST_PP_ITERATION_START_5_DIGIT_2, NDNBOOST_PP_ITERATION_START_5_DIGIT_1)
# else
#    define NDNBOOST_PP_ITERATION_START_5 NDNBOOST_PP_ITERATION_START_5_DIGIT_1
# endif


text:
package com.hubspot.nebula;

public interface Result {
  public long getId();
}


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

namespace FdtSharp
{
	internal sealed class StringWriter
	{
		public StringWriter()
		{
			result = new List<byte>();
			alreadyWritten = new Dictionary<string, int>();
		}

		public List<byte> Result
		{
			get
			{
				return result.ToList();
			}
		}

		public int PutString(string str)
		{
			if(alreadyWritten.ContainsKey(str))
			{
				return alreadyWritten[str];
			}
			// our string can also be a substring of some another string
			foreach(var cached in alreadyWritten)
			{
				var subIndex = cached.Key.IndexOf(str, StringComparison.Ordinal);
				if(subIndex != -1 && subIndex + str.Length == cached.Key.Length)
				{
					var newStringIndex = cached.Value + subIndex;
					alreadyWritten.Add(str, newStringIndex);
					return newStringIndex;
				}
			}
			var index = result.Count;
			alreadyWritten.Add(str, index);
			result.AddRange(str.NullTerminated());
			return index;
		}

		private readonly List<byte> result;
		private readonly Dictionary<string, int> alreadyWritten;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">

	<ui:with field='resources' type='org.ovirt.engine.ui.common.CommonApplicationResources' />

	<ui:style type="org.ovirt.engine.ui.common.widget.dialog.SimpleDialogPanel.Style">
		.header {
			position: absolute;
			top: 5px;
			left: 0px;
			right: 0px;
		}

		.headerRightPanel {
			position: absolute;
			right: 5px;
		}

		.headerLeftPanel {
			position: absolute;
			left: 5px;
		}

		.headerCenterPanel {
			position: absolute;
			background: url(images/dialog_header_background_repetitive.png) repeat-x;
			height: 27px;
			line-height: 27px;
			width: auto;
			left: 27px;
			right: 123px;
		}

		.headerTitle {
			text-align: left;
			font-size: 14px;
			font-weight: bold;
			color: white;
			margin-left: 5px;
			padding-left: 3px;
		}

		.content {
			border: 1px solid #CED8DF;
			position: absolute;
			padding: 0px;
			top: 34px;
			bottom: 35px;
			left: 6px;
			right: 6px;
		}

		.footer {
			position: absolute;
			right: 11px;
			bottom: 9px;
		}

		.footerButton {
			float: right;
			font-size: 12px;
			margin-left: 4px;
		}

		.contentWidget {
			width: 100%;
			height: 100%;
		}

		.helpButton {
			position: absolute;
			background: transparent;
			border: 1px solid transparent;
			width: 18px;
			height: 18px;
			line-height: 32px;
			vertical-align: middle;
			top: 0px;
			right: 6px;
			padding: 1px;
			cursor: hand;
		    cursor: pointer;
		    z-index: 1;
		}
	</ui:style>

	<g:HTMLPanel>
		<g:FlowPanel addStyleNames="{style.header}">
			<g:SimplePanel ui:field="headerLeftPanel" addStyleNames="{style.headerLeftPanel}">
				<g:Image resource='{resources.dialogLogoInfoImage}' />
			</g:SimplePanel>
			<g:SimplePanel ui:field="headerCenterPanel" addStyleNames="{style.headerCenterPanel} {style.headerTitle}" />
			<g:SimplePanel ui:field="headerRightPanel" addStyleNames="{style.headerRightPanel}">
				<g:FlowPanel>
					<g:Image resource='{resources.dialogHeaderImage}' />
					<g:PushButton ui:field='helpButton' addStyleNames="{style.helpButton}" visible="false">
					   <g:upFace image='{resources.dialogIconHelp}'/>
					   <g:downFace image='{resources.dialogIconHelpDown}'/>
					   <g:upHoveringFace image='{resources.dialogIconHelpRollover}'/>
					 </g:PushButton>
				</g:FlowPanel>
			</g:SimplePanel>
		</g:FlowPanel>

		<g:SimplePanel ui:field="contentPanel" addStyleNames="{style.content}" />

		<g:HTMLPanel addStyleNames="{style.footer}">
			<g:FlowPanel ui:field="footerButtonPanel" />
			<div style="clear: both;" />
		</g:HTMLPanel>
	</g:HTMLPanel>

</ui:UiBinder>


text:
package org.apache.flink.runtime.io.network;

import org.apache.flink.runtime.event.TaskEvent;
import org.apache.flink.runtime.io.network.api.TaskEventHandler;
import org.apache.flink.runtime.io.network.partition.ResultPartitionID;
import org.apache.flink.runtime.io.network.partition.consumer.LocalInputChannel;
import org.apache.flink.runtime.io.network.partition.consumer.RemoteInputChannel;
import org.apache.flink.runtime.util.event.EventListener;

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

import java.util.HashMap;
import java.util.Map;

import static org.apache.flink.util.Preconditions.checkNotNull;

/**
 * The task event dispatcher dispatches events flowing backwards from a consuming task to the task
 * producing the consumed result.
 *
 *
Backwards events only work for tasks, which produce pipelined results, where both the
 * producing and consuming task are running at the same time.
 */
public class TaskEventDispatcher implements TaskEventPublisher {
    private static final Logger LOG = LoggerFactory.getLogger(TaskEventDispatcher.class);

    private final Map<ResultPartitionID, TaskEventHandler> registeredHandlers = new HashMap<>();

    /**
     * Registers the given partition for incoming task events allowing calls to {@link
     * #subscribeToEvent(ResultPartitionID, EventListener, Class)}.
     *
     * @param partitionId the partition ID
     */
    public void registerPartition(ResultPartitionID partitionId) {
        checkNotNull(partitionId);

        synchronized (registeredHandlers) {
            LOG.debug("registering {}", partitionId);
            if (registeredHandlers.put(partitionId, new TaskEventHandler()) != null) {
                throw new IllegalStateException(
                        "Partition "
                                + partitionId
                                + " already registered at task event dispatcher.");
            }
        }
    }

    /**
     * Removes the given partition from listening to incoming task events, thus forbidding calls to
     * {@link #subscribeToEvent(ResultPartitionID, EventListener, Class)}.
     *
     * @param partitionId the partition ID
     */
    public void unregisterPartition(ResultPartitionID partitionId) {
        checkNotNull(partitionId);

        synchronized (registeredHandlers) {
            LOG.debug("unregistering {}", partitionId);
            // NOTE: tolerate un-registration of non-registered task (unregister is always called
            //       in the cleanup phase of a task even if it never came to the registration - see
            //       Task.java)
            registeredHandlers.remove(partitionId);
        }
    }

    /**
     * Subscribes a listener to this dispatcher for events on a partition.
     *
     * @param partitionId ID of the partition to subscribe for (must be registered via {@link
     *     #registerPartition(ResultPartitionID)} first!)
     * @param eventListener the event listener to subscribe
     * @param eventType event type to subscribe to
     */
    public void subscribeToEvent(
            ResultPartitionID partitionId,
            EventListener<TaskEvent> eventListener,
            Class<? extends TaskEvent> eventType) {
        checkNotNull(partitionId);
        checkNotNull(eventListener);
        checkNotNull(eventType);

        TaskEventHandler taskEventHandler;
        synchronized (registeredHandlers) {
            taskEventHandler = registeredHandlers.get(partitionId);
        }
        if (taskEventHandler == null) {
            throw new IllegalStateException(
                    "Partition " + partitionId + " not registered at task event dispatcher.");
        }
        taskEventHandler.subscribe(eventListener, eventType);
    }

    /**
     * Publishes the event to the registered {@link EventListener} instances.
     *
     *
This method is either called directly from a {@link LocalInputChannel} or the network I/O
     * thread on behalf of a {@link RemoteInputChannel}.
     *
     * @return whether the event was published to a registered event handler (initiated via {@link
     *     #registerPartition(ResultPartitionID)}) or not
     */
    @Override
    public boolean publish(ResultPartitionID partitionId, TaskEvent event) {
        checkNotNull(partitionId);
        checkNotNull(event);

        TaskEventHandler taskEventHandler;
        synchronized (registeredHandlers) {
            taskEventHandler = registeredHandlers.get(partitionId);
        }

        if (taskEventHandler != null) {
            taskEventHandler.publish(event);
            return true;
        }

        return false;
    }

    /** Removes all registered event handlers. */
    public void clearAll() {
        synchronized (registeredHandlers) {
            registeredHandlers.clear();
        }
    }
}


text:
<?php namespace Models\Vip;

interface VipImplementation
{
    /**
     * @return \Laravel\Validator
     */
    public function getValidator();

    /**
     * @return string
     */
    public function getInputs();

    /**
     * @return boolean
     */
    public function execute();

    /**
     *
     * @param \Character $entity
     * @param array $attributes
     */
    public function __construct(\Character $entity, array $attributes);
}