text:
=head1 TITLE

Keyed arrays

=head1 VERSION

  Maintainer: Glenn Linderman <glenn@linderman.com>
  Date: 20 Sep 2000
  Last Modified: 28 Sep 2000
  Mailing List: perl6-language@perl.org
  Number: 268
  Version: 3
  Status: Withdrawn

=head1 ABSTRACT

The  idea here  is to  merge the  concepts of  array and  hash,  not to
replace  either  one, but  to  provide  some  middle ground  with  data
structures  having some  characteristics of  each.  The  resultant data
structure is  based on array,  may be more  costly than hash,  for some
operations, may be more efficient  than hashes for some operations, and
may provide a more compatible  solution for some types of problems than
other RFCs.

=head1 Notes on withdrawal

There are some  nice ideas in here, if only they  could work.  At least
it provided  a bit  of inspiration for  RFC 273,  so it wasn't  a total
waste of time.

=head1 CHANGES

In Version 2:

Clarify wording  in various  places.  Prohibit use  of splice  on keyed
arrays that  actually contain keys.   Change the default array  type to
:nokey, since splice is prohibited on keyed arrays.

=head1 DESCRIPTION

These  are not  pseudo-hashes.   Michael Schwern,  author  of RFC  241:
Pseudo-hashes must die! after some lengthy discussion, said: <quote> Ya
know, I'm going to say that $aref->[string] might be made to work where
pseudo-hashes failed. </quote>.  However,  that is not intended to mean
that  Mr.   Schwern  endorses this  proposal,  but  I  did take  it  as
encouragement to develop this RFC  to squeak in before the deadline and
hope that it lends just a bit credence to the proposal.  That said...

I think  that Mr.  Schwern's comment  does imply that  a proposal along
these lines  might be  able to solve  problems that  pseudo-hashes were
invented  to  solve,  in  ways  that might  be  less  problematical  to
implement; this would  allow pseudo-hashes to not need  to coexist with
keyed arrays,  so the proposal  doesn't discuss such  coexistance.  See
also RFC 241.

=head2 Definition syntax

An array could have an optional namespace.  Probably best to call these
keys, because  it really is the  same concept as hash  keys--we look up
values  using  them.   Probably  there  could be  several  flavors,  as
described below.  I'm not yet  certain if all these flavors are useful,
or  if  all these  flavors,  even  if useful,  are  worth  the pain  of
implementation, since  I don't know the cost  of implementation.  There
may  be  flavors  I  haven't  thought  of  yet,  that  would  be  worth
implementing.  All  but the first are generically  called keyed arrays.
Here's my current concept list:

    my/our @array :nokey;
    my/our @array :key;
    my/our @array :initialkey ( key0, key1, ... );
    my/our @array :keyonly;
    my/our @array :hashsyntax;

With the :nokey attribute, we  would have a familiar perl<6 array.  Use
numeric indexes, and [] indexing syntax.  This would be the default, if
no attribute is specified, for compatibility.

With the  :key attribute,  it would be  allowed, but not  required, for
keys  to be  added  to  point to  particular  array elements.   Numeric
indexing could still  be used for speed.  Not  all array elements would
necessarily have keys.

The :initialkey  variation would  specify in the  definition a  list of
keys which  would correlate  to the  array indexes 0,  1, ...

The :keyonly variation  would be less efficient, and  would require use
of keys for lookup.  Of course, the compiler could translate fixed keys
into numeric indexes under the covers for performance.

The  :hashsyntax  variation is  identical  to  the :keyonly  variation,
except for  the syntax,  which is like  hashes instead of  like arrays.
This  variation  could  unify  the  concepts of  hash  and  array.  The
definition  of a :hashsyntax  array should  probably reserve  a special
pointer in the  symbol table so that the similarly  named hash would be
automatically  defined for  access,  but would  actually  refer to  the
:hashsyntax keyed array.  In other words, the definition of

    my/our @array :hashsyntax;

would hide the definition of %array in the same way that

    my/our %array

would  hide a  prior definition  of %array.   And references  to %array
would thenceforth actually be references to the keyed array @array.

=head2 Reference syntax

The syntaxes

    $foo['element']
    $foo[element]

or for :hashsyntax arrays, either the above or

    $foo{'element'}
    $foo{element}

would be interpreted as a reference to @foo.  If the namespace for @foo
contains 'element', that member of  @foo is the interpretation.  If the
namespace for @foo does not  contain 'element', then 'element' is added
to the namespace for @foo, the size  of @foo is increased by 1, and the
member 'element' refers to the newly added item in @foo.

So, starting with

   my @foo:key; # empty array
   $foo ['month'] = 10;  #  $#foo == 1, $foo[0] == 10
   $foo ['day'] = 20;   # $#foo == 2, $foo [1] == 20
   $foo ['year'] = 30;   # $#foo = 3, $foo [2] == 30

We achieve an array with 3 elements.  There is a clear parallel between
this and

   my %foo;
   $foo{'month'} = 10;
   $foo{'day'} = 20;
   $foo{'year'} = 30;

However, the lookups for @foo are done at compile time, the lookups for
%foo are done at runtime.

For :key and :initialkey arrays, the syntax

    $foo[$bar]

would inspect $bar to determine if it is convertable to numeric.  If it
is, the value is used as the numeric index of the array.  If it is not,
it is treated as a key for the array, and is looked up in the namespace
of the array.

For :keyonly and  :hashsyntax arrays, all indexes are  considered to be
string keys just  like hash keys, requiring lookup  in the namespace of
the array.

Perl uses some heuristic to decide  whether a bareword within the {} of
a hash  key reference  is a  function or a  string, the  same heuristic
should be applied within [] for keyed arrays.

Push,  pop,  shift,  and  unshift   are  not  valid  for  :keyonly  and
:hashsyntax  arrays,  because  they  access  data by  index,  which  is
prohibited for  those types of  keyed arrays.  Splice is  prohibited on
all keyed arrays, to allow compile time name lookup.

The  operations keys,  values,  and  each would  make  sense for  keyed
arrays.   Their syntax  should be  extended to  accept keyed  arrays as
parameters, and the semantics should be similar to that for hashes.  It
should be  noted that values is  not necessarily the same  order as the
original keyed  array, since it would  iterate via the  keys.  For :key
and :initialkey arrays,  it would not even necessarily  be the complete
array, because not all array entries would necessarily have keys.

=head2 Usages

=head3 Garrulous builtins

(I cloned this heading from RFC  259, thanks Damian) (I cloned the list
of  functions  from  RFC 37,  thanks  Jarkko)  (I  cloned the  list  of
standardized key names from RFC 259, thanks again, Damian)

The idea here is that some functions return an array of values that are
hard to keep  track of.  It would be nice  to retain compatibility, but
also be  able to access the members  of the array by  name, rather than
number.  Since these arrays are of fixed size, and known values, we can
apply  the :initialkeys  variation to  these functions.   The functions
remain  fully compatible with  current definitions  and usage  of their
results, however, new code could  be written using the names instead of
the numbers  to access the results.   One example, and  then the cloned
lists of details.

   my ( @stat_array ) = stat ( $filename );
   print "File $filename has a size of $stat_array[size] bytes.\n";

=head4 List of garrulous builtins

        caller [1]
        getgrent
        getgrnam
        getgrgid
        gethostbyaddr
        gethostbyname
        gethostent
        getnetbyaddr
        getnetbyname
        getnetent
        getprotobyname
        getprotobynumber
        getprotoent
        getpwent
        getpwnam
        getpwuid
        getservbyname
        getservbyport
        getservent
        gmtime
        localtime
        stat

Some changes to this list may be necessitated by other changes to Perl6.

=head4 Standardized keys

The standardized keys for these functions would be:

=over 4

=item C<stat>/C<lstat>

                'dev'           Device number of filesystem
                'ino'           Inode number
                'mode'          File mode  (type and permissions)
                'nlink'         Number of (hard) links to the file
                'uid'           Numeric user ID of file's owner
                'gid'           Numeric group ID of file's owner
                'rdev'          The device identifier (special files
only)
                'size'          Total size of file, in bytes
                'atime'         Last access time in seconds since the
epoch
                'mtime'         Last modify time in seconds since the
epoch
                'ctime'         Inode change time in seconds since the
epoch
                'blksize'       Preferred block size for file system I/O

                'blocks'        Actual number of blocks allocated

=item C<localtime>/C<gmtime>

                'sec'           Second
                'min'           Minute
                'hour'          Hour
                'mon'           Month
                'year'          Year
                'mday'          Day of the month
                'wday'          Day of the week
                'yday'          Day of the year
                'isdst'         Is daylight savings time in effect
                                (localtime only)

=item C<caller>

                'package'       Name of the package from which sub was
called
                'file'          Name of the file from which sub was
called
                'line'          Line in the file from which sub was
called
                'sub'           Name by which sub was called
                'args'          Was sub called with args?
                'want'          Hash of values returned by want()
                'eval'          Text of EXPR within eval EXPR
                'req'           Was sub called from a C<require> (or
C<use>)?
                'hints'         Pragmatic hints with which sub was
compiled
                'bitmask'       Bitmask with which sub was compiled

=item C<getpw*>

                'name'          Username
                'passwd'        Crypted password
                'uid'           User ID
                'gid'           Group ID
                'quota'         Disk quota
                'comment'       Administrative comments
                'gcos'          User information
                'dir'           Home directory
                'shell'         Native shell
                'expire'        Expiry date of account of password

=item C<getgr*>

                'name'          Group name
                'passwd'        Group password
                'gid'           Group id
                'members'       Group members

=item C<gethost*>

                'name'          Official host name
                'aliases'       Other host names
                'addrtype'      Host address type
                'length'        Length of address
                'addrs'         Anonymous array of raw addresses in 'C4'
format

=item C<getnet*>

                'name'          Official name of netwwork
                'aliases'       Other names for network
                'addrtype'      Type of network number
                'net'           Network number

=item C<getproto*>

                'name'          Official name of protocol
                'aliases'       Other names for protocol
                'proto'         Protocol number

=item C<getserv*>

                'name'          Official name of service
                'aliases'       Other names for service
                'port'          Port at which service resides
                'proto'         Protocol to be used

=head3 Accessor functions

The :keyonly and :hashsyntax variation would allow objects built out of
keyed arrays to  use (multiple) inheritance, within the  set of objects
built out of keyed arrays, of course.  It seems hard (to me) to inherit
from an object that is a hash  for an object that is an array, and vice
versa.   If the  unified  :hashsyntax variation  is implementable,  one
could easily  convert (with  a pragma?) existing  objects to  use keyed
arrays instead of hashes, and thus gain any benefits for accessor speed
as noted next.

For objects  built out of  them, and if  such objects implement  a fair
number of accessor  function (see RFC 163) which  are effectively fixed
value keyed  lookup and store operations, the  compiler could translate
the fixed key  values in the accessor functions  to an index internally
for speed.

=head3 Pairs

I'm not  yet sure  how this  RFC would interact  with RFC  84.  Clearly
there would be some ramifications, however, should both be adopted.

=head3 Sets

I'm not  yet sure how  this RFC would  interact with RFC  179.  Clearly
there could be some ramifications, however, should both be adopted.

=head3 Private/public

RFC 188 should  interact with this RFC, if both are  adopted.  I see no
conflict to  extending RFC 188 to  use its keywords  with keyed arrays,
with the same semantics on the names.

=head1 IMPLEMENTATION

One possible  implementation of a  keyed array would  be to add  to the
usual array implementation a name table  via a hidden hash and a hidden
numeric value, called the offset, which is initially zero.

The purpose  of the name  table is to  provide the lookup from  name to
number.   For   each  object,  the  name  table   would  contain  (key,
index-base)  pairs  that would  provide  the  translation  from key  to
index-base.  Index-base  is added to  offset to produce the  index into
the array.

The purpose  of the offset  is to be  added to the number  that results
from a  key-to-index translation before you actually  lookup the value.
This  allows operations  such as  shift and  unshift, which  affect the
relationship of all  indexes and data values to  be implemented without
updating each  entry in the name  table.  If a later  lookup returns an
index less  than zero, an undef  is returned.  So  shift would decrease
offset by  the shift  count, and unshift  would increase offset  by the
shift count.  (The shift count is always 1 in perl<6, but see RFC 56.)

With the above in mind, the  algorithm for inserting a new entry in the
name table, would be to create  a pair consisting of (key, $# - offset)
and insert it into the name table for the keyed array.

=head1 REFERENCES

RFC 21: Subroutines: Replace C<wantarray> with a generic C<want> function

RFC 37: Positional Return Lists Considered Harmful

RFC 56: Optional 2nd argument to C<pop()> and C<shift()>

RFC 84: Replace => (stringifying comma) with => (pair constructor)

RFC 127: Sane resolution to large function returns

RFC 163: Objects: Autoaccessors for object data structures

RFC 179: More functions from set theory to manipulate arrays

RFC 188: Objects : Private keys and methods

RFC 241: Pseudo-hashes must die!

RFC 259: Builtins : Make use of hashref context for garrulous builtins


text:
ActsAsWordCloud.configure do |config|
  # The default recursion depth when looking at data in associations.
  # A min_depth of 1 will look at all fields on the current model and the name of each association.
  # A min_depth of 2 will look at all fields on the current model, all fields on the associations, and all names of the association's associations
  # config.default_search_depth = 1

  # This option is useful when associations do not use the acts_as_word_cloud mixin.
  # When word_cloud is called, the system tries to guess a reasonable name for the associated models.
  # It calls the methods in order meaning it will look for name first.
  # Make sure that the final method in this list is on every model
  # config.default_object_names = [:name, :title, :label, :to_s]

  # A list of models that should never be included on the word cloud
  # Examples include user models, auditing or versioning models, and logging models.
  #
  # Each of the contants in this list will be added to the word cloud attribute, excluded_models.
  # This will happen even when the attribute is included in the mixin call.
  # config.permanently_excluded_models = []
end

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<testResults>
  <FitNesseVersion>v20140201</FitNesseVersion>
  <rootPath>FitNesse.SuiteAcceptanceTests.SuiteFixtureTests.SuiteColumnFixtureSpec.TestSaveAndRecallSymbol</rootPath>
    <result>
    <counts>
      <right>5</right>
      <wrong>0</wrong>
      <ignores>0</ignores>
      <exceptions>2</exceptions>
    </counts>
    <runTimeInMillis>5</runTimeInMillis>
    <content>

Expand All

Collapse All

Included page: .FitNesse.SuiteAcceptanceTests.SetUp (edit)

		Import

		fitnesse.fixtures

		SetUp

java.lang.NoClassDefFoundError: org/apache/velocity/context/Context
	at fitnesse.FitNesseContext.<init>(FitNesseContext.java:67)
	at fitnesse.ContextConfigurator.makeFitNesseContext(ContextConfigurator.java:114)
	at fitnesse.testutil.FitNesseUtil.makeTestContext(FitNesseUtil.java:84)
	at fitnesse.testutil.FitNesseUtil.makeTestContext(FitNesseUtil.java:68)
	at fitnesse.fixtures.SetUp.<init>(SetUp.java:24)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at java.lang.Class.newInstance0(Class.java:374)
	at java.lang.Class.newInstance(Class.java:327)
	at fit.FixtureClass.newInstance(FixtureClass.java:24)
	at fit.FixtureLoader.instantiateFixture(FixtureLoader.java:62)
	at fit.FixtureLoader.instantiateFirstValidFixtureClass(FixtureLoader.java:84)
	at fit.FixtureLoader.disgraceThenLoad(FixtureLoader.java:44)
	at fit.Fixture.loadFixture(Fixture.java:141)
	at fit.Fixture.getLinkedFixtureWithArgs(Fixture.java:133)
	at fit.Fixture.interpretFollowingTables(Fixture.java:119)
	at fit.Fixture.interpretTables(Fixture.java:106)
	at fit.Fixture.doTables(Fixture.java:80)
	at fit.FitServer.process(FitServer.java:81)
	at fit.FitServer.run(FitServer.java:56)
	at fit.FitServer.main(FitServer.java:41)
Caused by: java.lang.ClassNotFoundException: org.apache.velocity.context.Context
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 23 more

You can save and recall symbols in a ColumnFixture.  You do this by using the =id? and id= syntax.

=id? or =id() takes the output of a function and stores it in the symbol named by the cell.  In the example below the integer 1 is stored in the symbol one, and the integer 2 is stored in the symbol two.

id= recalls the value of the symbol named by the cell, and puts it in the id variable.

		fitnesse.fixtures.ColumnFixtureTestFixture

		input
		=output?

		1
		one  = 1

		2
		two  = 2

		fitnesse.fixtures.ColumnFixtureTestFixture

		input=
		output?

		one  = 1
		1

		two  = 2
		2

With classed integral types, there's a chance the value may be null as a correct result:

		fitnesse.fixtures.ColumnFixtureTestFixture

		integerInput
		=integerOutput?

		1
		one  = 1

		2
		two  = 2

		null
		three  = null

		fitnesse.fixtures.ColumnFixtureTestFixture

		integerInput=
		integerOutput?

		one  = 1
		1

		two  = 2
		2

		three  = null
		null

public class ColumnFixtureTestFixture extends ColumnFixture
{
  public int input;
  public int output() {return input;}

  public Integer integerInput;
  public Integer integerOutput() { return integerInput; }

  public boolean exception() throws Exception {throw new Exception("I thowed up");}
}

Expand All

Collapse All

Included page: .FitNesse.SuiteAcceptanceTests.TearDown (edit)

		tear down

java.lang.NullPointerException
	at fitnesse.fixtures.TearDown.<init>(TearDown.java:15)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at java.lang.Class.newInstance0(Class.java:374)
	at java.lang.Class.newInstance(Class.java:327)
	at fit.FixtureClass.newInstance(FixtureClass.java:24)
	at fit.FixtureLoader.instantiateFixture(FixtureLoader.java:62)
	at fit.FixtureLoader.instantiateFirstValidFixtureClass(FixtureLoader.java:84)
	at fit.FixtureLoader.disgraceThenLoad(FixtureLoader.java:44)
	at fit.Fixture.loadFixture(Fixture.java:141)
	at fit.Fixture.getLinkedFixtureWithArgs(Fixture.java:133)
	at fit.Fixture.interpretFollowingTables(Fixture.java:119)
	at fit.Fixture.interpretTables(Fixture.java:106)
	at fit.Fixture.doTables(Fixture.java:80)
	at fit.FitServer.process(FitServer.java:81)
	at fit.FitServer.run(FitServer.java:56)
	at fit.FitServer.main(FitServer.java:41)

</content>
    <relativePageName>TestSaveAndRecallSymbol</relativePageName>

  </result>

    <finalCounts>
    <right>0</right>
    <wrong>0</wrong>
    <ignores>0</ignores>
    <exceptions>1</exceptions>
  </finalCounts>
  <totalRunTimeInMillis>5</totalRunTimeInMillis>

</testResults>


text:
package org.apereo.cas.authentication.mfa;

import org.apereo.cas.authentication.AuthenticationException;
import org.apereo.cas.authentication.MultifactorAuthenticationUtils;
import org.apereo.cas.util.RegexUtils;
import org.apereo.cas.util.spring.ApplicationContextProvider;

import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.binding.expression.support.LiteralExpression;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import org.springframework.webflow.context.ExternalContextHolder;
import org.springframework.webflow.context.servlet.ServletExternalContext;
import org.springframework.webflow.engine.Transition;
import org.springframework.webflow.engine.support.DefaultTargetStateResolver;
import org.springframework.webflow.engine.support.DefaultTransitionCriteria;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContextHolder;
import org.springframework.webflow.test.MockRequestContext;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

/**
 * This is {@link MultifactorAuthenticationUtilsTests}.
 *
 * @author Misagh Moayyed
 * @since 6.2.0
 */

@Tag("MFA")
public class MultifactorAuthenticationUtilsTests {

    @Test
    public void verifyMissingTransition() {
        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setCurrentEvent(new Event(this, "currentState"));
        context.setCurrentTransition(new Transition());
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
        RequestContextHolder.setRequestContext(context);
        ExternalContextHolder.setExternalContext(context.getExternalContext());
        assertThrows(AuthenticationException.class,
            () -> MultifactorAuthenticationUtils.validateEventIdForMatchingTransitionInContext("unknown", Optional.of(context), Map.of()));
    }

    @Test
    public void verifyMissingProviderEvent() {
        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
        RequestContextHolder.setRequestContext(context);
        ExternalContextHolder.setExternalContext(context.getExternalContext());

        assertNotNull(MultifactorAuthenticationUtils.evaluateEventForProviderInContext(
            MultifactorAuthenticationTestUtils.getPrincipal("casuser"),
            MultifactorAuthenticationTestUtils.getRegisteredService(),
            Optional.of(context),
            null));
    }

    @Test
    public void verifyAvailProviders() {
        val appCtx = mock(ApplicationContext.class);
        when(appCtx.getBeansOfType(any(), anyBoolean(), anyBoolean())).thenThrow(new RuntimeException());
        assertNotNull(MultifactorAuthenticationUtils.getAvailableMultifactorAuthenticationProviders(appCtx));
    }

    @Test
    public void verifyProviders() {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));

        ApplicationContextProvider.holdApplicationContext(null);
        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        assertFalse(MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderFromApplicationContext(provider.getId()).isPresent());
    }

    @Test
    public void verifyResolveBySingleAttribute() {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));

        ApplicationContextProvider.holdApplicationContext(applicationContext);
        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        assertTrue(MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderFromApplicationContext(provider.getId()).isPresent());

        val targetResolver = new DefaultTargetStateResolver(TestMultifactorAuthenticationProvider.ID);
        val transition = new Transition(new DefaultTransitionCriteria(
            new LiteralExpression(TestMultifactorAuthenticationProvider.ID)), targetResolver);
        context.getRootFlow().getGlobalTransitionSet().add(transition);

        val result = MultifactorAuthenticationUtils.resolveEventViaSingleAttribute(MultifactorAuthenticationTestUtils.getPrincipal("casuser"),
            List.of("mfa-value1"), MultifactorAuthenticationTestUtils.getRegisteredService(),
            Optional.of(context), provider, (s, mfaProvider) -> RegexUtils.find("mismatch-.+", s));
        assertNull(result);
    }

    @Test
    public void verifyResolveByAttribute() {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));

        ApplicationContextProvider.holdApplicationContext(applicationContext);
        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        assertTrue(MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderFromApplicationContext(provider.getId()).isPresent());

        val targetResolver = new DefaultTargetStateResolver(TestMultifactorAuthenticationProvider.ID);
        val transition = new Transition(new DefaultTransitionCriteria(
            new LiteralExpression(TestMultifactorAuthenticationProvider.ID)), targetResolver);
        context.getRootFlow().getGlobalTransitionSet().add(transition);

        val result = MultifactorAuthenticationUtils.resolveEventViaMultivaluedAttribute(MultifactorAuthenticationTestUtils.getPrincipal("casuser"),
            List.of("mfa-value"), MultifactorAuthenticationTestUtils.getRegisteredService(),
            Optional.of(context), provider, (s, mfaProvider) -> RegexUtils.find("mfa-.+", s));
        assertNotNull(result);
        assertFalse(result.isEmpty());
    }

    @Test
    public void verifyMultivaluedAttrs() {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        ApplicationContextProvider.holdApplicationContext(applicationContext);
        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);

        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));

        var result = MultifactorAuthenticationUtils.resolveEventViaMultivaluedAttribute(MultifactorAuthenticationTestUtils.getPrincipal("casuser"),
            List.of("some-value"), MultifactorAuthenticationTestUtils.getRegisteredService(), Optional.of(context), provider,
            (s, mfaProvider) -> {
                throw new RuntimeException("Bad Predicate");
            });
        assertNotNull(result);
        assertTrue(result.isEmpty());

        result = MultifactorAuthenticationUtils.resolveEventViaMultivaluedAttribute(MultifactorAuthenticationTestUtils.getPrincipal("casuser"),
            "some-value", MultifactorAuthenticationTestUtils.getRegisteredService(), Optional.of(context), provider,
            (s, mfaProvider) -> {
                throw new RuntimeException("Bad Predicate");
            });
        assertNull(result);
    }

    @Test
    public void verifyProviderByService() {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        ApplicationContextProvider.holdApplicationContext(applicationContext);
        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        assertTrue(MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderFromApplicationContext(provider.getId()).isPresent());

        val registeredService = MultifactorAuthenticationTestUtils.getRegisteredService();
        when(registeredService.getMultifactorAuthenticationPolicy().getMultifactorAuthenticationProviders()).thenReturn(Set.of("mfa-other"));
        var result = MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderForService(registeredService, applicationContext);
        assertNotNull(result);
        assertTrue(result.isEmpty());

        when(registeredService.getMultifactorAuthenticationPolicy().getMultifactorAuthenticationProviders()).thenReturn(Set.of(provider.getId()));
        result = MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderForService(registeredService, applicationContext);
        assertNotNull(result);
        assertFalse(result.isEmpty());

        when(registeredService.getMultifactorAuthenticationPolicy()).thenReturn(null);
        assertTrue(MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderForService(registeredService, applicationContext).isEmpty());
    }
}


text:
package com.zynaps.demo.rostering;

import com.zynaps.bioforge.Builder;
import com.zynaps.bioforge.schemes.RouletteSelection;
import org.joda.time.format.DateTimeFormat;

import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

class Program {

    public static void main(String[] args) {
        var schedule = Generator.makeArchtype(); // 64, 32, 11
        var rules = new Rules(schedule);
        var mapper = new Mapper(schedule);
        var island = new Builder().tribes(1).selectionScheme(new RouletteSelection(.75))
                                  .populationSize(100)
                                  .genomeSize(mapper.genomeLength)
                                  .crossoverRate(0.3)
                                  .mutationRate(0.0003)
                                  .nuke(true)
                                  .build();
        System.out.println(output(new Controller(schedule, island, mapper, rules).evolve(60)));
    }

    private static String output(List<Assignment> solution) {
        var sorted = solution.stream()
                             .collect(Collectors.groupingBy(assignment -> assignment.shift));

        var fullFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm");
        var shortTimeFormat = DateTimeFormat.forPattern("HH:mm");

        var shifts = sorted.keySet()
                           .stream()
                           .sorted(Comparator.comparingLong(a -> a.start.getMillis()))
                           .collect(Collectors.toList());

        var sb = new StringBuilder();
        sb.append(System.lineSeparator());
        for (var shift : shifts) {
            sb.append(String.format("Shift: %d, Requires: %d, Start: %s, End: %s",
                                    shift.id,
                                    shift.required,
                                    shift.start.toString(fullFormat),
                                    shift.end.toString(fullFormat)));
            sb.append(System.lineSeparator());
            var assignments = sorted.get(shift)
                                    .stream()
                                    .sorted(Comparator.comparingInt(a -> a.employee.id))
                                    .collect(Collectors.toList());
            for (var assignment : assignments) {
                sb.append(String.format(" Employee: %d", assignment.employee.id));
                sb.append(System.lineSeparator());
                for (var a : assignment.employee.absences) {
                    sb.append(String.format("  Absent: %s to %s",
                                            a.start.toString(fullFormat),
                                            a.end.toString(shortTimeFormat)));
                    sb.append(System.lineSeparator());
                }
            }
            sb.append(System.lineSeparator());
        }

        return sb.toString();
    }
}


text:
#pragma once
#include <aws/location/LocationService_EXPORTS.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace LocationService
{
namespace Model
{

  /**
   *
Contains details of an existing map resource in your AWS
   * account.

See Also:
   AWS
   * API Reference

   */
  class AWS_LOCATIONSERVICE_API ListMapsResponseEntry
  {
  public:
    ListMapsResponseEntry();
    ListMapsResponseEntry(Aws::Utils::Json::JsonView jsonValue);
    ListMapsResponseEntry& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The timestamp for when the map resource was created in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline const Aws::Utils::DateTime& GetCreateTime() const{ return m_createTime; }

    /**
     *
The timestamp for when the map resource was created in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline bool CreateTimeHasBeenSet() const { return m_createTimeHasBeenSet; }

    /**
     *
The timestamp for when the map resource was created in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline void SetCreateTime(const Aws::Utils::DateTime& value) { m_createTimeHasBeenSet = true; m_createTime = value; }

    /**
     *
The timestamp for when the map resource was created in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline void SetCreateTime(Aws::Utils::DateTime&& value) { m_createTimeHasBeenSet = true; m_createTime = std::move(value); }

    /**
     *
The timestamp for when the map resource was created in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline ListMapsResponseEntry& WithCreateTime(const Aws::Utils::DateTime& value) { SetCreateTime(value); return *this;}

    /**
     *
The timestamp for when the map resource was created in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline ListMapsResponseEntry& WithCreateTime(Aws::Utils::DateTime&& value) { SetCreateTime(std::move(value)); return *this;}

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline const Aws::String& GetDataSource() const{ return m_dataSource; }

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline bool DataSourceHasBeenSet() const { return m_dataSourceHasBeenSet; }

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline void SetDataSource(const Aws::String& value) { m_dataSourceHasBeenSet = true; m_dataSource = value; }

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline void SetDataSource(Aws::String&& value) { m_dataSourceHasBeenSet = true; m_dataSource = std::move(value); }

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline void SetDataSource(const char* value) { m_dataSourceHasBeenSet = true; m_dataSource.assign(value); }

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline ListMapsResponseEntry& WithDataSource(const Aws::String& value) { SetDataSource(value); return *this;}

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline ListMapsResponseEntry& WithDataSource(Aws::String&& value) { SetDataSource(std::move(value)); return *this;}

    /**
     *
Specifies the data provider for the associated map tiles.

     */
    inline ListMapsResponseEntry& WithDataSource(const char* value) { SetDataSource(value); return *this;}

    /**
     *
The description for the map resource.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
The description for the map resource.

     */
    inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }

    /**
     *
The description for the map resource.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
The description for the map resource.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }

    /**
     *
The description for the map resource.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
The description for the map resource.

     */
    inline ListMapsResponseEntry& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
The description for the map resource.

     */
    inline ListMapsResponseEntry& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
The description for the map resource.

     */
    inline ListMapsResponseEntry& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
The name of the associated map resource.

     */
    inline const Aws::String& GetMapName() const{ return m_mapName; }

    /**
     *
The name of the associated map resource.

     */
    inline bool MapNameHasBeenSet() const { return m_mapNameHasBeenSet; }

    /**
     *
The name of the associated map resource.

     */
    inline void SetMapName(const Aws::String& value) { m_mapNameHasBeenSet = true; m_mapName = value; }

    /**
     *
The name of the associated map resource.

     */
    inline void SetMapName(Aws::String&& value) { m_mapNameHasBeenSet = true; m_mapName = std::move(value); }

    /**
     *
The name of the associated map resource.

     */
    inline void SetMapName(const char* value) { m_mapNameHasBeenSet = true; m_mapName.assign(value); }

    /**
     *
The name of the associated map resource.

     */
    inline ListMapsResponseEntry& WithMapName(const Aws::String& value) { SetMapName(value); return *this;}

    /**
     *
The name of the associated map resource.

     */
    inline ListMapsResponseEntry& WithMapName(Aws::String&& value) { SetMapName(std::move(value)); return *this;}

    /**
     *
The name of the associated map resource.

     */
    inline ListMapsResponseEntry& WithMapName(const char* value) { SetMapName(value); return *this;}

    /**
     *
The timestamp for when the map resource was last updated in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline const Aws::Utils::DateTime& GetUpdateTime() const{ return m_updateTime; }

    /**
     *
The timestamp for when the map resource was last updated in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline bool UpdateTimeHasBeenSet() const { return m_updateTimeHasBeenSet; }

    /**
     *
The timestamp for when the map resource was last updated in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline void SetUpdateTime(const Aws::Utils::DateTime& value) { m_updateTimeHasBeenSet = true; m_updateTime = value; }

    /**
     *
The timestamp for when the map resource was last updated in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline void SetUpdateTime(Aws::Utils::DateTime&& value) { m_updateTimeHasBeenSet = true; m_updateTime = std::move(value); }

    /**
     *
The timestamp for when the map resource was last updated in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline ListMapsResponseEntry& WithUpdateTime(const Aws::Utils::DateTime& value) { SetUpdateTime(value); return *this;}

    /**
     *
The timestamp for when the map resource was last updated in ISO 8601
     * format: YYYY-MM-DDThh:mm:ss.sssZ.

     */
    inline ListMapsResponseEntry& WithUpdateTime(Aws::Utils::DateTime&& value) { SetUpdateTime(std::move(value)); return *this;}

  private:

    Aws::Utils::DateTime m_createTime;
    bool m_createTimeHasBeenSet = false;

    Aws::String m_dataSource;
    bool m_dataSourceHasBeenSet = false;

    Aws::String m_description;
    bool m_descriptionHasBeenSet = false;

    Aws::String m_mapName;
    bool m_mapNameHasBeenSet = false;

    Aws::Utils::DateTime m_updateTime;
    bool m_updateTimeHasBeenSet = false;
  };

} // namespace Model
} // namespace LocationService
} // namespace Aws


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28639_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans129.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Energy Ser vices.,,
Job Number: SVGJ-141068
Company: EOG Resources, Inc.
Lease/Well: Parshall 92-28H
Location: Mountrail County, ND Rig Name: H&P #316
RKB: 24'
G.L. or M.S.L.: GL
State/Country: North Dakota/USA Declination: 7.25°
Grid: East To True North
File name: S:\2014SU-1\EOG\GJ\PARSHALL\92\28H.SW Date/Time: 04-Sep-14 l 12:51
Curve Name: Surface - 1944' MD. (Rate Gyro)

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">MS SURVEY

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">WINSERVE SURVEY CALCULATIONS Minimum Curvature Method
\/...4.'.v.l 0-.."-.. 1-"... an

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">VUIUUdl oeuuun mane .UU Vertical Section Referenced to Wellhead Rectangular Coordinates Referenced to Wellhead

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Measured Incl Dn'ft Depth Angle Direction FT Deg Deg

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">True Vertical Depth

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">.00 100.00 200.00 300.00 400.00
.00 .10 .56 .63 .40
.00 229.75 19.32 335.04 320.06
.00 100.00 200.00 299.99 399.99
.00 -.06 .35 1.31 2.07
.00 —.07 .03 -.04 —.50
.00 -.06 .35 1.31 2.07
.00 .09 .35 1.31 2.13
.00 229.75 4.67 358.17 346.50
.00 .10 .65 .45 .26

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">500.00 600.00 700.00 800.00 900.00

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Page 1

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">N-s FT

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">.17 .47 .63 .27 .26

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">E-W FT

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">10.57 34.56 351.97 284.25 208.17

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Vertical Section FT

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">499.99 599.99 699.98 799.98 899.98

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">C L O S U R E Distance Direction FT Dea

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">2.49 2.97 3.85 4.46 4.31

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Dogleg Severity Bea/100

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">2.49 2.97 3.85 4.46 4.31

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">2.58 3.00 3.86 4.49 4.41

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">344.39 351.67 355.86 352.53 347.96

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">.32 .32 .43 .58 .33


text:
module Ans::Updates
  module SpecHelper

    def self.for_view_spec

      # view のテストでルーティングエラーになる問題を回避
      Helper.send :define_method, :updates_get_link do |label,opts={}|
      end

    end

  end
end


text: export { default } from '@datahub/shared/components/health/health-factor-action';


text:
#pragma once
#include "synthfunctions.h"
#include "ModulationMatrix.h"

#define AMP_MOD_RANGE -96	// -96dB

class CDCA
{
public:
	CDCA(void);
	~CDCA(void);

	CModulationMatrix* m_pModulationMatrix;

	UINT m_uModSourceEG;
	UINT m_uModSourceAmp;
	UINT m_uModSourceVelocity;
	UINT m_uModSourcePan;

protected:
	// our internal gain variable
	double m_dGain;

	// velocity input from MIDI keyboard
	// need this separated for legato mode NO figure it out!
	UINT m_uMIDIVelocity; // 0 -> 127

	// controls for user GUI (optional)
	double m_dAmplitude_dB;		// the user's control setting in dB
	double m_dAmplitudeControl;	// the user's control setting, converted from dB

	// pan control
	double m_dPanControl;	/* -1 to +1 == left to right */

	// modulate amplitude
	double m_dAmpMod;				/* modulation input for LFOs */

	// input to EGMod is EXPONENTIAL
	double m_dEGMod;		 /* modulation input for EG 0 to +1 */

	// input to modulate pan control is bipolar
	double m_dPanMod;			/* modulation input for EG 0 to +1 */

public:
	// MIDI controller functions
	inline void setMIDIVelocity(UINT u){m_uMIDIVelocity = u;}

	// expecting connection from bipolar source (LFO)
	// but this component will only be able to attenuate
	// so convert to unipolar
	inline void setAmpMod(double d){m_dAmpMod = bipolarToUnipolar(d);}

	// EG Mod Input Functions
	inline void setEGMod(double d){m_dEGMod = d;}

	// Pan control and Mod Input Functions
	inline void setPanControl(double d){m_dPanControl = d;}
	inline void setPanMod(double d){m_dPanMod = d;}

	inline void reset()
	{
		m_dEGMod = 1.0;
		m_dAmpMod = 1.0;
	}

	// -96dB to +20dB
	inline void setAmplitude_dB(double d)
	{
		m_dAmplitude_dB = d;
		m_dAmplitudeControl = pow((double)10.0, m_dAmplitude_dB/(double)20.0);
	}

	// recalculate gain value
	inline void updateDCA()
	{
		if(m_pModulationMatrix)
		{
			if(m_uModSourceEG != DEST_NONE)
				m_dEGMod = m_pModulationMatrix->m_dDestinations[m_uModSourceEG];
			if(m_uModSourceAmp != DEST_NONE)
				m_dAmpMod = m_pModulationMatrix->m_dDestinations[m_uModSourceAmp];
			if(m_uModSourceVelocity != DEST_NONE)
				m_uMIDIVelocity = m_pModulationMatrix->m_dDestinations[m_uModSourceVelocity];
		}

		// check polarity
		if(m_dEGMod >= 0)
			m_dGain = m_dEGMod;
		else
			m_dGain = m_dEGMod + 1.0;

		// amp mod is attenuation only, in dB
		m_dGain *= pow(10.0, m_dAmpMod/(double)20.0);

		// use MMA MIDI->Atten (convex) transform
		m_dGain *= mmaMIDItoAtten(m_uMIDIVelocity);
	}

	// do the DCA: uses pass-by-reference for outputs
	inline void doMonoDCA(double dInput, double& dLeftOutput, double& dRightOutput)
	{
		if(m_pModulationMatrix)
		{
			if(m_uModSourcePan != DEST_NONE)
				m_dPanMod = m_pModulationMatrix->m_dDestinations[m_uModSourcePan];
		}

		// total pan value
		double dPanTotal = m_dPanControl + m_dPanMod;

		// limit in case pan control is biased
		dPanTotal = fmin(dPanTotal, 1.0);
		dPanTotal = fmax(dPanTotal, -1.0);

		double dPanLeft = 0.707;
		double dPanRight = 0.707;

		// equal power calculation in synthfunction.h
		calculatePanValues(dPanTotal, dPanLeft, dPanRight);

		// form left and right outputs
		dLeftOutput =  dPanLeft*m_dAmplitudeControl*dInput*m_dGain;
		dRightOutput =  dPanRight*m_dAmplitudeControl*dInput*m_dGain;
	}

	// do the DCA: uses pass-by-reference for outputs
	// stereo version
	inline void doStereoDCA(double dLeftInput, double dRightInput, double& dLeftOutput, double& dRightOutput)
	{
		// total pan value
		if(m_pModulationMatrix)
		{
			if(m_uModSourcePan != DEST_NONE)
				m_dPanMod = m_pModulationMatrix->m_dDestinations[m_uModSourcePan];
		}

		// total pan value
		double dPanTotal = m_dPanControl + m_dPanMod;

		// limit in case pan control is biased
		dPanTotal = fmin(dPanTotal, 1.0);
		dPanTotal = fmax(dPanTotal, -1.0);

		double dPanLeft = 0.707;
		double dPanRight = 0.707;

		// equal power calculation in synthfunction.h
		calculatePanValues(dPanTotal, dPanLeft, dPanRight);

		// form left and right outputs
		dLeftOutput =  dPanLeft*m_dAmplitudeControl*dLeftInput*m_dGain;
		dRightOutput =  dPanRight*m_dAmplitudeControl*dRightInput*m_dGain;
	}
};


text:
require 'spec_helper'

klass = OneviewSDK::API600::C7000::StoragePool
RSpec.describe klass, integration: true, type: UPDATE, sequence: seq(klass) do
  include_examples 'StoragePoolUpdateExample API500'
end


text:
FCK.ContextMenu = new Object();
FCK.ContextMenu.Listeners = new Array();

FCK.ContextMenu.RegisterListener = function(listener) {
	if (listener)
		this.Listeners.push(listener);
}

function FCK_ContextMenu_Init() {
	var oInnerContextMenu = FCK.ContextMenu._InnerContextMenu = new FCKContextMenu(
			FCKBrowserInfo.IsIE ? window : window.parent, FCKLang.Dir);
	oInnerContextMenu.CtrlDisable = FCKConfig.BrowserContextMenuOnCtrl;
	oInnerContextMenu.OnBeforeOpen = FCK_ContextMenu_OnBeforeOpen;
	oInnerContextMenu.OnItemClick = FCK_ContextMenu_OnItemClick;

	// Get the registering function.
	var oMenu = FCK.ContextMenu;

	// Register all configured context menu listeners.
	for (var i = 0; i < FCKConfig.ContextMenu.length; i++)
		oMenu
				.RegisterListener(FCK_ContextMenu_GetListener(FCKConfig.ContextMenu[i]));
}

function FCK_ContextMenu_GetListener(listenerName) {
	switch (listenerName) {
		case 'Generic' :
			return {
				AddItems : function(menu, tag, tagName) {
					menu
							.AddItem(
									'Cut',
									FCKLang.Cut,
									7,
									FCKCommands.GetCommand('Cut').GetState() == FCK_TRISTATE_DISABLED);
					menu
							.AddItem(
									'Copy',
									FCKLang.Copy,
									8,
									FCKCommands.GetCommand('Copy').GetState() == FCK_TRISTATE_DISABLED);
					menu
							.AddItem(
									'Paste',
									FCKLang.Paste,
									9,
									FCKCommands.GetCommand('Paste').GetState() == FCK_TRISTATE_DISABLED);
				}
			};

		case 'Table' :
			return {
				AddItems : function(menu, tag, tagName) {
					var bIsTable = (tagName == 'TABLE');
					var bIsCell = (!bIsTable && FCKSelection
							.HasAncestorNode('TABLE'));

					if (bIsCell) {
						menu.AddSeparator();
						var oItem = menu.AddItem('Cell', FCKLang.CellCM);
						oItem.AddItem('TableInsertCellBefore',
								FCKLang.InsertCellBefore, 69);
						oItem.AddItem('TableInsertCellAfter',
								FCKLang.InsertCellAfter, 58);
						oItem.AddItem('TableDeleteCells', FCKLang.DeleteCells,
								59);
						if (FCKBrowserInfo.IsGecko)
							oItem
									.AddItem(
											'TableMergeCells',
											FCKLang.MergeCells,
											60,
											FCKCommands
													.GetCommand('TableMergeCells')
													.GetState() == FCK_TRISTATE_DISABLED);
						else {
							oItem
									.AddItem(
											'TableMergeRight',
											FCKLang.MergeRight,
											60,
											FCKCommands
													.GetCommand('TableMergeRight')
													.GetState() == FCK_TRISTATE_DISABLED);
							oItem
									.AddItem(
											'TableMergeDown',
											FCKLang.MergeDown,
											60,
											FCKCommands
													.GetCommand('TableMergeDown')
													.GetState() == FCK_TRISTATE_DISABLED);
						}
						oItem.AddItem('TableHorizontalSplitCell',
								FCKLang.HorizontalSplitCell, 61, FCKCommands
										.GetCommand('TableHorizontalSplitCell')
										.GetState() == FCK_TRISTATE_DISABLED);
						oItem.AddItem('TableVerticalSplitCell',
								FCKLang.VerticalSplitCell, 61, FCKCommands
										.GetCommand('TableVerticalSplitCell')
										.GetState() == FCK_TRISTATE_DISABLED);
						oItem.AddSeparator();
						oItem.AddItem('TableCellProp', FCKLang.CellProperties,
								57, FCKCommands.GetCommand('TableCellProp')
										.GetState() == FCK_TRISTATE_DISABLED);

						menu.AddSeparator();
						oItem = menu.AddItem('Row', FCKLang.RowCM);
						oItem.AddItem('TableInsertRowBefore',
								FCKLang.InsertRowBefore, 70);
						oItem.AddItem('TableInsertRowAfter',
								FCKLang.InsertRowAfter, 62);
						oItem
								.AddItem('TableDeleteRows', FCKLang.DeleteRows,
										63);

						menu.AddSeparator();
						oItem = menu.AddItem('Column', FCKLang.ColumnCM);
						oItem.AddItem('TableInsertColumnBefore',
								FCKLang.InsertColumnBefore, 71);
						oItem.AddItem('TableInsertColumnAfter',
								FCKLang.InsertColumnAfter, 64);
						oItem.AddItem('TableDeleteColumns',
								FCKLang.DeleteColumns, 65);
					}

					if (bIsTable || bIsCell) {
						menu.AddSeparator();
						menu.AddItem('TableDelete', FCKLang.TableDelete);
						menu.AddItem('TableProp', FCKLang.TableProperties, 39);
					}
				}
			};

		case 'Link' :
			return {
				AddItems : function(menu, tag, tagName) {
					var bInsideLink = (tagName == 'A' || FCKSelection
							.HasAncestorNode('A'));

					if (bInsideLink
							|| FCK.GetNamedCommandState('Unlink') != FCK_TRISTATE_DISABLED) {
						// Go up to the anchor to test its properties
						var oLink = FCKSelection.MoveToAncestorNode('A');
						var bIsAnchor = (oLink && oLink.name.length > 0 && oLink.href.length == 0);
						// If it isn't a link then don't add the Link context
						// menu
						if (bIsAnchor)
							return;

						menu.AddSeparator();
						menu.AddItem('VisitLink', FCKLang.VisitLink);
						menu.AddSeparator();
						if (bInsideLink)
							menu.AddItem('Link', FCKLang.EditLink, 34);
						menu.AddItem('Unlink', FCKLang.RemoveLink, 35);
					}
				}
			};

		case 'Image' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'IMG' && !tag.getAttribute('_fckfakelement')) {
						menu.AddSeparator();
						menu.AddItem('Image', FCKLang.ImageProperties, 37);
					}
				}
			};

		case 'Anchor' :
			return {
				AddItems : function(menu, tag, tagName) {
					// Go up to the anchor to test its properties
					var oLink = FCKSelection.MoveToAncestorNode('A');
					var bIsAnchor = (oLink && oLink.name.length > 0);

					if (bIsAnchor
							|| (tagName == 'IMG' && tag
									.getAttribute('_fckanchor'))) {
						menu.AddSeparator();
						menu.AddItem('Anchor', FCKLang.AnchorProp, 36);
						menu.AddItem('AnchorDelete', FCKLang.AnchorDelete);
					}
				}
			};

		case 'Flash' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'IMG' && tag.getAttribute('_fckflash')) {
						menu.AddSeparator();
						menu.AddItem('Flash', FCKLang.FlashProperties, 38);
					}
				}
			};

		case 'Form' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (FCKSelection.HasAncestorNode('FORM')) {
						menu.AddSeparator();
						menu.AddItem('Form', FCKLang.FormProp, 48);
					}
				}
			};

		case 'Checkbox' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'INPUT' && tag.type == 'checkbox') {
						menu.AddSeparator();
						menu.AddItem('Checkbox', FCKLang.CheckboxProp, 49);
					}
				}
			};

		case 'Radio' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'INPUT' && tag.type == 'radio') {
						menu.AddSeparator();
						menu.AddItem('Radio', FCKLang.RadioButtonProp, 50);
					}
				}
			};

		case 'TextField' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'INPUT'
							&& (tag.type == 'text' || tag.type == 'password')) {
						menu.AddSeparator();
						menu.AddItem('TextField', FCKLang.TextFieldProp, 51);
					}
				}
			};

		case 'HiddenField' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'IMG' && tag.getAttribute('_fckinputhidden')) {
						menu.AddSeparator();
						menu
								.AddItem('HiddenField',
										FCKLang.HiddenFieldProp, 56);
					}
				}
			};

		case 'ImageButton' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'INPUT' && tag.type == 'image') {
						menu.AddSeparator();
						menu
								.AddItem('ImageButton',
										FCKLang.ImageButtonProp, 55);
					}
				}
			};

		case 'Button' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'INPUT'
							&& (tag.type == 'button' || tag.type == 'submit' || tag.type == 'reset')) {
						menu.AddSeparator();
						menu.AddItem('Button', FCKLang.ButtonProp, 54);
					}
				}
			};

		case 'Select' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'SELECT') {
						menu.AddSeparator();
						menu.AddItem('Select', FCKLang.SelectionFieldProp, 53);
					}
				}
			};

		case 'Textarea' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (tagName == 'TEXTAREA') {
						menu.AddSeparator();
						menu.AddItem('Textarea', FCKLang.TextareaProp, 52);
					}
				}
			};

		case 'BulletedList' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (FCKSelection.HasAncestorNode('UL')) {
						menu.AddSeparator();
						menu.AddItem('BulletedList', FCKLang.BulletedListProp,
								27);
					}
				}
			};

		case 'NumberedList' :
			return {
				AddItems : function(menu, tag, tagName) {
					if (FCKSelection.HasAncestorNode('OL')) {
						menu.AddSeparator();
						menu.AddItem('NumberedList', FCKLang.NumberedListProp,
								26);
					}
				}
			};

		case 'DivContainer' :
			return {
				AddItems : function(menu, tag, tagName) {
					var currentBlocks = FCKDomTools.GetSelectedDivContainers();

					if (currentBlocks.length > 0) {
						menu.AddSeparator();
						menu.AddItem('EditDiv', FCKLang.EditDiv, 75);
						menu.AddItem('DeleteDiv', FCKLang.DeleteDiv, 76);
					}
				}
			};

	}
	return null;
}

function FCK_ContextMenu_OnBeforeOpen() {
	// Update the UI.
	FCK.Events.FireEvent('OnSelectionChange');

	// Get the actual selected tag (if any).
	var oTag, sTagName;

	// The extra () is to avoid a warning with strict error checking. This is
	// ok.
	if ((oTag = FCKSelection.GetSelectedElement()))
		sTagName = oTag.tagName;

	// Cleanup the current menu items.
	var oMenu = FCK.ContextMenu._InnerContextMenu;
	oMenu.RemoveAllItems();

	// Loop through the listeners.
	var aListeners = FCK.ContextMenu.Listeners;
	for (var i = 0; i < aListeners.length; i++)
		aListeners[i].AddItems(oMenu, oTag, sTagName);
}

function FCK_ContextMenu_OnItemClick(item) {
	FCK.Focus();
	FCKCommands.GetCommand(item.Name).Execute(item.CustomData);
}


text:
/**
 * @author Santokh Singh
 *
 */
function LandscapeLabels() {
	this.labels = {};
	this.fontSize = 16;
	this.fontColor = "Red";
	this.labelColor = "White";
	this.fontWeight = null;
	this.tagBox = {}
	this.landscapeLabelPrefix = "landscapeLabel_";
	var me = this;

	// -----------------------------------------------------------------------
	LandscapeLabels.prototype.init = function(labels, tagBox) {
		if (labels["labels"] != undefined) {
			if (labels["labelcolor"] != undefined) {
				this.labelColor = labels["labelcolour"];
			}
			if (labels["fontsize"] != undefined) {
				this.fontSize = labels["labelcolour"];
			}
			this.labels = labels["labels"];
			this.tagBox = tagBox;
			this.landscapeLabelPrefix = "landscapeLabel_";
			me = this;

		}
	}

	// -----------------------------------------------------------------------
	LandscapeLabels.prototype.addUrankTagStyling = function(index, color){
		var tagId = this.landscapeLabelPrefix + index;
		var a = tagCloudCanvas.select("#"+tagId);
		var b = d3.select("#"+tagId);
		if(!d3.select("#"+tagId).empty()) {
			$tag = d3.select("#"+tagId);
			var prevColor  = $tag.style("color");
			$tag = d3.select("#"+tagId);
			$tag.style("color", prevColor );
		    $tag.style("fill", color );
			$tag.style("font-weight", "bold");
		}
	}

	// -----------------------------------------------------------------------
	LandscapeLabels.prototype.removeUrankTagStyling = function(index){
		var tagId = this.landscapeLabelPrefix + index;
		if(!d3.select("#"+tagId).empty()) {
			$tag = d3.select("#"+tagId);
			var prevColor  = $tag.style("color");
			var test = this.labelColor;
			$tag.style("fill", prevColor );
			$tag.style("font-weight", null);
		}
	}

	LandscapeLabels.prototype.processLabels = function() {

	}

	// -----------------------------------------------------------------------
	LandscapeLabels.prototype.drawLabels = function() {
		svgcanvas.selectAll("#landscapeLabelDragLines").remove();
		svgcanvas.selectAll("#landscapeLabel").remove();

	   	//--------------------------------------------------------------------------------------

		var fontSize = this.fontSize;
		var fontColor = this.fontColor;
		var labelColor = this.labelColor;
		var fontWeight = this.fontWeight;
		var totalScreenWidth = 2024;
		var containerWidth = totalScreenWidth*0.40;
		var labelScale = d3.scale.linear().domain([ 0, containerWidth ]).range([4, 16 ]);
		fontSize = labelScale(landscapeConfig.getWidth());

		// create labels containers
		//---------------------------------------------------------------------------------------
		var landscapeLabelsDragingLines = svgcanvas.append("g")
			.attr("class", "landscapeLabels")
			.attr("id", "landscapeLabelDragLines")
		var landscapeLabelsContainer = svgcanvas.append("g")
			.attr("class", "landscapeLabels")
			.attr("id", "landscapeLabel")
		//--------------------------------------------------------------------------------------

		// Drag labels rectangle
		//---------------------------------------------------------------------------------------
		var dragLabelsRectangle = d3.behavior.drag().origin(function() {
				var t = d3.select(this);
				return {x: t.attr("x") + d3.transform(t.attr("transform")).translate[0],
						y: t.attr("y") + d3.transform(t.attr("transform")).translate[1]};
	        }).on("drag", function(d,i) {
	            var id = d3.select(this).attr("id");
	            var rectId = id + "_rect";
	            var lineId = id + "_line";
	            var transX = 0;
	            var transY = 0;
	            d3.select(this).attr("transform", function(d,i){
	            	transX =  d3.event.x;
	            	transY = d3.event.y ;
	                return "translate(" + [ d3.event.x,d3.event.y ] + ")"
	            })

	            var rect = landscapeLabelsContainer.select("#"+rectId);
	            var dx = parseInt(rect.attr("x")) ;
	            var dy =  parseInt(rect.attr("y"));
	            var width =  parseInt(rect.attr("width")) / 2;
	            var height =  parseInt(rect.attr("height")) / 2;
	            var xMiddle = dx + width + transX;
	            var yMiddle = dy + height + transY;
	            landscapeLabelsDragingLines.select("#"+lineId)
				    .attr("x2", xMiddle)
				    .attr("y2", yMiddle);
	   	});

		var totalLabelCounter = 0;
		$.each(this.labels, function(labelindex, label) {

			var labelsText = label["labels"]
			var labelWeight = label["weight"];
			var keywordsObj = label.keywords;
			if(labelsText ==null || labelsText == "" || labelsText.length < 1) {
				return true;
			}
			var labelDepth = label["depth"]
			var labelPosX = label["coordinates"][0] * landscapeConfig.getWidth();
			var labelPosY = label["coordinates"][1] * landscapeConfig.getHeight();
			var labelCounter = 0;
			// var documentsIds = [];
			// for(var i =0; i< label["docs"].length; i++ ) {
				// documentsIds.push("doc_"+label["docs"][i]);
			// }

			// get Label with max Length
			//-------------------------------------------------------------------------------------
			var textBoxHeight = 15;
			var textBoxWidth = 15;
			var maxTextLenght = 0;
			var maxCharText = "";
			$.each(labelsText, function(index, text) {
				var length = text.length;
				if (length > maxTextLenght) {
					maxTextLenght = length;
					maxCharText = text;
				}
			});
			//-------------------------------------------------------------------------------------

			// create Label group which will holds a group of labels
			var landscapeLabels = landscapeLabelsContainer.append("g")
				.attr("id", labelindex)
				.call(dragLabelsRectangle);
			//-------------------------------------------------------------------------------------

			var dummyText = landscapeLabels.append("svg:text")
				.attr("dx", labelPosX - 2)
				.attr("dy", labelPosY)
				.attr("id", "dummyLandscapeLabel").attr("depth", labelDepth)
				.style("font-size", (fontSize+labelWeight))
				.style("fill", labelColor)
				.text(maxCharText)

			textBoxHeight = dummyText.node().getBBox().height;
			textBoxWidth = dummyText.node().getBBox().width;

			svgcanvas.selectAll("#dummyLandscapeLabel").remove();

			var textBoxPosX = labelPosX - (textBoxWidth + 15)/2;
			var textBoxPosY =  labelPosY - textBoxHeight;

			if((textBoxPosX + textBoxWidth + 15) > landscapeConfig.getWidth()) {
				textBoxPosX = textBoxPosX  + landscapeConfig.getWidth() - (textBoxPosX + textBoxWidth + 15)-2;
			}

			if((textBoxPosY + labelsText.length * textBoxHeight + 10) > landscapeConfig.getHeight()) {
				textBoxPosY = textBoxPosY  + landscapeConfig.getHeight() - (textBoxPosY + labelsText.length * textBoxHeight + 10)-2;
			}

			var textBox = landscapeLabels
				.append("rect")
				.attr("id",labelindex+"_rect")
				.attr("x",textBoxPosX)
				.attr("y", textBoxPosY)
				.attr("height", labelsText.length * textBoxHeight + 10)
				.attr("width",textBoxWidth + 15)
				.attr("rx", "10")
				.attr("ry", "10")
				.style(	"opacity", 0.3)
				.style("stroke-opacity", 0.3)
				.on("mouseover", function(d, i) {
					d3.select(this).style("opacity", 0.5);
					d3.select(this).style("stroke-opacity", 0.5);
					d3.select(this).style("cursor", "pointer");
				})
				.on("mouseout", function(d, i) {
					d3.select(this).style("opacity", 0.3)
					d3.select(this).style("stroke-opacity", 0.3)
				})
			var lineId = labelindex+"_line";
			landscapeLabelsDragingLines.append("line")
			    .style("stroke", "black")
			   	.attr("id", lineId)
			    .attr("x1", labelPosX)
			    .attr("y1", labelPosY)
			    .attr("x2", labelPosX)
			    .attr("y2", labelPosY)
				.style("stroke-dasharray", ("3, 3"))
				//.style("opacity", 0.0)
				//.style("stroke-opacity", 0.0)

			$.each(labelsText, function(index, text) {
				var stem = text;
				var labelIndex = totalLabelCounter;
				if(landscapeConfig.getLandscapeType() == "urankLandscape") {
					for(var j=0; j < keywordsObj.length; j++) {
						if(keywordsObj[j].term == text) {
							stem = keywordsObj[j].stem;
							labelIndex = keywordsObj[j].index;
						}
					}
				}

				var padding = (textBoxWidth+15-text.length)/2;
				var dummyText2 = landscapeLabels.append("svg:text")
					.attr("dx", labelPosX - 2)
					.attr("dy", labelPosY)
					.attr("id", "dummyLandscapeLabel2").attr("depth", labelDepth)
					.style("font-size", (fontSize+labelWeight))
					.style("fill", labelColor)
					.text(text)

				var dummyTextWidth = dummyText2.node().getBBox().width;
				var padding = (textBoxWidth+15-dummyTextWidth)/2;
					svgcanvas.selectAll("#dummyLandscapeLabel2").remove();
					landscapeLabels.append("svg:text")
					.attr("id", "landscapeLabel_" + labelIndex)
					.attr("dx", textBoxPosX  +  padding)
					.attr("dy", (textBoxPosY + (labelCounter * textBoxHeight))+15)//
					.attr("depth", labelDepth)
					.attr("color", labelColor)
					.attr("stem", stem)
					.style("font-size", (fontSize+labelWeight))
					.style("fill", labelColor)
					.style("font-weight", fontWeight)
					.text(text)
					.attr("labelCounter", labelIndex)
						.attr("isLabelInTagBox", 0)
					.attr("labelID", labelindex).attr("text", text)
					.on("mouseover",function(d, i) {
						var color = d3.select(this).style("fill")
						d3.select(this).attr("color", color);
						d3.select(this).style("cursor", "pointer")
						d3.select(this).style("font-size", (fontSize+labelWeight))
						d3.select(this).style("fill", "#FFBE3B")
						d3.select(this).style("font-weight", "bold")
						var stem = d3.select(this).attr("stem");
						var tagDataset = landscapeController.dataProcessor.getObjectsBasedOnTag(stem);
						if(landscapeConfig.getLandscapeType() == "standaloneLandscape") {
							landscapeController.stateCurrent.heighlightDocumentsByIds(tagDataset.indices);
						}
						else if(landscapeConfig.getLandscapeType() == "urankLandscape") {
							var i = parseInt(d3.select(this).attr("labelCounter"));
							var label = d3.select(this).attr("text");
							var tagIdPrefix = "urank-tag-";
							var tagClass = 'urank-tagcloud-tag';

							var mousePos = landscapeConfig.getCurrentMousePos();
							var tagId = tagIdPrefix + i;
							 var padding = 4;
							 $('#'+tagId).css({'top':(mousePos[1]-padding),'left':(mousePos[0]-padding)}).fadeIn();
							 $('.'+tagClass).hide();
   							 $('#'+tagId).show();
						}
					})
					.on("mouseout", function(d, i) {
						var color = d3.select(this).attr("color")
						d3.select(this).style("fill", color);
						d3.select(this).style("font-weight", null)
						if(landscapeConfig.getLandscapeType() == "standaloneLandscape") {
							landscapeController.stateCurrent.heighlightDocumentsByIds([]);
						}

					}).on("click", function(d, i) {
						var tag = $( this ).html();
						var stem = d3.select(this).attr("stem");
						if(landscapeConfig.getLandscapeType() == "standaloneLandscape") {
							var tagDataset = landscapeController.dataProcessor.getObjectsBasedOnTag(stem);
							FilterHandler.setCurrentFilterCategories('category', tagDataset.dataList, "tag", [tag]);
						}

					})
					labelCounter++;
						totalLabelCounter++;
				})

		});

	}

}


text:
class Inquiry::Answer
  include SS::Document
  include SS::Reference::Site
  include SimpleCaptcha::ModelHelpers

  seqid :id
  field :node_id, type: Integer
  field :remote_addr, type: String
  field :user_agent, type: String

  belongs_to :node, foreign_key: :node_id, class_name: "Inquiry::Node::Form"
  embeds_many :data, class_name: "Inquiry::Answer::Data"

  permit_params :id, :node_id, :remote_addr, :user_agent, :captcha, :captcha_key

  apply_simple_captcha
  validates :node_id, presence: true
  validate :validate_data

  public
    def set_data(hash = {})
      self.data = []
      hash.each do |key, data|
        value, confirm = data
        if value.kind_of?(Hash)
          values = value.values
          value  = value.map {|k, v| v}.join("\n")
        else
          values = [value.to_s]
          value  = value.to_s
        end

        self.data << Inquiry::Answer::Data.new(column_id: key.to_i, value: value, values: values, confirm: confirm)
      end
    end

    def data_summary
      summary = ""
      data.each do |d|
        summary << "#{d.value} "
      end
      summary.gsub(/\s+/, ", ").gsub(/, $/, "").truncate(80)
    end

  private
    def validate_data
      columns = Inquiry::Column.where(node_id: self.node_id, state: "public").order_by(order: 1)
      columns.each do |column|
        if column.required?
          required_data = data.select { |d| column.id == d.column_id }.shift
          if required_data.blank? || required_data.value.blank?
            errors.add :base, "#{column.name}#{I18n.t('errors.messages.blank')}"
          end
        end
        if column.input_confirm == "enabled"
          required_data = data.select { |d| column.id == d.column_id }.shift
          if required_data.present? && required_data.value != required_data.confirm
            errors.add :base, "#{column.name}#{I18n.t('errors.messages.input_confirm_not_match')}"
          end
        end
      end
    end
end


text:
KCONF=${KERNCONF:=VKERNEL64}
REPOSITORY=${REPOSITORY:=/usr/src}
NCPU=`sysctl hw.ncpu | cut -w -f 2`
COPTFLAGS="-g -O0"
export COPTFLAGS

usage()
{
	echo `basename $0`: '[buildkernel|quickkernel|nativekernel]'
	echo 'Make sure you set VKDIR environment variable to your VKERNEL path'
	echo 'REPOSITORY environment variable points to /usr/src by default.'
	echo 'KERNCONF environment variable is VKERNEL64 by default.'
	exit 255
}

do_build()
{
    local _ret
    local buildmode=$1

    cd ${REPOSITORY}
    make -j${NCPU} ${buildmode} -DNO_MODULES KERNCONF=${KCONF} \
	> /tmp/buildkernel_${ACTION}.log 2>&1

    if [ $? -ne 0 ]; then
	echo Failed to build, please check /tmp/buildkernel_${ACTION}.log
	exit 1
    else
	echo "    + Installing vkernel into ${VKDIR}"
	if $(which sudo>/dev/null); then
	    sh -c "make installkernel DESTDIR=${VKDIR} -DNO_MODULES KERNCONF=${KCONF}" > /tmp/buildkernel_${ACTION}.log2 >&1
	else
	    kfile=$(make -V .OBJDIR)/sys/${KCONF}/kernel.debug
	    if [ ! -d ${VKDIR}/boot/kernel ]; then
		mkdir -p ${VKDIR}/boot/kernel
	    fi
	    cp ${kfile} ${VKDIR}/boot/kernel/vkernel
	fi
    fi

    # Make sure the symlink exists
    if [ ! -L ${VKDIR}/vkernel ]; then
	ln -sf ${VKDIR}/boot/kernel/vkernel ${VKDIR}/vkernel
    fi
}

# ---------------------------------------------------------------
ACTION="$1"

if [ $# -ne 1 ]; then
	usage
fi

if [ "${VKDIR}" = "" ]; then
    usage
fi

if [ ! -d ${VKDIR} ]; then
	echo ${VKDIR} directory does not exist.
	exit
fi

case $1 in
	'buildkernel'|'quickkernel'|'nativekernel')
		echo --- Action: ${ACTION} config file: ${KCONF}
		do_build ${ACTION}
		;;
	*)
		usage
		;;
esac


text:
PrettyPrint
=====================
PrettyPrint is cli tool for pritty printing.
It supports JSON and XML format.

## Install

    $ gem install prettyprint

## Usage

prittyprint has 2 subcommands; json, xml.
prittyprint supports file and stdin.

Pretty printing JSON from file:

    $ prettyprint json input.json

Pretty printing XML from stdin:

    $ echo '<title>prettyprint</title>happy pretty printing' | prettyprint xml

     <title>
      prettyprint
     </title>

      happy pretty printing


text:
package cn.fql.account.service;

import cn.fql.account.model.dto.OpenAccountDTO;
import cn.fql.account.model.dto.TransferDTO;

/**
 * Created by fuquanlin on 28/11/2017.
 */
public interface AccountService {

    void open(OpenAccountDTO openAccountDTO);

    void transfer(TransferDTO transferDTO);

    void freeze();

    void unfreeze();

    void unfreezeAndTransfer();

}


text:
  <execution-details-section-nav sections="configSections"></execution-details-section-nav>

Provider

Amazon

Image

{{stage.context.ami}}

Region

{{stage.context.region}}

Package

{{stage.context.package}}

Base OS

{{stage.context.baseOs}}

VM Type

{{stage.context.vmType | uppercase}}

Store Type

{{stage.context.storeType | uppercase}}

Label

{{stage.context.baseLabel}}

Rebake

{{stage.context.rebake || false}}

Template

{{stage.context.templateFileName}}

Var File

{{stage.context.varFileName}}

    <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>

No changes detected; reused existing bake

            Image:

{{stage.context.imageName}}

({{stage.context.ami}})

            View Bakery Details

      <execution-step-details item="stage"></execution-step-details>


text:
/*	$NetBSD: lo_main.c,v 1.19 2010/08/06 09:14:40 dholland Exp $	*/

/*
 * Copyright (c) 1983, 1993
 *	The Regents of the University of California.  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.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lo_main.c	8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: lo_main.c,v 1.19 2010/08/06 09:14:40 dholland Exp $");
#endif
#endif /* not lint */

/*
 * Print out the top ten SAILors
 *
 * -l force a long listing (print out real usernames)
 */

#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
#include <curses.h>

#include "extern.h"
#include "pathnames.h"

static const char *const title[] = {
	"Admiral", "Commodore", "Captain", "Captain",
	"Captain", "Captain", "Captain", "Commander",
	"Commander", "Lieutenant"
};

void
lo_curses(void)
{
	FILE *fp;
	char sbuf[32];
	int n = 0, npeople;
	int line;
	struct passwd *pass;
	struct logs log;
	struct ship *ship;

	erase();

	fp = fopen(_PATH_LOGFILE, "r");
	if (fp == NULL) {
		mvprintw(5, 10, "%s: %s", _PATH_LOGFILE, strerror(errno));
		mvaddstr(7, 10, "Press any key...");
		getch();
		return;
	}
	switch (fread(&npeople, sizeof npeople, 1, fp)) {
	    case 0:
		mvprintw(5, 10, "Nobody has sailed yet.");
		mvaddstr(7, 10, "Press any key...");
		getch();
		return;
	    case 1:
		break;
	    default:
		mvprintw(5, 10, "%s: %s", _PATH_LOGFILE, strerror(errno));
		mvaddstr(7, 10, "Press any key...");
		getch();
		return;
	}
	line = 0;
	while (fread(&log, sizeof log, 1, fp) == 1 &&
	       log.l_name[0] != '\0' &&
		line < LINES - 2) {
		if (longfmt && (pass = getpwuid(log.l_uid)) != NULL)
			snprintf(sbuf, sizeof(sbuf),
				"%10.10s (%s)", log.l_name, pass->pw_name);
		else
			snprintf(sbuf, sizeof(sbuf),
				"%20.20s", log.l_name);
		ship = &scene[log.l_gamenum].ship[log.l_shipnum];
		mvprintw(line, 0,
			"%-10s %21s of the %15s %3d points, %5.2f equiv",
			title[n++], sbuf, ship->shipname, log.l_netpoints,
			(float) log.l_netpoints / ship->specs->pts);
		line++;
	}
	fclose(fp);
	mvprintw(line+1, 0, "%d people have played. Press any key.", npeople);
	getch();
}

int
lo_main(void)
{
	FILE *fp;
	char sbuf[32];
	int n = 0, npeople;
	struct passwd *pass;
	struct logs log;
	struct ship *ship;

	if ((fp = fopen(_PATH_LOGFILE, "r")) == 0) {
		err(1, "%s", _PATH_LOGFILE);
	}
	switch (fread(&npeople, sizeof npeople, 1, fp)) {
	case 0:
		printf("Nobody has sailed yet.\n");
		exit(0);
	case 1:
		break;
	default:
		err(1, "%s", _PATH_LOGFILE);
	}
	while (fread(&log, sizeof log, 1, fp) == 1 &&
	       log.l_name[0] != '\0') {
		if (longfmt && (pass = getpwuid(log.l_uid)) != NULL)
			snprintf(sbuf, sizeof(sbuf),
				"%10.10s (%s)", log.l_name, pass->pw_name);
		else
			snprintf(sbuf, sizeof(sbuf),
				"%20.20s", log.l_name);
		ship = &scene[log.l_gamenum].ship[log.l_shipnum];
		printf("%-10s %21s of the %15s %3d points, %5.2f equiv\n",
			title[n++], sbuf, ship->shipname, log.l_netpoints,
			(float) log.l_netpoints / ship->specs->pts);
	}
	fclose(fp);
	printf("\n%d people have played.\n", npeople);
	return 0;
}


text:
===========================
MOTECH first-run experience
===========================

.. contents:: Table of Contents
    :depth: 4

################
Bootstrap screen
################

Once you've installed MOTECH and started it for the first time, you'll be welcomed by the following bootstrap screen.
Here you'll have to provide some basic configuration information for the MOTECH to load properly.

        .. image:: img/first_run_experience/bootstrap_settings.png
            :scale: 100 %
            :alt: MOTECH bootstrap screen
            :align: center

    **ActiveMQ Broker URL**
        The URL pointing to the ActiveMQ server. If you've installed ActiveMQ using the default settings, or by using
        the provided :code:`install.sh` script, you can simply click :code:`Use` button next to the first suggestion
        right under the text box. Otherwise, you must provide the correct URL.

    **SQL URL**
        The URL pointing to the SQL server. If you've installed MySQL, or by using the provided :code:`install.sh`
        script, you can simply click :code:`Use` button next to the first suggestion. If you've installed Postgres using
        the default settings, you can simply click :code:`Use` button next to the second suggestion. Otherwise, you must
        provide the correct URL.

    **SQL Database Driver**
        JDBC driver for the chosen database.
        :code:`com.mysql.jdbc.Driver` for MySQL database.
        :code:`org.postgresql.Driver` for Postgresql.

    **SQL Username**
        The username that MOTECH will be using for managing the database.

    **SQL Password**
        The password for the account with the username provided in the **SQL Username**.

    **Felix path**
        The location where OSGi cache should be stored.

    **Configuration Mode**
        The mode that will be used for further MOTECH configuration. Both modes will be explained in the following
        sections. Keep in mind that if you select the :code:`FILE` mode, you must provide a configuration file BEFORE
        progressing further. See `Configuring MOTECH through FILE`_ section for more information about how to prepare
        the configuration file.

After you've filled up the bootstrap form and clicked :code:`Continue` button, you will have to wait for the MOTECH to
start. The following screen will inform you about to the progress during MOTECH startup process.

        .. image:: img/first_run_experience/server_starting.png
            :scale: 100 %
            :alt: MOTECH is starting
            :align: center

####################
MOTECH configuration
####################

Once the MOTECH have started, it might require some more configuration depending on the selected configuration mode. If
you've selected :code:`UI` as configuration mode jump to the `Configuring MOTECH through UI`_ section or to the
`Configuring MOTECH through FILE`_ section if you've selected :code:`FILE`.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configuring MOTECH through the UI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you've selected the UI as the configuration mode, the following screen will be displayed.

        .. image:: img/first_run_experience/startup_settings.png
            :scale: 100 %
            :alt: MOTECH Startup Settings
            :align: center

Here you are able to select the language MOTECH will be using, as well as one of the following login mode:

    - **Repository** Using this mode will result in creating accounts locally.

    - **OpenID** Using this mode will result in using the OpenID standard. For more information about the OpenID, please visit the `www.openid.net`_ website.

---------------------
Repository login mode
---------------------

If you've selected :code:`Repository` as the login mode, the following screen will be displayed. Here you have to
provide the credentials for the administrator account.

        .. image:: img/first_run_experience/repository_startup_settings.png
            :scale: 100 %
            :alt: MOTECH Repository Startup Settings
            :align: center

    **Admin login**
        The username of the administrator account.

    **Admin password**
        The password of the administrator account.

    **Repeat admin password**
        The password of the administrator account.

    **Admin e-mail**
        The e-mail of the administrator.

Once you're done just hit :code:`Submit` button and then continue to the `First login through repository`_ section.

-----------------
OpenID login mode
-----------------

If you've selected OpenID as the login mode, the following screen will be displayed. Here you have to provide the
information about OpenID provider. For more information about the OpenID please visit `www.openid.net`_ website.

        .. image:: img/first_run_experience/openid_startup_settings.png
            :scale: 100 %
            :alt: MOTECH OpenID Startup Settings
            :align: center

    **Provider name**
        Here you should type how do you want to call the provider.

    **Provider URL**
        Here you should put the URL that your OpenID provider uses for authentication.

Once you're done just hit :code:`Submit` button and then continue to the `First login through OpenID`_ section.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configuring MOTECH through FILE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you've selected this method of configuring MOTECH you'll have to provide the configuration file. The file must have
the :code:`.properties` extension and must be placed in the :code:`config` subfolder of the MOTECH folder(most likely
:code:`/home/{username}/.motech/config`) and must store the following properties.

    **system.language**
        The language the MOTECH will be using. The accepted values are :code:`en`, :code:`pl` etc.

    **login.mode**
        The login mode that will be used. The accepted values are :code:`repository` and :code:`openid`.

---------------------
Repository login mode
---------------------

If you've selected repository as the login mode, the following screen will pop up. Here you'll be able to create admin
account by providing the credentials. Keep in mind that this is admin account and those credentials should be strong.

    .. image:: img/first_run_experience/file_startup_settings.png
        :scale: 100 %
        :alt: MOTECH File Startup Settings
        :align: center

    **Admin login**
        The username of the administrator account.

    **Admin password**
        The password of the administrator account.

    **Repeat admin password**
        The password of the administrator account.

    **Admin e-mail**
        The e-mail of the administrator.

Once you're done just hit :code:`Submit` button and then continue to the `First login through repository`_ section.

-----------------
OpenID login mode
-----------------

If you've selected OpenID login mode, you'll have to include two more properties into the file.

    **provider.name**
        The name of the OpenID provider.

    **provider.url**
        The URL that the OpenID provider uses for authentication.

Here's an example file that uses OpenID mode.

.. code::

    system.language=en
    login.mode=openid
    provider.name=UbuntuOne
    provider.url=https://login.launchpad.net/

Once you're done just hit :code:`Submit` button and then continue to the `First login through OpenID`_ section.

###########
First login
###########

Once you're done with installing and configuring MOTECH, the first login screen(depending on the selected login mode)
will pop up.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
First login through repository
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you've chosen repository as the login mode, the following window will be displayed. Here you'll have to enter the
credentials you provided in the `MOTECH configuration`_ step.

    .. image:: img/first_run_experience/repository_login_screen.png
        :scale: 100 %
        :alt: MOTECH first login using repository mode
        :align: center

^^^^^^^^^^^^^^^^^^^^^^^^^^
First login through OpenID
^^^^^^^^^^^^^^^^^^^^^^^^^^

If you've chosen OpenID as the login mode, the following window will be displayed. Here, you'll have to click on the
:code:`Sign in with Provide name` button, which will result in redirecting you to the OpenID provider login page, where
you'll have to enter valid credentials for that provider.

    .. image:: img/first_run_experience/openid_login_screen.png
        :scale: 100 %
        :alt: MOTECH first login using repository mode
        :align: center

.. _www.openid.net: http://openid.net/


text:
EIMS 企业信息管理系统
====

Enterprise Information Management System

Built environment: Intellij13.0.2, Mysql
Using frames: Playframework1.2.5
Front frame: jquery easyui

System description:
Enterprise information management system, staff management, departmental management, rights management, file management, business management, customer relationship management, file send and receive, project management, query statistics and other functions

As a core part of the system function is the function module to achieve the following functions:
1.Staff management: the ability of employees to maintain the basic information on the query, the new employee information entry, as well as former employees of the information deleted, employee information including the entry time, where the department has the powers and so on.
2.Sector Management: Creating hand sector is divided into functional. Easy to classify and manage employees. So add and delete departments. Employees associated with the department, authority associated with the department.
3.Rights Management: Character set permissions management, staff and various departments which will have different rights in sectors in which jobs.
4.File Management: File primarily for employee files, history archive project management, important documents archive management.
5.Customer Relationship Management: The relationship between employees and customers will be associated with the establishment, the establishment of relations, is disconnected. And a corresponding number of customers, and so do the staff management.
6.Send and receive files: file system can support each other to send control data.
7.Project Management: Project generated from the process until the end, it is necessary to do the project schedule management, project personnel involved in performance appraisal, asset management, and organizational processes.
8.Query statistics : For all employees, files, documents and information retrieval done fast search

系统名称:企业信息管理系统
搭建环境:Intellij13.0.2 , Mysql
使用框架:Playframework1.2.5
前端框架:Jquery EasyUI

系统介绍:
企业信息管理系统,实现
员工管理、部门管理、权限管理、档案管理、商务管理、客户关系管理、文件收发、项目管理、查询统计等功能

作为系统功能核心部分也就是功能模块将实现以下这些功能:
员工管理:能够对员工的基本信息查询维护,新增员工的信息录入,以及离职员工的信息删除,员工的信息包括入职时间、所在部门、拥有的职权等。
部门管理:部门的创建一方面是划分职能,方便归类管理员工。所以添加删除部门,员工与部门关联,权限与部门关联。
权限管理:权限字符集管理,员工所处部门以及在部门所处岗位不同将拥有不同的权限。
档案管理:档案主要将针对员工档案,历史项目归档管理,重要文件归档管理。
客户关系管理:员工与客户建立的关系将做关联,对关系的建立,断开。以及一个员工对应多个客户等做管理。
文件收发:系统可以支持文件、资料的相互发送以及文件有效保留时间控制。
项目管理:项目从产生直至结束的过程中,需要做项目进度管理,以及组织过程资产管理。
查询统计:查询模块实现针对所有员工、档案、文件信息等做检索实现快速搜索。


text:
::---License---
::This is free and unencumbered software released into the public domain.

::Anyone is free to copy, modify, publish, use, compile, sell, or
::distribute this software, either in source code form or as a compiled
::binary, for any purpose, commercial or non-commercial, and by any
::means.

::by frainfreeze

::---Description---
::Tiny batch script that makes use of wget.

::---code---
title tinyGet
@echo off
echo image scrap/file dl (img/dl)
set /p option=
IF /i "%option%"=="img" goto imgScrap
IF /i "%option%"=="dl" goto dlFile
echo Not found.
goto commonexit

:imgScrap
set /p ImgLink=Copy the website URL and right click in this window. Scraps jpeg,jpg,bmp,gif,png:
echo Scraping all images from "%ImgLink%"
wget -r -P download -A jpeg,jpg,bmp,gif,png "%ImgLink%"
goto commonexit

:dlFile
set /p FileLink=Copy the direct link to file and right click in this window to download it:
wget download --no-check-certificate "%FileLink%"
goto commonexit

:commonexit
pause


text:
package liu.study.api.java.net.interfaces;

import java.net.FileNameMap;

public interface XFileNameMap extends FileNameMap {

	@Override
	String getContentTypeFor(String fileName);

}


text:
package org.apache.shardingsphere.sql.parser.sql.segment.dml;

import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.sql.segment.SQLSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;

import java.util.Collection;
import java.util.LinkedList;

@Getter
@Setter
public final class JoinedTableSegment implements SQLSegment {

    private int startIndex;

    private int stopIndex;

    private TableFactorSegment tableFactor;

    private JoinSpecificationSegment joinSpecification;

    /**
     * get table.
     * @return tableSegment.
     */
    public Collection<SimpleTableSegment> getSimpleTableSegments() {
        Collection<SimpleTableSegment> tables = new LinkedList<>();
        if (null != tableFactor) {
            tables.addAll(tableFactor.getSimpleTableSegments());
        }
        if (null != joinSpecification) {
            tables.addAll(joinSpecification.getSimpleTableSegments());
        }
        return tables;
    }
}


text:
/*  Some initial testing with sockets in Java
 */

import java.io.*;
import java.net.*;

public class EchoClient {
    public static void main(String[] args) throws IOException {

        Socket echoSocket = null;
        PrintWriter out = null;
        BufferedReader in = null;

        try {
            echoSocket = new Socket("192.168.0.115", 7000);
            out = new PrintWriter(echoSocket.getOutputStream(), true);
            in = new BufferedReader(new InputStreamReader(
                                        echoSocket.getInputStream()));
        } catch (UnknownHostException e) {
            System.err.println("Don't know about host: taranis.");
            System.exit(1);
        } catch (IOException e) {
            System.err.println("Couldn't get I/O for "
                               + "the connection to: taranis.");
            System.exit(1);
        }

	BufferedReader stdIn = new BufferedReader(
                                   new InputStreamReader(System.in));
	String userInput;

        out.println("Hola desde Java!!!");

        /*
	while ((userInput = stdIn.readLine()) != null) {
	    out.println(userInput);
	    System.out.println("echo: " + in.readLine());
	}*/

	out.close();
	in.close();
	stdIn.close();
	echoSocket.close();
    }
}