text:
using System;
using Newtonsoft.Json;
using Spg.ExampleRefactoring.Util;
using UnitTests;

namespace Spg.ExampleRefactoring.Util
{
    /// <summary>
    /// Json utility
    /// </summary>
    public class JsonUtil<T>
    {
        /// <summary>
        /// Write object to data
        /// </summary>
        /// <param name="t">Object</param>
        /// <param name="path">File path</param>
        public static void Write(T t, string path)
        {
            System.IO.StreamWriter file = new System.IO.StreamWriter(path);
            string json = "";
            try
            {
                json = JsonConvert.SerializeObject(t, Formatting.Indented,
                    new JsonSerializerSettings() {ReferenceLoopHandling = ReferenceLoopHandling.Ignore});
                file.Write(json);
            }
            catch (OutOfMemoryException)
            {
                //MessageBox.Show("Exception");
                Console.WriteLine("Could not write to file: " + path);
            }
            finally
            {
                file.Close();
            }
        }

        /// <summary>
        /// Read Json object
        /// </summary>
        /// <param name="path">File path</param>
        /// <returns>Object</returns>
        public static T Read(string path)
        {
            //JsonSerializerSettings settings = new JsonSerializerSettings();
            //settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
            //settings.PreserveReferencesHandling = PreserveReferencesHandling.Objects;

            string json = FileUtil.ReadFile(path);
            T obj = JsonConvert.DeserializeObject<T>(json/*, settings*/);
            return obj;
        }
    }
}


text:
package io.apiman.gateway.engine.policy;

/**
 * Core policy context entry keys.
 *
 * @author eric.wittmann@redhat.com
 */
@SuppressWarnings("nls")
public class PolicyContextKeys {

    public static final String REQUEST_METRIC = "apiman.request-metric";
    public static final String REQUEST_PAYLOAD = "apiman.request-payload";
    public static final String REQUEST_PAYLOAD_IO = "apiman.request-payload-io";

}

redpajama_set_name: RedPajamaGithub


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="showMessage"
        android:text="@string/button" />

</LinearLayout>


text:
<?php

namespace App\Transformers;

class CategoryTransformer extends Transformer
{

    public function transform($category)
    {
        return [
            'id' => $category['id'],
            'name' => $category['name'],
            'image_url' => config('app.url') . '/files/category/' .  $category['id'] . '.jpg',
        ];
    }
}


text:
namespace Nancy.Tests.Unit
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading;
    using Nancy.Responses;
    using Nancy.Responses.Negotiation;
    using Xunit;
    using Xunit.Extensions;

    public class DefaultSerializerFactoryFixture
    {
        private DefaultSerializerFactory serializerFactory;

        public DefaultSerializerFactoryFixture()
        {
        }

        [Theory]
        [InlineData("application/json")]
        [InlineData("application/xml")]
        [InlineData("image/png")]
        public void Should_return_serializer_for_media_range(string expectedMediaRange)
        {
            // Given
            var expectedSerializer =
                new TestableSerializer(expectedMediaRange);

            var serializers = new ISerializer[]
            {
                expectedSerializer,
                new TestableSerializer("custom/foo"),
                new TestableSerializer("custom/bar"),
                new TestableSerializer("custom/baz"),
            };

            this.serializerFactory = new DefaultSerializerFactory(serializers);

            // When
            var result = this.serializerFactory.GetSerializer(expectedMediaRange);

            // Then
            result.ShouldBeSameAs(expectedSerializer);
        }

        [Fact]
        public void Should_return_null_if_no_serializer_matched_media_range()
        {
            // Given
            var serializers = new ISerializer[]
            {
                new TestableSerializer("custom/foo"),
                new TestableSerializer("custom/bar"),
                new TestableSerializer("custom/baz"),
            };

            this.serializerFactory = new DefaultSerializerFactory(serializers);

            // When
            var result = this.serializerFactory.GetSerializer("application/json");

            // Then
            result.ShouldBeNull();
        }

        [Fact]
        public void Should_not_throw_exception_if_a_serializer_throws()
        {
            // Given
            var serializers = new ISerializer[]
            {
                new ExceptionThrowingSerializer()
            };

            this.serializerFactory = new DefaultSerializerFactory(serializers);

            // When, Then
            Assert.DoesNotThrow(() => this.serializerFactory.GetSerializer("application/json"));
        }

        [Fact]
        public void Should_throw_if_multiple_serializers_matched_media_range()
        {
            var serializers = new ISerializer[]
            {
                new TestableSerializer("application/json"),
                new TestableSerializer("application/json")
            };

            this.serializerFactory = new DefaultSerializerFactory(serializers);

            // When, Then
            Assert.Throws<InvalidOperationException>(() => this.serializerFactory.GetSerializer("application/json"));
        }

        [Fact]
        public void Should_not_include_default_serializers_when_counting_matches()
        {
            var serializers = new ISerializer[]
            {
                new TestableSerializer("application/json"),
                new DefaultJsonSerializer()
            };

            this.serializerFactory = new DefaultSerializerFactory(serializers);

            // When, Then
            Assert.DoesNotThrow(() => this.serializerFactory.GetSerializer("application/json"));
        }

        [Fact]
        public void Should_prioritize_non_default_serializer_match()
        {
            const string expectedMediaRange = "application/json";

            var expectedSerializer =
                new TestableSerializer(expectedMediaRange);

            var serializers = new ISerializer[]
            {
                new DefaultJsonSerializer(),
                expectedSerializer
            };

            this.serializerFactory = new DefaultSerializerFactory(serializers);

            // When
            var result = this.serializerFactory.GetSerializer(expectedMediaRange);

            // Then
            result.ShouldBeSameAs(expectedSerializer);
        }

        [Fact]
        public void Should_return_default_serializer_if_no_other_match_could_be_made()
        {
            // Given
            var expectedSerializer =
                new DefaultJsonSerializer();

            var serializers = new ISerializer[]
            {
                expectedSerializer,
                new TestableSerializer("application/xml"),
                new TestableSerializer("application/xml"),
            };

            this.serializerFactory = new DefaultSerializerFactory(serializers);

            // When
            var result = this.serializerFactory.GetSerializer("application/json");

            // Then
            result.ShouldBeSameAs(expectedSerializer);
        }

        internal class ExceptionThrowingSerializer : ISerializer
        {
            public bool CanSerialize(MediaRange mediaRange)
            {
                throw new Exception();
            }

            public IEnumerable<string> Extensions { get; set; }

            public void Serialize<TModel>(MediaRange mediaRange, TModel model, Stream outputStream)
            {
                throw new System.NotImplementedException();
            }
        }

        internal class TestableSerializer : ISerializer
        {
            private readonly MediaRange mediaRange;

            public TestableSerializer(MediaRange mediaRange)
            {
                this.mediaRange = mediaRange;
            }

            public bool CanSerialize(MediaRange mediaRange)
            {
                return this.mediaRange.Matches(mediaRange);
            }

            public IEnumerable<string> Extensions { get; set; }

            public void Serialize<TModel>(MediaRange mediaRange, TModel model, Stream outputStream)
            {
                throw new System.NotImplementedException();
            }
        }
    }
}


text:
"""Comprehensions."""
from joeutils.data_structures.comprehensions import maps


text:
package nl.knaw.dans.easy.multideposit

import better.files.File
import better.files.File.root
import org.apache.commons.configuration.PropertiesConfiguration

import scala.collection.JavaConverters._

case class Configuration(version: String, properties: PropertiesConfiguration, formats: Set[String], licenses: Set[String])

object Configuration {

  def apply(home: File): Configuration = {
    val cfgPath = Seq(
      root / "etc" / "opt" / "dans.knaw.nl" / "easy-split-multi-deposit",
      home / "cfg")
      .find(_.exists)
      .getOrElse { throw new IllegalStateException("No configuration directory found") }

    val formatsFile = cfgPath / "acceptedMediaTypes.txt"
    val licenses = new PropertiesConfiguration((cfgPath / "lic/licenses.properties").toJava)

    new Configuration(
      version = (home / "bin" / "version").contentAsString.stripLineEnd,
      properties = new PropertiesConfiguration() {
        setDelimiterParsingDisabled(true)
        load((cfgPath / "application.properties").toJava)
      },
      formats =
        if (formatsFile.exists) formatsFile.lines.map(_.trim).toSet
        else Set.empty,
      licenses = licenses.getKeys.asScala.filterNot(_.isEmpty).toSet
    )
  }
}


text:
class BinScript
  VERSION = "0.2"
end


text: export {CloudSchedulerClient} from './cloud_scheduler_client';


text:
public interface IFishStates
{
   public void eatGumball();
   public void crash();
   public void revive();
}


text:
<?php

/**
*
*/
class Mvalidar extends CI_model
{

	public function valnumcategoria($num){

		$this->db->select('id');
		$this->db->from('categoria');
		$this->db->where('numcategoria',$num);
		return $this->db->get();
	}
	public function valdescripcion($des){

		$this->db->select('id');
		$this->db->from('categoria');
		$this->db->where('descripcion',$des);
		return $this->db->get();
	}
	public function valgerepro($gere){

		$this->db->select('idgp');
		$this->db->from('gereproyecto');
		$this->db->where('gp',$gere);
		return $this->db->get();
	}
	public function valsiglashab($s){

		$this->db->select('idgere');
		$this->db->from('gerencia');
		$this->db->where('siglas',$s);
		return $this->db->get();
	}
	public function valgerehab($gere){

		$this->db->select('idgere');
		$this->db->from('gerencia');
		$this->db->where('gerehab',$gere);
		return $this->db->get();
	}

}


text:
<org.usip.osp.baseobjects.CustomizeableSection>
  <creatingOrganization>org.usip.osp.</creatingOrganization>
  <uniqueName>Memos</uniqueName>
  <version>1</version>
  <thisIsACustomizedSection>false</thisIsACustomizedSection>
  <hasASpecificMakePage>true</hasASpecificMakePage>
  <specificMakePage>customize_section_pages/core/make_memos_page.jsp</specificMakePage>
  <bigString></bigString>
  <description>A section to pass memos back and forth from HQ.</description>
  <url></url>
  <directory>../osp_core/</directory>
  <page__file__name>memos.jsp</page__file__name>
  <rec__tab__heading>HQ Memos</rec__tab__heading>
  <sample__image>memos.png</sample__image>
  <control__section>false</control__section>
  <confers__read__ability>true</confers__read__ability>
  <confers__write__ability>false</confers__write__ability>
</org.usip.osp.baseobjects.CustomizeableSection>


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
module.exports = function(grunt) {
    // Project configuration.
    grunt.initConfig({
    });
};


text:
#region License

#endregion License

using System;
using Tao.OpenAl;

namespace Microsoft.Xna.Framework.Audio
{
    public sealed class Cue : IDisposable
    {

        string name;
        int buffer;
        int source;

        #region Events

        public event EventHandler Disposing;

        #endregion

        #region Public Properties

        public bool IsCreated
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsDisposed
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsPaused
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsPlaying
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsPrepared
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsPreparing
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsStopped
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsStopping
        {
            get { throw new NotImplementedException(); }
        }

        public string Name
        {
            get { return name; }
        }

        #endregion Public Properties

        #region Constructors

        internal Cue(string cuename, int bufferid, int sourceid)
        {
            name = cuename;
            buffer = bufferid;
            source = sourceid;
        }

        #endregion Constructors

        #region Destructors

        ~Cue()
        {
        }

        #endregion Destructors

        #region Public Methods

        public void Apply3D(AudioListener listener, AudioEmitter emitter)
        {
            throw new NotImplementedException();
        }

        /*public static bool operator !=(Cue left, Cue right)
        {
            throw new NotImplementedException();
        }

        public static bool operator ==(Cue left, Cue right)
        {
            throw new NotImplementedException();
        }*/

        public void Dispose()
        {
            throw new NotImplementedException();
        }

        /*public override bool Equals(object obj)
        {
            throw new NotImplementedException();
        }

        public override int GetHashCode()
        {
            throw new NotImplementedException();
        }*/

        public float GetVariable(string name)
        {
            throw new NotImplementedException();
        }

        public void Pause()
        {
            throw new NotImplementedException();
        }

        public void Play()
        {
            // Bind the buffer with the source.
            Al.alSourcei(source, Al.AL_BUFFER, buffer);
            Al.alSourcePlay(source);
        }

        public void Resume()
        {
            throw new NotImplementedException();
        }

        /*public void SetMatrixCoefficients(int sourceChannelCount, int destinationChannelCount, float[] matrixCoefficients)
        {
            throw new NotImplementedException();
        }*/

        public void SetVariable(string name, float value)
        {
            throw new NotImplementedException();
        }

        public void Stop(AudioStopOptions options)
        {
            throw new NotImplementedException();
        }

        #endregion Public Methods
    }
}


text:
/*	$NetBSD: cpufunc.h,v 1.18 2014/02/25 22:16:52 dsl Exp $	*/

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

#ifndef _X86_CPUFUNC_H_
#define	_X86_CPUFUNC_H_

/*
 * Functions to provide access to x86-specific instructions.
 */

#include <sys/cdefs.h>
#include <sys/types.h>

#include <machine/segments.h>
#include <machine/specialreg.h>

#ifdef _KERNEL

void	x86_pause(void);
void	x86_lfence(void);
void	x86_sfence(void);
void	x86_mfence(void);
void	x86_flush(void);
#ifndef XEN
void	x86_patch(bool);
#endif
void	invlpg(vaddr_t);
void	lidt(struct region_descriptor *);
void	lldt(u_short);
void	ltr(u_short);
void	lcr0(u_long);
u_long	rcr0(void);
void	lcr2(vaddr_t);
vaddr_t	rcr2(void);
void	lcr3(vaddr_t);
vaddr_t	rcr3(void);
void	lcr4(vaddr_t);
vaddr_t	rcr4(void);
void	lcr8(vaddr_t);
vaddr_t	rcr8(void);
void	tlbflush(void);
void	tlbflushg(void);
void	dr0(void *, uint32_t, uint32_t, uint32_t);
vaddr_t	rdr6(void);
void	ldr6(vaddr_t);
void	wbinvd(void);
void	breakpoint(void);
void	x86_hlt(void);
void	x86_stihlt(void);
u_int	x86_getss(void);

/* fpu save, restore etc */
union savefpu;
void	fldcw(const uint16_t *);
void	fnclex(void);
void	fninit(void);
void	fnsave(union savefpu *);
void	fnstcw(uint16_t *);
uint16_t fngetsw(void);
void	fnstsw(uint16_t *);
void	frstor(const union savefpu *);
void	fwait(void);
void	clts(void);
void	stts(void);
void	fxsave(union savefpu *);
void	fxrstor(const union savefpu *);
void	x86_ldmxcsr(const uint32_t *);
void	x86_stmxcsr(uint32_t *);

void	fldummy(void);
void	fp_divide_by_0(void);

/* Extended processor state functions (for AVX registers etc) */

uint64_t rdxcr(uint32_t);		/* xgetbv */
void	wrxcr(uint32_t, uint64_t);	/* xsetgv */

void	xrstor(const union savefpu *, uint64_t);
void	xsave(union savefpu *, uint64_t);
void	xsaveopt(union savefpu *, uint64_t);

void	x86_monitor(const void *, uint32_t, uint32_t);
void	x86_mwait(uint32_t, uint32_t);
/* x86_cpuid2() writes four 32bit values, %eax, %ebx, %ecx and %edx */
#define	x86_cpuid(a,b)	x86_cpuid2((a),0,(b))
void	x86_cpuid2(uint32_t, uint32_t, uint32_t *);

/* Use read_psl, write_psl when saving and restoring interrupt state. */
void	x86_disable_intr(void);
void	x86_enable_intr(void);
u_long	x86_read_psl(void);
void	x86_write_psl(u_long);

/* Use read_flags, write_flags to adjust other members of %eflags. */
u_long	x86_read_flags(void);
void	x86_write_flags(u_long);

void	x86_reset(void);

/*
 * Some of the undocumented AMD64 MSRs need a 'passcode' to access.
 *
 * See LinuxBIOSv2: src/cpu/amd/model_fxx/model_fxx_init.c
 */

#define	OPTERON_MSR_PASSCODE	0x9c5a203aU

uint64_t	rdmsr(u_int);
uint64_t	rdmsr_locked(u_int, u_int);
int		rdmsr_safe(u_int, uint64_t *);
uint64_t	rdtsc(void);
uint64_t	rdpmc(u_int);
void		wrmsr(u_int, uint64_t);
void		wrmsr_locked(u_int, u_int, uint64_t);
void		setfs(int);
void		setusergs(int);

#endif /* _KERNEL */

#endif /* !_X86_CPUFUNC_H_ */


text:
<ng-form name="applicationsSubForm" class="form-horizontal">

        <ui-select multiple name="applications" class="form-control input-sm"
                   ng-model="command.config.applications"
                   on-select="ctrl.addApplication($item)"
                   on-remove="ctrl.applicationRemoved($item)">
          <ui-select-match>
            {{$item}}
          </ui-select-match>
          <ui-select-choices repeat="application in applications | filter: $select.search | limitTo: viewState.infiniteScroll.currentItems"
                             infinite-scroll="ctrl.addMoreItems()"
                             infinite-scroll-distance="2">
            {{application}}
          </ui-select-choices>
        </ui-select>

</ng-form>


text:
function functionNetSingleIpType {
  echo "####################################################################################"
  echo "Select what type of IP address needs to be configured: 'DHCP' or 'STATIC' IP;"
  echo "####################################################################################"
    select yn in "DHCP" "STATIC"; do
      case $yn in
        'DHCP' ) varIpType="$varNetworkType-DHCP"; break;;
        'STATIC' ) varIpType="$varNetworkType-STATIC"; break;;
      esac
    done
}


text:
#import <UIKit/UIKit.h>

#import <BlueSTSDK/BlueSTSDKDebug.h>

/**
 *  show the device console, where the user can send coomand to the device serial port
 */
@interface ConsoleViewController : UIViewController

/**
 *  service that permit to send/receive commands
 */
@property (retain) BlueSTSDKDebug *debugInterface;

/**
 *  text field where the user can write the command
 */
@property (weak, nonatomic) IBOutlet UITextField *userText;

/**
 * text view where we show the device response
 */
@property (weak, nonatomic) IBOutlet UITextView *console;

/**
 *  method used for initialize the private and static object of this class
 */
+(void)initialize;

@end


text:
from abc import ABCMeta, abstractmethod

import copy

from pyspark import since
from pyspark.ml.param import Params
from pyspark.ml.param.shared import *
from pyspark.ml.common import inherit_doc
from pyspark.sql.functions import udf
from pyspark.sql.types import StructField, StructType, DoubleType

@inherit_doc
class Estimator(Params):
    """
    Abstract class for estimators that fit models to data.

    .. versionadded:: 1.3.0
    """

    __metaclass__ = ABCMeta

    @abstractmethod
    def _fit(self, dataset):
        """
        Fits a model to the input dataset. This is called by the default implementation of fit.

        :param dataset: input dataset, which is an instance of :py:class:`pyspark.sql.DataFrame`
        :returns: fitted model
        """
        raise NotImplementedError()

    @since("1.3.0")
    def fit(self, dataset, params=None):
        """
        Fits a model to the input dataset with optional parameters.

        :param dataset: input dataset, which is an instance of :py:class:`pyspark.sql.DataFrame`
        :param params: an optional param map that overrides embedded params. If a list/tuple of
                       param maps is given, this calls fit on each param map and returns a list of
                       models.
        :returns: fitted model(s)
        """
        if params is None:
            params = dict()
        if isinstance(params, (list, tuple)):
            return [self.fit(dataset, paramMap) for paramMap in params]
        elif isinstance(params, dict):
            if params:
                return self.copy(params)._fit(dataset)
            else:
                return self._fit(dataset)
        else:
            raise ValueError("Params must be either a param map or a list/tuple of param maps, "
                             "but got %s." % type(params))

@inherit_doc
class Transformer(Params):
    """
    Abstract class for transformers that transform one dataset into another.

    .. versionadded:: 1.3.0
    """

    __metaclass__ = ABCMeta

    @abstractmethod
    def _transform(self, dataset):
        """
        Transforms the input dataset.

        :param dataset: input dataset, which is an instance of :py:class:`pyspark.sql.DataFrame`
        :returns: transformed dataset
        """
        raise NotImplementedError()

    @since("1.3.0")
    def transform(self, dataset, params=None):
        """
        Transforms the input dataset with optional parameters.

        :param dataset: input dataset, which is an instance of :py:class:`pyspark.sql.DataFrame`
        :param params: an optional param map that overrides embedded params.
        :returns: transformed dataset
        """
        if params is None:
            params = dict()
        if isinstance(params, dict):
            if params:
                return self.copy(params)._transform(dataset)
            else:
                return self._transform(dataset)
        else:
            raise ValueError("Params must be a param map but got %s." % type(params))

@inherit_doc
class Model(Transformer):
    """
    Abstract class for models that are fitted by estimators.

    .. versionadded:: 1.4.0
    """

    __metaclass__ = ABCMeta

@inherit_doc
class UnaryTransformer(HasInputCol, HasOutputCol, Transformer):
    """
    Abstract class for transformers that take one input column, apply transformation,
    and output the result as a new column.

    .. versionadded:: 2.3.0
    """

    @abstractmethod
    def createTransformFunc(self):
        """
        Creates the transform function using the given param map. The input param map already takes
        account of the embedded param map. So the param values should be determined
        solely by the input param map.
        """
        raise NotImplementedError()

    @abstractmethod
    def outputDataType(self):
        """
        Returns the data type of the output column.
        """
        raise NotImplementedError()

    @abstractmethod
    def validateInputType(self, inputType):
        """
        Validates the input type. Throw an exception if it is invalid.
        """
        raise NotImplementedError()

    def transformSchema(self, schema):
        inputType = schema[self.getInputCol()].dataType
        self.validateInputType(inputType)
        if self.getOutputCol() in schema.names:
            raise ValueError("Output column %s already exists." % self.getOutputCol())
        outputFields = copy.copy(schema.fields)
        outputFields.append(StructField(self.getOutputCol(),
                                        self.outputDataType(),
                                        nullable=False))
        return StructType(outputFields)

    def _transform(self, dataset):
        self.transformSchema(dataset.schema)
        transformUDF = udf(self.createTransformFunc(), self.outputDataType())
        transformedDataset = dataset.withColumn(self.getOutputCol(),
                                                transformUDF(dataset[self.getInputCol()]))
        return transformedDataset


text:
<?php

namespace clifflu\aws_prices\base;
use clifflu\aws_prices as ROOT_NS;

/**
 * Parser
 *
 * Usage:
 *     $p = Parser::forge();
 *     $p->attach(new Fetcher);
 *     $result = $p->get_json(); // json
 */
abstract class Parser extends Base {
    // ===========================
    // Constructor & Overrides
    // ===========================

    public static function defaults($config = []) {
        $_ = [
            'lock_patience_s' => 2,
            'expire_hot_s' => 1,
        ];

        if ($config)
            $_ = array_replace_recursive($_, (array) $config);

        return parent::defaults($_);
    }

    public static function get_lock_fn() {
        return ROOT_NS\util\Fs::fn_parser_lock(static::get_domain());
    }

    public function has_cache() {
        return file_exists($this->get_cache_fn());
    }

    public function is_cache_hot() {
        $fn = $this->get_cache_fn();
        return ROOT_NS\util\Fs::file_age($fn) < $this->config['expire_hot_s'];
    }

    public function is_cache_valid() {
        $fn = $this->get_cache_fn();

        if (!(is_file($fn) && is_readable($fn)))
            return false;

        // still hot
        if ($this->is_cache_hot())
            return true;

        $mtime = ROOT_NS\util\Fs::file_mtime($fn);
        foreach($this->list_input_fn() as $fn) {
            if (ROOT_NS\util\Fs::file_mtime($fn) > $mtime)
                return false;
        }

        foreach($this->_fetchers as $f) {
            if (!$f->is_cache_valid())
                return false;
        }

        return true;
    }

    // ===========================
    // Abstract Methods
    // ===========================

    /**
     * Array of absolute path of input files
     */
    abstract public function list_input_fn();

    abstract public function get_cache_fn();

    /**
     * 重建快取, 呼叫時已保證 $fetcher 執行完畢
     *
     * @return array
     */
    abstract protected function _rebuild();

    // ===========================
    // Procedural
    // ===========================
    protected $_fetchers = [];

    public function attach(Fetcher $f) {
        $this->_fetchers[] = $f;
    }

    /**
     * 處理 lock , 生成並寫入重建快取
     *
     * @return [type] [description]
     */
    protected function rebuild() {
        $lock_fn = ROOT_NS\util\Fs::fn_parser_lock($this->get_domain());
        $sleep_us = $this->config['sleep_lock_s'] * 1000000;

        if (!$this->lock_acquire()) {
            $this->lock_waive();
            // can't acquire lock, another parser is running.
            $wait_start = microtime(true);

            // wait for it until lock_patience_s
            while(microtime(true) - $wait_start < $this->config['lock_patience_s']) {
                usleep($sleep_us);
                if ($this->is_cache_hot()) {
                    return $this->_get_json_from_cache();
                }
            }

            // he's not done yet, try old results
            $result = $this->_get_json_from_cache();
            if ($result)
                return $result;

            // no such result, keep waiting
            for(;!$this->is_cache_valid(); usleep($sleep_us)){}
            return $this->_get_json_from_cache();
        }

        // feed fetchers
        foreach($this->_fetchers as $f)
            $f->sync();

        $output = ROOT_NS\util\Data::json_encode($this->_rebuild());
        ROOT_NS\util\Fs::fdump($this->get_cache_fn(), $output);

        $this->lock_release();

        return $output;
    }

    /**
     * 自快取讀取資料
     * @return [type] [description]
     */
    protected function _get_json_from_cache() {
        $fn = $this->get_cache_fn();

        if (file_exists($fn))
            return file_get_contents($fn);

        return '';
    }

    /**
     * 讀取資料
     * @return [type] [description]
     */
    public function get_json() {
        if ($this->is_cache_valid())
            return $this->_get_json_from_cache();

        return $this->rebuild();
    }

    public function get_data() {
        return ROOT_NS\util\Data::json_decode($this->get_json());
    }

    // ===========================
    // Lock
    // ===========================
    private $_lock_fp = null;

    protected function lock_acquire() {
        $lock_fn = ROOT_NS\util\Fs::fn_parser_lock($this->get_domain());
        $this->_lock_fp = fopen($lock_fn, 'w');
        return flock($this->_lock_fp, LOCK_EX | LOCK_NB);
    }

    protected function lock_waive() {
        if (!is_resource($this->_lock_fp))
            return;

        fclose($this->_lock_fp);
    }

    protected function lock_release() {
        if (!is_resource($this->_lock_fp))
            return;

        $lock_fn = ROOT_NS\util\Fs::fn_parser_lock($this->get_domain());

        flock($this->_lock_fp, LOCK_UN);
        fclose($this->_lock_fp);
        unlink($lock_fn);
    }
}


text:
class ApplicationSerializer < ActiveModel::Serializer
  # cached

  embed :ids, include: true
  # delegate :cache_key, to: :object

  attribute :errors

  def initialize(object, options={})
    super
    @_links ||= {}
  end

  def _links
    @_links
  end

  def link(attribute, href)
    @_links[attribute] = { href: href }
  end

  def id
    object.to_param
  end

  def errors
    object.errors
  end

  def include_errors?
    object.errors.any?
  end

  def include__links?
    !@options[:minimal] && object.persisted?
  end

  def association_attributes(association_name)
    association_name = association_name.to_sym
    association = object.send(association_name)
    association_type = association.class.name.downcase
    association_attributes = {}

    if expand_options.include?(association_name) || expand_options.include?(:all)
      association_attributes = association.serialize(minimal: true)

      { association_name => association_attributes }
    else
      association_attributes["#{association_name}_id"] = association.to_param if object.respond_to?("#{association_name}_id")
      association_attributes["#{association_name}_type"] = association_type if object.respond_to?("#{association_name}_type")

      association_attributes
    end

  end

  protected

  def expand_options
    @expand_options ||= if expand_options = @options[:expand]
      expand_options.is_a?(Array) ? expand_options.map(&:to_sym) : Array[expand_options]
    else
      []
    end
  end

  def serialized_object(obj)
    obj ? obj.active_model_serializer.new(obj).serialize_object : {}
  end

end


text:
<?php
// Database config & class
$db_config = array(
	"servername"=> "localhost",
	"username"	=> "root",
	"password"	=> "",
	"database"	=> ""
);
if(extension_loaded("mysqli")) require_once("_inc/class._database_i.php");
else require_once("_inc/class._database.php");

// Tree class
require_once("_inc/class.tree.php");
?>


text:
node-red-contrib-luxtronik2
========================

**Warning: this repo is no longer maintained!**

[Node-RED][1] contribution package for [Luxtronik2][2] heat pump controllers

**Attention**: unfortunately I dicovered just after I buzilt and published this repo that there is already a node called *node-red-contrib-luxtronik2*. You can find it here: [coolchip/node-red-contrib-luxtronik2](https://github.com/coolchip/node-red-contrib-luxtronik2)

Anyway, as far as I can tell my node works fine and I'll stickto it.

# Install

TBD

# How to use

1. Place the node within your flow
2. Configure the IP of your Luxtronik and the port (8888 for SW versions < 1.76, 8889 for SW versions >= 1.76)
3. Trigger the node via the input, it doesn't matter what type the input is
4. The node querys the heat pump for the data, parses the response and outputs the parsed result

# Data format

The result is an object of objects:

```
{
    10: {
        id: "ID_WEB_Temperatur_TVL"
        description: "Vorlauftemperatur Heizkreis"
        value: 42.3
        type: "celcius"
        }
    11: {
        ...
        }
    ...
}
```

- The `key` is the index as received from the heatpump
- `id` is the identifier as used by [AIT][3] within their java code
- `description` is mostly the description text out of the java code
- `value` is the parsed and converted value
- `type` describes what kind of data the datapoint is

# Authors

The module was developed by Bouni inspired by a post seen on the [loxforum][4].
The detailed information comes mostly from reverse engeneering the java applet sent by the heat pump when one loads the web interface.

[1]:https://nodered.org
[2]:http://www.alpha-innotec.ch/fileadmin/content/downloads/Lux_Fachhandwerker_de.pdf
[3]:http://www.alpha-innotec.ch
[4]:http://loxforum.com


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Text;

namespace Exigo.WebControls
{
    /// <summary>
    /// Renders a jQuery modal alert script and a hidden vaiable called 'ApplicationErrors' designed to display alerts throughout your applications.
    /// </summary>
    public class ApplicationErrorModal : WebControl
    {
        #region Constructors
        public ApplicationErrorModal()
        {

        }
        #endregion

        #region Public Properties
        /// <summary>
        /// The error message you want to display in the modal. This value is server-encoded and optimized for Javascript automatically when set.
        /// </summary>
        public string ErrorMessage
        {
            get { return _errorMessage; }
            set { _errorMessage = HttpContext.Current.Server.UrlEncode(value.Replace("'", "\"").Replace("%0a", "").Replace("%0A", "")); }
        }
        private string _errorMessage;

        /// <summary>
        /// The text of the button used to close the modal.
        /// </summary>
        public string ButtonText { get; set; }
        #endregion

        #region Render
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            // Create a hidden variable so our features can communicate with the jQuery.
            HiddenField applicationErrorsField = new HiddenField();
            applicationErrorsField.ID = "ApplicationErrors";
            applicationErrorsField.Value = HttpContext.Current.Server.UrlDecode(ErrorMessage);
            applicationErrorsField.RenderControl(writer);

            // Build the jQuery
            StringBuilder javascripts = new StringBuilder();

            // jQuery UI scripts to stylize common web elements
            javascripts.AppendLine(string.Format(@"
                <!-- ***** START Error Handling ***** -->
                <link href='Assets/Plugins/jquery.msgbox/styles/jquery.msgbox.css' rel='stylesheet' type='text/css' />
                <script src='Assets/Plugins/jquery.msgbox/jquery.msgbox.min.js' type='text/javascript'></script>

                <script type='text/javascript' language='javascript'>
                    $(document).ready(function () {{
                        if ($('INPUT[type=""hidden""][id*=""ApplicationErrors""]').val() != '') {{
                            $(function () {{
                                var error = $('INPUT[type=""hidden""][id*=""ApplicationErrors""]').val();
                                $.msgbox(error, {{
                                    type: 'error',
                                    buttons: [
                                        {{ type: 'submit', value: '" + ((!string.IsNullOrEmpty(ButtonText)) ? ButtonText : "OK") + @"'}}
                                    ]
                                }});
                            }});
                        }}
                    }});
                </script>
                <!-- ***** END Error Handling ***** -->
            "));

            // Render the jQuery
            writer.Write(javascripts.ToString());
        }
        #endregion
    }
}


text:
package com.github.rhacoal.skylink.plug.sponge;

import com.github.rhacoal.skylink.plug.PluginOfflinePlayer;
import java.util.UUID;
import org.spongepowered.api.entity.living.player.User;

/**
 *
 * @author Rhacoal
 */
public class PluginOfflinePlayer_Sponge implements PluginOfflinePlayer {

    private User user;

    public PluginOfflinePlayer_Sponge(User user){
        this.user=user;
    }

    @Override
    public UUID getUUID() {
        return user.getUniqueId();
    }

    @Override
    public String getName() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

}


text: Analysis of soccer statistics for Kaggle challenge


text:
package main

import (
	"net/http"
	"net/http/httptest"
	"net/url"
	"reflect"
	"strings"
	"testing"

	"github.com/mediocregopher/radix.v2/redis"
	"github.com/mtyurt/slackbet"
	"github.com/mtyurt/slackbet/bet"
	"github.com/mtyurt/slackbet/repo"
	"github.com/mtyurt/slackcommander"
)

const slacktoken = "slacktoken"

func TestComplexBet(t *testing.T) {
	service := mockService()
	mockService := &MockService{}
	service.SlackService = mockService
	cli, err := openRedis()
	if err != nil {
		t.Fatal(err)
	}
	cli.Cmd("FLUSHALL")
	mux.Token = slacktoken
	populateMux(mux, service)
	ts := httptest.NewServer(http.HandlerFunc(mux.SlackHandler()))
	defer ts.Close()

	params := make(url.Values)
	params.Add("token", slacktoken)
	params.Add("user_name", "sezgin")
	params.Add("text", "start")
	if resp := betWithParams(params, service, mux); resp != "started bet[1] successfully" {
		t.Fatal(resp)
	}
	params.Set("user_name", "omer")
	params.Set("text", "save 100")
	if resp := betWithParams(params, service, mux); resp != "saved successfully" {
		t.Fatal(resp)
	}
	params.Set("user_name", "tarik")
	params.Set("text", "save 250")
	if resp := betWithParams(params, service, mux); resp != "saved successfully" {
		t.Fatal(resp)
	}
	params.Set("user_name", "tarik")
	params.Set("text", "save 75")
	if resp := betWithParams(params, service, mux); resp != "saved successfully" {
		t.Fatal(resp)
	}
	params.Set("text", "info 1")
	if resp := betWithParams(params, service, mux); strings.Contains(resp, "75") || strings.Contains(resp, "100") || !strings.Contains(resp, "open") {
		t.Fatal("response contains confidential info", resp)
	}
	params.Set("text", "end")
	params.Set("user_name", "sezgin")
	if resp := betWithParams(params, service, mux); resp != "ended bet[1] successfully" {
		t.Fatal(resp)
	}
	params.Set("text", "info 1")
	resp := betWithParams(params, service, mux)
	if strings.Contains(resp, "250") || !strings.Contains(resp, "100") || !strings.Contains(resp, "omer") || !strings.Contains(resp, "tarik") || !strings.Contains(resp, "end") {
		t.Fatal("response does not contain necessary info", resp)
	}
	body := mockService.sentCallback
	if strings.Contains(body, "250") || !strings.Contains(body, "100") || !strings.Contains(body, "omer") || !strings.Contains(body, "tarik") || !strings.Contains(body, "end") {
		t.Log(body)
		t.Fatal("body is wrong")
	}
}

func TestExampleConf(t *testing.T) {

	conf, err := parseConf("../conf.example.json")
	if err != nil || conf == nil {
		t.Fatal("error in initialization, err:", err, "conf:", conf)
	}
	if !reflect.DeepEqual(conf.Admins, []string{"tarik"}) {
		t.Fatal("admins is wrong:", conf.Admins)
	}
	if conf.PostToken != "chat-bot-token" {
		t.Error("token is wrong:", conf.PostToken)
	}
	if conf.Channel != "#general" {
		t.Fatal("channel is wrong:", conf.Channel)
	}
	if conf.ChannelID != "C9NMN9WVP" {
		t.Fatal("channel id is wrong:", conf.ChannelID)
	}
	if conf.SlashCommandToken != "8sLyRlhvsFwnZNOT1bpOxuocv1NnvZ1u" {
		t.Fatal("slash command token is wrong:", conf.SlashCommandToken)
	}
	if conf.RedisUrl != "http://localhost:6379" {
		t.Fatal("redis url is wrong:", conf.RedisUrl)
	}
	if conf.Port != "37564" {
		t.Fatal("port is wrong:", conf.Port)
	}
}

func betWithParams(params url.Values, service slackbet.BetService, mux *slackcommander.SlackMux) string {
	recorder := httptest.NewRecorder()
	req := &http.Request{
		Method: "POST",
		URL:    &url.URL{Path: "/bet"},
		Form:   params,
	}
	mux.SlackHandler()(recorder, req)
	return recorder.Body.String()
}

type MockService struct {
	channelMembers []string
	sentCallback   string
}

func openRedis() (*redis.Client, error) {
	client, err := redis.Dial("tcp", "localhost:37564")
	if err != nil {
		return nil, err
	}

	return client, nil
}

func (service *MockService) GetChannelMembers(channelID string) ([]string, error) {
	return service.channelMembers, nil
}

func (service *MockService) SendCallback(text string, channel string) {
	service.sentCallback = text
}
func mockService() *bet.BetService {
	c := &slackbet.Conf{SlashCommandToken: slacktoken, Admins: []string{"sezgin", "abdurrahim"}}
	mockService := bet.BetService{Conf: c, Repo: &repo.RedisRepo{Url: "localhost:37564"}, SlackService: &MockService{}}
	return &mockService
}


text:
⚠⚠⚠ This library has been deprecated and will be removed in the future. ⚠⚠⚠

# PlayerKit

[![CI Status](http://img.shields.io/travis/ghking/PlayerKit.svg?style=flat)](https://travis-ci.org/vimeo/PlayerKit)
[![Version](https://img.shields.io/cocoapods/v/PlayerKit.svg?style=flat)](http://cocoapods.org/pods/PlayerKit)
[![License](https://img.shields.io/cocoapods/l/PlayerKit.svg?style=flat)](http://cocoapods.org/pods/PlayerKit)
[![Platform](https://img.shields.io/cocoapods/p/PlayerKit.svg?style=flat)](http://cocoapods.org/pods/PlayerKit)

PlayerKit is a modular video player system for iOS and tvOS.

### Motivation

Vimeo supports various types of video and playback (360 video, Chromecast, etc.). PlayerKit allows the app to create, utilize, and interact with different types of players in an abstract way.

### Goals

- Provide an interface defining a common API and delegate callback strategy for different types of players to implement
- Allow players to define their capabilities using protocol conformance

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory.

## Minimum Requirements

- iOS 8.0 / tvOS 9.0
- Swift 4.2

## Installation

PlayerKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "PlayerKit"
```

## Usage

### Using RegularPlayer

RegularPlayer is an implementation of Player used to play regular videos.

To play a video:

```swift
let player = RegularPlayer()

view.addSubview(player.view) // RegularPlayer conforms to `ProvidesView`, so we can add its view

player.set(asset: AVURLAsset(URL: "https://example.com/video.mp4"))

player.play()
```

Optionally, an object can conform to PlayerDelegate to receive updates from the player and perform actions such as UI updates. Check out the example project for an example of this.

```swift
player.delegate = delegate
```

### Creating New Types of Players

You can create your own players by creating objects that conform to the Player protocol and call the delegate methods when appropriate.

## Questions?

Post on [Stackoverflow](http://stackoverflow.com/questions/tagged/vimeo-ios) with the tag `vimeo-ios`.  Get in touch [here](https://vimeo.com/help/contact).  Interested in working at Vimeo? We're [hiring](https://vimeo.com/jobs)!

## License

PlayerKit is available under the MIT license. See the LICENSE file for more info.


text:
package uk.co.webamoeba.slf4j.junit.logger;

import org.slf4j.Marker;
import uk.co.webamoeba.slf4j.junit.log.Level;

public class RecordingLoggerInfoTest extends RecordingLoggerLevelTest {

	public RecordingLoggerInfoTest() {
		super(Level.INFO);
	}

	@Override
	protected boolean isEnabled(RecordingLogger recordingLogger) {
		return recordingLogger.isInfoEnabled();
	}

	@Override
	protected boolean isEnabled(RecordingLogger recordingLogger, Marker marker) {
		return recordingLogger.isInfoEnabled(marker);
	}

	@Override
	protected void log(RecordingLogger recordingLogger, String message) {
		recordingLogger.info(message);
	}

	@Override
	protected void log(String format, Object argument, RecordingLogger recordingLogger) {
		recordingLogger.info(format, argument);
	}

	@Override
	protected void log(String format, Object argument1, Object argument2, RecordingLogger recordingLogger) {
		recordingLogger.info(format, argument1, argument2);
	}

	@Override
	protected void log(String format, Object argument1, Object argument2, Object argument3, RecordingLogger recordingLogger) {
		recordingLogger.info(format, argument1, argument2, argument3);
	}

	@Override
	protected void log(String message, Throwable throwable, RecordingLogger recordingLogger) {
		recordingLogger.info(message, throwable);
	}

	@Override
	protected void log(Marker marker, String message, RecordingLogger recordingLogger) {
		recordingLogger.info(marker, message);
	}

	@Override
	protected void log(Marker marker, String format, Object argument, RecordingLogger recordingLogger) {
		recordingLogger.info(marker, format, argument);
	}

	@Override
	protected void log(Marker marker, String format, Object argument1, Object argument2, RecordingLogger recordingLogger) {
		recordingLogger.info(marker, format, argument1, argument2);
	}

	@Override
	protected void log(Marker marker, String format, Object argument1, Object argument2, Object argument3, RecordingLogger recordingLogger) {
		recordingLogger.info(marker, format, argument1, argument2, argument3);
	}

	@Override
	protected void log(Marker marker, String message, Throwable throwable, RecordingLogger recordingLogger) {
		recordingLogger.info(marker, message, throwable);
	}

}


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

<TITLE>
Uses of Class javafe.ast.ObjectDesignator (Javafe)
</TITLE>

<META NAME="date" CONTENT="2010-04-26">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../javafe.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

Javafe
© 2010 IT University of Copenhagen
© 2007,2008,2009,2010 Joseph Kiniry
© 2003,2004,2005,2006 David Cok and Joseph Kiniry
© 2005,2006,2007,2008,2009 University College Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
javafe.ast.ObjectDesignator

Packages that use ObjectDesignator

javafe.ast

javafe.tc

Uses of ObjectDesignator in javafe.ast

Subclasses of ObjectDesignator in javafe.ast

 class
ExprObjectDesignator

          Represents an ObjectDesignator of the form "Expr . ".

 class
SuperObjectDesignator

          Represents a ObjectDesignator of the form "super . ".

 class
TypeObjectDesignator

          Represents a ObjectDesignator of the form "TypeName . "

  Is created from AmbiguousVariableAccess/AmbiguousMethodInvocation
 by the name resolution code.

Fields in javafe.ast declared as ObjectDesignator

 ObjectDesignator
MethodInvocation.od

 ObjectDesignator
FieldAccess.od

Methods in javafe.ast with parameters of type ObjectDesignator

static FieldAccess
FieldAccess.make(ObjectDesignator od,
         Identifier id,
         int locId)

static MethodInvocation
MethodInvocation.make(ObjectDesignator od,
         Identifier id,
         TypeModifierPragmaVec tmodifiers,
         int locId,
         int locOpenParen,
         ExprVec args)

 void
StandardPrettyPrint.print(java.io.OutputStream o,
           int ind,
           ObjectDesignator od)

abstract  void
PrettyPrint.print(java.io.OutputStream o,
           int ind,
           ObjectDesignator od)

 void
DelegatingPrettyPrint.print(java.io.OutputStream o,
           int ind,
           ObjectDesignator od)

 void
PrettyPrint.println(java.io.PrintStream out,
               ObjectDesignator e)

          Writes an ObjectDesignator (a type of ASTNode) to the given PrintStream,
 followed by an end-of-line.

 java.lang.String
PrettyPrint.toString(ObjectDesignator od)

 void
Visitor.visitObjectDesignator(ObjectDesignator x)

 void
ASTDotVisitor.visitObjectDesignator(ObjectDesignator x)

 java.lang.Object
VisitorArgResult.visitObjectDesignator(ObjectDesignator x,
                                           java.lang.Object o)

Constructors in javafe.ast with parameters of type ObjectDesignator

FieldAccess(ObjectDesignator od,
                       Identifier id,
                       int locId)

MethodInvocation(ObjectDesignator od,
                                 Identifier id,
                                 TypeModifierPragmaVec tmodifiers,
                                 int locId,
                                 int locOpenParen,
                                 ExprVec args)

Uses of ObjectDesignator in javafe.tc

Methods in javafe.tc that return ObjectDesignator

 ObjectDesignator
Env.getObjectDesignator(TypeSig C,
                                       int loc)

          Return an inferred ObjectDesignator for use in a reference to
 a possibly-instance member of class C from here.

Methods in javafe.tc with parameters of type ObjectDesignator

protected  Type
FlowInsensitiveChecks.checkObjectDesignator(Env env,
                                           ObjectDesignator od)

static void
CheckInvariants.checkObjectDesignator(TypeSig sig,
                                           ObjectDesignator od)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

Javafe
© 2010 IT University of Copenhagen
© 2007,2008,2009,2010 Joseph Kiniry
© 2003,2004,2005,2006 David Cok and Joseph Kiniry
© 2005,2006,2007,2008,2009 University College Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

The ESC/Java2 Project Homepage


text:
package com.drisoftie.action.async;

import java.util.List;

/**
 * A generic action interface.
 *
 * @author Alexander Dridiger
 */
public interface IAsyncAction<ViewT> {

    /**
     * Cancels all running actions.
     */
    void cancelActions();

    /**
     * Returns the {@link ViewT} targets this action is bound to.
     *
     * @return all targets
     */
    List<ViewT> getViewTargets();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="primary">#673AB7</color>
    <color name="primary_dark">#512DA8</color>
    <color name="primary_light">#D1C4E9</color>
    <color name="accent">#00BCD4</color>
    <color name="primary_text">#212121</color>
    <color name="primary_text_dark">#FFFFFF</color>
    <color name="secondary_text">#727272</color>
    <color name="icons">#FFFFFF</color>
    <color name="divider">#B6B6B6</color>
    <color name="wrong_state">#FF5252</color>
    <color name="good_state">#8BC34a</color>
</resources>


text:
Service Monitor
==============

Service Monitor when executed will check a list of services for there status and if down, resurrect them and send an email if required.

## Requirements ##

Python 2.7, 3.3

Tested on Python 2.7 and 3.3 so this is a good indicator that any currently supported version is fine.

## Setup ##

All configuration options are set as class variables(so go and have a peak at them). You can change them or you can specify them before calling check_services().

## Usage ##

Really simple, just initialise a new instance, set your params and call check_services().

```usage
from servicemonitor.servicemonitor import ServiceMonitor
# If loading it from a dir named 'servicemonitor'

monitor = ServiceMonitor()
monitor.debug = True
monitor.services = ["nginx", "redis-server", "mysql"]
monitor.send_notify = True
monitor.notify_email = "you@domain.com"
monitor.smtp_email = "service@domain.com"
monitor.smtp_password = ""
monitor.check_services()
```

## How to use long term? ##

I have this setup on a 5 minute cronjob, take inspiration from that if you want.


text:
'use strict'

const tape = require('tape')
const cullKeywords = require('./_index.js')

const expected = {
  keywords: ['MTV', 'Quick', 'fox', 'jumps', 'quack', 'quiz', 'zephyrs'],
  keyphrases: ['Alex Trebek\'s fun TV quiz game', 'Junk MTV quiz',
    'MTV ax quiz prog', 'Quick', 'fox']
}

const format = array => array.map(key => key.replace('\'', '').split(' ').join('-'))

var string =
`
The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz
prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex.
Waltz, bad, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick
quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick
wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim.
Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex.
Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax
jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs
jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves
quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips
galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The
jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a
quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard's job is to
vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game
. Woven silk pyjamas exchanged for blue quartz. Brawny gods just
`

tape('cull-keywords', test => {
  /*
   * Should Error
   */

  /* Using promises */
  cullKeywords('', 'format').then(test.notOk).catch(err => {
    test.ok(err instanceof Error)
    test.ok(err.message, 'Expected `string` as first argument.')
  })

  cullKeywords('').then(test.notOk).catch(err => {
    test.ok(err instanceof Error)
    test.ok(err.message, 'Expected `string` as first argument.')
  })

  /* Using callbacks */
  cullKeywords('', 'format', (err, res) => {
    test.notOk(res)
    test.ok(err instanceof Error)
    test.ok(err.message, 'Expected `string` as first argument.')
  })

  cullKeywords('', (err, res) => {
    test.notOk(res)
    test.ok(err instanceof Error)
    test.ok(err.message, 'Expected `string` as first argument.')
  })

  /**
   * Should return results
   */

  /* Using promises */
  cullKeywords(string).then(res => {
    test.ok(res)
    test.deepEqual(res.keyphrases, expected.keyphrases)
    test.deepEqual(res.keywords, expected.keywords)
  }).catch(test.notOk)

  cullKeywords(string, {keyphrases: true, keywords: true}).then(res => {
    test.ok(res)
    test.deepEqual(res.keyphrases, expected.keyphrases)
    test.deepEqual(res.keywords, expected.keywords)
  }).catch(test.notOk)

  cullKeywords(string, 'keyphrases').then(res => {
    test.ok(res)
    test.deepEqual(res.keyphrases, expected.keyphrases)
  })

  cullKeywords(string, 'keywords').then(res => {
    test.ok(res)
    test.deepEqual(res.keywords, expected.keywords)
  })

  cullKeywords(string, 'format').then(res => {
    test.ok(res)
    test.deepEqual(res.keyphrases, format(expected.keyphrases))
    test.deepEqual(res.keywords, format(expected.keywords))
  }).catch(test.notOk)

  cullKeywords(string, {keyphrases: true, keywords: true, format: true}).then(res => {
    test.ok(res)
    test.deepEqual(res.keyphrases, format(expected.keyphrases))
    test.deepEqual(res.keywords, format(expected.keywords))
  }).catch(test.notOk)

  cullKeywords(string, {keyphrases: true, format: true}).then(res => {
    test.ok(res)
    test.deepEqual(res.keyphrases, format(expected.keyphrases))
  })

  cullKeywords(string, {keywords: true, format: true}).then(res => {
    test.ok(res)
    test.deepEqual(res.keywords, format(expected.keywords))
  })

  test.ok(typeof cullKeywords.doop === 'function')
  test.ok(cullKeywords.doop.name === 'doop')
  test.notOk(cullKeywords.doop())

  test.end()
})


text:
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#ifndef NATIVE_EXTENSION_VTK_VTKBOXWIDGETWRAP_H
#define NATIVE_EXTENSION_VTK_VTKBOXWIDGETWRAP_H

#include <nan.h>

#include <vtkSmartPointer.h>
#include <vtkBoxWidget.h>

#include "vtk3DWidgetWrap.h"
#include "../../plus/plus.h"

class VtkBoxWidgetWrap : public Vtk3DWidgetWrap
{
	public:
		using Nan::ObjectWrap::Wrap;
		static void Init(v8::Local<v8::Object> exports);
		static void InitPtpl();
		static void ConstructorGetter(
			v8::Local<v8::String> property,
			const Nan::PropertyCallbackInfo<v8::Value>& info);

		VtkBoxWidgetWrap(vtkSmartPointer<vtkBoxWidget>);
		VtkBoxWidgetWrap();
		~VtkBoxWidgetWrap( );
		static Nan::Persistent<v8::FunctionTemplate> ptpl;

	private:
		static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);

		static void GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetFaceProperty(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetHandleProperty(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetInsideOut(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetOutlineCursorWires(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetOutlineFaceWires(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetOutlineProperty(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetPlanes(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetPolyData(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetRotationEnabled(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetScalingEnabled(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetSelectedFaceProperty(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetSelectedHandleProperty(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetSelectedOutlineProperty(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetTransform(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetTranslationEnabled(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void HandlesOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void HandlesOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void InsideOutOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void InsideOutOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void IsA(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void OutlineCursorWiresOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void OutlineCursorWiresOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void OutlineFaceWiresOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void OutlineFaceWiresOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void PlaceWidget(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void RotationEnabledOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void RotationEnabledOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void ScalingEnabledOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void ScalingEnabledOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetEnabled(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetInsideOut(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetOutlineCursorWires(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetOutlineFaceWires(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetRotationEnabled(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetScalingEnabled(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetTransform(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetTranslationEnabled(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void TranslationEnabledOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void TranslationEnabledOn(const Nan::FunctionCallbackInfo<v8::Value>& info);

#ifdef VTK_NODE_PLUS_VTKBOXWIDGETWRAP_CLASSDEF
		VTK_NODE_PLUS_VTKBOXWIDGETWRAP_CLASSDEF
#endif
};

#endif


text:
<?php

namespace Mxtb\Tests\Model\Lookup\Network\Smtp;

use Mxtb\Model\Lookup\Network\Smtp\FailedResponse;

class FailedResponseTest extends \PHPUnit_Framework_TestCase
{
    public function testCanSetInfo()
    {
        // Arrange
        $response = new FailedResponse();

        // Act
        $response->setId(1234);
        $response->setName('test info');
        $response->setInfo('test info');
        $response->setUrl('test info');
        $response->setDelistUrl('test info');

        // Assert
        $this->assertEquals(1234, $response->getId());
        $this->assertEquals('test info', $response->getName());
        $this->assertEquals('test info', $response->getInfo());
        $this->assertEquals('test info', $response->getUrl());
        $this->assertEquals('test info', $response->getDelistUrl());
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Editor
{
    public class GameScreen : ObjectTreeElement
    {

        private string _screenName;

        public string ScreenName
        {
            get
            {
                return _screenName;
            }
            set
            {
                _screenName = value;
                SetNodeText(_screenName + ": Screen");
            }
        }
        public string Script { get; set; }
        public Color BackgroundColor { get; set; }

        private InteractionComponent iComponent;
        private InteractionArea iArea;
        private ScreenPropPanel props;

        private List<IDrawable> drawables;
        private List<Sprite> sprites;
        private List<Text> texts;
        private List<IUpdateable> updateables;

        private List<LibrarySprite> lSprites;

        public GameScreen()
        {

            BackgroundColor = Color.Black;
            iArea = new InteractionArea();
            iComponent = new InteractionComponent();
            iComponent.IsInfinet = true;
            iComponent.Dragable = false;

            props = new ScreenPropPanel();
            props.OnPropChange += props_onPropChange;
            props.OnLSpriteRemove += OnPropPanel_LibSpriteRemove;
            props.OnLSpratePlace += OnPropPanel_LibSpritePlace;
            props.OnScriptEditClick += OnScriptEdit;

            iArea.AddEntity(iComponent);

            iComponent.OnClick += iEntity_Click;

            AddMenuItem("Delete");
            OnMenuItemSelect += OnMenuItemSel;

            drawables = new List<IDrawable>();
            updateables = new List<IUpdateable>();
            sprites = new List<Sprite>();
            texts = new List<Text>();
            lSprites = new List<LibrarySprite>();

        }

        public void Draw(Canvas canvas)
        {

            foreach (IUpdateable up in updateables)
            {
                up.Update();
            }

            canvas.SetClearColor(BackgroundColor);
            canvas.Clear();

            foreach (IDrawable drawable in drawables)
            {
                drawable.Draw(canvas);
            }

            canvas.Present();

        }

        public void AddSprite(Sprite sprite)
        {
            sprites.Add(sprite);
            drawables.Add(sprite);
            updateables.Add(sprite);
            iArea.AddEntity(sprite.GetIntractionComponent());

            AddChild(sprite);
        }

        public void RemoveSprite(Sprite sprite)
        {
            sprites.Remove(sprite);
            drawables.Remove(sprite);
            updateables.Remove(sprite);
            iArea.RemoveEntity(sprite.GetIntractionComponent());

            RemoveChild(sprite);

            ShowPropsPanel();
        }

        public void AddText(Text text)
        {
            texts.Add(text);
            drawables.Add(text);

            iArea.AddEntity(text.GetIntractionComponent());

            AddChild(text);
        }

        public void RemoveText(Text text)
        {
            texts.Remove(text);
            drawables.Remove(text);
            iArea.RemoveEntity(text.GetIntractionComponent());

            RemoveChild(text);
        }

        public void AddLibrarySprite(LibrarySprite lSprite)
        {
            lSprites.Add(lSprite);
            props.AddLibrarySprite(lSprite.Name);
        }

        public void RemoveLibrarySprite(LibrarySprite lSprite)
        {
            int index = lSprites.IndexOf(lSprite);
            lSprites.Remove(lSprite);

            props.RemoveLibrarySprite(index);
        }

        public uint GetNumberOfSprites()
        {
            return (uint)sprites.Count;
        }

        public Sprite GetSpriteAt(uint index)
        {
            return sprites[(int)index];
        }

        public uint GetNumberOfTexts()
        {
            return (uint)texts.Count;
        }

        public Text GetTextAt(uint index)
        {
            return texts[(int)index];
        }

        public uint GetNumberOfLibrarySprites()
        {
            return (uint)lSprites.Count;
        }

        public LibrarySprite GetLibrarySpriteAt(uint index)
        {
            return lSprites[(int)index];
        }

        public InteractionArea GetInteractionArea()
        {
            return iArea;
        }

        private void iEntity_Click(object sender, EventArgs e)
        {
            FocusHandler.OutOfFocus();
            ShowPropsPanel();
        }

        private void props_onPropChange(object sender, ScreenPropPanel_PropChangeArgs e)
        {
            this.ScreenName = props.ScreenName;
            this.Script = props.ScreenName;
            this.BackgroundColor = props.BGColor;
        }

        private void OnMenuItemSel(object sender, MenuItemClickedArgs e)
        {
            GameApp.RemoveScreen(this);
        }

        public void ShowPropsPanel()
        {

            props.ScreenName = ScreenName;
            props.Script = Script;
            props.BGColor = BackgroundColor;

            PropPanelLoader.SetPropContent(props);
        }

        protected override void OnTreeNodeClick()
        {
            FocusHandler.OutOfFocus();
            ShowPropsPanel();
            GameApp.SetCurrentScreen(this);
        }

        private void OnPropPanel_LibSpriteRemove(object sender, ScreenPropPanel_LSpriteArgs e)
        {
            lSprites.RemoveAt(e.Index);
        }

        private void OnPropPanel_LibSpritePlace(object sender, ScreenPropPanel_LSpriteArgs e)
        {
            LibrarySprite lib = lSprites[e.Index];
            ToolManager.SetCurrentTool(new CreateScreenObjectTool(ObjectType.Sprite, LibrarySprite.GenerateSprite(lib)));
        }

        private void OnScriptEdit(object sender, EventArgs e)
        {
            AppManager.RunEditScriptDialog(this);
        }
    }
}


text:
;(function(Agent) {

  // @private
  // Like onSetted, but calls the callback every time object[property] is setted to a non
  // undefined value and also immediately if it's already non-undefined.
  Agent.onDefined = function(object, property, callback) {
      if (object[property] !== undefined) {
        callback(object[property]);
      }

      Agent.onSetted(object, property, function(newValue) {
          if (newValue !== undefined) callback(newValue);
      });
  };

}(Agent));


text:
static void foo() {}
static void bar() {}

TEST(ThreadSanitizer, FuncCall) {
  ScopedThread t1, t2;
  MemLoc l;
  t1.Write1(l);
  t2.Call(foo);
  t2.Call(bar);
  t2.Write1(l, true);
  t2.Return();
  t2.Return();
}

// We use this function instead of main, as ISO C++ forbids taking the address
// of main, which we need to pass inside __tsan_func_entry.
int run_tests(int argc, char **argv) {
  TestMutexBeforeInit();  // Mutexes must be usable before __tsan_init();
  __tsan_init();
  __tsan_func_entry(__builtin_return_address(0));
  __tsan_func_entry((void*)((intptr_t)&run_tests + 1));

  testing::GTEST_FLAG(death_test_style) = "threadsafe";
  testing::InitGoogleTest(&argc, argv);
  int res = RUN_ALL_TESTS();

  __tsan_func_exit();
  __tsan_func_exit();
  return res;
}

int main(int argc, char **argv) {
  return run_tests(argc, argv);
}


text:
body {
  background: #e9e9e9;
  color: #666666;
  font-family: 'RobotoDraft', 'Roboto', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  position: relative;
  max-width: 460px;
  width: 100%;
  margin: 0 auto 100px;
}
.container.active .card:first-child {
  background: #f2f2f2;
  margin: 0 15px;
}
.container.active .card:nth-child(2) {
  background: #fafafa;
  margin: 0 10px;
}

/* Card */
.card {
  position: relative;
  background: #ffffff;
  border-radius: 5px;
  padding: 60px 0 40px 0;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  -webkit-transition: .3s ease;
  transition: .3s ease;
  /* Title */
  /* Inputs */
  /* Button */
  /* Footer */
}
.card:first-child {
  background: #fafafa;
  height: 10px;
  border-radius: 5px 5px 0 0;
  margin: 0 10px;
  padding: 0;
}
.card .title {
  position: relative;
  z-index: 1;
  border-left: 5px solid #ed2553;
  margin: 0 0 35px;
  padding: 10px 0 10px 50px;
  color: #ed2553;
  font-size: 32px;
  font-weight: 600;
  text-transform: uppercase;
}
.card .input-container {
  position: relative;
  margin: 0 60px 50px;
}
.card .input-container input {
  outline: none;
  z-index: 1;
  position: relative;
  background: none;
  width: 100%;
  height: 60px;
  border: 0;
  color: #212121;
  font-size: 24px;
  font-weight: 400;
}
.card .input-container input:focus ~ label {
  color: #9d9d9d;
  -webkit-transform: translate(-12%, -50%) scale(0.75);
          transform: translate(-12%, -50%) scale(0.75);
}
.card .input-container input:focus ~ .bar:before, .card .input-container input:focus ~ .bar:after {
  width: 50%;
}
.card .input-container input:valid ~ label {
  color: #9d9d9d;
  -webkit-transform: translate(-12%, -50%) scale(0.75);
          transform: translate(-12%, -50%) scale(0.75);
}
.card .input-container label {
  position: absolute;
  top: 0;
  left: 0;
  color: #757575;
  font-size: 24px;
  font-weight: 300;
  line-height: 60px;
  -webkit-transition: 0.2s ease;
  transition: 0.2s ease;
}
.card .input-container .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  background: #757575;
  width: 100%;
  height: 1px;
}
.card .input-container .bar:before, .card .input-container .bar:after {
  content: '';
  position: absolute;
  background: #ed2553;
  width: 0;
  height: 2px;
  -webkit-transition: .2s ease;
  transition: .2s ease;
}
.card .input-container .bar:before {
  left: 50%;
}
.card .input-container .bar:after {
  right: 50%;
}
.card .button-container {
  margin: 0 60px;
  text-align: center;
}
.card .button-container button {
  outline: 0;
  cursor: pointer;
  position: relative;
  display: inline-block;
  background: 0;
  width: 240px;
  border: 2px solid #B6B6B6;
  padding: 20px 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  -webkit-transition: .3s ease;
  transition: .3s ease;
}
.card .button-container button span {
  position: relative;
  z-index: 1;
  color: #ddd;
  -webkit-transition: .3s ease;
  transition: .3s ease;
}
.card .button-container button:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  background: #ed2553;
  width: 30px;
  height: 30px;
  border-radius: 100%;
  margin: -15px 0 0 -15px;
  opacity: 0;
  -webkit-transition: .3s ease;
  transition: .3s ease;
}
.card .button-container button:hover, .card .button-container button:active, .card .button-container button:focus {
  border-color: #ed2553;
}
.card .button-container button:hover span, .card .button-container button:active span, .card .button-container button:focus span {
  color: #ed2553;
}
.card .button-container button:active span, .card .button-container button:focus span {
  color: #ffffff;
}
.card .button-container button:active:before, .card .button-container button:focus:before {
  opacity: 1;
  -webkit-transform: scale(10);
  transform: scale(10);
}
.card .footer {
  margin: 40px 0 0;
  color: #d3d3d3;
  font-size: 24px;
  font-weight: 300;
  text-align: center;
}
.card .footer a {
  color: inherit;
  text-decoration: none;
  -webkit-transition: .3s ease;
  transition: .3s ease;
}
.card .footer a:hover {
  color: #bababa;
}


text:
"use strict";

module.exports = {
  builders: require("./doc-builders"),
  printer: require("./doc-printer"),
  utils: require("./doc-utils"),
  debug: require("./doc-debug")
};


text:
import merge from "lodash.merge";
import { makeAdInitMocks, adInit } from "../../fixtures/ad-init-mocks";

export default () => {
  let initOptions;

  beforeEach(() => {
    ({ initOptions } = makeAdInitMocks());
  });

  it("initialises admantx", () => {
    const init = adInit(
      merge(initOptions, { data: { bidInitialiser: false } })
    );

    jest.spyOn(init.admantx, "init");
    init.init();
    expect(init.admantx.init).toHaveBeenCalledTimes(1);
  });

  it("extracts names correctly", () => {
    const init = adInit(initOptions);

    const input = [
      { score: 6, origin: "NORMAL", name: "foo", type: "MAINLEMMAS" },
      { score: 1, origin: "NORMAL", name: "Bar", type: "PLACES" },
      { score: 2, origin: "NORMAL", name: "Foo Bar    ", type: "MAINLEMMAS" },
      { score: 2, origin: "NORMAL", name: "Foo Bar    ", type: "PLACES" },
      {
        score: 1,
        origin: "NORMAL",
        name: "Foo Foo Bar['=!+#*~;^()<>[],& ",
        type: "PLACES"
      }
    ];

    const output = "foo,bar,foo_bar,foo_foo_bar";

    expect(init.admantx.extractNames(input)).toEqual(output);
  });
};


text:
using Akka.Actor;
using System;

namespace ClusterDemo.Actors.Service
{
    using Common;
    using Common.Messages;
    using Messages;

    public class Worker
        : ReceiveActorEx
    {
        readonly int _id;
        readonly IActorRef _workerEvents;

        IActorRef _currentDispatcher;

        public Worker(int id, IActorRef workerEvents)
        {
            _id = id;
            _workerEvents = workerEvents;
        }

        void WaitingForDispatcher()
        {
            Log.Info("Worker {Worker} waiting for initial announcement from dispatcher.", Self.Path);

            // If dispatcher moves or is restarted, re-announce ourselves.
            Receive<DispatcherAvailable>(dispatcherAvailable =>
            {
                Log.Info("Worker {Worker} received initial announcement from dispatcher {Dispatcher}.",
                    Self.Path,
                    dispatcherAvailable.Dispatcher.Path.ToStringWithAddress()
                );

                _currentDispatcher = dispatcherAvailable.Dispatcher;

                Become(WaitingForJob);
            });
        }

        void WaitingForJob()
        {
            Log.Info("Worker {Worker} waiting for job.", Self.Path);
            _workerEvents.Tell(
                new WorkerAvailable(Self)
            );

            Receive<ExecuteJob>(executeJob =>
            {
                Log.Info("Worker {Worker} executing job {JobId}...",
                    Self.Path.Name,
                    executeJob.Id
                );

                // TODO: Call fake work API.
                // For now, just reply after random delay.
                TimeSpan jobExecutionTime = TimeSpan.FromSeconds(
                    new Random().Next(1, 10)
                );
                ScheduleTellSelfOnce(
                    delay: jobExecutionTime,
                    message: new JobCompleted(executeJob.Id, Self, jobExecutionTime,
                        $"Job {executeJob.Id} completed successfully."
                    )
                );

                _workerEvents.Tell(new JobStarted(
                    worker: Self,
                    id: executeJob.Id
                ));

                Become(ExecutingJob);
            });

            // If dispatcher moves or is restarted, re-announce ourselves.
            Receive<DispatcherAvailable>(dispatcherAvailable =>
            {
                if (_currentDispatcher.Equals(dispatcherAvailable.Dispatcher) && !dispatcherAvailable.IsFirstAnnouncement)
                    return; // We already know about this dispatcher; no need to re-announce ourselves.

                _currentDispatcher = dispatcherAvailable.Dispatcher;
                _workerEvents.Tell(
                    new WorkerAvailable(Self)
                );
            });
        }

        void ExecutingJob()
        {
            Receive<JobCompleted>(jobCompleted =>
            {
                Log.Info("Worker {Worker} completed job {JobId}.", Self.Path, jobCompleted.Id);

                _workerEvents.Tell(jobCompleted);

                Become(WaitingForJob);
            });
        }

        protected override void PreStart()
        {
            base.PreStart();

            Become(WaitingForDispatcher);
        }

        public static Props Create(int id, IActorRef workerEvents)
        {
            return Props.Create<Worker>(id, workerEvents);
        }
    }
}


text:
<TITLE>Review for Sweet November (2001)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Sweet November (2001)

reviewed by
Jon Popick

Planet Sick-Boy: http://www.sick-boy.com
"We Put the SIN in Cinema"

© Copyright 2001 Planet Sick-Boy. All Rights Reserved.

If forced to name a celebrity I'm completely tired of seeing and hearing
about, the names Keanu Reeves and Charlize Theron would be blurted out just
after Jennifer Lopez and right before Kate Hudson.  Not only do Keanu and
Charlize have ridiculous names, they've also appeared in three films apiece
in the last six months, most of which were formulaic crap (him: The
Replacements, The Watcher and The Gift; her: The Yards, Men of Honor and The
Legend of Bagger Vance).  Hey, why not put them in a film together?  It's
almost as if Hollywood senses I'm on the brink of a workplace shooting and
is trying to nudge me off the fence.

Sweet November is a remake of moderately entertaining 1968 film that starred
Sandy Dennis and Anthony Newley (think of a young Charles Grodin, only with
charisma and hair).  Both films are about a dying woman who takes on one
dysfunctional man each month of her last year on Earth in some bizarre
attempt to...to...okay, I have no idea why she does it.  The 2001 version,
lifelessly directed by Pat O'Connor (Dancing at Lughnasa), swaps the woman's
cool Greenwich Village loft for a cramped San Francisco walkup and totally
blows the ending, turning the subtle, well-done original into something
extraordinarily unpleasant and plodding.

Theron plays Sara Deever, a less-annoying version of Jenna Elfman's Dharma.
Sara is Hollywood eccentric, which means she has close-cropped hair, clothes
that don't match and wears a lot of weird hats and scarves.  Her "November"
is Nelson Moss (Reeves), an advertising executive portrayed as a
high-powered, workaholic version of Darrin Stephens.  Nelson's life is ruled
by his work and everything else, including his lovely but perpetually
ignored girlfriend (Gilmore Girls' Lauren Graham), is pushed aside.  It's
hard to tell if the character is a dick or if the actor is a moron (it's
probably a little of both).

The two "meet cute" at the DMV, where Sara offers to make Nelson her
"November."  Confused (a stretch for Reeves, I'm sure), Nelson writes her
off as a kook, but takes her up on the offer after getting fired and dumped
on the same day.  He's still wary of Sara's motives - heck, I'd be expecting
her to turn into Kathy Bates in Misery, or find out Satan is somehow
involved (Reeves and Theron were in The Devil's Advocate together) - but
eventually they fall in love, otherwise there wouldn't be a movie.

When Nelson pesters Sara about her strange monthly arrangements, she
replies, "I told you - I can't tell you my reasons."  He has no clue
(another stretch for Reeves), so, apparently, he hasn't seen November's
trailer, where Sara's raccoon-like, sunken cancer eyes are prominently
displayed, ruining the ending for anyone who couldn't see it coming a mile
away.  Sure enough, about an hour into the film, she starts acting
mysterious, sweaty and tired, and you can only sit back and wait for the
inevitable, which drags out with the exciting pace of a nursing home Bingo
game.

The ending is so bad, somebody at my screening actually shouted, "Hurry up
and die already!"  Okay, it was me, but you get the point.  There's plenty
of other stuff to get pissed off about, like the fact that it's a Warner
Bros. film that shamelessly plugs several of its products (America Online,
CNN and Sports Illustrated, among others).  Look for the scene where Nelson
and his buddy (Greg Germann, Down to Earth) talk to each other on their cell
phones, even though they're walking right next to each other (just like
Clueless).  If that wasn't bad enough, there's also a karaoke scene where
Keanu shows he's a better singer than an actor.  But that's kind of like
saying George W. Bush is a lot smarter than people give him credit for.

1:58 - PG-13 for sexual content and language

==========
X-RAMR-ID: 29087
X-Language: en
X-RT-ReviewID: 191010
X-RT-TitleID: 1104841
X-RT-SourceID: 595
X-RT-AuthorID: 1146

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
<partnerships>
    <partner name="OpenAS2A"
             as2_id="OpenAS2A_OID"
             x509_alias="openas2a"
             email="as2msgs@openas2a.com"/>
    <partner name="OpenAS2B"
             as2_id="OpenAS2B_OID"
             x509_alias="openas2b"
             email="as2msgs@openas2b.com"/>

    <partnership name="OpenAS2A-to-OpenAS2B">
        <sender name="OpenAS2A"/>
        <receiver name="OpenAS2B"/>
        <attribute name="protocol" value="as2"/>
        <attribute name="content_transfer_encoding" value="8bit"/>
        <attribute name="compression_type" value="ZLIB"/>
        <attribute name="as2_url" value="http://localhost:20080"/>
        <attribute name="mdnsubject" value="Your requested MDN response from $receiver.as2_id$"/>
        <attribute name="as2_mdn_to" value="edi@openas2b.org"/>
        <!--  <attribute name="as2_receipt_option" value="http://localhost:10080"/>   ...for async MDN-->
        <attribute name="as2_mdn_options"
                   value="signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, $attribute.sign$"/>
        <attribute name="encrypt" value="3DES"/>
        <attribute name="sign" value="SHA1"/>
        <attribute name="resend_max_retries" value="3"/>
        <attribute name="prevent_canonicalization_for_mic" value="false"/>
        <attribute name="rename_digest_to_old_name" value="true"/>
        <attribute name="remove_cms_algorithm_protection_attrib" value="false"/>
    </partnership>

    <partnership name="OpenAS2B-to-OpenAS2A">
        <sender name="OpenAS2B"/>
        <receiver name="OpenAS2A"/>
        <attribute name="protocol" value="as2"/>
        <attribute name="content_transfer_encoding" value="8bit"/>
		<attribute name="subject" value="File $attributes.filename$ sent from $sender.name$ to $receiver.name$"/>
        <attribute name="as2_url" value="http://localhost:10080"/>
        <attribute name="as2_mdn_to" value="edi@openas2a.org"/>
        <attribute name="no_chunked_max_size" value="10485760"/> <!-- Disables chunked transfer, set max. mime-size to 10 MB -->
         <!--   ...for async MDN-->
        <attribute name="as2_receipt_option" value="$properties.as2_async_mdn_url$"/>
        <attribute name="as2_mdn_options"
                   value="signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, SHA256"/>
        <attribute name="encrypt" value="3DES"/>
        <attribute name="sign" value="SHA256"/>
        <attribute name="prevent_canonicalization_for_mic" value="false"/>
        <attribute name="rename_digest_to_old_name" value="false"/>
        <attribute name="remove_cms_algorithm_protection_attrib" value="false"/>
        <!--
        Example for adding static custom headers to Mime body part and additionally add to HTTP
        <attribute name="custom_mime_headers" value="X-CustomHeader: shift-shape ; X-CustomShape: oblong"/>
        <attribute name="add_custom_mime_headers_to_http" value="true"/>
        -->
        <!--
        Example for adding dynamic custom headers to Mime body part using delimiters where filename is of form XXX-YYY-ZZZ or XXX_YYY-ZZZ etc
        <attribute name="custom_mime_header_names_from_filename" value="header.X-CustomRouteId,header.X-CustomCenter, junk.extraStuff"/>
        <attribute name="custom_mime_header_name_delimiters_in_filename" value="-_"/>

        Example for adding dynamic custom headers to Mime body part where filename is of form XXX-YYY.msg
        <attribute name="custom_mime_header_names_from_filename" value="X-CustomRouteId,X-CustomCenter"/>
        <attribute name="custom_mime_header_names_regex_on_filename" value="([^-]*)-([^.]*).msg"/>

        Example for parsing filename into parameters that can be referenced this is a file name of the form XXXNNNN.edi where X is alphabetic and N are numerics
        <attribute name="attribute_names_from_filename" value="P-DynamicParm1,P-DynamicParm2"/>
        <attribute name="attribute_values_regex_on_filename" value="([A-Za-z]*)([^.]*).edi"/>
        -->
    </partnership>

</partnerships>


text:
In some use cases you want to query data from the process engine database directly, e.g. health-monitoring, reporting or the like.

In this Snippet we collect helpful SQL queries which can be used - no guarantee they work on your database as some of them are collected in real-life projects (but on certain databases).

# Typical Monitoring Queries

Put the following queries in your favorite monitoring tool, e.g. [Nagios](http://omdistro.org/),
and [track them over time](http://docs.pnp4nagios.org/pnp-0.6/gallery/start)
to monitor [Camunda BPM](http://camunda.org) engine performance.

```sql
--  running process instances
select count(*) from act_ru_execution
where parent_id_ is null;

-- finished process instances
select count(*) from act_hi_procinst where end_time_ is not null;

-- flow nodes count
select count(*) from act_hi_actinst where end_time_ is not null;

-- number of Jobs that are currently being processed,
-- i.e. are acquired by a Job Executor
select count(*) from act_ru_job res
where (RES.LOCK_OWNER_ is not null);

-- number of Jobs that are due to be processed,
-- but not yet aquired by a Job Executor
select count(*) from act_ru_job res
where (RES.RETRIES_ > 0)
and (RES.DUEDATE_ is null or RES.DUEDATE_ < sysdate)
and (RES.LOCK_OWNER_ is null or RES.LOCK_EXP_TIME_ < sysdate)
and (RES.SUSPENSION_STATE_ = 1 or RES.SUSPENSION_STATE_ is null);

-- number of Jobs that are failed,
-- i.e. have no more automatic retries
select count(*) from act_ru_job where retries_ = 0;

-- number of open incidents in running processes
select count(*) from act_ru_incident;

-- number of all incidents in history
select count(*) from act_hi_incident;

-- number of open incidents with particular error type in running processes
select count(*) from act_ru_incident where lower(incident_msg_) like '%api.twitter.com%';

```

## Process/Case instances over time

One count per hour for the last 30 days, can be drawn as line chart to see development, e.g.

![Line Chart][1]

H2:
```sql
-- process instances
select hour_date, ACT_RE_PROCDEF.KEY_ , count(*) as processInstanceCount
FROM (select  DATEADD('HOUR', -1*rownum, sysdate) as hour_date  from SYSTEM_RANGE(1, 168))
     join act_hi_procinst on (start_time_ <= hour_date and (end_time_ is null OR end_time_ > hour_date))
     join ACT_RE_PROCDEF on act_hi_procinst.PROC_DEF_ID_  = ACT_RE_PROCDEF.ID_
group by (hour_date, ACT_RE_PROCDEF.KEY_)
order by ACT_RE_PROCDEF.KEY_, hour_date;

-- case instances
select hour_date, ACT_RE_CASE_DEF.KEY_ , count(*) as caseInstanceCount
FROM (select  DATEADD('HOUR', -1*rownum, sysdate) as hour_date  from SYSTEM_RANGE(1, 168))
     join act_hi_caseinst on (create_time_ <= hour_date and (close_time_ is null OR close_time_ > hour_date))
     join ACT_RE_CASE_DEF on act_hi_caseinst.CASE_DEF_ID_  = ACT_RE_CASE_DEF.ID_
group by (hour_date, ACT_RE_CASE_DEF.KEY_)
order by ACT_RE_CASE_DEF.KEY_, hour_date;
```

Oracle:
```sql
select hour_date, to_char(hour_date, 'yyyy-mm-dd') as dateString, to_char(hour_date, 'hh24') as hourString, ACT_RE_PROCDEF.KEY_ , count(*) as processInstanceCount
FROM (select  sysdate - rownum/24 as hour_date  from all_objects WHERE rownum < 169)
     join act_hi_procinst on (start_time_ <= hour_date and (end_time_ is null OR end_time_ > hour_date))
     join ACT_RE_PROCDEF on act_hi_procinst.PROC_DEF_ID_  = ACT_RE_PROCDEF.ID_
group by (hour_date, ACT_RE_PROCDEF.KEY_  )
order by ACT_RE_PROCDEF.KEY_, hour_date;
```

# Additional metrics to monitor

- CPU utilization
- Memory usage
- Swap file size
- Database response time
- Database size
- Utilization/size of Job Executor thread pool (Application Server)

[1]: instancesOverTime.png


text:
title: Static Website Manager
repo:
date: 2015-12-07T22:10:00.000+00:00
posted_date: 2015-12-07T22:10:00.000+00:00
featured: false
tools:
- "Content Management"
data_model: Git-based
tags: []
urls:
  website: https://www.staticwebsitemanager.com/
draft: true
---
Static Website Manager is a web-based CMS for your Jekyll website or blog. We offer a collaborative git-based platform, a standardized content management system with live website previews, external deployments to your favorite hosting prodivers, and form responders to animate your static website!


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

namespace Azure.AI.Language.Conversations.Models
{
    public partial class DeepstackPrediction
    {
        internal static DeepstackPrediction DeserializeDeepstackPrediction(JsonElement element)
        {
            IReadOnlyList<DeepstackIntent> intents = default;
            IReadOnlyList<DeepstackEntity> entities = default;
            ProjectKind projectType = default;
            Optional<string> topIntent = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("intents"))
                {
                    List<DeepstackIntent> array = new List<DeepstackIntent>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DeepstackIntent.DeserializeDeepstackIntent(item));
                    }
                    intents = array;
                    continue;
                }
                if (property.NameEquals("entities"))
                {
                    List<DeepstackEntity> array = new List<DeepstackEntity>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DeepstackEntity.DeserializeDeepstackEntity(item));
                    }
                    entities = array;
                    continue;
                }
                if (property.NameEquals("projectType"))
                {
                    projectType = new ProjectKind(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("topIntent"))
                {
                    topIntent = property.Value.GetString();
                    continue;
                }
            }
            return new DeepstackPrediction(projectType, topIntent.Value, intents, entities);
        }
    }
}


text:
class LoginsController < ApplicationController
  layout 'no_header'
  skip_filter :require_login

  def show
    redirect_to root_path if current_user
  end
end


text:
import Vue from "vue"
import Vuex from "vuex"

import posts from "./posts"

Vue.use(Vuex)

export const state = {
  count: 0
}

export const mutations = {
  increment(state) {
    state.count++
  }
}

const store = new Vuex.Store({
  state,
  mutations,
  modules: {
    posts
  }
})

export default store