text:
{%  extends "layout.html" %}

{%  block title %}Convert miles to kilometers{%  endblock %}

{%  block content %}

Enter any number of miles and click "Submit" to convert number to kilometers.

		<form action="/mtokm_result">Miles:

			<input type="text" name="miles" value="20">
			<input type="submit" name="Submit">
		</form>

{%  endblock %}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
  ~ Copyright 2010-2013 Ning, Inc.
  ~
  ~ Ning licenses this file to you under the Apache License, version 2.0
  ~ (the "License"); you may not use this file except in compliance with the
  ~ License.  You may obtain a copy of the License at:
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
  ~ License for the specific language governing permissions and limitations
  ~ under the License.
  -->

<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">

    <effectiveDate>2016-01-01T00:00:00+00:00</effectiveDate>
    <catalogName>Issue481</catalogName>

    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>

    <currencies>
        <currency>USD</currency>
    </currencies>

    <products>
        <product name="Something">
            <category>BASE</category>
        </product>
    </products>

    <rules>
        <changePolicy>
            <changePolicyCase>
                <phaseType>TRIAL</phaseType>
                <policy>IMMEDIATE</policy>
            </changePolicyCase>
            <changePolicy>
                <changePolicyCase>
                    <policy>IMMEDIATE</policy>
                </changePolicyCase>
            </changePolicy>
        </changePolicy>
        <changeAlignment>
            <changeAlignmentCase>
                <alignment>START_OF_SUBSCRIPTION</alignment>
            </changeAlignmentCase>
        </changeAlignment>
        <cancelPolicy>
            <cancelPolicyCase>
                <policy>IMMEDIATE</policy>
            </cancelPolicyCase>
        </cancelPolicy>
        <createAlignment>
            <createAlignmentCase>
                <alignment>START_OF_BUNDLE</alignment>
            </createAlignmentCase>
        </createAlignment>
    </rules>

    <plans>
        <plan name="something-monthly">
            <product>Something</product>
            <finalPhase type="EVERGREEN">
                <duration>
                    <unit>UNLIMITED</unit>
                </duration>
                <recurring>
                    <billingPeriod>MONTHLY</billingPeriod>
                    <recurringPrice>
                        <price>
                            <currency>USD</currency>
                            <value>10</value>
                        </price>
                    </recurringPrice>
                </recurring>
            </finalPhase>
        </plan>
    </plans>
    <priceLists>
        <defaultPriceList name="DEFAULT">
            <plans>
                <plan>something-monthly</plan>
            </plans>
        </defaultPriceList>
    </priceLists>
</catalog>


text:
using Newtonsoft.Json.Linq;

namespace TestRail.Types
{
    /// Stores information about a status.
    public class Status : BaseTestRailType
    {
        #region Public Properties
        /// ID of the status.
        public ulong Id { get; private set; }

        /// Name of the status.
        public string Name { get; private set; }

        /// Display name of the current status.
        public string Label { get; private set; }

        /// The 'dark' color being used for the current status.
        public ulong ColorDark { get; private set; }

        /// The 'medium' color being used for the current status.
        public ulong ColorMedium { get; private set; }

        /// The 'bright' color being used for the current status.
        public ulong ColorBright { get; private set; }

        /// Whether or not the current instance is a system status.
        public bool IsSystem { get; private set; }

        /// Whether or not the current instance is untested.
        public bool IsUntested { get; private set; }

        /// Whether or not the current instance is finalized.
        public bool IsFinal { get; private set; }
        #endregion Public Properties

        #region Public Methods
        /// <inheritdoc />
        public override string ToString()
        {
            return Name;
        }

        /// Parses JSON into a Status object.
        /// <param name="json">JSON to parse.</param>
        /// <returns>Status object corresponding to the JSON.</returns>
        public static Status Parse(JObject json)
        {
            var status = new Status
            {
                JsonFromResponse = json,
                Id = (ulong)json["id"],
                Name = (string)json["name"],
                Label = (string)json["label"],
                ColorDark = (ulong)json["color_dark"],
                ColorMedium = (ulong)json["color_medium"],
                ColorBright = (ulong)json["color_bright"],
                IsSystem = (bool)json["is_system"],
                IsUntested = (bool)json["is_untested"],
                IsFinal = (bool)json["is_final"]
            };

            return status;
        }
        #endregion Public Methods
    }
}


text:
class AddActiveToTaskAlerts < ActiveRecord::Migration
  def change
    add_column :task_alerts, :active, :boolean

  end
end


text:
            <canvas id="myCanvas" width="256" height="192" ng-style="borderStyle"></canvas>

            <button type="button" class='btn btn-sm btn-primary' ng-click="stepCode()">Step</button>
            <button type="button" class='btn btn-sm btn-primary' ng-click="run()" ng-show='!running'>Start</button>
            <button type="button" class='btn btn-sm btn-primary' ng-click="stop()" ng-show='running'>Stop</button>
            <button type="button" class='btn btn-sm btn-primary' ng-click="reset()">Reset</button>

{{ d.address |toHex}}	{{ d.opcode }}

            Registers:

                     PC
                     SP
                     A
                     B
                     C
                     D
                     E
                     H
                     L
                     IX
                     IY
                     I

                    {{ registers.PC |toHex }}
                    {{ registers.SP |toHex }}
                    {{ registers.A |toHex }}
                    {{ registers.B |toHex }}
                    {{ registers.C |toHex }}
                    {{ registers.D |toHex }}
                    {{ registers.E |toHex }}
                    {{ registers.H |toHex }}
                    {{ registers.L |toHex }}
                    {{ registers.IX |toHex }}
                    {{ registers.IY |toHex }}
                    {{ registers.I |toHex }}

                    {{ registers.A_ |toHex }}
                    {{ registers.B_ |toHex }}
                    {{ registers.C_ |toHex }}
                    {{ registers.D_ |toHex }}
                    {{ registers.E_ |toHex }}
                    {{ registers.H_ |toHex }}
                    {{ registers.L_ |toHex }}

Flags:

                     S
                     Z
                     H
                     PV
                     N
                     C

                    {{ registers.F |isSet:128 }}
                    {{ registers.F |isSet:64 }}
                    {{ registers.F |isSet:32 }}
                    {{ registers.F |isSet:8 }}
                    {{ registers.F |isSet:2 }}
                    {{ registers.F |isSet:1 }}

T States: {{ t_states | toHex }}

            Interrupts:

Enabled	Mode

{{ registers.int_enabled}}	{{ registers.int_mode}}

Instruction:

Prev	{{ report}}

Next	{{ next}}

Breakpoint<input name='breakpoint' class='form-input input-sm' ng-model="breakpoint"/>

            <button type="button" class='btn btn-sm btn-primary' ng-click="monitor()" ng-diabled='running || !breakpoint'>Run to</button>

Watch<input name='watch' class='form-control input-sm' ng-model="watch_mem"/>

            Select rom
            <select style='padding:0px' name='select-rom' class='form-control input-sm' ng-model='selected_rom' ng-options='rom.value as rom.name for rom in roms'></select>
            <button type="button" class='btn btn-sm btn-primary' ng-disabled='!selected_rom || running' ng-click="load()" >Load</button>

Memory<input name='memory' class='form-input input-sm' ng-model="mem_start"/>

<button style='display:none;' type="button" class='btn btn-sm btn-primary' ng-click="playSound()">Play Sound</button>

<button type="button" class='btn btn-sm btn-primary' ng-click="disassemble()">Disassemble</button>

Disassembly:

{{ d.address}} : {{ d.opcode}}


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

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <groupId>com.github.ladutsko</groupId>
  <artifactId>isbn-core</artifactId>
  <version>1.1.0</version>

  <packaging>bundle</packaging>

  <name>ISBN core</name>
  <url>https://github.com/ladutsko/isbn-core</url>
  <description>ISBN core tools</description>

  <issueManagement>
    <url>https://github.com/ladutsko/isbn-core/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://github.com/ladutsko/isbn-core/blob/master/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <url>git@github.com:ladutsko/isbn-core.git</url>
    <connection>scm:git:git@github.com:ladutsko/isbn-core.git</connection>
    <developerConnection>scm:git:git@github.com:ladutsko/isbn-core.git</developerConnection>
  </scm>

  <developers>
    <developer>
      <email>ladutsko@gmail.com</email>
      <name>George Ladutsko</name>
      <url>https://github.com/ladutsko</url>
      <id>ladutsko</id>
    </developer>
  </developers>

  <properties>
    <maven.compiler.source>1.5</maven.compiler.source>
    <maven.compiler.target>1.5</maven.compiler.target>
  </properties>

  <build>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
      </resource>

      <resource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <version>0.8.3</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <schemaLanguage>dtd</schemaLanguage>
              <schemaDirectory>${basedir}/src/main/schemas</schemaDirectory>
              <schemaIncludes>
                <value>RangeMessage.dtd</value>
              </schemaIncludes>
              <generatePackage>org.isbn.prefix.ranges.model</generatePackage>
              <episode>false</episode>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.7</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>{local-packages};version=${project.version};-noimport:=true</Export-Package>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>


text:
package org.apache.sling.distribution.common;

/**
 * Generic checked exception for distribution
 */
@SuppressWarnings("serial")
public class DistributionException extends Exception {

    public DistributionException(Throwable e) {
        super(e);
    }

    public DistributionException(String string) {
        super(string);
    }

    public DistributionException(String string, Throwable cause) {
        super(string, cause);
    }
}


text:
@interface CTWakeupFacade : BaseChetuFacade

@end


text:
module Interface
  module Error
    # Raised when a method has not been implemented by a class that
    # has used the implements <InterfaceName> method.
    class NotImplementedError < NoMethodError
      def initialize(class_name:, method_name:, method_arity:, interface_name:)
        super(error_message(class_name, method_name, method_arity, interface_name), method_name)
      end

      private

      def error_message(class_name, method_name, method_arity, interface_name)
        arity = method_arity ? "/#{method_arity}" : ""

        "Expected #{class_name} to implement #{method_name}#{arity} for interface #{interface_name}"
      end
    end
  end
end


text:
"""

m2wsgi.io.gevent:  gevent-based I/O module for m2wsgi
=====================================================

This module provides subclasses of m2wsgi.WSGIHandler and related classes
that are specifically tuned for running under gevent.  You can import
and use the classes directory from here, or you can select this module
when launching m2wsgi from the command-line::

    m2wsgi --io=gevent dotted.app.name tcp://127.0.0.1:9999

You will need the gevent_zeromq package from here:

    https://github.com/traviscline/gevent-zeromq

"""
#  Copyright (c) 2011, Ryan Kelly.
#  All rights reserved; available under the terms of the MIT License.

from __future__ import absolute_import
from m2wsgi.util import fix_absolute_import
fix_absolute_import(__file__)

from m2wsgi.io import base

import gevent
import gevent.monkey
import gevent.event
import gevent.core
import gevent.hub

import gevent_zeromq
from gevent_zeromq import zmq

import zmq.core.poll as zmq_poll

if hasattr(zmq, '_Context'):
    ZContext = zmq._Context
else:
    ZContext = zmq.Context

if hasattr(zmq, '_Socket'):
    ZSocket = zmq._Socket
else:
    ZSocket = zmq.Socket

def monkey_patch():
    """Hook to monkey-patch the interpreter for this IO module.

    This calls the standard gevent monkey-patching routines.  Don't worry,
    it's not called by default unless you're running from the command line.
    """
    gevent.monkey.patch_all()
    gevent_zeromq.monkey_patch()
    #  Patch signal module for gevent compatability.
    #  Courtesy of http://code.google.com/p/gevent/issues/detail?id=49
    import signal
    _orig_signal = signal.signal
    def gevent_signal_wrapper(signum,*args,**kwds):
        handler = signal.getsignal(signum)
        if callable(handler):
            handler(signum,None)
    def gevent_signal(signum,handler):
        _orig_signal(signum,handler)
        return gevent.hub.signal(signum,gevent_signal_wrapper,signum)
    signal.signal = gevent_signal

#  The BaseConnection recv logic is based on polling, but I can't get
#  gevent polling on multiple sockets to work correctly.
#  Instead, we simulate polling on each socket individually by reading an item
#  and keeping it in a local buffer.
#
#  Ideally I would juse use the _wait_read() method on gevent-zmq sockets,
#  but this seems to cause hangs for me.  Still investigating.

class _Context(ZContext):
    def socket(self,socket_type):
        if self.closed:
            raise zmq.ZMQError(zmq.ENOTSUP)
        return _Socket(self,socket_type)
    def term(self):
        #  This seems to be needed to let other greenthreads shut down.
        #  Omit it, and the SIGHUP handler gets  "bad file descriptor" errors.
        gevent.sleep(0.1)
        return super(_Context,self).term()

class _Socket(ZSocket):
    def __init__(self,*args,**kwds):
        self._polled_recv = None
        super(_Socket,self).__init__(*args,**kwds)
    #  This blockingly-reads a message from the socket, but stores
    #  it in a buffer rather than returning it.
    def _recv_poll(self,flags=0,copy=True,track=False):
        if self._polled_recv is None:
            self._polled_recv = super(_Socket,self).recv(flags,copy,track)
    #  This uses the buffered result if available, or polls otherwise.
    def recv(self,flags=0,copy=True,track=False):
        v = self._polled_recv
        while v is None:
            self._recv_poll(flags,copy=copy,track=track)
            v = self._polled_recv
        self._polled_recv = None
        return v

zmq.Context = _Context
zmq.Socket = _Socket

class Client(base.Client):
    __doc__ = base.Client.__doc__

class Request(base.Client):
    __doc__ = base.Client.__doc__

class ConnectionBase(base.ConnectionBase):
    __doc__ = base.ConnectionBase.__doc__ + """
    This ConnectionBase subclass is designed for use with gevent.  It uses
    the monkey-patched zmq module from gevent and spawns a number of green
    threads to manage non-blocking IO and interrupts.
    """
    ZMQ_CTX = zmq.Context()

    #  A blocking zmq.core.poll doesn't play nice with gevent.
    #  Instead we read from each socket in a separate greenthread, and keep
    #  the results in a local buffer so they don't get lost.  An interrupt
    #  then just kills all the currently-running threads.
    def __init__(self):
        super(ConnectionBase,self).__init__()
        self.poll_threads = []

    def _poll(self,sockets,timeout=None):
        #  If there's anything available non-blockingly, just use it.
        (ready,_,error) = zmq_poll.select(sockets,[],sockets,timeout=0)
        if ready:
            return ready
        if error:
            return []
        if timeout == 0:
            return []
        #  Spawn a greenthread to poll-recv from each socket.
        ready = []
        threads = []
        res = gevent.event.Event()
        for sock in sockets:
            threads.append(gevent.spawn(self._do_poll,sock,ready,res,timeout))
        self.poll_threads.append((res,threads))
        #  Wait for one of them to return, or for an interrupt.
        try:
            res.wait()
        finally:
            gevent.killall(threads)
            gevent.joinall(threads)
        return ready

    def _do_poll(self,sock,ready,res,timeout):
        if timeout is None:
            sock._recv_poll()
        else:
            with gevent.Timeout(timeout,False):
                sock._recv_poll()
        ready.append(sock)
        if not res.is_set():
            res.set()

    def _interrupt(self):
        for (res,threads) in self.poll_threads:
            gevent.killall(threads)
            if not res.is_set():
                res.set()

class Connection(base.Connection,ConnectionBase):
    __doc__ = base.Connection.__doc__ + """
    This Connection subclass is designed for use with gevent.  It uses the
    monkey-patched zmq module from gevent and spawns a number of green
    threads to manage non-blocking IO and interrupts.
    """

class DispatcherConnection(base.DispatcherConnection,ConnectionBase):
    __doc__ = base.DispatcherConnection.__doc__ + """
    This DispatcherConnection subclass is designed for use with gevent.  It
    uses the monkey-patched zmq module from gevent and spawns a number of
    green threads to manage non-blocking IO and interrupts.
    """

class StreamingUploadFile(base.StreamingUploadFile):
    __doc__ = base.StreamingUploadFile.__doc__ + """
    This StreamingUploadFile subclass is designed for use with gevent.  It
    uses uses gevent.sleep() instead of time.sleep().
    """
    def _wait_for_data(self):
        curpos = self.fileobj.tell()
        cursize = os.fstat(self.fileobj.fileno()).st_size
        while curpos >= cursize:
            gevent.sleep(0.01)
            cursize = os.fstat(self.fileobj.fileno()).st_size

class Handler(base.Handler):
    __doc__ = base.Handler.__doc__ + """
    This Handler subclass is designed for use with gevent.  It spawns a
    a new green thread to handle each incoming request.
    """

    ConnectionClass = Connection

    def __init__(self,*args,**kwds):
        super(Handler,self).__init__(*args,**kwds)
        #  We need to count the number of inflight requests, so the
        #  main thread can wait for them to complete when shutting down.
        self._num_inflight_requests = 0
        self._all_requests_complete = gevent.event.Event()

    def handle_request(self,req):
        self._num_inflight_requests += 1
        if self._num_inflight_requests >= 1:
            self._all_requests_complete.clear()
        @gevent.spawn
        def do_handle_request():
            try:
                self.process_request(req)
            finally:
                self._num_inflight_requests -= 1
                if self._num_inflight_requests == 0:
                    self._all_requests_complete.set()

    def wait_for_completion(self):
        if self._num_inflight_requests > 0:
            self._all_requests_complete.wait()

class WSGIResponder(base.WSGIResponder):
    __doc__ = base.WSGIResponder.__doc__

class WSGIHandler(base.WSGIHandler,Handler):
    __doc__ = base.WSGIHandler.__doc__ + """
    This WSGIHandler subclass is designed for use with gevent.  It spawns a
    a new green thread to handle each incoming request.
    """
    ResponderClass = WSGIResponder
    StreamingUploadClass = StreamingUploadFile


text:
import time
import logging
import django
from scripts import utils as script_utils
from django.db import transaction

from framework.celery_tasks import app as celery_app

from website.app import init_app
from website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers

django.setup()
logger = logging.getLogger(__name__)

def add_identifiers_to_preprints(dry_run=True):
    from osf.models import PreprintService

    preprints_without_identifiers = PreprintService.objects.filter(identifiers__isnull=True)
    logger.info('About to add identifiers to {} preprints.'.format(preprints_without_identifiers.count()))
    identifiers_added = 0

    for preprint in preprints_without_identifiers:
        logger.info('Saving identifier for preprint {} from source {}'.format(preprint._id, preprint.provider.name))

        if not dry_run:
            ezid_response = request_identifiers_from_ezid(preprint)
            id_dict = parse_identifiers(ezid_response)
            preprint.set_identifier_values(doi=id_dict['doi'])
            preprint.save()

            doi = preprint.get_identifier('doi')
            assert preprint._id.upper() in doi.value
            identifiers_added += 1

            logger.info('Created DOI {} for Preprint with guid {} from service {}'.format(doi.value, preprint._id, preprint.provider.name))
            time.sleep(1)
        else:
            logger.info('Dry run - would have created identifier for preprint {} from service {}'.format(preprint._id, preprint.provider.name))

    logger.info('Finished Adding identifiers to {} preprints.'.format(identifiers_added))

def main(dry_run=True):
    add_identifiers_to_preprints(dry_run)
    if dry_run:
        # When running in dry_run mode force the transaction to rollback
        raise Exception('Dry Run complete -- not actually saved')

@celery_app.task(name='scripts.add_missing_identifiers_to_preprints')
def run_main(dry_run=True):
    init_app(routes=False)
    if not dry_run:
        # If we're not running in dry mode log everything to a file
        script_utils.add_file_logger(logger, __file__)

    # Finally run the migration
    with transaction.atomic():
        main(dry_run=dry_run)


text:
## TOSCA Service Template

A TOSCA Service Template (YAML) document contains element definitions of building blocks for cloud application,
or complete models of cloud applications.

From [TOSCA Simple Profile in YAML Version 1.0](http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/csprd02/TOSCA-Simple-Profile-YAML-v1.0-csprd02.html):
>A Service Template is typically used to specify the "topology" (or structure) and "orchestration" (or invocation of management behavior) of IT services so that they can be provisioned and managed in accordance with constraints and policies.

>Specifically, TOSCA Service Templates optionally allow definitions of a TOSCA Topology Template, TOSCA types (e.g., Node, Relationship, Capability, Artifact, etc.), groupings, policies and constraints along with any input or output declarations.

In Toscana, Service Template is represented by **ToscaServiceTemplate** class.

Toscana allows parsing YAML from an external file or from a stream.

### Loading TOSCA Service Template from a file

**Make sure to include the required usings**
```C#
using System.IO;
using Toscana;
```

**Parse TOSCA Service Template from a YAML file**
```C#
ToscaServiceTemplate serviceTemplate = ToscaServiceTemplate.Parse("tosca.yaml");
```

### Loading TOSCA Service Template from stream
**Make sure to include the required usings**
```C#
using Toscana;
```

**Parse TOSCA Service Template from a stream**
```C#
ToscaServiceTemplate serviceTemplate = ToscaServiceTemplate.Parse(stream);
```


text:
require 'digest'

module Gitlab
  module SidekiqMiddleware
    module DuplicateJobs
      # This class defines an identifier of a job in a queue
      # The identifier based on a job's class and arguments.
      #
      # As strategy decides when to keep track of the job in redis and when to
      # remove it.
      #
      # Storing the deduplication key in redis can be done by calling `check!`
      # check returns the `jid` of the job if it was scheduled, or the `jid` of
      # the duplicate job if it was already scheduled
      #
      # When new jobs can be scheduled again, the strategy calls `#delete`.
      class DuplicateJob
        DUPLICATE_KEY_TTL = 6.hours
        DEFAULT_STRATEGY = :until_executing

        attr_reader :existing_jid

        def initialize(job, queue_name)
          @job = job
          @queue_name = queue_name
        end

        # This will continue the middleware chain if the job should be scheduled
        # It will return false if the job needs to be cancelled
        def schedule(&block)
          Strategies.for(strategy).new(self).schedule(job, &block)
        end

        # This will continue the server middleware chain if the job should be
        # executed.
        # It will return false if the job should not be executed.
        def perform(&block)
          Strategies.for(strategy).new(self).perform(job, &block)
        end

        # This method will return the jid that was set in redis
        def check!(expiry = DUPLICATE_KEY_TTL)
          read_jid = nil

          Sidekiq.redis do |redis|
            redis.multi do |multi|
              redis.set(idempotency_key, jid, ex: expiry, nx: true)
              read_jid = redis.get(idempotency_key)
            end
          end

          self.existing_jid = read_jid.value
        end

        def delete!
          Sidekiq.redis do |redis|
            redis.del(idempotency_key)
          end
        end

        def scheduled?
          scheduled_at.present?
        end

        def duplicate?
          raise "Call `#check!` first to check for existing duplicates" unless existing_jid

          jid != existing_jid
        end

        def droppable?
          idempotent? && ::Feature.disabled?("disable_#{queue_name}_deduplication")
        end

        def scheduled_at
          job['at']
        end

        def options
          return {} unless worker_klass
          return {} unless worker_klass.respond_to?(:get_deduplication_options)

          worker_klass.get_deduplication_options
        end

        private

        attr_reader :queue_name, :job
        attr_writer :existing_jid

        def worker_klass
          @worker_klass ||= worker_class_name.to_s.safe_constantize
        end

        def strategy
          return DEFAULT_STRATEGY unless worker_klass
          return DEFAULT_STRATEGY unless worker_klass.respond_to?(:idempotent?)

          worker_klass.get_deduplicate_strategy
        end

        def worker_class_name
          job['class']
        end

        def arguments
          job['args']
        end

        def jid
          job['jid']
        end

        def idempotency_key
          @idempotency_key ||= "#{namespace}:#{idempotency_hash}"
        end

        def idempotency_hash
          Digest::SHA256.hexdigest(idempotency_string)
        end

        def namespace
          "#{Gitlab::Redis::Queues::SIDEKIQ_NAMESPACE}:duplicate:#{queue_name}"
        end

        def idempotency_string
          "#{worker_class_name}:#{arguments.join('-')}"
        end

        def idempotent?
          return false unless worker_klass
          return false unless worker_klass.respond_to?(:idempotent?)

          worker_klass.idempotent?
        end
      end
    end
  end
end


text:
(function(app) {
	/**
	 * @constructor
	 * @description
	 * This class provides the code for displaying snippets of code into a user friendly manner.
	 */
	function CodePanel() {
		this.restrict = "E";
		this.transclude = true;
		this.templateUrl = "/_System/apps/bc-api-discovery/templates/directives/code_panel.html";
		this.scope = {
			"snippet": "&",
			"resourceDescriptor": "&",
			"highlighter": "&"
		};
	};

	/**
	 * @public
	 * @instance
	 * @method
	 * @description
	 * This method is used to transform the code panel dom element into an active angularjs directive.
	 */
	CodePanel.prototype.link = function(scope, element, attrs) {
		scope.snippetFriendly = scope.snippet;

		scope.highlight = function(snippet, identifiers) {
			return scope.highlighter().highlight(snippet, identifiers);
		};

		scope.$parent.$watch(attrs.snippet, function(value) {
			var resourceDescriptor = scope.resourceDescriptor();

			scope.snippetFriendly = scope.highlight(value, resourceDescriptor);
		});
	};

	app.directive("apiCodePanel", function() {
		return new CodePanel();
	});
})(DiscoveryApp);


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--

 Copyright 2003 - 2014 The eFaps Team

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 Author:          The eFaps Team
 Revision:        $Rev$
 Last Changed:    $Date$
 Last Changed By: $Author$

-->
<ui-command xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">

    <uuid>cd084445-153b-4be8-b7de-132931da7a05</uuid>
    <file-application>eFapsApp-Sales</file-application>
    <file-revision>$Rev$</file-revision>

    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>Sales_QuoteRequestTree_Menu_Action_Edit</name>
        <access>
            <role>Sales_Salesman</role>
            <role>Sales_Admin</role>
        </access>
        <target>
            <form>Sales_QuoteRequestForm</form>
            <execute program="org.efaps.esjp.sales.document.QuoteRequest" method="edit">
                <property name="PositionType">Sales_QuoteRequestPosition</property>
            </execute>
            <trigger event="UI_ACCESSCHECK" method="check4Status"
                name="Sales_QuoteRequestTree_Menu_Action_Edit.UI_ACCESSCHECK"
                program="org.efaps.esjp.admin.access.AccessCheck4UI">
                <property name="Status">Draft</property>
            </trigger>
        </target>
        <property name="Target">modal</property>
        <property name="TargetMode">edit</property>
        <property name="WindowHeight">600</property>
        <property name="WindowWidth">900</property>
    </definition>
</ui-command>


text:
// Copyright 2011 Google Inc. All Rights Reserved.
package com.google.appengine.tools.mapreduce;

import java.io.IOException;
import java.io.Serializable;
import java.util.NoSuchElementException;

/**
 * Reads data from an input source.
 *
 *
Created by {@link Input} to read input for a given shard.  Reads input for
 * a shard as a number of slices, where the slicing is up to the caller.
 *
 *
Each slice is read by calling {@link #beginSlice}, then {@link #next}
 * and/or {@link #getProgress} any number of times in any order, then
 * {@link #endSlice}.  Between two slices, before the first slice, or after the
 * final slice, the {@code InputReader} may go through serialization and
 * deserialization.
 *
 *
If a slice is aborted, there is no guarantee whether {@link #endSlice}
 * will be called; however, if it is not called, the {@code InputReader} will
 * not be serialized.  If the slice is retried later, the {@code InputReader}
 * serialized after the previous slice will be deserialized again.
 *
 *
This class is really an interface that might be evolving. In order to avoid breaking
 * users when we change the interface, we made it an abstract class.
 *
 *
 * @param  type of values produced by this input
 */
public abstract class InputReader implements Serializable {
  private static final long serialVersionUID = 680562312715017093L;

  /**
   * Returns the next input value, or throws {@link NoSuchElementException}
   * when there is no more input data. This is done rather than providing a
   * hasNext() function, to allow the implementation to deal with streams and
   * remain serializable, even if the item being read is not.
   */
  public abstract I next() throws IOException, NoSuchElementException;

  /**
   * Returns the relative progress reading this input as a number from 0 to 1.
   * Returns null if relative progress cannot be determined.
   */
  public abstract Double getProgress();

  /**
   * Prepares the {@code InputReader} for reading, after possibly having gone
   * through serialization and deserialization.
   */
  public void beginSlice() throws IOException {}

  /**
   * Prepares the {@code InputReader} for serialization.
   */
  public void endSlice() throws IOException {}

}


text:
typedef struct node // structure: Node
{
	short *data; // integer data
	struct node *left, *right; // the pointer of Node: left, right
}Node;

typedef Node *NodePtr;

extern short del( NodePtr *start, NodePtr *current ); // delete function of double linked list
extern void add( NodePtr *start, NodePtr *current, short input ); // add function of double linked list

#endif


text: Rails.application.config.session_store :cookie_store, key: '_jcfausto_com_session'


text:
import { Component, OnInit, HostBinding } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';

import { ProjectService } from "../projects/project.service";
import { Project } from "../projects/project";

@Component({
  selector: 'app-project-detail',
  templateUrl: './project-detail.component.html',
  styleUrls: ['./project-detail.component.css']
})
export class ProjectDetailComponent implements OnInit {

project: Project;

  constructor(private service:ProjectService,
              private route:ActivatedRoute) {  }

   ngOnInit() {
    this.route.params
      // (+) converts string 'id' to a number
      .switchMap((params: Params) => this.service.getProject(params['id']))
      .subscribe((project: Project) => this.project = project);
  }
}


text:
        <title>Buy Attachments Tutorial</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="css/tutorial-style.css">

Click on items to your left to buy them

            <input type="button" class="blueButton gotIt" onclick="gotIt()" value="GOT IT" />


text:
import DateTitle from './mixins/date-title'
import DateHeader from './mixins/date-header'
import DateTable from './mixins/date-table'
import DateYears from './mixins/date-years'
import Picker from '~mixins/picker'
import { createRange } from '~util/helpers'

const defaultDateFormat = val => new Date(val).toISOString().substr(0, 10)

export default {
  name: 'v-date-picker',

  mixins: [DateTitle, DateHeader, DateTable, DateYears, Picker],

  data () {
    return {
      tableDate: new Date(),
      originalDate: this.value,
      currentDay: null,
      currentMonth: null,
      currentYear: null,
      isSelected: false,
      isReversing: false,
      narrowDays: []
    }
  },

  props: {
    locale: {
      type: String,
      default: 'en-us'
    },
    dateFormat: {
      type: Function,
      default: defaultDateFormat
    },
    titleDateFormat: {
      type: Object,
      default: () => ({ weekday: 'short', month: 'short', day: 'numeric' })
    },
    headerDateFormat: {
      type: Object,
      default: () => ({ month: 'long', year: 'numeric' })
    },
    formattedValue: {
      required: false
    },
    allowedDates: {
      type: [Array, Object, Function],
      default: () => (null)
    },
    firstDayOfWeek: {
      type: [String, Number],
      default: 0
    },
    yearIcon: String
  },

  computed: {
    firstAllowedDate () {
      const date = new Date()
      date.setHours(12, 0, 0, 0)

      if (this.allowedDates) {
        const millisecondOffset = 1 * 24 * 60 * 60 * 1000
        const valid = new Date(date)
        for (let i = 0; i < 31; i++) {
          if (this.isAllowed(valid)) return valid

          valid.setTime(valid.getTime() + millisecondOffset)
        }
      }

      return date
    },
    inputDate: {
      get () {
        if (!this.value) return this.firstAllowedDate
        if (this.value instanceof Date) return this.value
        if (!isNaN(this.value) ||
            typeof this.value === 'string' && this.value.indexOf(':') !== -1
        ) return new Date(this.value)

        return new Date(`${this.value}T12:00:00`)
      },
      set (val) {
        this.$emit('input', val ? defaultDateFormat(val) : this.originalDate)
        this.$emit('update:formattedValue', val ? this.dateFormat(val) : this.dateFormat(this.originalDate))
      }
    },
    day () {
      return this.inputDate.getDate()
    },
    month () {
      return this.inputDate.getMonth()
    },
    year () {
      return this.inputDate.getFullYear()
    },
    tableMonth () {
      return this.tableDate.getMonth()
    },
    tableYear () {
      return this.tableDate.getFullYear()
    },
    computedTransition () {
      return this.isReversing ? 'v-tab-reverse-transition' : 'v-tab-transition'
    }
  },

  watch: {
    isSelected (val) {
      val && this.$nextTick(() => {
        this.$refs.years.scrollTop = this.$refs.years.scrollHeight / 2 - 125
      })
    },
    tableDate (val, prev) {
      this.isReversing = val < prev
    },
    value (val) {
      if (val) this.tableDate = this.inputDate
    }
  },

  methods: {
    save () {
      if (this.originalDate) {
        this.originalDate = this.value
      } else {
        this.originalDate = this.inputDate
      }

      if (this.$parent && this.$parent.isActive) this.$parent.isActive = false
    },
    cancel () {
      this.inputDate = this.originalDate
      if (this.$parent && this.$parent.isActive) this.$parent.isActive = false
    },
    isAllowed (date) {
      if (!this.allowedDates) return true

      if (Array.isArray(this.allowedDates)) {
        return !!this.allowedDates.find(allowedDate => {
          const d = new Date(allowedDate)
          d.setHours(12, 0, 0, 0)

          return d - date === 0
        })
      } else if (this.allowedDates instanceof Function) {
        return this.allowedDates(date)
      } else if (this.allowedDates instanceof Object) {
        const min = new Date(this.allowedDates.min)
        min.setHours(12, 0, 0, 0)
        const max = new Date(this.allowedDates.max)
        max.setHours(12, 0, 0, 0)

        return date >= min && date <= max
      }

      return true
    }
  },

  created () {
    const date = new Date()
    date.setDate(date.getDate() - date.getDay() + parseInt(this.firstDayOfWeek))

    createRange(7).forEach(() => {
      const narrow = date.toLocaleString(this.locale, { weekday: 'narrow' })
      this.narrowDays.push(narrow)

      date.setDate(date.getDate() + 1)
    })
  },

  mounted () {
    this.currentDay = this.tableDate.getDate()
    this.currentMonth = this.tableDate.getMonth()
    this.currentYear = this.tableDate.getFullYear()
    this.tableDate = this.inputDate
  },

  render (h) {
    const children = []

    !this.noTitle && children.push(this.genTitle())

    if (!this.isSelected) {
      const bodyChildren = []

      bodyChildren.push(this.genHeader())
      bodyChildren.push(this.genTable())

      children.push(h('div', {
        'class': 'picker__body'
      }, bodyChildren))
    } else {
      children.push(this.genYears())
    }

    this.$scopedSlots.default && children.push(this.genSlot())

    return h('v-card', {
      'class': {
        'picker picker--date': true,
        'picker--landscape': this.landscape,
        'picker--dark': this.dark,
        'picker--light': this.light && !this.dark
      }
    }, children)
  }
}


text:
crits.core.management package
=============================

Subpackages
-----------

.. toctree::

    crits.core.management.commands

Module contents
---------------

.. automodule:: crits.core.management
    :members:
    :undoc-members:
    :show-inheritance:


text:
Requests

        Posted on

        by

        Deleted User

    No Requests yet, why don't you create one?


text:
rake "spree_core:install spree_auth:install spree_sample:install"
run "rails g spree_drop_shipping:install"


text:
{% import "lib/paramList.html" as params -%}

{%- macro renderHeritage(exportDoc) -%}
  {%- if exportDoc.extendsClauses.length %} extends {% for clause in exportDoc.extendsClauses -%}
  {$ clause $}{% if not loop.last %}, {% endif -%}
  {% endfor %}{% endif %}
  {%- if exportDoc.implementsClauses.length %} implements {% for clause in exportDoc.implementsClauses -%}
  {$ clause $}{% if not loop.last %}, {% endif -%}
  {% endfor %}{% endif %}
{%- endmacro -%}

{%- macro renderMember(member, truncateLines) -%}
    {%- if member.accessibility !== 'public' %}{$ member.accessibility $} {% endif -%}
    {%- if member.isGetAccessor %}get {% endif -%}
    {%- if member.isSetAccessor %}set {% endif -%}
    {%- if member.isStatic  %}static {% endif -%}
    {$ member.name $}{$ member.typeParameters | escape $}{$ params.paramList(member.parameters, truncateLines) | trim $}
    {%- if member.isOptional  %}?{% endif -%}
    {$ params.returnType(member.type) | trim | truncateCode(truncateLines) $}
{%- endmacro -%}

{%- macro renderMemberDetail(member, cssClass) -%}

  {$ renderMember(member) $}
  {%- if not member.notYetDocumented %}
  {$ member.description | marked $}
  {% endif -%}

{% endmacro -%}

{% macro renderMemberDetails(members, containerClass, itemClass, titleText) %}
{% if members.length %}

{$ titleText $}

  {% for member in members %}{% if not member.internal %}
    {$ renderMemberDetail(member, itemClass) $}
    {% if member.overloads.length %}

      Overloads

        {% for overload in member.overloads %}
        {$ renderMemberDetail(overload, itemClass + '-overload') $}
        {% if not loop.last %}
{% endif %}
        {% endfor %}

    {% endif %}
    {% if not loop.last %}
{% endif %}
  {% endif %}{% endfor %}

{% endif %}
{% endmacro %}


text:
<?php if (!defined('IDIR')) { die; }

/**
* vb4 Associate Users
*
* @package 		ImpEx.vb4
*
*/
class vb4_002 extends vb4_000
{
	var $_dependent = '001';

	function vb4_002(&$displayobject)
	{
		$this->_modulestring = $displayobject->phrases['associate_users'];
	}

	function init(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
	{
		$proceed = $this->check_order($sessionobject,$this->_dependent);
		if ($proceed)
		{
			if($sessionobject->get_session_var('associateperpage') == 0)
			{
				$sessionobject->add_session_var('associateperpage','25');
			}

			$displayobject->update_basic('title', $displayobject->phrases['associate_users']);
			$displayobject->update_html($displayobject->do_form_header('index','002'));
			$displayobject->update_html($displayobject->make_hidden_code('002','WORKING'));
			$displayobject->update_html($displayobject->make_hidden_code('associateusers','1'));
			$displayobject->update_html($displayobject->make_table_header($displayobject->phrases['associate_users']));
			$displayobject->display_now($displayobject->phrases['assoc_desc_1']);
			$displayobject->display_now($displayobject->phrases['assoc_desc_2']);
			$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'], $displayobject->phrases['quit']));

			$sessionobject->add_session_var('doassociate','0');
			$sessionobject->add_session_var('associatestartat','0');
		}
		else
		{
			// Dependant has not been run
			$displayobject->update_html($displayobject->do_form_header('index',''));
			$displayobject->update_html($displayobject->make_description("
{$displayobject->phrases['dependant_on']} " . $sessionobject->get_module_title($this->_dependent) . " {$displayobject->phrases['cant_run']} ."));
			$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'],''));
			$sessionobject->set_session_var(substr(get_class($this) , -3),'FALSE');
			$sessionobject->set_session_var('module','000');
		}
	}

	function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
	{
		// Turn off the modules display
		$displayobject->update_basic('displaymodules','FALSE');

		// Get some more usable local vars
		$associate_start_at		= $sessionobject->get_session_var('associatestartat');
		$associate_per_page		= $sessionobject->get_session_var('associateperpage');
		$target_database_type	= $sessionobject->get_session_var('targetdatabasetype');
		$target_table_prefix	= $sessionobject->get_session_var('targettableprefix');
		$source_database_type	= $sessionobject->get_session_var('sourcedatabasetype');
		$source_table_prefix	= $sessionobject->get_session_var('sourcetableprefix');

		// Get some usable variables
		$associate_users		= 	$sessionobject->get_session_var('associateusers');
		$do_associate			=	$sessionobject->get_session_var('doassociate');
		$class_num				= 	substr(get_class($this) , -3);

		// Start the timings
		if(!$sessionobject->get_session_var($class_num . '_start'))
		{
			$sessionobject->timing($class_num, 'start', $sessionobject->get_session_var('autosubmit'));
		}

		//	List from the start_at number
		if ($associate_users == 1)
		{
			// Get a list of the vB members in this current selection
			$user_array = $this->get_details($Db_source, $source_database_type, $source_table_prefix, $associate_start_at, $associate_per_page, 'user', 'userid');

			// Build a list of the ubb users with a box to enter a vB user id into
			$displayobject->update_html($displayobject->do_form_header('index','002'));
			$displayobject->update_html($displayobject->make_table_header($displayobject->phrases['assoc_list']));
			$displayobject->update_html($displayobject->make_description($displayobject->phrases['assoc_match']));

			// Set up list variables
			$any_more = false;
			$counter  = 1;

			// Build the list
			foreach ($user_array as $userid => $user_details)
			{
				$displayobject->update_html($displayobject->make_input_code("$counter) {$displayobject->phrases['user_id']} - " . $userid . " :: " . $user_details['username'] ,'user_to_ass_' . $userid,'',10));
				$any_more = true;
				$counter++;
			}

			// If there arn't any more, tell the user and quit out for them.
			if(!$any_more)
			{
				$displayobject->update_html($displayobject->make_description($displayobject->phrases['no_users']));
			}
			else
			{
				$sessionobject->set_session_var('associatestartat',$associate_start_at + $associate_per_page);
			}

			// Continue with the association
			$sessionobject->set_session_var('associateusers','0');
			$sessionobject->set_session_var('doassociate','1');
			$displayobject->update_html($displayobject->make_hidden_code('doassociate','1'));
			$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['associate'],''));

			// Quit button
			$displayobject->update_html($displayobject->do_form_header('index','002'));
			$displayobject->update_html($displayobject->make_hidden_code('associateusers','2'));
			$displayobject->update_html($displayobject->make_hidden_code('doassociate','0'));
			$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['quit'],''));
		}

		//	If there are some to assosiate
		if ($do_associate == 1)
		{
			$displayobject->update_html($displayobject->display_now('
Associating the users...
'));

			$users_to_associate = $sessionobject->get_users_to_associate();

			foreach ($users_to_associate as $key => $value)
			{
				if($this->associate_user($Db_target, $target_database_type, $target_table_prefix, substr(key($value),12),  current($value)))
				{
					$displayobject->update_html($displayobject->display_now("
{$displayobject->phrases['user']} " .  substr(key($value),12) . $displayobject->phrases['successful'] . ".
"));
					$sessionobject->add_session_var($class_num . '_objects_done',intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1 );
				}
				else
				{
					$sessionobject->set_session_var($class_num . '_objects_failed',$sessionobject->get_session_var($class_num . '_objects_failed') + 1 );
					$displayobject->update_html($displayobject->display_now('
' . substr(key($value),12) . '  ' . current($value) . $displayobject->phrases['failed'] . ' .
'));
				}
			}

			$sessionobject->delete_users_to_associate();

			// Continue with the association
			$sessionobject->set_session_var('associateusers','1');
			$sessionobject->set_session_var('doassociate','0');
			$displayobject->update_html($displayobject->display_now("
{$displayobject->phrases['continue']}.
"));
			$displayobject->update_html($displayobject->print_redirect('index.php',$sessionobject->get_session_var('pagespeed')));
		}

		//	Finish the module
		if ($associate_users == 2)
		{
			$sessionobject->set_session_var('002','FINISHED');
			$sessionobject->set_session_var('module','000');

			$displayobject->update_html($displayobject->display_now("
{$displayobject->phrases['completed']}.
"));
			$displayobject->update_html($displayobject->print_redirect('index.php',$sessionobject->get_session_var('pagespeed')));
		}
	}
}
/*======================================================================*/
?>


text:
export { AuthorizationRules } from './authorization/authorizationRules';
export { SyncStatus } from './http/web-client';
export { ensure, FactDescription, Jinaga, Preposition, Profile, Trace, Tracer } from './jinaga';
export { JinagaBrowser, JinagaBrowserConfig } from './jinaga-browser';
export { JinagaServer, JinagaServerConfig, JinagaServerInstance } from './jinaga-server';
export { JinagaTest, JinagaTestConfig } from './jinaga-test';
export { Watch } from './watch/watch';


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/plat/prdfRasServices.C $                    */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2016                             */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

/** @file  prdfRasServices.C
 *  @brief Utility code to parse an SDC and produce the appropriate error log.
 */

#include <prdfRasServices.H>
#include <prdfMfgSync.H>
#include <prdfErrlUtil.H>
#include <prdfPlatServices.H>

#include <initservice/initserviceif.H>

using namespace TARGETING;

namespace PRDF
{

using namespace PlatServices;

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

void ErrDataService::MnfgTrace( ErrorSignature * i_esig,
                                const PfaData & i_pfaData )
{
    #define PRDF_FUNC "[ErrDataService::MnfgTrace] "

    do
    {
        // This is for Hostboot IPL and FSP machines only.
        #ifndef __HOSTBOOT_RUNTIME
        if ( !INITSERVICE::spBaseServicesEnabled() ) break;

        errlHndl_t errl = NULL;
        errl = getMfgSync().syncMfgTraceToFsp(i_esig, i_pfaData);
        if (errl)
        {
            PRDF_ERR(PRDF_FUNC "failed to sync to the FSP");
            PRDF_COMMIT_ERRL(errl, ERRL_ACTION_REPORT);
            break;
        }
        #endif

    } while(0);

    #undef PRDF_FUNC
}

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

void ErrDataService::updateSrc( uint32_t i_user1, uint32_t i_user2,
                                uint32_t i_user3, uint32_t i_user4,
                                uint16_t i_rc )
{
    // We should always have a valid pointer here. If it is NULL, there
    // is some major issue.
    PRDF_ASSERT ( NULL != iv_errl);

    iv_errl->setReasonCode(i_rc);
    iv_errl->addUserData1( PRDF_GET_UINT64_FROM_UINT32( i_user1, i_user2 ));
    iv_errl->addUserData2( PRDF_GET_UINT64_FROM_UINT32( i_user3, i_user4 ));
}

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

void ErrDataService::createInitialErrl( ATTENTION_TYPE i_attnType )
{
    // We should always have a NULL pointer here. If it is not NULL, there
    // is some major issue.
    PRDF_ASSERT ( NULL == iv_errl );
    using namespace ERRORLOG;

    iv_errl = new ErrlEntry(
                        ERRL_SEV_RECOVERED,
                        PRDF_RAS_SERVICES,
                        PRDF_CODE_FAIL, //ERRL keys off of ReasonCode to set
                                        //creator id.  ReasonCode will later be
                                        //changed to reflect the actual one
                        PRDF_GET_UINT64_FROM_UINT32( 0, 0 ),
                        PRDF_GET_UINT64_FROM_UINT32( 0, 0 ) );
}

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

bool ErrDataService::checkForceTerm( const ServiceDataCollector & i_sdc,
                                     TargetHandle_t i_dumpTrgt,
                                     PfaData &io_pfaData )
{
    //Return false from HB
    return false;
}

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

void ErrDataService::handleUnitCS( const ServiceDataCollector & i_sdc,
                                   TargetHandle_t i_unitCsTarget,
                                   bool & o_initiateHwudump)
{
    // No-op in Hostboot
    o_initiateHwudump = false; // default to not initiate hwudump
}

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

void ErrDataService::handleChannelFail( TargetHandle_t i_memTarget )
{
    // No-op in Hostboot
}

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

void ErrDataService::handleCoreUnitCS( TargetHandle_t i_exTarget,
                                       bool & o_initiateHwudump)
{
    // No-op in Hostboot
    o_initiateHwudump = false; // default to not initiate hwudump
}

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

void ErrDataService::handleNxUnitCS( TargetHandle_t i_nxTarget )
{
    // No-op in Hostboot
}

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

void ErrDataService::commitErrLog( errlHndl_t & io_errl,
                                   const PfaData & i_pfaData )

{
    errlCommit( io_errl, PRDF_COMP_ID );
    io_errl = NULL;
}

} // end namespace PRDF


text:
<?php

namespace Google\AdsApi\Dfp\v201611;

/**
 * This file was generated from WSDL. DO NOT EDIT.
 */
class AdExclusionRule
{

    /**
     * @var int $id
     */
    protected $id = null;

    /**
     * @var string $name
     */
    protected $name = null;

    /**
     * @var boolean $isActive
     */
    protected $isActive = null;

    /**
     * @var \Google\AdsApi\Dfp\v201611\InventoryTargeting $inventoryTargeting
     */
    protected $inventoryTargeting = null;

    /**
     * @var boolean $isBlockAll
     */
    protected $isBlockAll = null;

    /**
     * @var long[] $blockedLabelIds
     */
    protected $blockedLabelIds = null;

    /**
     * @var long[] $allowedLabelIds
     */
    protected $allowedLabelIds = null;

    /**
     * @var string $type
     */
    protected $type = null;

    /**
     * @param int $id
     * @param string $name
     * @param boolean $isActive
     * @param \Google\AdsApi\Dfp\v201611\InventoryTargeting $inventoryTargeting
     * @param boolean $isBlockAll
     * @param long[] $blockedLabelIds
     * @param long[] $allowedLabelIds
     * @param string $type
     */
    public function __construct($id = null, $name = null, $isActive = null, $inventoryTargeting = null, $isBlockAll = null, array $blockedLabelIds = null, array $allowedLabelIds = null, $type = null)
    {
      $this->id = $id;
      $this->name = $name;
      $this->isActive = $isActive;
      $this->inventoryTargeting = $inventoryTargeting;
      $this->isBlockAll = $isBlockAll;
      $this->blockedLabelIds = $blockedLabelIds;
      $this->allowedLabelIds = $allowedLabelIds;
      $this->type = $type;
    }

    /**
     * @return int
     */
    public function getId()
    {
      return $this->id;
    }

    /**
     * @param int $id
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setId($id)
    {
      $this->id = $id;
      return $this;
    }

    /**
     * @return string
     */
    public function getName()
    {
      return $this->name;
    }

    /**
     * @param string $name
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setName($name)
    {
      $this->name = $name;
      return $this;
    }

    /**
     * @return boolean
     */
    public function getIsActive()
    {
      return $this->isActive;
    }

    /**
     * @param boolean $isActive
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setIsActive($isActive)
    {
      $this->isActive = $isActive;
      return $this;
    }

    /**
     * @return \Google\AdsApi\Dfp\v201611\InventoryTargeting
     */
    public function getInventoryTargeting()
    {
      return $this->inventoryTargeting;
    }

    /**
     * @param \Google\AdsApi\Dfp\v201611\InventoryTargeting $inventoryTargeting
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setInventoryTargeting($inventoryTargeting)
    {
      $this->inventoryTargeting = $inventoryTargeting;
      return $this;
    }

    /**
     * @return boolean
     */
    public function getIsBlockAll()
    {
      return $this->isBlockAll;
    }

    /**
     * @param boolean $isBlockAll
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setIsBlockAll($isBlockAll)
    {
      $this->isBlockAll = $isBlockAll;
      return $this;
    }

    /**
     * @return long[]
     */
    public function getBlockedLabelIds()
    {
      return $this->blockedLabelIds;
    }

    /**
     * @param long[] $blockedLabelIds
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setBlockedLabelIds(array $blockedLabelIds)
    {
      $this->blockedLabelIds = $blockedLabelIds;
      return $this;
    }

    /**
     * @return long[]
     */
    public function getAllowedLabelIds()
    {
      return $this->allowedLabelIds;
    }

    /**
     * @param long[] $allowedLabelIds
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setAllowedLabelIds(array $allowedLabelIds)
    {
      $this->allowedLabelIds = $allowedLabelIds;
      return $this;
    }

    /**
     * @return string
     */
    public function getType()
    {
      return $this->type;
    }

    /**
     * @param string $type
     * @return \Google\AdsApi\Dfp\v201611\AdExclusionRule
     */
    public function setType($type)
    {
      $this->type = $type;
      return $this;
    }

}


text:
module HH::API
  @root = nil
  @refresh_time = nil

  class << self
    def root
      if !@refresh_time || (Time.now.to_i - @refresh_time.to_i) > 3600
        @refresh_time = Time.now
        @root = get('/') { |f| Hpricot(f.body) }
      else
        @root
      end
    end

    def get(path)
      url = URI.parse(HH::API_ROOT + path)
      response = Net::HTTP.get_response(url)

      yield response
    end

    def post(path, params)
      url = URI.parse(HH::API_ROOT + path)
      response = Net::HTTP.post_form(url, params)

      yield response
    end

  end

end


text:
package com.igormaznitsa.jhexed.engine;

import com.igormaznitsa.jhexed.engine.misc.HexPoint2D;
import org.junit.Test;
import static org.junit.Assert.*;

public class PointTest {

  @Test
  public void testGetPointPositionRelativelyVector_Vertical_LeftSide() {
    assertEquals(1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(0,50), -10, 25));
  }

  @Test
  public void testGetPointPositionRelativelyVector_Horizontal_LeftSide() {
    assertEquals(1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(50,0), 10, 10));
  }

  @Test
  public void testGetPointPositionRelativelyVector_VerticalNegative_LeftSide() {
    assertEquals(1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(0,-50), 10, -10));
  }

  @Test
  public void testGetPointPositionRelativelyVector_HorizontalNegative_LeftSide() {
    assertEquals(1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(-50,0), -10, -10));
  }

  @Test
  public void testGetPointPositionRelativelyVector_Vertical_RightSide() {
    assertEquals(-1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(0,50), 10, 25));
  }

  @Test
  public void testGetPointPositionRelativelyVector_Horizontal_RightSide() {
    assertEquals(-1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(50,0), 10, -10));
  }

  @Test
  public void testGetPointPositionRelativelyVector_VerticalNegative_RightSide() {
    assertEquals(-1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(0,-50), -10, -10));
  }

  @Test
  public void testGetPointPositionRelativelyVector_HorizontalNegative_RightSide() {
    assertEquals(-1,HexPoint2D.getPointPositionRelativelyVector(new HexPoint2D(0,0), new HexPoint2D(-50,0), -10, 10));
  }

}


text:
import io, struct, os, sys, math
from binascii import crc32, unhexlify, hexlify
from bitcoin.main import *
from bitcoin.bci import *
from bitcoin.transaction import *
#from bitcoin.pyspecials import hexify, unhexify, by

def _mk_multisig_scriptpubkey(fo):
    # make a single output's redeemScript
    data = fo.read(65*3)

    if not data:
        return None

    script_pubkeys = []
    while data:
        chunk = data[:65]
        data = data[65:]
        # pad right side with null bytes

        if len(chunk) < 33:
            chunk += by(bytearray(33-len(chunk)))
        elif len(chunk) < 65:
            chunk += by(bytearray(65-len(chunk)))
        script_pubkeys.append(chunk)

    pubz = list(map(hexify, script_pubkeys))
    return mk_multisig_script(pubz, 1)

def _mk_txouts(fo, value=None):
    value = 547 if not value else int(value)
    hexval = hexify(struct.pack('<Q', value))	# make 8 byte LE value
    txouts = []
    while True:
        scriptPubKey = _mk_multisig_scriptpubkey(fo)
        if scriptPubKey is None: break
        txouts.append( {'script': scriptPubKey, 'value': value} )
    return txouts
    #return ''.join([(hexval + str(wrap_script(x['script']))) for x in txouts])

#Encode file into the blockchain (with prepended file length, crc32) using multisig addresses
def _mk_binary_txouts(filename, value=None):
    try: fileobj = open(filename, 'rb').read()
    except: raise Exception("can't find file!")

    data = struct.pack('<I', len(fileobj)) + \
           struct.pack('<I', crc32(fileobj) & 0xffffffff) + fileobj
    fd = io.BytesIO(data)
    TXOUTS = _mk_txouts(fd, value)
    return list(TXOUTS)
    #return wrap_varint(TXOUTS)

def encode_file(filename, privkey, *args):
    """"""
    #filename, privkey, value, change_address, network, signtx
    if len(args) == 0:
        value, input_address, network, signtx = None, None, None, False
    elif len(args) == 3:
        value, input_address, network = args
        signtx = False
    elif len(args) == 4:
        value, input_address, network, signtx = args
    else:
        raise SyntaxError("params = filename, privkey, value, change_address, network, signtx")

    if not network:
        network = 'testnet'

    if input_address is None:
        input_address = privtoaddr(privkey, 111) if network == 'testnet' else privtoaddr(privkey)

    u = unspent(input_address, 'testnet', source='blockr') if network == 'testnet' else unspent(input_address)
    value = 547 if value is None else int(value)

    TXFEE = int(math.ceil(1.1 * (10000*os.path.getsize(filename)/1000)))
    OUTS = _mk_binary_txouts(filename, value)
    TOTALFEE = TXFEE + int(value)*len(OUTS)
    INS = select(u, TOTALFEE)

    rawtx = mksend(INS, OUTS, input_address, TXFEE)
    if signtx:
        signedtx = sign(rawtx, 0, privkey, 1)
        return signedtx
    return rawtx

def decode_file(txid, network='btc'):
    """Returns decoded blockchain binary file as bytes, ready to write to a file"""
    # TODO: multiple TxIDs? verify encode_file output?
    assert network in ('btc', 'testnet')

    txh = fetchtx(txid, network, source='blockr')
    txo = deserialize(txh)
    outs1 = map(deserialize_script, multiaccess(txo['outs'], 'script'))

    # get hex key data from multisig scripts
    outs2 = filter(lambda l: l[-1] == 174, outs1)	# TODO: check for _non-p2sh_ outputs
    outs3 = map(lambda l: l[1:-2], outs2)

    data = unhexify(''.join([item for sublist in outs3 for item in sublist]))	# base 256 of encoded data

    # TODO: are length & crc32 prepended?
    length = struct.unpack('<I', data[0:4])[0]		# TODO: check length == len(data)
    checksum = struct.unpack('<I', data[4:8])[0]

    data = data[8:8+length]

    assert checksum == crc32(data) & 0xffffffff
    return data # TODO: write return to file object?

# def decode_files(txids, network='btc'):
#     if isinstance(txids, string_types):
#         return decode_file(txids, network)
#     elif isinstance(txids, list) and len(txids) == 1:
#         return decode_file(txids[0], network)
#     return ''.join([decode_file(x) for x in txids])


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

<TITLE>
ClusterUnitDatabase (FreeTTS 1.2)
</TITLE>

<META NAME="keywords" CONTENT="com.sun.speech.freetts.clunits.ClusterUnitDatabase class">

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

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

com.sun.speech.freetts.clunits

Class ClusterUnitDatabase

java.lang.Object
  com.sun.speech.freetts.clunits.ClusterUnitDatabase

public class ClusterUnitDatabase
extends java.lang.Object

Provides support for the cluster unit database. The use of the
 cluster unit database is confined to this clunits package. This
 class provides a main program that can be used to convert from a
 text version of the database to a binary version of the database.

 The ClusterUnitDataBase can be loaded from a text or a binary
 source. The binary form of the database loads much faster and
 therefore is generally used in a deployed system.

Method Summary

 boolean
compare(ClusterUnitDatabase other)

          Determines if two databases are identical.

static void
main(java.lang.String[] args)

          Manipulates a ClusterUnitDatabase.

Methods inherited from class java.lang.Object

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

Method Detail

compare

public boolean compare(ClusterUnitDatabase other)

Determines if two databases are identical.

Parameters:
other - the database to compare this one to

Returns:
true if the databases are identical

main

public static void main(java.lang.String[] args)

Manipulates a ClusterUnitDatabase.

  Usage

   java com.sun.speech.freetts.clunits.ClusterUnitDatabase
  [options]

  Options

  -src path  provides a directory
          path to the source text for the database

  -dest path  provides a directory
          for where to place the resulting binaries

  -generate_binary [filename] reads
		in the text version of the database and generates
		the binary version of the database.

  -compare   Loads the text and
		binary versions of the database and compares them to
		see if they are equivalent.

  -showTimes  shows timings for any
		loading, comparing or dumping operation

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
'use strict';

var React = require('react');
var mui = require('material-ui');
var SvgIcon = mui.SvgIcon;

var ContentForward = React.createClass({
  displayName: 'ContentForward',

  render: function render() {
    return React.createElement(
      SvgIcon,
      this.props,
      React.createElement('path', { d: 'M12 8V4l8 8-8 8v-4H4V8z' })
    );
  }

});

module.exports = ContentForward;


text:
package com.github.mxsm.framework.core.exception;

public class MxsmException extends Exception {

	/**
	 *
	 */
	private static final long serialVersionUID = -2941306647956606488L;

}


text:
<?php

namespace OpenMedMan\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

abstract class Request extends FormRequest
{
    //
}


text:
<?php

namespace FM\TTBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Messagecomment
 *
 * @ORM\Table(name="MessageComment")
 * @ORM\Entity(repositoryClass="MessageCommentRepository")
 */
class MessageComment
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="comment", type="text", nullable=true)
     */
    private $comment;

    /**
     * @var \FM\TTBundle\Entity\Message
     *
     * @ORM\ManyToOne(targetEntity="FM\TTBundle\Entity\Message")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="message_id", referencedColumnName="id")
     * })
     */
    private $message;

    /**
     * @var \FM\TTBundle\Entity\User
     *
     * @ORM\ManyToOne(targetEntity="FM\TTBundle\Entity\User")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     * })
     */
    private $user;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set comment
     *
     * @param string $comment
     * @return Messagecomment
     */
    public function setComment($comment)
    {
        $this->comment = $comment;

        return $this;
    }

    /**
     * Get comment
     *
     * @return string
     */
    public function getComment()
    {
        return $this->comment;
    }

    /**
     * Set message
     *
     * @param \FM\TTBundle\Entity\Message $message
     * @return Messagecomment
     */
    public function setMessage(\FM\TTBundle\Entity\Message $message = null)
    {
        $this->message = $message;

        return $this;
    }

    /**
     * Get message
     *
     * @return \FM\TTBundle\Entity\Message
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * Set user
     *
     * @param \FM\TTBundle\Entity\User $user
     * @return Messagecomment
     */
    public function setUser(\FM\TTBundle\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \FM\TTBundle\Entity\User
     */
    public function getUser()
    {
        return $this->user;
    }
}


text:
<?php
namespace Aikidesk\SDK\Instance\Resources;

use Aikidesk\SDK\Instance\Contracts\RequestInterface;

/**
 * Class CustomersEmails
 */
class CustomersEmails
{

    /**
     * @var int
     */
    protected $customerId;

    /**
     * @var null|int
     */
    protected $emailId = null;

    /**
     * @var \Aikidesk\SDK\Instance\Contracts\RequestInterface
     */
    private $request;

    public function __construct(RequestInterface $request, $customerId, $emailId = null)
    {
        $this->setCustomerId($customerId);
        $this->setEmailId($emailId);
        $this->request = $request;
    }

    /**
     * Scopes: role_operator, role_admin, role_owner
     *
     * @param array $filter
     *
     * @return \Aikidesk\SDK\Instance\Contracts\ResponseInterface
     */
    public function all($filter = [])
    {
        $customerId = $this->getCustomerId();
        $input = [];

        if (isset($filter['page'])) {
            $input['page'] = $filter['page'];
        }

        if (isset($filter['keyword'])) {
            $input['keyword'] = $filter['keyword'];
        }

        if (isset($filter['with'])) {
            $input['with'] = $filter['with'];
        }

        return $this->request->get(sprintf('customer/%1d/email', $customerId), $input);
    }

    /**
     * @return int|null
     */
    public function getCustomerId()
    {
        return $this->customerId;
    }

    /**
     * @param int|null $customerId
     *
     * @return $this
     */
    public function setCustomerId($customerId)
    {
        $this->customerId = $customerId;

        return $this;
    }

    /**
     * Scopes: role_operator, role_admin, role_owner
     *
     * @param string $email
     * @param array  $optional
     *
     * @return \Aikidesk\SDK\Instance\Contracts\ResponseInterface
     */
    public function create($email, $optional = [])
    {
        $customerId = $this->getCustomerId();
        $input = [];
        $input['value'] = $email;

        if (isset($optional['confirmed'])) {
            $input['confirmed'] = (bool) $optional['confirmed'];
        }

        return $this->request->post(sprintf('customer/%1d/email', $customerId), $input);
    }

    /**
     * Scopes: role_operator, role_admin, role_owner
     *
     * @param array $optional
     *
     * @return \Aikidesk\SDK\Instance\Contracts\ResponseInterface
     */
    public function get($optional = [])
    {
        $customerId = $this->getCustomerId();
        $emailId = $this->getEmailId();
        $input = [];
        if (isset($optional['with'])) {
            $input['with'] = $optional['with'];
        }

        return $this->request->get(sprintf('customer/%1d/email/%1d', $customerId, $emailId), $input);
    }

    /**
     * @return int|null
     */
    public function getEmailId()
    {
        return $this->emailId;
    }

    /**
     * @param int|null $emailId
     *
     * @return $this
     */
    public function setEmailId($emailId)
    {
        $this->emailId = $emailId;

        return $this;
    }

    /**
     * Scopes: role_operator, role_owner, role_admin
     * @return \Aikidesk\SDK\Instance\Contracts\ResponseInterface
     */
    public function remove()
    {
        $customerId = $this->getCustomerId();
        $emailId = $this->getEmailId();
        $input = [];

        return $this->request->delete(sprintf('customer/%1d/email/%1d', $customerId, $emailId), $input);
    }

    /**
     * Scopes: role_operator, role_owner, role_admin
     * @return \Aikidesk\SDK\Instance\Contracts\ResponseInterface
     */
    public function reverify()
    {
        $customerId = $this->getCustomerId();
        $emailId = $this->getEmailId();
        $input = [];

        return $this->request->put(sprintf('customer/%1d/email/%1d/reverify', $customerId, $emailId), $input);
    }

    /**
     * Scopes: role_operator, role_owner, role_admin
     * @return \Aikidesk\SDK\Instance\Contracts\ResponseInterface
     */
    public function makeDefault()
    {
        $customerId = $this->getCustomerId();
        $emailId = $this->getEmailId();
        $input = [];

        return $this->request->put(sprintf('customer/%1d/email/%1d/default', $customerId, $emailId), $input);
    }
}


text:
//-----------------------------------------------------------------------
// <copyright file="ItemWithAsynchRuleList.cs" company="Marimer LLC">
//     Copyright (c) Marimer LLC. All rights reserved.
//     Website: https://cslanet.com
// </copyright>
// <summary>no summary</summary>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Csla.Rules;
using System.ComponentModel;
using System.Threading;
using Csla.Core;
using Csla.Serialization;

namespace Csla.Testing.Business.BusyStatus
{
  [Serializable]
  public class ItemWithAsynchRuleList : BusinessListBase<ItemWithAsynchRuleList, ItemWithAsynchRule>
  {

    public static ItemWithAsynchRuleList GetListWithItems(IDataPortal<ItemWithAsynchRuleList> dataPortal)
    {
      return dataPortal.Fetch();
    }

    [Fetch]
    private void Fetch([Inject] IChildDataPortal<ItemWithAsynchRule> childDataPortal)
    {
      Add(ItemWithAsynchRule.GetOneItemForList(childDataPortal, "1"));
      Add(ItemWithAsynchRule.GetOneItemForList(childDataPortal, "2"));
    }

    [Update]
	protected void DataPortal_Update()
    {
      foreach (var oneItem in this)
      {
        oneItem.Update();
      }
    }
  }
}


text:
import numpy as np
from typing import List
from scipy.cluster.hierarchy import fcluster, linkage
from sklearn.metrics.pairwise import cosine_similarity

import plotly.express as px
import plotly.graph_objects as go

def visualize_heatmap(topic_model,
                      topics: List[int] = None,
                      top_n_topics: int = None,
                      n_clusters: int = None,
                      custom_labels: bool = False,
                      width: int = 800,
                      height: int = 800) -> go.Figure:
    """ Visualize a heatmap of the topic's similarity matrix

    Based on the cosine similarity matrix between topic embeddings,
    a heatmap is created showing the similarity between topics.

    Arguments:
        topic_model: A fitted BERTopic instance.
        topics: A selection of topics to visualize.
        top_n_topics: Only select the top n most frequent topics.
        n_clusters: Create n clusters and order the similarity
                    matrix by those clusters.
        custom_labels: Whether to use custom topic labels that were defined using
                       `topic_model.set_topic_labels`.
        width: The width of the figure.
        height: The height of the figure.

    Returns:
        fig: A plotly figure

    Examples:

    To visualize the similarity matrix of
    topics simply run:

    ```python
    topic_model.visualize_heatmap()
    ```

    Or if you want to save the resulting figure:

    ```python
    fig = topic_model.visualize_heatmap()
    fig.write_html("path/to/file.html")
    ```
    <iframe src="../../getting_started/visualization/heatmap.html"
    style="width:1000px; height: 720px; border: 0px;""></iframe>
    """

    # Select topic embeddings
    if topic_model.topic_embeddings_ is not None:
        embeddings = np.array(topic_model.topic_embeddings_)
    else:
        embeddings = topic_model.c_tf_idf_

    # Select topics based on top_n and topics args
    freq_df = topic_model.get_topic_freq()
    freq_df = freq_df.loc[freq_df.Topic != -1, :]
    if topics is not None:
        topics = list(topics)
    elif top_n_topics is not None:
        topics = sorted(freq_df.Topic.to_list()[:top_n_topics])
    else:
        topics = sorted(freq_df.Topic.to_list())

    # Order heatmap by similar clusters of topics
    if n_clusters:
        if n_clusters >= len(set(topics)):
            raise ValueError("Make sure to set `n_clusters` lower than "
                             "the total number of unique topics.")

        embeddings = embeddings[[topic + topic_model._outliers for topic in topics]]
        distance_matrix = cosine_similarity(embeddings)
        Z = linkage(distance_matrix, 'ward')
        clusters = fcluster(Z, t=n_clusters, criterion='maxclust')

        # Extract new order of topics
        mapping = {cluster: [] for cluster in clusters}
        for topic, cluster in zip(topics, clusters):
            mapping[cluster].append(topic)
        mapping = [cluster for cluster in mapping.values()]
        sorted_topics = [topic for cluster in mapping for topic in cluster]
    else:
        sorted_topics = topics

    # Select embeddings
    indices = np.array([topics.index(topic) for topic in sorted_topics])
    embeddings = embeddings[indices]
    distance_matrix = cosine_similarity(embeddings)

    # Create labels
    if topic_model.custom_labels_ is not None and custom_labels:
        new_labels = [topic_model.custom_labels_[topic + topic_model._outliers] for topic in sorted_topics]
    else:
        new_labels = [[[str(topic), None]] + topic_model.get_topic(topic) for topic in sorted_topics]
        new_labels = ["_".join([label[0] for label in labels[:4]]) for labels in new_labels]
        new_labels = [label if len(label) < 30 else label[:27] + "..." for label in new_labels]

    fig = px.imshow(distance_matrix,
                    labels=dict(color="Similarity Score"),
                    x=new_labels,
                    y=new_labels,
                    color_continuous_scale='GnBu'
                    )

    fig.update_layout(
        title={
            'text': "<b>Similarity Matrix",
            'y': .95,
            'x': 0.55,
            'xanchor': 'center',
            'yanchor': 'top',
            'font': dict(
                size=22,
                color="Black")
        },
        width=width,
        height=height,
        hoverlabel=dict(
            bgcolor="white",
            font_size=16,
            font_family="Rockwell"
        ),
    )
    fig.update_layout(showlegend=True)
    fig.update_layout(legend_title_text='Trend')

    return fig


text:
/**
 * This code was generated by
 * \ / _    _  _|   _  _
 *  | (_)\/(_)(_|\/| |(/_  v1.0.0
 *       /       /
 */

import Page = require('../../../../base/Page');
import Response = require('../../../../http/response');
import V2 = require('../../V2');
import { SerializableClass } from '../../../../interfaces';

/**
 * Initialize the CountryList
 *
 * @param version - Version of the resource
 */
declare function CountryList(version: V2): CountryListInstance;

interface CountryListInstance {
  /**
   * @param sid - sid of instance
   */
  (sid: string): CountryContext;
  /**
   * Streams CountryInstance records from the API.
   *
   * This operation lazily loads records as efficiently as possible until the limit
   * is reached.
   *
   * The results are passed into the callback function, so this operation is memory
   * efficient.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Function to process each record
   */
  each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void;
  /**
   * Streams CountryInstance records from the API.
   *
   * This operation lazily loads records as efficiently as possible until the limit
   * is reached.
   *
   * The results are passed into the callback function, so this operation is memory
   * efficient.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param opts - Options for request
   * @param callback - Function to process each record
   */
  each(opts?: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void;
  /**
   * Constructs a country
   *
   * @param isoCountry - The ISO country code of the pricing information to fetch
   */
  get(isoCountry: string): CountryContext;
  /**
   * Retrieve a single target page of CountryInstance records from the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Callback to handle list of records
   */
  getPage(callback?: (error: Error | null, items: CountryPage) => any): Promise<CountryPage>;
  /**
   * Retrieve a single target page of CountryInstance records from the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param targetUrl - API-generated URL for the requested results page
   * @param callback - Callback to handle list of records
   */
  getPage(targetUrl?: string, callback?: (error: Error | null, items: CountryPage) => any): Promise<CountryPage>;
  /**
   * Lists CountryInstance records from the API as a list.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Callback to handle list of records
   */
  list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise<CountryInstance[]>;
  /**
   * Lists CountryInstance records from the API as a list.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param opts - Options for request
   * @param callback - Callback to handle list of records
   */
  list(opts?: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise<CountryInstance[]>;
  /**
   * Retrieve a single page of CountryInstance records from the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param callback - Callback to handle list of records
   */
  page(callback?: (error: Error | null, items: CountryPage) => any): Promise<CountryPage>;
  /**
   * Retrieve a single page of CountryInstance records from the API.
   *
   * The request is executed immediately.
   *
   * If a function is passed as the first argument, it will be used as the callback
   * function.
   *
   * @param opts - Options for request
   * @param callback - Callback to handle list of records
   */
  page(opts?: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise<CountryPage>;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

/**
 * Options to pass to each
 *
 * @property callback -
 *                         Function to process each record. If this and a positional
 *                         callback are passed, this one will be used
 * @property done - Function to be called upon completion of streaming
 * @property limit -
 *                         Upper limit for the number of records to return.
 *                         each() guarantees never to return more than limit.
 *                         Default is no limit
 * @property pageSize -
 *                         Number of records to fetch per request,
 *                         when not set will use the default value of 50 records.
 *                         If no pageSize is defined but a limit is defined,
 *                         each() will attempt to read the limit with the most efficient
 *                         page size, i.e. min(limit, 1000)
 */
interface CountryListInstanceEachOptions {
  callback?: (item: CountryInstance, done: (err?: Error) => void) => void;
  done?: Function;
  limit?: number;
  pageSize?: number;
}

/**
 * Options to pass to list
 *
 * @property limit -
 *                         Upper limit for the number of records to return.
 *                         list() guarantees never to return more than limit.
 *                         Default is no limit
 * @property pageSize -
 *                         Number of records to fetch per request,
 *                         when not set will use the default value of 50 records.
 *                         If no page_size is defined but a limit is defined,
 *                         list() will attempt to read the limit with the most
 *                         efficient page size, i.e. min(limit, 1000)
 */
interface CountryListInstanceOptions {
  limit?: number;
  pageSize?: number;
}

/**
 * Options to pass to page
 *
 * @property pageNumber - Page Number, this value is simply for client state
 * @property pageSize - Number of records to return, defaults to 50
 * @property pageToken - PageToken provided by the API
 */
interface CountryListInstancePageOptions {
  pageNumber?: number;
  pageSize?: number;
  pageToken?: string;
}

interface CountryPayload extends CountryResource, Page.TwilioResponsePayload {
}

interface CountryResource {
  country: string;
  inbound_call_prices?: string[];
  iso_country: string;
  outbound_prefix_prices?: string[];
  price_unit?: string;
  url: string;
}

interface CountrySolution {
}

declare class CountryContext {
  /**
   * Initialize the CountryContext
   *
   * @param version - Version of the resource
   * @param isoCountry - The ISO country code of the pricing information to fetch
   */
  constructor(version: V2, isoCountry: string);

  /**
   * fetch a CountryInstance
   *
   * @param callback - Callback to handle processed record
   */
  fetch(callback?: (error: Error | null, items: CountryInstance) => any): Promise<CountryInstance>;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

declare class CountryInstance extends SerializableClass {
  /**
   * Initialize the CountryContext
   *
   * @param version - Version of the resource
   * @param payload - The instance payload
   * @param isoCountry - The ISO country code of the pricing information to fetch
   */
  constructor(version: V2, payload: CountryPayload, isoCountry: string);

  private _proxy: CountryContext;
  country: string;
  /**
   * fetch a CountryInstance
   *
   * @param callback - Callback to handle processed record
   */
  fetch(callback?: (error: Error | null, items: CountryInstance) => any): Promise<CountryInstance>;
  inboundCallPrices: string[];
  isoCountry: string;
  outboundPrefixPrices: string[];
  priceUnit: string;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
  url: string;
}

declare class CountryPage extends Page<V2, CountryPayload, CountryResource, CountryInstance> {
  /**
   * Initialize the CountryPage
   *
   * @param version - Version of the resource
   * @param response - Response from the API
   * @param solution - Path solution
   */
  constructor(version: V2, response: Response<string>, solution: CountrySolution);

  /**
   * Build an instance of CountryInstance
   *
   * @param payload - Payload response from the API
   */
  getInstance(payload: CountryPayload): CountryInstance;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

export { CountryContext, CountryInstance, CountryList, CountryListInstance, CountryListInstanceEachOptions, CountryListInstanceOptions, CountryListInstancePageOptions, CountryPage, CountryPayload, CountryResource, CountrySolution }


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3: 450 (1898)

#### Original name
Uromyces euphorbiae (Schwein.) Cooke & Peck

### Remarks
null


text:
import Ember from 'ember';
import generateContent from '../../utils/c';

const {A} = Ember;

export default Ember.Controller.extend({

  title: 'Expandable Rows',
  model: generateContent(20),
  expandedRowTemplate: 'custom/expanded-row',
  columns: A([
    {
      template: 'components/models-table/expand-row-cell',
      templateForFilterCell: 'components/models-table/expand-all-rows-cell',
      mayBeHidden: false
    },
    {
      propertyName: 'id',
      title: 'ID'
    },
    { propertyName: 'firstName' },
    { propertyName: 'lastName' },
    { propertyName: 'city' }
  ])

});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <artifactId>malhar-examples-pi</artifactId>
  <packaging>jar</packaging>

  <name>Apache Apex Malhar Pi Example</name>
  <description>Apex example applications that calculate the value of Pi. This is a starting point to understand how Apex works.</description>

  <parent>
    <groupId>org.apache.apex</groupId>
    <artifactId>malhar-examples</artifactId>
    <version>3.8.0-SNAPSHOT</version>
  </parent>

  <properties>
    <apex.apppackage.tags>demos, pi</apex.apppackage.tags>
    <apex.apppackage.longDescription>README.md</apex.apppackage.longDescription>
  </properties>

  <dependencies>
    <dependency>
      <groupId>it.unimi.dsi</groupId>
      <artifactId>fastutil</artifactId>
      <version>6.6.4</version>
    </dependency>
  </dependencies>

</project>


text:
import { Injectable } from '@angular/core';
import { Action, Selector, State, StateContext, StateToken } from '@ngxs/store';

import { setUserState } from './user.actions';
import { IUserState, TUserPayload } from './user.interface';

export const userActions = {
  setUserState,
};

export const USER_STATE_TOKEN = new StateToken<IUserState>('user');

@State<IUserState>({
  name: USER_STATE_TOKEN,
  defaults: {
    profiles: [],
    userConfig: void 0,
    github: void 0,
    githubRepos: [],
    githubLanguages: void 0,
    githubLanguagesTotal: 0,
    githubLanguagesRate: void 0,
    githubLanguagesKeys: [],
    imgShow: {
      github: true,
      codepen: true,
      codewars: true,
      hackerrank: true,
      languageIcons: {},
    },
    githubOrgs: [],
    publicEvents: [],
  },
})
@Injectable({
  providedIn: 'root',
})
export class UserState {
  /**
   * State selector.
   * @param state
   */
  @Selector([USER_STATE_TOKEN])
  public static getState(state: IUserState) {
    return state;
  }

  /**
   * Set state action.
   * @param ctx
   * @param param1
   */
  @Action(setUserState)
  public setUserState(ctx: StateContext<IUserState>, { payload }: TUserPayload) {
    return ctx.patchState(payload);
  }
}