text:
using namespace std;

void testFun()
{
	//string codefile1("function.txt");
	//Compiler testCom1(codefile1);
	//cout << endl << testCom1.callMain();

	//string codefile2("function2.txt");
	//Compiler testCom2(codefile2);
	//cout << endl << testCom2.callMain();

	//string codefile3("function3.txt");
	//Compiler testCom3(codefile3);
	//cout << endl << testCom3.callMain();

	//string codefile4("function4.txt");
	//Compiler testCom4(codefile4);
	//cout << endl << testCom4.callMain();

	string codefile5("function5.txt");
	Compiler testCom5(codefile5);
	cout << endl << testCom5.callMain();
}

int main()
{
	testFun();
	getchar();
}


text:
module Distribution.Utils.NubList
    ( NubList    -- opaque
    , toNubList  -- smart construtor
    , fromNubList
    , overNubList

    , NubListR
    , toNubListR
    , fromNubListR
    , overNubListR
    ) where

import Distribution.Compat.Semigroup as Semi
import Distribution.Compat.Binary

import Distribution.Simple.Utils (ordNub, listUnion, ordNubRight, listUnionRight)

import qualified Text.Read as R

-- | NubList : A de-duplicated list that maintains the original order.
newtype NubList a =
    NubList { fromNubList :: [a] }
    deriving Eq

-- NubList assumes that nub retains the list order while removing duplicate
-- elements (keeping the first occurence). Documentation for "Data.List.nub"
-- does not specifically state that ordering is maintained so we will add a test
-- for that to the test suite.

-- | Smart constructor for the NubList type.
toNubList :: Ord a => [a] -> NubList a
toNubList list = NubList $ ordNub list

-- | Lift a function over lists to a function over NubLists.
overNubList :: Ord a => ([a] -> [a]) -> NubList a -> NubList a
overNubList f (NubList list) = toNubList . f $ list

-- | Monoid operations on NubLists.
-- For a valid Monoid instance we need to satistfy the required monoid laws;
-- identity, associativity and closure.
--
-- Identity : by inspection:
--      mempty `mappend` NubList xs == NubList xs `mappend` mempty
--
-- Associativity : by inspection:
--      (NubList xs `mappend` NubList ys) `mappend` NubList zs
--      == NubList xs `mappend` (NubList ys `mappend` NubList zs)
--
-- Closure : appending two lists of type a and removing duplicates obviously
-- does not change the type.

instance Ord a => Monoid (NubList a) where
    mempty = NubList []
    mappend = (Semi.<>)

instance Ord a => Semigroup (NubList a) where
    (NubList xs) <> (NubList ys) = NubList $ xs `listUnion` ys

instance Show a => Show (NubList a) where
    show (NubList list) = show list

instance (Ord a, Read a) => Read (NubList a) where
    readPrec = readNubList toNubList

-- | Helper used by NubList/NubListR's Read instances.
readNubList :: (Read a) => ([a] -> l a) -> R.ReadPrec (l a)
readNubList toList = R.parens . R.prec 10 $ fmap toList R.readPrec

-- | Binary instance for 'NubList a' is the same as for '[a]'. For 'put', we
-- just pull off constructor and put the list. For 'get', we get the list and
-- make a 'NubList' out of it using 'toNubList'.
instance (Ord a, Binary a) => Binary (NubList a) where
    put (NubList l) = put l
    get = fmap toNubList get

-- | NubListR : A right-biased version of 'NubList'. That is @toNubListR
-- ["-XNoFoo", "-XFoo", "-XNoFoo"]@ will result in @["-XFoo", "-XNoFoo"]@,
-- unlike the normal 'NubList', which is left-biased. Built on top of
-- 'ordNubRight' and 'listUnionRight'.
newtype NubListR a =
    NubListR { fromNubListR :: [a] }
    deriving Eq

-- | Smart constructor for the NubListR type.
toNubListR :: Ord a => [a] -> NubListR a
toNubListR list = NubListR $ ordNubRight list

-- | Lift a function over lists to a function over NubListRs.
overNubListR :: Ord a => ([a] -> [a]) -> NubListR a -> NubListR a
overNubListR f (NubListR list) = toNubListR . f $ list

instance Ord a => Monoid (NubListR a) where
  mempty = NubListR []
  mappend = (Semi.<>)

instance Ord a => Semigroup (NubListR a) where
  (NubListR xs) <> (NubListR ys) = NubListR $ xs `listUnionRight` ys

instance Show a => Show (NubListR a) where
  show (NubListR list) = show list

instance (Ord a, Read a) => Read (NubListR a) where
    readPrec = readNubList toNubListR

redpajama_set_name: RedPajamaGithub


text:
#ifndef __CHORUSSOUNDEFFECT_H__
#define __CHORUSSOUNDEFFECT_H__

#include "SoundEffect.h"

class ChorusSoundEffect : public SoundEffect {
public:
    ChorusSoundEffect(const EffectParameterMap& parameterMap);
    ~ChorusSoundEffect();

private:
    float wetDryMix;
    float depth;
    float feedback;
    float frequency;
    bool isSinWave;
    float delay;

    bool EnableEffect(irrklang::ISoundEffectControl& soundEffectCtrl) const;
    bool DisableEffect(irrklang::ISoundEffectControl& soundEffectCtrl) const;

    DISALLOW_COPY_AND_ASSIGN(ChorusSoundEffect);
};

#endif // __CHORUSSOUNDEFFECT_H__


text:
package io.fabric8.itests.smoke;

import io.fabric8.api.Constants;
import io.fabric8.api.Container;
import io.fabric8.api.CreateEnsembleOptions;
import io.fabric8.api.FabricService;
import io.fabric8.api.ServiceLocator;
import io.fabric8.api.ServiceProxy;
import io.fabric8.itests.paxexam.support.FabricTestSupport;
import io.fabric8.itests.paxexam.support.Provision;

import org.apache.curator.framework.CuratorFramework;
import org.apache.karaf.tooling.exam.options.KarafDistributionOption;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.options.DefaultCompositeOption;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.service.cm.ConfigurationAdmin;

import java.util.Arrays;
import java.util.Dictionary;

@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class ContainerStartupTest extends FabricTestSupport {

    private static final String SYSTEM_PASSWORD = "systempassword";
    private static final String SYSTEM_PASSWORD_BASE64 = "ZKENC=c3lzdGVtcGFzc3dvcmQ=";

    private static final String TEST_PASSWORD = "testpassword";
    private static final String TEST_PASSWORD_BASE64 = "ZKENC=dGVzdHBhc3N3b3Jk";

    @Test
    public void testLocalFabricCluster() throws Exception {
        System.out.println(executeCommand("fabric:create --clean root"));
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);
        try {
            Container[] containers = fabricProxy.getService().getContainers();
            Assert.assertNotNull(containers);

            Provision.containersStatus(Arrays.asList(containers), "success", PROVISION_TIMEOUT);
            Assert.assertEquals("Expected to find 1 container", 1, containers.length);
            Assert.assertEquals("Expected to find the root container","root", containers[0].getId());
        } finally {
            fabricProxy.close();
        }
        //Test that a provided by commmand line password exists
        //We don't inject the configuration admin as it causes issues when the tracker gets closed.
        ConfigurationAdmin configurationAdmin = ServiceLocator.awaitService(bundleContext, ConfigurationAdmin.class);
        org.osgi.service.cm.Configuration configuration = configurationAdmin.getConfiguration(Constants.ZOOKEEPER_CLIENT_PID);
        Dictionary<String, Object> dictionary = configuration.getProperties();
        Assert.assertEquals("Expected provided zookeeper password", SYSTEM_PASSWORD_BASE64, dictionary.get("zookeeper.password"));
    }

    @Ignore
    @Test
    public void testLocalFabricClusterWithPassword() throws Exception {
        System.out.println(executeCommand("fabric:create --clean --zookeeper-password "+TEST_PASSWORD+" root"));
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);
        try {
            Container[] containers = fabricProxy.getService().getContainers();
            Assert.assertNotNull(containers);

            Provision.containersStatus(Arrays.asList(containers), "success", PROVISION_TIMEOUT);
            Assert.assertEquals("Expected to find 1 container",1, containers.length);
            Assert.assertEquals("Expected to find the root container","root", containers[0].getId());
        } finally {
            fabricProxy.close();
        }

        //Test that a provided by command line password exists
        //We don't inject the configuration admin as it causes issues when the tracker gets closed.
        ConfigurationAdmin configurationAdmin = ServiceLocator.awaitService(bundleContext, ConfigurationAdmin.class);
        org.osgi.service.cm.Configuration configuration = configurationAdmin.getConfiguration(Constants.ZOOKEEPER_CLIENT_PID);
        Dictionary<String, Object> dictionary = configuration.getProperties();
        Assert.assertEquals("Expected provided zookeeper password", TEST_PASSWORD_BASE64, dictionary.get("zookeeper.password"));
    }

    @Test
    //Test that when a container is accidentally assigned a missing profile, it is properlly displayed and can be removed.
    public void testLocalFabricWithMissignProfile() throws Exception {
        System.out.println(executeCommand("fabric:create -p missing"));

        String response = executeCommand("fabric:container-list");
        Assert.assertTrue(response.contains("The following profiles are assigned but not found: missing."));
        executeCommand("fabric:container-remove-profile root missing");
        response = executeCommand("fabric:container-list");
        Assert.assertFalse(response.contains("The following profiles are assigned but not found:"));
    }

    @Configuration
    public Option[] config() {
        return new Option[]{
                new DefaultCompositeOption(managedFabricDistributionConfiguration()),
                new VMOption("-D"+ CreateEnsembleOptions.ZOOKEEPER_PASSWORD +"=" + SYSTEM_PASSWORD_BASE64),
                //KarafDistributionOption.debugConfiguration("5005", true)
        };
    }
}


text:
module Docker
  # The version of the docker-api gem.
  VERSION = '1.33.6'

  # The version of the compatible Docker remote API.
  API_VERSION = '1.16'
end


text:
FROM mcr.microsoft.com/dotnet/sdk:3.1-focal
ENV DEBIAN_FRONTEND=noninteractive
ARG OPENCV_VERSION=4.5.3

WORKDIR /

# Install opencv dependencies
RUN apt-get update && apt-get -y install --no-install-recommends \
      apt-transport-https \
      software-properties-common \
      wget \
      unzip \
      ca-certificates \
      build-essential \
      cmake \
      git \
      libtbb-dev \
      libatlas-base-dev \
      libgtk2.0-dev \
      libavcodec-dev \
      libavformat-dev \
      libswscale-dev \
      libdc1394-22-dev \
      libxine2-dev \
      libv4l-dev \
      libtheora-dev \
      libvorbis-dev \
      libxvidcore-dev \
      libopencore-amrnb-dev \
      libopencore-amrwb-dev \
      libavresample-dev \
      x264 \
      libtesseract-dev \
      libgdiplus \
    && apt-get -y clean \
    && rm -rf /var/lib/apt/lists/*

# Setup opencv and opencv-contrib source
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
    unzip ${OPENCV_VERSION}.zip && \
    rm ${OPENCV_VERSION}.zip && \
    mv opencv-${OPENCV_VERSION} opencv && \
    wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \
    unzip ${OPENCV_VERSION}.zip && \
    rm ${OPENCV_VERSION}.zip && \
    mv opencv_contrib-${OPENCV_VERSION} opencv_contrib

# Build OpenCV
RUN cd opencv && mkdir build && cd build && \
    cmake \
    -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
    -D CMAKE_BUILD_TYPE=RELEASE \
    -D BUILD_SHARED_LIBS=OFF \
    -D ENABLE_CXX11=ON \
    -D BUILD_EXAMPLES=OFF \
    -D BUILD_DOCS=OFF \
    -D BUILD_PERF_TESTS=OFF \
    -D BUILD_TESTS=OFF \
    -D BUILD_JAVA=OFF \
    -D BUILD_opencv_app=OFF \
    -D BUILD_opencv_barcode=OFF \
    -D BUILD_opencv_java_bindings_generator=OFF \
    -D BUILD_opencv_js_bindings_generator=OFF \
    -D BUILD_opencv_python_bindings_generator=OFF \
    -D BUILD_opencv_python_tests=OFF \
    -D BUILD_opencv_ts=OFF \
    -D BUILD_opencv_js=OFF \
    -D BUILD_opencv_bioinspired=OFF \
    -D BUILD_opencv_ccalib=OFF \
    -D BUILD_opencv_datasets=OFF \
    -D BUILD_opencv_dnn_objdetect=OFF \
    -D BUILD_opencv_dpm=OFF \
    -D BUILD_opencv_fuzzy=OFF \
    -D BUILD_opencv_gapi=OFF \
    -D BUILD_opencv_intensity_transform=OFF \
    -D BUILD_opencv_mcc=OFF \
    -D BUILD_opencv_objc_bindings_generator=OFF \
    -D BUILD_opencv_rapid=OFF \
    -D BUILD_opencv_reg=OFF \
    -D BUILD_opencv_stereo=OFF \
    -D BUILD_opencv_structured_light=OFF \
    -D BUILD_opencv_surface_matching=OFF \
    -D BUILD_opencv_videostab=OFF \
    -D BUILD_opencv_wechat_qrcode=ON \
    -D WITH_GSTREAMER=OFF \
    -D WITH_ADE=OFF \
    -D OPENCV_ENABLE_NONFREE=ON \
    .. && make -j$(nproc) && make install && ldconfig

# Download OpenCvSharp
RUN git clone https://github.com/shimat/opencvsharp.git && cd opencvsharp

# Install the Extern lib.
RUN mkdir /opencvsharp/make && cd /opencvsharp/make && \
    cmake -D CMAKE_INSTALL_PREFIX=/opencvsharp/make /opencvsharp/src && \
    make -j$(nproc) && make install && \
    rm -rf /opencv && \
    rm -rf /opencv_contrib && \
    mkdir /artifacts && \
    cp /opencvsharp/make/OpenCvSharpExtern/libOpenCvSharpExtern.so /artifacts/

# Test OpenCvSharpExtern
RUN cp artifacts/libOpenCvSharpExtern.so /usr/lib/ && \
    echo "\n\
#include <stdio.h> \n\
int core_Mat_sizeof(); \n\
int main(){ \n\
  int i = core_Mat_sizeof(); \n\
  printf(\"sizeof(Mat) = %d\", i); \n\
  return 0; \n\
}" > /test.c && \
    gcc -I./ -L./ test.c -o test -lOpenCvSharpExtern && \
    LD_LIBRARY_PATH=. ./test && \
    rm -f /test*

# Install Build the C# part of OpenCvSharp
#RUN cd /opencvsharp/src/OpenCvSharp && \
#    dotnet build -c Release -f netstandard2.1 && \
#    cd /opencvsharp/src/OpenCvSharp.Blob && \
#    dotnet build -c Release -f netstandard2.1 && \
#    cd /opencvsharp/src/OpenCvSharp.Extensions && \
#    dotnet build -c Release -f netstandard2.1 && \
#    cp /opencvsharp/src/OpenCvSharp/bin/Release/netstandard2.1/* /artifacts/ && \
#    cp /opencvsharp/src/OpenCvSharp.Blob/bin/Release/netstandard2.1/* /artifacts/ && \
#    cp /opencvsharp/src/OpenCvSharp.Extensions/bin/Release/netstandard2.1/* /artifacts/

# Test OpenCvSharp
#RUN dotnet test /opencvsharp/test/OpenCvSharp.Tests/OpenCvSharp.Tests.csproj -c Release -f netcoreapp3.1 --runtime ubuntu.18.04-x64 --logger "trx;LogFileName=test-results.trx" < /dev/null

RUN rm -rf /opencvsharp

# Simple console app test using NuGet
#RUN dotnet new console -f netcoreapp3.1 -o "ConsoleApp01" && cd /ConsoleApp01 && \
#    echo "\n\
#using System; \n\
#using OpenCvSharp; \n\
#class Program{ \n\
#  static void Main(){ \n\
#    Console.WriteLine(Cv2.GetTickCount()); \n\
#    using var mat = new Mat(1, 1, MatType.CV_8UC1); \n\
#    Console.WriteLine(mat.CvPtr); \n\
#  } \n\
#}" > Program.cs && \
#    dotnet add package OpenCvSharp4 && \
#    dotnet run && \
#    rm -rf /ConsoleApp01

#RUN ldd /artifacts/libOpenCvSharpExtern.so


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1815d4cc1">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Northern District of Ohio</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2012-01-03</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2008-01-10</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-1_07-cr-00310</identifier>
<identifier type="local">P0b002ee1815d4cc1</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2012-01-03</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2012-01-04</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-ohnd-1_07-cr-00310</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ohnd-1_07-cr-00310</accessId>
 <courtType>District</courtType>
 <courtCode>ohnd</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Ohio</courtState>
 <courtSortOrder>2392</courtSortOrder>
 <caseNumber>1:07-cr-00310</caseNumber>
 <caseOffice>Cleveland</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="Stephane" fullName="Stephane Stevens" lastName="Stevens" role="Defendant"></party>
 <party fullName="United States of America" lastName="United States of America" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>United States of America v. Stevens</title>
 <partNumber>1:07-cr-00310</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-1_07-cr-00310/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">1:07-cr-00310;07-310</identifier>
<name type="corporate">
 <namePart>United States District Court Northern District of Ohio</namePart>
 <namePart>6th Circuit</namePart>
 <namePart>Cleveland</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Stephane Stevens</displayForm>
 <namePart type="family">Stevens</namePart>
 <namePart type="given">Stephane</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>United States of America</displayForm>
 <namePart type="family">United States of America</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ohnd-1_07-cr-00310</accessId>
 <courtType>District</courtType>
 <courtCode>ohnd</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Ohio</courtState>
 <courtSortOrder>2392</courtSortOrder>
 <caseNumber>1:07-cr-00310</caseNumber>
 <caseOffice>Cleveland</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="Stephane" fullName="Stephane Stevens" lastName="Stevens" role="Defendant"></party>
 <party fullName="United States of America" lastName="United States of America" role="Plaintiff"></party>
 <state>Ohio</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ohnd-1_07-cr-00310-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_07-cr-00310/USCOURTS-ohnd-1_07-cr-00310-0/mods.xml">
 <titleInfo>
  <title>United States of America v. Stevens</title>
  <subTitle>Judgment as to Stephane Stevens (1), Count(s) 1, 2. Defendant sentenced to the Bureau of Prisons for 168 months each on Counts 1,2 to run concurrently followed by 4 years supervised release on each count to run concurrently. Defendant's fine waived. Special assessment of $200 due immediately and payable to Clerk, US District Court. Signed by Judge Christopher A. Boyko on 01/10/08. (M,M)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2008-01-10</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ohnd-1_07-cr-00310-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1816f0af7</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_07-cr-00310/USCOURTS-ohnd-1_07-cr-00310-0</identifier>
 <identifier type="former granule identifier">ohnd-1_07-cr-00310_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_07-cr-00310/USCOURTS-ohnd-1_07-cr-00310-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-1_07-cr-00310/pdf/USCOURTS-ohnd-1_07-cr-00310-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 1:07-cr-00310; United States of America v. Stevens; </searchTitle>
  <courtName>United States District Court Northern District of Ohio</courtName>
  <state>Ohio</state>
  <accessId>USCOURTS-ohnd-1_07-cr-00310-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2008-01-10</dateIssued>
  <docketText>Judgment as to Stephane Stevens (1), Count(s) 1, 2. Defendant sentenced to the Bureau of Prisons for 168 months each on Counts 1,2 to run concurrently followed by 4 years supervised release on each count to run concurrently. Defendant's fine waived. Special assessment of $200 due immediately and payable to Clerk, US District Court. Signed by Judge Christopher A. Boyko on 01/10/08. (M,M)</docketText>
</extension>
</relatedItem>
</mods>


text:
/*
Package log provides simple log interfaces
*/
package log

import (
	"sync/atomic"
	"time"
)

type Level int32

const (
	MinLevel = Level(iota)
	DebugLevel
	InfoLevel
	ErrorLevel
	OffLevel
)

type Logger struct {
	level   Level
	prefix  string
	context []Field
}

func New(level Level, prefix string, context ...Field) *Logger {
	return &Logger{level: level, prefix: prefix, context: context}
}

func (l *Logger) With(fields ...Field) *Logger {
	var ctx []Field

	ll := len(l.context) + len(fields)
	if ll > 0 {
		ctx = make([]Field, 0, ll)
		if len(l.context) > 0 {
			ctx = append(ctx, l.context...)
		}

		if len(fields) > 0 {
			ctx = append(ctx, fields...)
		}
	}

	return &Logger{
		level:   l.level,
		prefix:  l.prefix,
		context: ctx,
	}
}

func (l *Logger) Level() Level {
	return Level(atomic.LoadInt32((*int32)(&l.level)))
}

func (l *Logger) SetLevel(level Level) {
	atomic.StoreInt32((*int32)(&l.level), int32(level))
}

func (l *Logger) Debug(msg string, fields ...Field) {
	if l.Level() < InfoLevel {
		es.Publish(Event{Time: time.Now(), Level: DebugLevel, Prefix: l.prefix, Message: msg, Context: l.context, Fields: fields})
	}
}

func (l *Logger) Info(msg string, fields ...Field) {
	if l.Level() < ErrorLevel {
		es.Publish(Event{Time: time.Now(), Level: DebugLevel, Prefix: l.prefix, Message: msg, Context: l.context, Fields: fields})
	}
}

func (l *Logger) Error(msg string, fields ...Field) {
	if l.Level() < OffLevel {
		es.Publish(Event{Time: time.Now(), Level: DebugLevel, Prefix: l.prefix, Message: msg, Context: l.context, Fields: fields})
	}
}


text:
from collections import namedtuple
import hashlib
import uuid

from flask import g
from flask_restful import reqparse, request
from slumber.exceptions import HttpClientError

from connector.config import Config
from connector.error_codes import ACTIVATION_ERROR
from connector.fbclient.user import User as FbUser
from connector.fbclient.client import Client
from connector.utils import escape_domain_name

from . import (ConnectorResource, Memoize, OA, OACommunicationException,
               parameter_validator, urlify)

config = Config()

AnalysisResult = namedtuple('AnalysisResult', 'recoverable data')
ProvisioningResult = namedtuple('ProvisioningResult', 'body status_code headers')

@Memoize
def get_name_for_tenant(tenant_id):
    tenant_resource = OA.get_resource(tenant_id)
    if 'tenantId' not in tenant_resource:
        raise KeyError("tenantId property is missing in OA resource {}".format(tenant_id))
    return tenant_resource['tenantId']

def sync_tenant_usage_with_client(tenant_id, client):
    tenant = build_usage(client)
    OA.send_request('put',
                    'aps/2/application/tenant/{}'.format(tenant_id),
                    tenant)

def make_default_fallball_admin(client):
    email = 'admin@{client_name}.{reseller_name}.fallball.io'.format(
        client_name=escape_domain_name(client.name),
        reseller_name=escape_domain_name(client.reseller.name))
    user_id = uuid.UUID(hashlib.md5(email.encode()).hexdigest())
    user = FbUser(client=client, user_id=user_id, email=email, superadmin=True,
                  storage={'limit': 0})
    return user

def get_tenant_args():
    parser = reqparse.RequestParser()

    parser.add_argument('aps', dest='aps_id', type=parameter_validator('id'), required=True,
                        help='Missing aps.id in request')
    parser.add_argument('aps', dest='sub_id', type=parameter_validator('subscription'),
                        required=True, help='Missing aps.subscription in request')
    parser.add_argument('aps', dest='aps_type', type=parameter_validator('type'), required=True,
                        help='Missing aps.type in request')
    parser.add_argument('aps', dest='aps_status', type=parameter_validator('status'))

    parser.add_argument('ENVIRONMENT', dest='environment', type=parameter_validator('limit'))
    parser.add_argument('COUNTRY', dest='country', type=parameter_validator('limit'))

    parser.add_argument('account', dest='acc_id', type=parameter_validator('aps', 'id'),
                        required=True, help='Missing link to account in request')

    parser.add_argument('accountInfo', dest='account_info', type=dict)
    parser.add_argument('status', type=str)
    parser.add_argument('statusData', dest='status_data', type=dict)

    parser.add_argument(config.diskspace_resource, dest='storage_limit',
                        type=parameter_validator('limit'))

    for user_resource in OA.get_user_resources():
        parser.add_argument(user_resource, dest='{}_limit'.format(user_resource.lower()),
                            type=parameter_validator('limit'))

    return parser.parse_args()

def analyze_service_error(data):
    if len(data) == 1 and 'postal_code' in data:
        info = {'status': 'activationRequired',
                'statusData': {
                    'code': 'ActivationData',
                    'messages': [
                        {
                            'type': 'error',
                            'text': "Please provide additional information to complete "
                                    "provisioning of the FallBall service",
                            'textLocalized': {
                                'ru_RU': u"Пожалуйста, предоставьте дополнительные данные "
                                         u"для завершения создания сервиса FallBall",
                                'fr_FR': u"Veuillez fournir des informations supplémentaires pour "
                                         u"compléter l'approvisionnement du service FallBall",
                            },
                        },
                    ],
                    'perPropertyData': [
                        {
                            'propertyName': 'accountInfo.addressPostal.postalCode',
                            'pattern': r'(\d{5})',
                        },
                    ],
                }}

        if data['postal_code']['code'] == ACTIVATION_ERROR:
            info['statusData']['perPropertyData'][0]['message'] = {
                'text': "Postal code should not start with 999. "
                        "Service is not available for Alaska currently",
                'textLocalized': {
                    'ru_RU': u"Почтовый индес не должен начинаться с 999. "
                             u"Сервис временно недоступен для Аляски",
                    'fr_FR': u"Code Postal ne doit pas commencer par 999. "
                             u"Le Service n'est pas disponible "
                             u"en Alaska actuellement",
                },
            }
        else:
            info['statusData']['perPropertyData'][0]['message'] = {
                'text': "The postal code must consist of five digits",
                'textLocalized': {
                   'ru_RU': u"Почтовый индекс должен состоять из пяти цифр.",
                   'fr_FR': u"Le code postal doit être composé de cinq chiffres.",
                },
            }

        return AnalysisResult(True, info)
    return AnalysisResult(False, {})

def build_usage(client):
    client.refresh()

    def key_by_value(obj, value):
        return {val: key for key, val in obj.items()}.get(value)

    tenant = {}
    counters = OA.get_counters()

    if config.diskspace_resource in counters:
        tenant[config.diskspace_resource] = {'usage': client.storage['usage']}
    if config.devices_resource in counters:
        tenant[config.devices_resource] = {'usage': 0}

    environment = key_by_value(config.environment, client.environment)
    country = key_by_value(config.country, client.country)

    if environment is not None:
        tenant['ENVIRONMENT'] = {'usage': environment}

    if country is not None:
        tenant['COUNTRY'] = {'usage': country}

    for user_type in OA.get_user_resources():
        tenant[user_type] = {
            'usage': client.users_by_type.get(user_type, 0)
        }

    return tenant

def report_error(message):
    return {'status': 'error',
            'statusData': {
                'code': 'ActivationData',
                'messages': [
                    {
                        'type': 'error',
                        'text': '{}'.format(message),
                    }

                ],
                'perPropertyData': []
            }}

def provision_fallball_client(args):
    company_info = OA.get_resource(args.acc_id)
    company_name = urlify(company_info['companyName'])
    admin_email = company_info['techContact']['email']

    if 'addressPostal' in args.account_info \
            and args.account_info['addressPostal'].get('postalCode'):
        postal_code = args.account_info['addressPostal']['postalCode']
    else:
        postal_code = company_info['addressPostal']['postalCode']

    info = {
        'accountInfo': {
            'addressPostal': {
                  'postalCode': postal_code,
            },
        },
    }

    sub_id = OA.get_resource(args.sub_id)['subscriptionId']
    company_name = '{}-sub{}'.format(company_name if company_name else 'Unnamed', sub_id)
    g.company_name = company_name
    storage_limit = args.storage_limit if args.storage_limit else 0

    country = None if args.country is None else config.country.get(args.country, None)

    environment = None if args.environment is None \
        else config.environment.get(args.environment, None)

    client = Client(g.reseller, name=company_name, is_integrated=OA.is_application_support_users(),
                    storage={'limit': storage_limit}, email=admin_email, postal_code=postal_code,
                    country=country, environment=environment)

    try:
        client.create()
    except HttpClientError as e:
        resp = e.response.json()
        result = analyze_service_error(resp)
        if result.recoverable:
            info.update(result.data)
            return ProvisioningResult(info, 202,
                                      {'Aps-Info': "Additional information required to complete "
                                                   "provisioning"})
        else:
            info.update(report_error(resp))
            return ProvisioningResult(info, 500, {})
    except Exception as e:
        info.update(report_error(str(e)))
        return ProvisioningResult(info, 500, {})

    user = make_default_fallball_admin(client)
    user.update()

    OA.subscribe_on(args.aps_id, 'http://aps-standard.org/core/events/linked',
                    relation='users',
                    source_type=args.aps_type,
                    handler='onUsersChange')
    OA.subscribe_on(args.aps_id, 'http://aps-standard.org/core/events/unlinked',
                    relation='users',
                    source_type=args.aps_type,
                    handler='onUsersChange')

    status = 'reprovisioned' if args.status else ''

    tenant = {
        'tenantId': client.name,
        'status': status,
        'statusData': {
           'messages': [],
           'perPropertyData': [],
        },
    }
    tenant.update(build_usage(client))

    return ProvisioningResult(tenant, 201, None)

class TenantList(ConnectorResource):
    def post(self):
        args = get_tenant_args()
        phase = request.headers.get('Aps-Request-Phase', 'sync')

        if args.status == 'reprovisioned':
            return {}, 201
        elif phase == 'async' and args.status != 'error':
            return {}, 202, {'Aps-Info': "Additional information required to complete provisioning",
                             'Aps-Retry-Timeout': 10}

        return provision_fallball_client(args)

class Tenant(ConnectorResource):
    def get(self, tenant_id):
        company_name = g.company_name = get_name_for_tenant(tenant_id)
        client = Client(g.reseller, name=company_name)
        tenant = build_usage(client)
        return tenant

    def put(self, tenant_id):
        parser = reqparse.RequestParser()
        parser.add_argument(config.diskspace_resource, dest='storage_limit',
                            type=parameter_validator('limit'), required=False,
                            help='Missing {} limit in request'.format(config.diskspace_resource))
        args = parser.parse_args()
        company_name = g.company_name = get_name_for_tenant(tenant_id)
        if args.storage_limit:
            client = Client(g.reseller, name=company_name,
                            storage={'limit': args.storage_limit})
            client.update()
        return {}

    def delete(self, tenant_id):
        company_name = g.company_name = get_name_for_tenant(tenant_id)
        client = Client(g.reseller, name=company_name)
        client.delete()
        return None, 204

class TenantDisable(ConnectorResource):
    def put(self, tenant_id):
        # Not supported by the service yet
        return {}

class TenantEnable(ConnectorResource):
    def put(self, tenant_id):
        # Not supported by the service yet
        return {}

class TenantAdminLogin(ConnectorResource):
    def get(self, tenant_id):
        try:
            company_name = g.company_name = get_name_for_tenant(tenant_id)
            client = Client(g.reseller, name=company_name)
            user = make_default_fallball_admin(client)
            login_link = user.login_link()
        except OACommunicationException:
            # Requesting login link for non-existing user to get link to login form from service
            fake_user = FbUser(client=Client(g.reseller, 'fake_client'),
                               email='does-not-exist@non-existing.local')
            login_link = fake_user.login_link()

        return {
            'redirectUrl': login_link,
        }, 200

class TenantUserCreated(ConnectorResource):
    def post(self, tenant_id):
        return {}

class TenantUserRemoved(ConnectorResource):
    def delete(self, tenant_id, user_id):
        return {}

class TenantOnUsersChange(ConnectorResource):
    def post(self, tenant_id):
        request.get_json()
        client = Client(g.reseller, get_name_for_tenant(tenant_id))
        sync_tenant_usage_with_client(tenant_id, client)
        send_after_users_change_notification(tenant_id)
        return {}

def send_after_users_change_notification(tenant_id):
    oa_account_id = OA.get_resources('/aps/2/resources/{}/account'
                                     .format(tenant_id))[0]['aps']['id']
    OA.send_notification('Usage updated',
                         details='Fallball resource usage was updated',
                         status='ready', account_id=oa_account_id)

class TenantReprovision(ConnectorResource):
    def post(self, tenant_id):
        args = get_tenant_args()

        tenant = OA.get_resource(tenant_id)
        if tenant['aps']['status'] != 'aps:provisioning' or tenant['status'] == 'reprovisioned':
            return {'error': "Cannot provision already provisioned client"}, 400

        result = provision_fallball_client(args)

        path = '/aps/2/application/tenant/{}'.format(tenant_id)

        if result.status_code == 201:
            body = {
                'accountInfo': args.account_info,
                'status': 'reprovisioned',
                'statusData': {},
            }
            body.update(result.body)
        else:
            body = result.body

        OA.send_request('PUT', path, body)

        return {}, 200


text:
package com.cognizant.cognizantits.qcconnection.qcupdation;

import com4j.Com4jObject;
import com4j.DefaultValue;
import com4j.IID;
import com4j.MarshalAs;
import com4j.NativeType;
import com4j.Optional;
import com4j.VTID;

@IID("{C7D067FD-11BD-4F3C-B245-1AC60C04414F}")
public abstract interface _ITestSetFolder5
  extends Com4jObject
{
  @VTID(3)
  public abstract void undo();

  @VTID(4)
  public abstract boolean modified();

  @VTID(5)
  public abstract boolean autoUnlock();

  @VTID(6)
  public abstract void autoUnlock(boolean paramBoolean);

  @VTID(7)
  public abstract void post(@Optional @DefaultValue("-1") boolean paramBoolean);

  @VTID(8)
  public abstract boolean isFieldModified(String paramString, @Optional Object paramObject);

  @VTID(9)
  public abstract void undoField(String paramString);

  @VTID(10)
  public abstract boolean verifyPutFieldWithErrorOnFail(String paramString, @MarshalAs(NativeType.VARIANT) Object paramObject);
}

/* Location:           D:\Prabu\jars\QC.jar
 * Qualified Name:     qcupdation._ITestSetFolder5
 * JD-Core Version:    0.7.0.1
 */


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Jonas Colmsjö's blog</title>
    <meta name="viewport"    content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author"      content="Jonas Colmsjö">

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

    <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="assets/css/bs-styles.css"            rel="stylesheet">

    <link rel="shortcut icon" href="assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72"   href="assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed"                 href="assets/ico/apple-touch-icon-57-precomposed.png">

Home

Client-side-javascript.md

Yet another post

[[Main_Page]]

== Intro ==

https://developer.mozilla.org/en/JavaScript/

https://developer.mozilla.org/en/Gecko_DOM_Reference

objects
 https://developer.mozilla.org/en/JavaScript/Guide/Inheritance_and_the_prototype_chain
 https://developer.mozilla.org/en/JavaScript/Reference/Operators/new

https://github.com/chaplinjs/chaplin

http://documentcloud.github.com/backbone/

http://underscorejs.org/

https://github.com/amdjs/amdjs-api/wiki/AMD

http://www.commonjs.org/

http://svn.cometd.com/trunk/bayeux/bayeux.html

http://microjs.com/#spa

http://microjs.com/#

Event delegation
* http://davidwalsh.name/event-delegate

Performance
* http://developer.yahoo.com/performance/rules.html/

Css
* http://www.css3.info/preview/

== Facts, best pratices etc. ==

http://www.netmarketshare.com/browser-market-share.aspx?qprid=1

http://www.w3schools.com/browsers/browsers_stats.asp

http://yuilibrary.com/yui/docs/tutorials/gbs/

== Firefox browser ==

https://developer.mozilla.org/en/Chrome_Registration/

== Render HTML ==

http://ejohn.org/blog/html5-shiv/

https://developer.mozilla.org/en/Gecko_DOM_Reference/Examples#Example_1:_height_and_width

https://developer.mozilla.org/En/Code_snippets:HTML_to_DOM

https://developer.mozilla.org/en/Chrome_Registration/

http://www.w3.org/TR/XMLHttpRequest/

https://developer.mozilla.org/en/DOM/XMLHttpRequest/Using_XMLHttpRequest
 CORS must be made from http:// NOT file://
 http://ejohn.org/blog/cross-site-xmlhttprequest/
 http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html
 http://fettig.net/weblog/2005/11/28/how-to-make-xmlhttprequest-connections-to-another-server-in-your-domain/

== Frameworks And tools ==

https://github.com/jquery/jquery/

https://github.com/cowboy/grunt

http://pivotal.github.com/jasmine/

http://jsbin.com/#javascript,html

http://jsfiddle.net/

http://tutti.tobyho.com/

== Books==

Ninja Book - http://freech.manning-sandbox.com/cemail?uid=92fb63db-e4e0-4928-817d-a935e68fd90c

== code ==

jquery dollar sign - http://api.jquery.com/jQuery/

prototype dollar sign - http://osric.com/chris/accidental-developer/2008/04/the-javascript-dollar-sign-function/

http://headjs.com/

https://github.com/janl/mustache.js

https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Iterators_and_Generators#Generators.3a_a_better_way_to_build_Iterators

http://tobyho.com/2011/01/28/checking-types-in-javascript/

https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

== jquery ==

Make sure that Node.js is installed.

Install and build:
* clone from github https://github.com/jquery/jquery/

 cd jquery && npm install
grunt -version
grunt                # build
grunt watch      # run inut tests

== grunt ==

https://github.com/cowboy/grunt

Install grunt globally:

sudo npm install -g grunt

== PhonatonJS ==

http://ariya.ofilabs.com/2012/02/phantomjs-and-mac-os-x.html
** https://github.com/cowboy/grunt/blob/master/docs/faq.md

== compile to JS ==

https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

About the author

Jonas Colmsjö

          colmsjo

          colmsjo

Gothenburg, Sweden

About this article

Date Released:

Sunday, January 01, 2012

        (c) Jonas Colmsjö 2012
        Follow @colmsjo
 View Jonas Colmsjö's profile


text:
class ReviewController {
  constructor() {
    this.name = 'review';
  }
}

export default ReviewController;


text:
package swarm

const (
	DockerImage              = "swarm:latest"
	DiscoveryServiceEndpoint = "https://discovery-stage.hub.docker.com/v1"
)

type SwarmOptions struct {
	IsSwarm        bool
	Address        string
	Discovery      string
	Master         bool
	Host           string
	Strategy       string
	Heartbeat      int
	Overcommit     float64
	TlsCaCert      string
	TlsCert        string
	TlsKey         string
	TlsVerify      bool
	ArbitraryFlags []string
}


text:
package database;

import java.util.*;

import org.hibernate.*;
import org.hibernate.criterion.*;

import beans.scripts.PatientIllnessScript;
import beans.scripts.VPScriptRef;
//import beans.LogEntry;
import beans.relation.*;
import beans.relation.summary.*;
import util.*;

public class DBClinReason /*extends HibernateUtil*/{
	static HibernateSession instance = new HibernateSession();

    /**
     * saves an object into the database. Object has to have a hibernate mapping!
     * @param o
     */
    public void saveAndCommit(Object o){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
        try {
        	instance.beginTransaction();
            s.setFlushMode(FlushMode.COMMIT);
            s.saveOrUpdate(o);
            instance.commitTransaction(s);
        }

        catch(Exception e){
        	System.out.println("DBClinReason.saveAndCommit(), Exception: " + StringUtilities.stackTraceToString(e));
        	instance.rollBackTx();
        }
        finally{
        	    s.flush();
        	    s.evict(o);
        	    s.close();
        }
    }

    /**
     * Saves/updates a collection of objects into the database
     * @param o
     */
    public void saveAndCommit(Collection o) {
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
        try {
        	instance.beginTransaction();
            s.setFlushMode(FlushMode.COMMIT);   //commit will be done after insert!
            //tx = s.beginTransaction();
            Iterator it = o.iterator();
            while(it.hasNext())
            {
            	s.saveOrUpdate(it.next());
            }
            instance.commitTransaction(s);
        }
        catch (Exception e) {
        	System.out.println("DBClinReason.saveAndCommit(), Exception: " + StringUtilities.stackTraceToString(e));
        	instance.rollBackTx();
        }
        finally{
    	    s.flush();
    	    s.evict(o);
    	    s.close();
        }
    }
    /**
     * Delete a collection from the database
     * @param o
     */
    public void deleteAndCommit(Collection c){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
        try {
        	instance.beginTransaction(s);
            s.setFlushMode(FlushMode.COMMIT);
            Iterator it = c.iterator();
            while(it.hasNext())
            {
            	s.delete(it.next());
            }
            instance.commitTransaction(s);
        }
        catch(Exception e){
        	System.out.println("DBClinReason.deleteAndCommit(), Exception: " + StringUtilities.stackTraceToString(e));
        	instance.rollBackTx();
        }
        finally{
    	    s.flush();
    	    s.close();
        }
    }

    /**
     * Delete a Bean from the database
     * @param o
     */
    public void deleteAndCommit(Object o){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
        try {
        	instance.beginTransaction(s);
            s.setFlushMode(FlushMode.COMMIT);
            s.delete(o);
            instance.commitTransaction(s);
        }
        catch(Exception e){
        	System.out.println("DBClinReason.deleteAndCommit(), Exception: " + StringUtilities.stackTraceToString(e));
        	instance.rollBackTx();
        }
        finally{
    	    s.flush();
    	    s.close();
        }
    }

    /**
     * Select the PatientIllnessScript of the expert, which is identified by the parentId and type from the database.
     * @param sessionId
     * @return PatientIllnessScript or null
     */
    public PatientIllnessScript selectExpertPatIllScriptByVPId(String vpId){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("vpId", vpId));
    	criteria.add(Restrictions.eq("type", new Integer(PatientIllnessScript.TYPE_EXPERT_CREATED)));
    	PatientIllnessScript patIllScript =  (PatientIllnessScript) criteria.uniqueResult();

    	if(patIllScript!=null){
    		patIllScript.setSummSt(loadSummSt(patIllScript.getSummStId(), s));
    		selectNodesAndConns(patIllScript, s);
    	}
    	s.close();
    	return patIllScript;
    }

    /**
     * loads all learner scripts for a given vpId, called from the reports section....
     * Do NOT load the summary statements!!!
     * @param vpId
     * @return
     */
    public List<PatientIllnessScript> selectLearnerPatIllScriptsByVPId(String vpId){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("vpId", vpId));
    	criteria.add(Restrictions.eq("type", new Integer(PatientIllnessScript.TYPE_LEARNER_CREATED)));
    	List<PatientIllnessScript> patIllScripts =  criteria.list();
    	if(patIllScripts!=null){
    		for(int i=0; i<patIllScripts.size(); i++){
    			selectNodesAndConns(patIllScripts.get(i), s);
    		}
    	}
    	s.close();

    	return patIllScripts;

    }

    /**
     * loads all learner scripts by given pisID
     *
     * @param vpId
     * @return
     */
    /*public List<PatientIllnessScript> selectLearnerPatIllScriptsById(long pisId){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("id", pisId));
    	criteria.add(Restrictions.eq("type", new Integer(PatientIllnessScript.TYPE_LEARNER_CREATED)));
    	List<PatientIllnessScript> patIllScripts =  criteria.list();
    	if(patIllScripts!=null){
    		for(int i=0; i<patIllScripts.size(); i++){
    			selectNodesAndConns(patIllScripts.get(i), s);
    		}
    	}
    	s.close();

    	return patIllScripts;
    }*/

    /**
     * Select the PatientIllnessScript for the sessionId from the database.
     * @param sessionId
     * @return PatientIllnessScript or null
     */
    public PatientIllnessScript selectPatIllScriptById(long id){
    	return selectAllIllScriptById(id, "id", false);
    }

    public PatientIllnessScript selectLearnerPatIllScript(long id, String identifier){
    	return selectAllIllScriptById(id, "id", true);
    }

    public PatientIllnessScript selectAllIllScriptById(long id, String identifier, boolean considerType){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq(identifier, new Long(id)));
    	if(considerType) criteria.add(Restrictions.eq("type", new Integer(PatientIllnessScript.TYPE_LEARNER_CREATED)));
    	PatientIllnessScript patIllScript =  (PatientIllnessScript) criteria.uniqueResult();

    	if(patIllScript!=null){
    		patIllScript.setSummSt(loadSummSt(patIllScript.getSummStId(), s));
    		selectNodesAndConns(patIllScript, s);
    	}
    	else {
    		CRTLogger.out("DBClinReason.selectAllIllScriptById: long: "  + id + ", identifier: " + identifier + ", considerType: " + considerType+ ", criteria: " + criteria, CRTLogger.LEVEL_PROD);

    	}
    	s.close();
    	return patIllScript;

    }

    /**
     * Select the PatientIllnessScripts for the userId from the database.
     * Beware: summStatement not loaded!
     * We only load the latest script of a user (not any previous, which have a deleteFlag=1)
     * @param sessionId
     * @return PatientIllnessScript or null
     */
    public List<PatientIllnessScript> selectActivePatIllScriptsByUserId(long userId){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("userId", new Long(userId)));
    	criteria.add(Restrictions.eq("deleteFlag", new Boolean(false)));
    	criteria.addOrder(Order.desc("lastAccessDate"));
    	List<PatientIllnessScript> scripts =   criteria.list();
    	if(scripts==null) return null;
    	for(int i=0;i<scripts.size(); i++){
    		selectNodesAndConns(scripts.get(i), s);
    	}
    	s.close();
    	return scripts;
    }

    /**
     * Select the PatientIllnessScripts for the userId and parentId from the database.
     * @param sessionId
     * @param vpId
     * @param uId (an optional unique id that can be transferred from the VP system, e.g. a sessionId)
     * @return PatientIllnessScript or null
     */
    public PatientIllnessScript selectPatIllScriptsByUserIdAndVpId(long userId, String vpId, String extUId){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("userId", new Long(userId)));
    	criteria.add(Restrictions.eq("vpId", vpId));
    	if(extUId!=null && !extUId.trim().equals("")) criteria.add(Restrictions.eq("extUId", extUId));
    	criteria.add(Restrictions.eq("type", PatientIllnessScript.TYPE_LEARNER_CREATED));
    	PatientIllnessScript patIllScript =  (PatientIllnessScript) criteria.uniqueResult();
    	if(patIllScript!=null){
    		patIllScript.setSummSt(loadSummSt(patIllScript.getSummStId(), s));
    		selectNodesAndConns(patIllScript, s);
    	}
    	s.close();
    	return patIllScript;
    }

    /**
     * Select the PatientIllnessScripts for the userId and parentId from the database.
     * @param sessionId
     * @param vpId
     * @param uId (an optional unique id that can be transferred from the VP system, e.g. a sessionId)
     * @return PatientIllnessScript or null
     */
    public List<PatientIllnessScript> selectPatIllScriptsByUserIdAndVpId(long userId, String vpId){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("userId", new Long(userId)));
    	criteria.add(Restrictions.eq("vpId", vpId));
    	criteria.add(Restrictions.eq("type", PatientIllnessScript.TYPE_LEARNER_CREATED));

    	//We do not need to load nodes here...
    	return
    			criteria.list();
    }

    public List<PatientIllnessScript> selectPatIllScriptsByExtUserIdsAndVpId(String[] extUserIds, String vpId){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.in("extUId", extUserIds ));
    	criteria.add(Restrictions.eq("vpId", vpId));
    	criteria.add(Restrictions.eq("type", PatientIllnessScript.TYPE_LEARNER_CREATED));

    	List<PatientIllnessScript> scripts = criteria.list();
    	if(scripts!=null){
    		for(int i=0;i<scripts.size();i++){
    			selectNodesAndConns(scripts.get(i), s);
    			scripts.get(i).setSummSt(loadSummSt(scripts.get(i).getId(), s));
    		}
    	}
    	s.close();
    	return scripts;
    }

    /**
     * for recalculation and scoring of summary statements in new format
     * @return PatientIllnessScript or null
     */
    public List selectLearnerPatIllScriptsByNotAnalyzedSummSt(int max, Date startDate, Date endDate, int type, boolean loadNodes, int analyzed, boolean submittedStage, int recalc){
    	/*
    	 * select * from CRT.PATIENT_ILLNESSSCRIPT pis,CRT.SUMMSTATEMENT smst where pis.SUMMST_ID = smst.ID and smst.ANALYZED = 0 and lang in ('de', 'en') and pis.TYPE = 1
    	 */
		CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByNotAnalyzedSummSt: max: "  + max + ", startDate: " + startDate + ", endDate: " + endDate+ ", type: " + type+ ", loadNodes: " + loadNodes+ ", analyzed: " + analyzed+ ", submittedStage: " + submittedStage, CRTLogger.LEVEL_PROD);

    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("type", new Integer(type)));

    	List<String> lang = new ArrayList<String>();
    	lang.add("de");
    	lang.add("en");

    	List<Locale> locale = new ArrayList<Locale>();
    	locale.add(Locale.GERMAN);
    	locale.add(Locale.ENGLISH);

    	// sub query:
    	DetachedCriteria stmts = DetachedCriteria.forClass(SummaryStatement.class, "stmt")
    			.setProjection( Property.forName("stmt.id") )
    			.add(Property.forName("stmt.lang").in(lang));

    	if (analyzed>=0) {
    		stmts.add( Property.forName("stmt.analyzed").eq(analyzed == 1 ? Boolean.TRUE : Boolean.FALSE) );
    	}

    	if (recalc>=0) {
    		stmts.add( Property.forName("stmt.recalcMode").eq(recalc) );
    	}

    	if (startDate != null) {
    		stmts.add(Restrictions.ge("stmt.creationDate", startDate));
    	}
    	if (endDate != null) {
    		stmts.add(Restrictions.le("stmt.creationDate", endDate));
    	}

    	// now query
    	criteria.add(Property.forName("summStId").in(stmts));
    	if (max>0) {
    		criteria.setMaxResults(max);
    	}

    	if (submittedStage) {
    		criteria.add(Property.forName("submittedStage").gt(Integer.valueOf(0)));
    	}

    	Disjunction disjunction = Restrictions.disjunction();
    	disjunction.add(Property.forName("pis2.summStId").le(Long.valueOf(0)));
    	disjunction.add(Restrictions.not(Property.forName("pis2.locale").in(locale)));

    	//select distinct(vp_id) from CRT.PATIENT_ILLNESSSCRIPT where type=2 and SUMMST_ID = -1
    	DetachedCriteria pis2 = DetachedCriteria.forClass(PatientIllnessScript.class, "pis2")
    			.setProjection( Projections.distinct(Property.forName("pis2.vpId")) )
    			.add(Property.forName("pis2.type").eq(Integer.valueOf(2)))
    			.add(disjunction);

    	criteria.add(Property.forName("vpId").notIn(pis2));

    	criteria.addOrder(Order.asc("creationDate"));
		CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByNotAnalyzedSummSt: criteria: "  + criteria + ", " + stmts + "," + pis2, CRTLogger.LEVEL_PROD);

    	List<PatientIllnessScript> scripts = criteria.list();
    	long smstMs = 0;
    	long nodesMs = 0;
    	long startms = 0;
    	long endms = 0;
    	if(scripts!=null){
    		CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByNotAnalyzedSummSt: scripts: #"  + scripts.size(), CRTLogger.LEVEL_PROD);
    		for(int i=0;i<scripts.size();i++){
    			if ((i%250) == 0) {
    				CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByNotAnalyzedSummSt: scripts: i:"  + i, CRTLogger.LEVEL_PROD);
    			}

    			PatientIllnessScript loop = scripts.get(i);
    			startms = System.currentTimeMillis() ;
    			loop.setSummSt(loadSummSt(loop.getSummStId(), s));
    			endms = System.currentTimeMillis() ;
    			smstMs += (endms-startms);

    			if (loadNodes) {
        			startms = System.currentTimeMillis() ;
    				selectNodesAndConns(loop, s);
        			endms = System.currentTimeMillis() ;
        			nodesMs += (endms-startms);
    			}
    		}

    		CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByNotAnalyzedSummSt: finish post process: smstMs: "  + smstMs + "ms; nodesMs: "  + nodesMs + "ms; ", CRTLogger.LEVEL_PROD);
    	}
    	else {
    		CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByNotAnalyzedSummSt: finish post process: scripts == null !!", CRTLogger.LEVEL_PROD);
    	}

    	s.close();

    	return scripts;
    }

    /**
     * Selects all PatientIllnessScripts that can be included into the peer responses.
     * Only scripts that have not yet been added (peerSync=0), scripts that have submitted a diagnosis (submittedStage>0),
     * and learner scripts (not expert ones) are considered and selected.
     * @return PatientIllnessScript or null
     */
    public List<PatientIllnessScript> selectLearnerPatIllScriptsByPeerSync(int max, Date startDate, Date endDate){
    	Session s = instance.getInternalSession(Thread.currentThread(), false);
    	Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("peerSync", new Boolean(false)));
    	criteria.add(Restrictions.gt("submittedStage", 0));
    	criteria.add(Restrictions.eq("type", new Integer(PatientIllnessScript.TYPE_LEARNER_CREATED)));

    	if (max>0) {
    		criteria.setMaxResults(max);
    	}

    	if (startDate != null) {
    		criteria.add(Restrictions.ge("lastAccessDate", startDate));
    	}
    	if (endDate != null) {
    		criteria.add(Restrictions.le("lastAccessDate", endDate));

    	}
    	//long minusOneYearMS = System.currentTimeMillis() - 1000 * 3600 * 24 * 365;
    	//Date minusOneYear = new Date(minusOneYearMS);
    	//criteria.add(Restrictions.gt("lastAccessDate", minusOneYear));

    	List<PatientIllnessScript> scripts = criteria.list();
    	if(scripts!=null){
    		CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByPeerSync: scripts: #"  + scripts.size(), CRTLogger.LEVEL_PROD);
    		for(int i=0;i<scripts.size();i++){
    			if ((i%2500) == 0) {
    				CRTLogger.out("DBClinReason.selectLearnerPatIllScriptsByPeerSync: scripts: i:"  + i, CRTLogger.LEVEL_PROD);
    			}
    			selectNodesAndConns(scripts.get(i), s);
    		}
    	}
    	s.close();
    	return scripts;
    }

	public SummaryStatement loadSummSt(long id, Session s){
		if(id<=0) return null;
		if(s==null) s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(SummaryStatement.class,"SummaryStatement");
		criteria.add(Restrictions.eq("id", new Long(id)));
		SummaryStatement st = (SummaryStatement) criteria.uniqueResult();
		st.setSqHitsAsList(selectSummaryStatementSQsBySumId(st.getId(), s));
		return st;
	}

	public SummaryStatement selectExpSummStByVPId(long id, Session s){
		if(id<=0) return null;
		if(s==null) s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(SummaryStatement.class,"SummaryStatement");
		criteria.add(Restrictions.eq("id", new Long(id)));
		SummaryStatement st = (SummaryStatement) criteria.uniqueResult();
		st.setSqHitsAsList(selectSummaryStatementSQsBySumId(st.getId(), s));
		return st;
	}

	private List selectSummaryStatementSQsBySumId(long summStId, Session s){
		//Session s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(SummaryStatementSQ.class,"SummaryStatementSQ");
		criteria.add(Restrictions.eq("summStId", new Long(summStId)));
		return criteria.list();
	}

	/**
	 * Get all summary statements (experts & learners) depending of analyze status. Called on start
	 * to analyze all non-analyzed statements.
	 * @param type
	 * @param analyzed
	 * @return
	 */
	public List<SummaryStatement> getSummaryStatementsByAnalyzed(boolean analyzed){
		Session s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(SummaryStatement.class,"SummaryStatement");
		criteria.add(Restrictions.eq("analyzed", new Boolean(analyzed)));
		return criteria.list();
	}

	/**
	 * Get all summary statements (experts & learners) depending of analyze status. Called on start
	 * to analyze all non-analyzed statements.
	 * @param type
	 * @param analyzed
	 * @return
	 */
	public List<SummaryStatement> getSummaryStatementsById(Long[] ids){
		Session s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(SummaryStatement.class,"SummaryStatement");
		criteria.add(Restrictions.in("id", ids));
		return criteria.list();
	}

	public static List<VPScriptRef> getVPScriptRefs(){
		Session s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(VPScriptRef.class,"VPScriptRef");
		return criteria.list();
	}

	public VPScriptRef getVPScriptRef(String parentId){
		Session s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(VPScriptRef.class,"VPScriptRef");
		criteria.add(Restrictions.eq("parentId", new String(parentId)));
		return (VPScriptRef) criteria.uniqueResult();
	}

	protected void selectNodesAndConns(PatientIllnessScript patIllScript, Session s){
		patIllScript.setProblems(selectProblemsForScript(s, patIllScript.getId()));
		patIllScript.setPatho(selectPathosForScript(s, patIllScript.getId()));
		patIllScript.setDiagnoses(selectDiagnosesForScript(s, patIllScript.getId()));
		patIllScript.setTests(selectTestsForScript(s, patIllScript.getId()));
		patIllScript.setMngs(selectMngsForScript(s, patIllScript.getId()));
		patIllScript.setConns(selectConnsForScript(s, patIllScript.getId()));
		patIllScript.setNursingManagement(selectNursingMngsForScript(s, patIllScript.getId()));
		patIllScript.setNursingAims(selectNursingAimsForScript(s, patIllScript.getId()));
		patIllScript.setInformation(selectInfosForScript(s, patIllScript.getId()));
		patIllScript.setNursingDiagnoses(selectNursingDDXForScript(s, patIllScript.getId()));
		patIllScript.setMidwifeManagement(selectMMngForScript(s, patIllScript.getId()));
		patIllScript.setMidwifeFindings(selectMFdgForScript(s, patIllScript.getId()));
		patIllScript.setMidwifeHypotheses(selectMHypForScript(s, patIllScript.getId()));
		patIllScript.setMidwifeRecommendations(selectMRecForScript(s, patIllScript.getId()));
	}

	private List<RelationProblem> selectProblemsForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationProblem.class,"RelationProblem");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationPatho> selectPathosForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationPatho.class,"RelationPatho");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}
	private List<RelationDiagnosis> selectDiagnosesForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationDiagnosis.class,"RelationDiagnosis");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.add(Restrictions.eq("discriminator", new Integer(Relation.TYPE_DDX)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationTest> selectTestsForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationTest.class,"RelationTest");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationManagement> selectMngsForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationManagement.class,"RelationManagement");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.add(Restrictions.eq("discriminator", new Integer(Relation.TYPE_MNG)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationNursingManagement> selectNursingMngsForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationNursingManagement.class,"RelationNursingManagement");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.add(Restrictions.eq("discriminator", new Integer(Relation.TYPE_NMNG)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationNursingAim> selectNursingAimsForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationNursingAim.class,"RelationNursingAim");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationNursingDiagnosis> selectNursingDDXForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationNursingDiagnosis.class,"RelationNursingDiagnosis");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.add(Restrictions.eq("discriminator", new Integer(Relation.TYPE_NDDX)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationInformation> selectInfosForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationInformation.class,"RelationInformation");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationMidwifeManagement> selectMMngForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationMidwifeManagement.class,"RelationMidwifeManagement");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationMidwifeFinding> selectMFdgForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationMidwifeFinding.class,"RelationMidwifeFinding");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationMidwifeHypothesis> selectMHypForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationMidwifeHypothesis.class,"RelationMidwifeHypothesis");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private List<RelationMidwifeRecommendation> selectMRecForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(RelationMidwifeRecommendation.class,"RelationMidwifeRecommendation");
		criteria.add(Restrictions.eq("destId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("order"));
		return criteria.list();
	}

	private Map<Long, Connection> selectConnsForScript(Session s, long patIllscriptId){
		Criteria criteria = s.createCriteria(Connection.class, "Connection");
		criteria.add(Restrictions.eq("illScriptId", new Long(patIllscriptId)));
		criteria.addOrder(Order.asc("id"));
		List<Connection> conns = criteria.list();
		if(conns==null) return null;
		Map<Long, Connection> connMap = new TreeMap<Long, Connection>();
		for(int i=0;i<conns.size(); i++){
			connMap.put(new Long(conns.get(i).getId()), conns.get(i));
		}
		return connMap;
	}

	public JsonTest selectJsonTestBySummStId(long id){
		Session s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(JsonTest.class, "JsonTest");
		criteria.add(Restrictions.eq("id", new Long(id)));
		return (JsonTest) criteria.uniqueResult();
	}

	/**
	 * temporary method to select scripts without a sessionId and add the encoded sessionId
	 * @return
	 */
	public List selectTmpPatientIllScripts() {
		Session s = instance.getInternalSession(Thread.currentThread(), false);
		Criteria criteria = s.createCriteria(PatientIllnessScript.class,"PatientIllnessScript");
    	criteria.add(Restrictions.eq("sessionId", new Long(-1)));
    	criteria.add(Restrictions.eq("type", PatientIllnessScript.TYPE_LEARNER_CREATED));

    	return criteria.list();
	}
}


text:
using System.IO;
using System.Reflection;
using System.Resources;

namespace Microsoft.Ddue.Tools.DxCoach {

    internal sealed class ResourceHelper {

        private static ResourceManager manager = new ResourceManager("TextStrings", Assembly.GetExecutingAssembly());

        private ResourceHelper() { }

        public static Stream GetStream(string file) {
            return (Assembly.GetExecutingAssembly().GetManifestResourceStream(file));
        }

        public static string GetString(string key) {
            return (manager.GetString(key));
        }

    }

}


text:
/* This should probably have ES6 to ES5 transpilation on when compiling to bookmarklet */

/* Suggested bookmarklet names: "+CSS" or "Apply Custom Stylesheet" */

const version = '1.1';

const styles = prompt('Enter CSS here to add it to the current page.');

const styleElement = (document.getElementsByTagName('head')[0]||document.body).appendChild(document.createElement('style'));
styleElement.dataset.ahBookmarkletInserted = "1";
const textNode = document.createTextNode(styles);
styleElement.appendChild(textNode);


text:
package cybervillains.ca;

import org.bouncycastle.crypto.digests.SHA1Digest;
import org.bouncycastle.util.encoders.Base64;

import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;

public class ThumbprintUtil {

  /**
   * Generates a SHA1 thumbprint of a certificate for long-term mapping.
   *
   * @param cert certificate
   * @return String with base64 encoded digest bytes.
   * @throws CertificateEncodingException certificate encoding
   */
  public static String getThumbprint(final X509Certificate cert)
      throws CertificateEncodingException {

    if (cert == null)
    {
      return null;
    }

    byte[] rawOctets = cert.getEncoded();

    SHA1Digest digest = new SHA1Digest();

    byte[] digestOctets = new byte[digest.getDigestSize()];

    digest.update(rawOctets, 0, rawOctets.length);

    digest.doFinal(digestOctets, 0);

    return new String(Base64.encode(digestOctets));
  }

}


text:
package com.gs.obevo.db.scenariotests;

import com.gs.obevo.api.appdata.PhysicalSchema;
import com.gs.obevo.api.platform.MainDeployerArgs;
import com.gs.obevo.db.api.factory.DbEnvironmentFactory;
import com.gs.obevo.db.api.platform.DbDeployerAppContext;
import com.gs.obevo.dbmetadata.api.DaIndex;
import com.gs.obevo.dbmetadata.api.DaSchemaInfoLevel;
import com.gs.obevo.dbmetadata.api.DaTable;
import com.gs.obevo.dbmetadata.api.DbMetadataManager;
import org.eclipse.collections.impl.block.factory.Predicates;
import org.eclipse.collections.impl.factory.Sets;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ChangesetDeploymentsTest {
    @Test
    public void testChangesetsAppliedInPhases() {
        DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance()
                .readOneFromSourcePath("scenariotests/changesetDeploy/step1")
                .buildAppContext()
                .setupEnvInfra().cleanEnvironment();

        dbDeployerAppContext.deploy();

        // in the default phase, all the
        checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", false);
        checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", false);
        checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", false);

        dbDeployerAppContext.deploy(new MainDeployerArgs().changesetNames(Sets.immutable.with("phaseA")));

        checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true);
        checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true);
        checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", false);

        dbDeployerAppContext.deploy(new MainDeployerArgs().changesetNames(Sets.immutable.with("phaseB")));

        checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true);
        checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true);
        checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", true);
    }

    @Test
    public void testChangesetAppliedAtOnce() {
        DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance()
                .readOneFromSourcePath("scenariotests/changesetDeploy/step1")
                .buildAppContext()
                .setupEnvInfra().cleanEnvironment();

        dbDeployerAppContext.deploy(new MainDeployerArgs().allChangesets(true));

        checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true);
        checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true);
        checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", true);
    }

    private void checkForIndex(DbDeployerAppContext dbDeployerAppContext, final String tableName, String indexName, boolean shouldExist) {
        final DbMetadataManager dbMetadataManager = dbDeployerAppContext.getDbMetadataManager();
        DaTable tableInfo = dbMetadataManager.getTableInfo(new PhysicalSchema("SCHEMA1"), tableName, new DaSchemaInfoLevel().setRetrieveTableIndexes(true));

        DaIndex index = tableInfo.getIndices().detect(Predicates.attributeEqual(DaIndex.TO_NAME, indexName));
        assertEquals("Index " + indexName + " should exist==" + shouldExist, shouldExist, index != null);
    }
}


text:
package com.kviation.sample.orientation;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
<?php
namespace app\modules\admin\widgets;

class Alert extends \app\widgets\Alert
{
    public $alertIcons = [
        'error'   => '',
        'danger'  => '',
        'success' => '',
        'info'    => '',
        'warning' => ''
    ];

    protected function alert($message, $type)
    {
        $message = $this->alertIcons[$type] . $message;
        return parent::alert($message, $type);
    }
}


text:
/**
 * Shared beans, enumerations and classes for core workbench functions.
 *
 */
package org.ngbw.sdk.core.shared;


text:
using NearbyConnectionsMojom =
    location::nearby::connections::mojom::NearbyConnections;
using AdvertisingOptionsPtr =
    location::nearby::connections::mojom::AdvertisingOptionsPtr;
using ConnectionLifecycleListener =
    location::nearby::connections::mojom::ConnectionLifecycleListener;
using ConnectionOptionsPtr =
    location::nearby::connections::mojom::ConnectionOptionsPtr;
using DiscoveryOptionsPtr =
    location::nearby::connections::mojom::DiscoveryOptionsPtr;
using EndpointDiscoveryListener =
    location::nearby::connections::mojom::EndpointDiscoveryListener;
using PayloadListener = location::nearby::connections::mojom::PayloadListener;
using PayloadPtr = location::nearby::connections::mojom::PayloadPtr;

namespace ash {
namespace nearby {

class MockNearbyConnections : public NearbyConnectionsMojom {
 public:
  MockNearbyConnections();
  MockNearbyConnections(const MockNearbyConnections&) = delete;
  MockNearbyConnections& operator=(const MockNearbyConnections&) = delete;
  ~MockNearbyConnections() override;

  const mojo::SharedRemote<NearbyConnectionsMojom>& shared_remote() const {
    return shared_remote_;
  }

  void BindInterface(
      mojo::PendingReceiver<NearbyConnectionsMojom> pending_receiver);

  MOCK_METHOD(void,
              StartAdvertising,
              (const std::string& service_id,
               const std::vector<uint8_t>& endpoint_info,
               AdvertisingOptionsPtr,
               mojo::PendingRemote<ConnectionLifecycleListener>,
               StartDiscoveryCallback),
              (override));
  MOCK_METHOD(void,
              StopAdvertising,
              (const std::string& service_id, StopAdvertisingCallback),
              (override));
  MOCK_METHOD(void,
              StartDiscovery,
              (const std::string& service_id,
               DiscoveryOptionsPtr,
               mojo::PendingRemote<EndpointDiscoveryListener>,
               StartDiscoveryCallback),
              (override));
  MOCK_METHOD(void,
              StopDiscovery,
              (const std::string& service_id, StopDiscoveryCallback),
              (override));
  MOCK_METHOD(void,
              InjectBluetoothEndpoint,
              (const std::string& service_id,
               const std::string& endpoint_id,
               const std::vector<uint8_t>& endpoint_info,
               const std::vector<uint8_t>& remote_bluetooth_mac_address,
               InjectBluetoothEndpointCallback callback),
              (override));
  MOCK_METHOD(void,
              RequestConnection,
              (const std::string& service_id,
               const std::vector<uint8_t>& endpoint_info,
               const std::string& endpoint_id,
               ConnectionOptionsPtr options,
               mojo::PendingRemote<ConnectionLifecycleListener>,
               RequestConnectionCallback),
              (override));
  MOCK_METHOD(void,
              DisconnectFromEndpoint,
              (const std::string& service_id,
               const std::string& endpoint_id,
               DisconnectFromEndpointCallback),
              (override));
  MOCK_METHOD(void,
              AcceptConnection,
              (const std::string& service_id,
               const std::string& endpoint_id,
               mojo::PendingRemote<PayloadListener> listener,
               AcceptConnectionCallback callback),
              (override));
  MOCK_METHOD(void,
              RejectConnection,
              (const std::string& service_id,
               const std::string& endpoint_id,
               RejectConnectionCallback callback),
              (override));
  MOCK_METHOD(void,
              SendPayload,
              (const std::string& service_id,
               const std::vector<std::string>& endpoint_ids,
               PayloadPtr payload,
               SendPayloadCallback callback),
              (override));
  MOCK_METHOD(void,
              CancelPayload,
              (const std::string& service_id,
               int64_t payload_id,
               CancelPayloadCallback callback),
              (override));
  MOCK_METHOD(void,
              StopAllEndpoints,
              (const std::string& service_id,
               DisconnectFromEndpointCallback callback),
              (override));
  MOCK_METHOD(void,
              InitiateBandwidthUpgrade,
              (const std::string& service_id,
               const std::string& endpoint_id,
               InitiateBandwidthUpgradeCallback callback),
              (override));
  MOCK_METHOD(void,
              RegisterPayloadFile,
              (const std::string& service_id,
               int64_t payload_id,
               base::File input_file,
               base::File output_file,
               RegisterPayloadFileCallback callback),
              (override));

 private:
  mojo::ReceiverSet<NearbyConnectionsMojom> receiver_set_;
  mojo::SharedRemote<NearbyConnectionsMojom> shared_remote_;
};

}  // namespace nearby
}  // namespace ash

#endif  // ASH_SERVICES_NEARBY_PUBLIC_CPP_MOCK_NEARBY_CONNECTIONS_H_


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using AccidentalFish.ApplicationSupport.Core.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.WindowsAzure.Storage.Blob.Protocol;

namespace AccidentalFish.ApplicationSupport.Core.Tests.Unit.Configuration
{
    [TestClass]
    public class ApplicationConfigurationTests
    {
        private XDocument GetEmbeddedConfigurationFile()
        {
            using (
                StreamReader streamReader =
                    new StreamReader(
                        GetType()
                            .Assembly.GetManifestResourceStream(
                                "AccidentalFish.ApplicationSupport.Core.Tests.Unit.Configuration.configuration.xml")))
            {
                string asString = streamReader.ReadToEnd();
                return XDocument.Parse(asString);
            }
        }

        [TestMethod]
        public async Task ReplacesSettings()
        {
            // Arrange
            XDocument configurationDocument = GetEmbeddedConfigurationFile();
            ApplicationConfigurationSettings settings = ApplicationConfigurationSettings.FromCollection(new List<ApplicationConfigurationSetting>
            {
                new ApplicationConfigurationSetting { IsSecret = false, Key = "service-bus-connection-string", Value = "HelloWorld"},
                new ApplicationConfigurationSetting { IsSecret = false, Key = "this", Value = "***"},
                new ApplicationConfigurationSetting { IsSecret = false, Key = "message", Value = "###"}
            });

            // Act
            ApplicationConfiguration configuration = await ApplicationConfiguration.FromXDocumentAsync(configurationDocument, settings, true);

            // Assert
            ApplicationComponent component = configuration.ApplicationComponents.Single(x => x.Fqn == "accidentalfish.samples.topicsandsubscriptions.processor");
            Assert.AreEqual("*** is a ###", component.Settings.Single(x => x.Key == "somesetting").Value);
            Assert.AreEqual("HelloWorld", configuration.ServiceBusConnectionStrings["accidentalfish.samples.topicsandsubscriptions.servicebus"]);
        }

        [TestMethod]
        public async Task SecretIsCollected()
        {
            // Arrange
            XDocument configurationDocument = GetEmbeddedConfigurationFile();
            ApplicationConfigurationSettings settings = ApplicationConfigurationSettings.FromCollection(new List<ApplicationConfigurationSetting>
            {
                new ApplicationConfigurationSetting { IsSecret = false, Key = "service-bus-connection-string", Value = "HelloWorld"},
                new ApplicationConfigurationSetting { IsSecret = true, Key = "this", Value = "***"},
                new ApplicationConfigurationSetting { IsSecret = false, Key = "message", Value = "###"}
            });

            // Act
            ApplicationConfiguration configuration = await ApplicationConfiguration.FromXDocumentAsync(configurationDocument, settings, true);

            // Assert
            Assert.AreEqual("*** is a ###", configuration.Secrets.Single());
        }

        [TestMethod]
        [ExpectedException(typeof(MissingSettingException))]
        public async Task ThrowsMissingSettingException()
        {
            // Arrange
            XDocument configurationDocument = GetEmbeddedConfigurationFile();
            ApplicationConfigurationSettings settings = ApplicationConfigurationSettings.FromCollection(new List<ApplicationConfigurationSetting>
            {

            });

            // Act
            ApplicationConfiguration configuration = await ApplicationConfiguration.FromXDocumentAsync(configurationDocument, settings, true);
        }
    }
}


text:
/* Selectors for the content area of the htmlArea RTE editor */
.htmlarea-content-body {
	font-family:Verdana, sans-serif;
	font-size:12px;
	margin:0;
	padding:3px;
	background-color:#ffffff;
	border-width:0;
}
/* Set cursor for WebKit */
.htmlarea-content-body img,
.htmlarea-content-body table {
	cursor: default;
}
.htmlarea-content-body table td,
.htmlarea-content-body table th {
	cursor: text;
}
/* Selectors for the Table Operations plugin */
/* Make borders visible */
/* Make sure we can click in empty cells without too much difficulty */
body.htmlarea-showtableborders table, body.htmlarea-showtableborders td, body.htmlarea-showtableborders th {
	padding: 3px; border:1px dashed #316ac5 !important;
}
/* Make language marks visible */
body.htmlarea-show-language-marks *[lang] {
	background: url("../../Images/language-marker.gif") left top no-repeat; padding-left: 14px; text-decoration: underline;
}
/* Make microdata visible */
body.htmlarea-show-microdata *[itemtype],
body.htmlarea-show-microdata *[itemprop] {
	background: url("../../Images/microdata.gif") left top no-repeat; padding-left: 14px; text-decoration: underline;
}
/* Selectors for the Abbreviation plugin */
body.htmlarea-content-body abbr, body.htmlarea-content-body acronym {
	border-bottom:1px dashed #000;
	cursor:help;
}


text:
@interface DCMediaPocketSnapshotPool : NSObject {

}

DEFINE_SINGLETON_FOR_HEADER(DCMediaPocketSnapshotPool);

- (NSArray *)allKeysForSnapshots;
- (DCMediaPocket *)mediaPocket:(NSString *)uniqueID;
- (void)insertSnapshot:(DCMediaPocket *)mediaPocket;
- (void)removeSnapshot:(NSString *)uniqueID;

@end


text:
namespace Zu.ChromeDevTools.Debugger
{
    using Newtonsoft.Json;

    /// <summary>
    /// Fired when the virtual machine resumed execution.
    /// </summary>
    public sealed class ResumedEvent : IEvent
    {
    }
}


text:
<?php

namespace Aquatic\AuthorizeNet\Contract;

interface Address
{
    public function getFirstName(): string;
    public function getLastName(): string;
    public function getCompany(): string;
    public function getStreet(): string;
    public function getCity(): string;
    public function getState(): string;
    public function getZip(): string;
    public function getCountry(): string;
    public function getPhoneNumber(): string;
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat|Roboto:300,400,500" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.5/sweetalert2.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Docman Pro</title>


text:
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script.  Only    //
// add custom code in the designated areas or it will be overwritten during  //
// the next update.                                                          //
//-----------------------------------NOTICE----------------------------------//

//--BEGIN FILE HEAD CUSTOM CODE--//

//--END CUSTOM CODE--//

#include "../../include/FixLink.h"
#include "../../include/ObjectRegistry.h"
#include "../../include/NIF_IO.h"
#include "../../include/obj/Lighting30ShaderProperty.h"
using namespace Niflib;

//Definition of TYPE constant
const Type Lighting30ShaderProperty::TYPE("Lighting30ShaderProperty", &BSShaderPPLightingProperty::TYPE);

Lighting30ShaderProperty::Lighting30ShaderProperty()
{
	//--BEGIN CONSTRUCTOR CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

Lighting30ShaderProperty::~Lighting30ShaderProperty()
{
	//--BEGIN DESTRUCTOR CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

const Type & Lighting30ShaderProperty::GetType() const
{
	return TYPE;
}

NiObject * Lighting30ShaderProperty::Create()
{
	return new Lighting30ShaderProperty;
}

void Lighting30ShaderProperty::Read(istream& in, list<unsigned int> & link_stack, const NifInfo & info)
{
	//--BEGIN PRE-READ CUSTOM CODE--//

	//--END CUSTOM CODE--//

	BSShaderPPLightingProperty::Read(in, link_stack, info);

	//--BEGIN POST-READ CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

void Lighting30ShaderProperty::Write(ostream& out, const map<NiObjectRef, unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info) const
{
	//--BEGIN PRE-WRITE CUSTOM CODE--//

	//--END CUSTOM CODE--//

	BSShaderPPLightingProperty::Write(out, link_map, missing_link_stack, info);

	//--BEGIN POST-WRITE CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

std::string Lighting30ShaderProperty::asString(bool verbose) const
{
	//--BEGIN PRE-STRING CUSTOM CODE--//

	//--END CUSTOM CODE--//

	stringstream out;
	out << BSShaderPPLightingProperty::asString(verbose);
	return out.str();

	//--BEGIN POST-STRING CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

void Lighting30ShaderProperty::FixLinks(const map<unsigned int, NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info)
{
	//--BEGIN PRE-FIXLINKS CUSTOM CODE--//

	//--END CUSTOM CODE--//

	BSShaderPPLightingProperty::FixLinks(objects, link_stack, missing_link_stack, info);

	//--BEGIN POST-FIXLINKS CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

std::list<NiObjectRef> Lighting30ShaderProperty::GetRefs() const
{
	list<Ref<NiObject> > refs;
	refs = BSShaderPPLightingProperty::GetRefs();
	return refs;
}

std::list<NiObject *> Lighting30ShaderProperty::GetPtrs() const
{
	list<NiObject *> ptrs;
	ptrs = BSShaderPPLightingProperty::GetPtrs();
	return ptrs;
}

//--This object has no eligable attributes.  No example implementation generated--//

//--BEGIN MISC CUSTOM CODE--//

//--END CUSTOM CODE--//


text:
class AddCourseIdToGroups < ActiveRecord::Migration[6.1]
  def change
    add_reference :groups, :course, null: false, foreign_key: true
    remove_index :groups, :group_name
    add_index :groups, [:group_name, :course_id], unique: true
  end
end


text:
require File.dirname(__FILE__) + '/../../../spec_helper'

ruby_version_is "1.9" do
  describe "Proc#parameters" do
    it "returns an empty Array for a proc expecting no parameters" do
      proc {}.parameters.should == []
    end

    it "returns an Array of Arrays for a proc expecting parameters" do
      p = proc {|x| }
      p.parameters.should be_an_instance_of(Array)
      p.parameters.first.should be_an_instance_of(Array)
    end

    it "sets the first element of each sub-Array to :opt for optional arguments" do
      proc {|x| }.parameters.first.first.should == :opt
      proc {|y,*x| }.parameters.first.first.should == :opt
    end

    it "regards named parameters in procs as optional" do
      proc {|x| }.parameters.first.first.should == :opt
    end

    it "regards parameters with default values as optional" do
      lambda {|x=1| }.parameters.first.first.should == :opt
      proc {|x=1| }.parameters.first.first.should == :opt
    end

    it "sets the first element of each sub-Array to :req for required arguments" do
      lambda {|x,y=[]| }.parameters.first.first.should == :req
      lambda {|y,*x| }.parameters.first.first.should == :req
    end

    it "regards named parameters in lambdas as required" do
      lambda {|x| }.parameters.first.first.should == :req
    end

    it "sets the first element of each sub-Array to :rest for parameters prefixed with asterisks" do
      lambda {|*x| }.parameters.first.first.should == :rest
      lambda {|x,*y| }.parameters.last.first.should == :rest
      proc {|*x| }.parameters.first.first.should == :rest
      proc {|x,*y| }.parameters.last.first.should == :rest
    end

    it "sets the first element of each sub-Array to :block for parameters prefixed with ampersands" do
      lambda {|&x| }.parameters.first.first.should == :block
      lambda {|x,&y| }.parameters.last.first.should == :block
      proc {|&x| }.parameters.first.first.should == :block
      proc {|x,&y| }.parameters.last.first.should == :block
    end

    it "sets the second element of each sub-Array to the name of the argument" do
      lambda {|x| }.parameters.first.last.should == :x
      lambda {|x=Math::PI| }.parameters.first.last.should == :x
      lambda {|an_argument, glark, &foo| }.parameters[1].last.should == :glark
      lambda {|*rest| }.parameters.first.last.should == :rest
      lambda {|&block| }.parameters.first.last.should == :block
      proc {|x| }.parameters.first.last.should == :x
      proc {|x=Math::PI| }.parameters.first.last.should == :x
      proc {|an_argument, glark, &foo| }.parameters[1].last.should == :glark
      proc {|*rest| }.parameters.first.last.should == :rest
      proc {|&block| }.parameters.first.last.should == :block
    end
  end
end


text:
<?php
require 'nav_bar/sesion.php';
?>

<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Admin | Waterwork</title>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

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

  <link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.min.css">

  <link rel="stylesheet" href="../bower_components/Ionicons/css/ionicons.min.css">

  <link rel="stylesheet" href="../bower_components/jvectormap/jquery-jvectormap.css">

  <link rel="stylesheet" href="../dist/css/AdminLTE.min.css">

  <link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">

   <?php require 'font/font_style.php'; ?>

      ALT

      AdminWaterwork

        Toggle navigation

          <?php require 'nav_bar/top_bar.php';?>

    <?php require 'nav_bar/side_bar.php';?>

                    เพิ่มรายการผู้ใช้น้ำประปา

 หน้าหลัก

ข้อมูลผู้ใช้น้ำ

เพิ่มรายการผู้ใช้น้ำประปา

    <form action="algorithm/insert_personnel.php" method="post" name="form1" onSubmit="JavaScript:return fncSubmit();">

ชื่อ-นามสกุล

                          ชื่อ
                          <input type="text" name="txtname" class="form-control" id="txtname" placeholder="ชื่อ">

                          นามสกุล
                          <input type="text" name="txtlastname" class="form-control" id="txtlastname" placeholder="นามสกุล">

บัญชีพนักงาน

                          Username :

                            <input type="text" name="txtusername" class="form-control" id="inputEmail3" >

                          Password :

                            <input type="text" name="txtpassword" class="form-control" id="inputPassword3" >

                          ตำเเหน่ง :

                            <input type="text" name="txtposition" class="form-control" id="inputPassword3" value="">

                          สถานะ  :

                            <select class="form-control select2" style="width: 100%;" name="txtstatus">
                               <option selected="selected">...กรุณาเลือกสถานะ...</option>
                               <option name="admin">admin</option>
                               <option name="employee">employee</option>
                            </select>

                        <button type="submit" class="btn btn-info pull-left" onclick="return confirm('ยืนยันการบันทึกข้อมูล')">ตกลง</button>

    </form>
   >

     Version 1.0.0

    CPE XIII-UP