text:
.. title: 22 - Diagnosis
.. slug: 22 - Diagnosis
.. date: 2016-01-23 06:52:57 UTC-08:00
.. tags: notes, mathjax
.. category:
.. link:
.. description:
.. type: text

==============
22 - Diagnosis
==============

01 - Preview
------------

Today we will talk about diagnosis. Diagnosis is the identification of the fault or faults responsible for a
malfunctioning system. The system it could be a car, a computer program, an organism, or the economy. Diagnosis builds
on our discussion of classification and configuration. They start by defining diagnosis. They really setup two spaces.

A data spaces and a hypothesis space. Data about the malfunctioning system.

Hypothesis about the fault that can explain that malfunctioning system.

Then, we'll constructing mappings through data space to hypothesis space which amount to diagnosis. We'll discuss two
views of diagnosis, diagnosis as classification and diagnosis as abduction. Abduction in this context is a new term to
you. We'll discuss it in more detail today.

02 - Exercise Diagnosing Illness
--------------------------------

To illustrate the task of diagnosis, let us begin with an exercise.

When we think of diagnosis, most of us think in terms of medical diagnosis.

The kind of diagnosis a doctor does. So this particular exercise, is coming from medical diagnosis, actually it's a
made-up exercise from medical diagnosis. And here's a set of diseases, fictional diseases, that the doctor knows about,
along with the symptoms that each diseases causes. So, Alphaitis, for example, causes elevated A, reduced C and elevated
F and so on. Given this set of data, and this set of diseases, what disease or set of diseases do you think the patient
suffers from?

03 - Exercise Diagnosing Illness
--------------------------------

>> That's a good answer, David. Note that David did several things in coming up with his answer. First, he made sure
that his answer covers all these signs and symptoms. This is the principle of coverage. We want to make sure that the
diagnostic conclusion actually accounts for all the input data.

Second, we chose a single hypothesis over a combination of hypothesis, although the combination could have explain this
data as well. This is the principle of parsimony. In general, we want a simple hypothesis for explaining the entire
data. Third, these hypotheses can have greatest interactions between them, and these interactions can make your
diagnostic task quite complicated.

Fourth, they would use the term explanation. This is an important aspect for diagnosis. We want a set of hypotheses that
could explain the input data.

Now this [UNKNOWN] we did it in this simple exercise, because there is one single disease that can, in fact, explain all
the input data. What would happen if there was no single hypothesis that could cover the entire input data?

Or what would happen if there were multiple hypotheses that could equally well explain the input data? [UNKNOWN]
diagnostic task can be quite complicated.

04 - Defining Diagnosis
-----------------------

>> Note that we discussed the same diagnostic task in three different domains.

In each domain, there was a discrepancy between the expected and observed behaviors. And we tried to identify the fault
or faults responsible for it. Note also that we eluded to three different methods for doing diagnosis. The method of
rule-based reasoning, the method of case-based reasoning, and the method of model-based reasoning.

We haven't talked a lot about the method of model-based reasoning so far.

We will do so when we come to systems thinking later in the class. Of course, we can use the method of rule-based engine
not only for diagnosing car engines, but also for repairing computer hardware or for diagnosing computer software. In
this particular lesson, our focus will be on the diagnostic task. By now, all of us are already familiar with many
reasoning methods that are potentially applicable to the task.

05 - Data Space and Hypothesis Space
------------------------------------

We can think of diagnosis as a mapping from a data space, to a hypothesis space,

In case of a medical diagnosis, the data may be the greatest kind of signs and symptoms that I may go to a doctor with.
Some of the data may be very specific, some of it may be very abstract, an example of a very specific data is that a
[UNKNOWN] temperature is 104 degrees fahrenheit.

An example of the extraction of the data is that [INAUDIBLE] is running a fever.

The hypothesis space consists of all hypothesis that can explain parts of the observed data. A hypothesis in the
hypothesis space can explain some part of the data, In case of medicine, this hypothesis may reference to diseases.

A doctor may say that my hypothesis is that a shook is suffering from flu, and that explains his high fever. In the
domain of car repairs, this hypothesis may refer to specific faults with the car, for example, the carburetor is not
working properly. In the domain of computer software, this hypothesis may refer to specific methods not working
properly.

And this mapping from data space to the hypothesis space can be very complex.

The complexity arises partly because of the size of data space, partly because of the size of hypothesis space, partly
because the mapping can be M to N. And also, because this hypothesis can interact with each other, If H3 is present,

H4 may be excluded, If H5 is present, H6 is sure to be present and so on. It helps then not to deal with all the raw
data, but to deal with abstractions of the data, so the initial data that a patient may go to a doctor with may be very,
very specific. The signs and symptoms of their particular specific patient, but the diagnostic process might abstract
them from Asok has a fever of 104 degrees farenheit to Asok has a high fever. This abstract data that can be mapped into
an abstract hypothesis,

Asok has high fever can get mapped into Asok has a bladder infection for example. The abstract hypothesis can now be
refined into a suffering from flu or a flu for a particular screen. At the end, we want a hypothesis that is as refined
as possible, and that explains all the available data. When we were talking about classification, we talked about two
processes of classification, bottom-up process and our top down process. The bottom up process of classification, we
started with raw data and then grouped and abstracted, it in case of top down classification we started with some high
level class and then established it and refined it.

You can see that in diagnosis both the bottom up process of classification, and the tope down process of classification
are co-occurring.

This method of bottom up classification and data space, mapping and hypothesis space, and then top down classification
of hypothesis space is called heuristic classification. This is yet another method like rule-based reasoning, case-based
reasoning, and model-based reasoning with a diagnostic task.

06 - Problems with Diagnosis as Classification
----------------------------------------------

>> In general, cancellation interactions are very hard to account for.

In order to address these factors that make diagnosis so complex, it is useful to shift from the perspective of
diagnosis solely as classification to a perspective of diagnosis as abduction.

07 - Deduction, Induction, Abduction
------------------------------------

>> Or given the rule if flu then fever and the fact that Ashok has fever we might be able to abduce that Ashok has flu.
First of all notice that we are back to diagnosis. Diagnosis is an instance of abduction. But notice several other
properties. First, deduction is truth preserving.

If the rule is true, and the cause is true, we can always guarantee that the effect is true as well. Induction and
abduction are not truth preserving.

We may know something about the relationship between cause and effect for some sample, that does not mean that the same
relationship holds for the entire population. Induction does not always guarantee correctness. Same for abduction.

We may know the rule and the effect, and we may suppose that its cause is true, but that may not necessarily be true. It
may be the case, if flu then fever, and

Ashok may have fever, but that does not necessarily mean that Ashok has flu.

Fever can be caused by many, many things. The reason that fever does not necessarily mean that Asoka's flu is because
there can be multiple causes for the same effect, multiple hypothesis for the same data. This is exactly the problem
that we had encountered earlier when we talking about what makes diagnosis hard. We said that deduction, induction, and
abduction, are three of the fundamental forms of inference.

We can of course also combine these inferences. Science is a good example.

You and I as scientists, observe some data about the world. Then, we abduce some explanation for it. Having abduced that
explanation for it, we induce a rule. Having induced a rule, now we can use deduction to predict new data elements. We
go and observe some more. Again, we abduce. Induce. Induce. And we continue the cycle.

Might the cycle also explain significant part of cognition?

Is this what you and I do on a daily basis? Abuse, induce, reduce?

08 - Criteria for Choosing a Hypothesis
---------------------------------------

Now that we understand abduction, and now that we know the diagnosis is an instance of abduction, let us ask ourselves,
how does this understanding help us in choosing hypotheses? So the first principle for choosing a hypothesis is
explanatory coverage. A hypotheses must cover as much of the data as possible.

Here's an example, hypotheses H3 explain data items D1 through D8.

Hypothesis H7 explains data item D5 to D9.

Assuming that all of these data elements are equally important or equally salient, we may prefer H3 over H7 because it
explains for of the data than does H7. The second principle for choosing between competing hypotheses is called the
principle of Parsimony.

All things being equal, we want to pick the simplest explanation for the data.

So consider the following scenario. H2 explains data elements D1 to D3.

H4 explains data elements D1 through D8. H6 explains data elements D4 to D6 and H8 explains data elements D7 to D9.

Now if you went by the criteria of explanatory coverage, then we might pick H2, plus H6, plus H8, because the three of
them combined, explain more than just H4.

However, the criteria of Parsimony would suggest if you pick H4, because H4 alone, explains almost all the data, and we
don't need the other three hypothesis. In general this is a balancing act between these two principles. We want to both
maximize the coverage, and maximize the parsimony. Based on this particular example, we may go with H4 and

H8. The two together explain all the data and in addition, the set of these two hypotheses is smaller than these set of
hypotheses H2,

H6, and H8. The [UNKNOWN] criteria for choosing between competing hypotheses is that we want to pick those hypotheses in
which we have more confidence.

Some hypotheses are more likely than others. You may have more confidence in some hypotheses than in others. As an
example, in this particular scenario,

H3 may explain data items D1 to D8 and H5 may explain more data elements from D1 to D9. So H5 also explains D9 that H3
doesn't.

However, we may have more confidence in H3, and so we may pick H3 instead of H5.

Once again this is a balancing act between these three criteria for choosing between competing diagnostic hypotheses. A
quick point to note here, these three criteria are useful for choosing between competing hypotheses even if the task is
not diagnosis. The same problem occurs for example in intelligence analysis. Imagine that you have some data that needs
to be explained and your competing hypothesis for explaining that particular data, well, you may pick between the
competing hypothesis based on this criteria.

All of the task is not a diagnostic task. These three criteria are useful for explanation. Diagnosis simply happens to
be an example of this [UNKNOWN] task.

09 - Exercise Diagnosis as Abduction
------------------------------------

Let us do an exercise together. The data in this particular exercise, a little bit more complicated than in the previous
one.

On the right-hand side, I've shown a set of diseases. What disease or subset of these diseases best explains the
available data?

10 - Exercise Diagnosis as Abduction
------------------------------------

>> Note that one can use alternative methods for the same problem. For example, one could use K-space reasoning. And for
when we came across a problem very similar to this one previously.

Suppose that the solution of that particular problem was ever labeled as a case.

In that particular case, B was high, C was low, and H was low. And the solution was Thetadesis. In the current problem,
the additional symptom is that F is low.

So case retrieval would first lead you to the conclusion of Thetadesis.

Only to [UNKNOWN] this particular solution to also account for the additional symptom of F being low. We could do that
by adding Kappacide and

Mutension to Thetadesis. Case based system thus would tend to focus the alternate set of hypotheses. One more point to
note here then.

Note that different methods can lead to different solutions.

Given different methods, how might an AI agent decide which method to select?

We'll return to this particular problem when we discuss meta reasoning.

11 - Completing the Process
---------------------------

>> We can also think of this last phase as a type of configuration which we talked about last time. Given a set of
hypothesis about illnesses or faults with a car, we can then configure a set of treatments or repairs that best address
the faults we discovered before.

12 - Assignment Diagnosis
-------------------------

So would the idea of diagnosis help us design an agent that can answer Raven's progressive matrices? Perhaps the best
way to think about this is to consider how your agent might respond when it answers a question wrong.

First, what data will it use to investigate its incorrect answer?

Second, what hypotheses might it have for incorrect answers?

Third, how will it select a hypothesis that best explains that data? And last, once it's selected hypothesis that
explains that data, how will it use that to repair its reasoning, so it doesn't make the same mistake again?

13 - Wrap Up
------------

So today, we talked about diagnosis which is a term we're very familiar with from our everyday lives. But today, we
talked about it specifically in a knowledge-based AI sense. We started off by defining diagnosis, which is finding the
fault responsible for the malfunction in some system.

This can be computers, computer programs, cars or even people and animals.

We then talked about the process of diagnosis, mapping data onto hypotheses and how we can see this as a form of
classification. We discovered though that this can be a very complicated process and classification might not get us all
the way there. So then we talked about diagnosis as a form of abduction.

Given a rule and effect or a symptom, we can abduce the cause of that problem, like an illness or a software bug. Both
configuration and diagnosis have been small tasks in the broader process of design. Now that we talk about them, we can
talk about AI agents that can actually do design in the real world, as well as what it would mean for an AI agent to
really be creative.

14 - The Cognitive Connection
-----------------------------

Diagnosis is a very common cognitive task. It occurs whenever our expectations are violated. We start diagnosing. Why
were our expectations violated?

Within a system, we expect some behavior out of it. We get a different behavior.

Why did the system not give the behavior we expected from it? Notice that diagnosis is a task. We can use several
methods to address it, like case-based reasoning. We have discussed diagnosis on several contexts like medicine, program
debugging, car repair, but it's also very common in other aspects of our life. For example, you get unexpected traffic.
Why did it occur? We review interaction with a co-worker or the economy. All are examples of diagnosis

15 - Final Quiz
---------------

Please write down what you learned in this lesson.

16 - Final Quiz
---------------

Thank you very much.


text:
$(document).ready(function () {
	var tempwithoutNext = "
 \

 \

 \

 \

 \
					    <button class='btn btn-default' data-role='prev'>« Prev</button> \
					    <button class='btn btn-default' data-role='end'>End tour</button> \

 \

";

	 var tour = new Tour({
	  steps: [
	  {
	    title: "Welcome! This is RazorFlow Dashboard",
	    content: "",
	    orphan: true
	  },
	  {
	  	element: ".rfComponentContainer:first",
	    title: "This is a component. Click on one of the items.",
	    content: "",
	    reflex: true,
	    template: tempwithoutNext
	  },
	  {
	  	element: ".rfComponentContainer:first",
	    title: "This is a Drill Down Chart component",
	    content: "",
	  },
	  {
	  	element: ".rfComponentContainer:nth-child(2)",
	    title: "This is one of many chart types",
	    content: "",
	    placement: "left"
	  },
	  {
	  	element: ".tabLinks > li:last",
	    title: "Click the 'second tab' to continue",
	    content: "",
	    reflex: true,
	    template: tempwithoutNext
	  },
	  {
	    title: "This is another dashboard as a tab",
	    content: "",
	    orphan: true
	  },
	  {
	  	element: "#rfTabCore-2 .rfComponentContainer:first",
	    title: "This is a KPI group component",
	    content: "",
	    placement: "bottom"
	  },
	  {
	  	element: "#rfTabCore-2 .rfComponentContainer:nth-child(3)",
	    title: "This is a Table Component",
	    content: "",
	    placement: "right"
	  },
	  {
	  	element: "#rfTabCore-2 .rfComponentContainer:nth-child(4)",
	    title: "This is a Filter Component, modify it",
	    content: "",
	    placement: "left"
	  },
	  {
	  	element: "#rfTabCore-2 .rfComponentContainer:nth-child(3)",
	    title: "Changes done on filter is reflected",
	    content: "",
	    placement: "right"
	  },
	  {
	    title: "Now click here to get started",
	    content: "",
	    orphan: true
	  }
	],
	  storage: false,
	  backdrop: true
	});

	 $('body').prepend("<input type='button' value='Start Tour' id='StartTour'>");

	 $("#StartTour").click(function () {
	 	tour.start();
	 	tour.restart();
	 });
});

redpajama_set_name: RedPajamaGithub


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.ovirt.engine.core</groupId>
    <artifactId>manager</artifactId>
    <version>3.6.9-SNAPSHOT</version>
  </parent>

  <artifactId>manager-modules</artifactId>
  <packaging>pom</packaging>

  <name>oVirt Modules - manager</name>
  <description>parent POM for all oVirt modules</description>

  <modules>
    <module>extensions-api-root</module>
    <module>uutils</module>
    <module>extensions-manager</module>
    <module>compat</module>
    <module>utils</module>
    <module>common</module>
    <module>dal</module>
    <module>vdsbroker</module>
    <module>builtin-extensions</module>
    <module>scheduler</module>
    <module>searchbackend</module>
    <module>aaa</module>
    <module>auth-plugin</module>
    <module>bll</module>
    <module>restapi</module>
    <module>logger</module>
    <module>root</module>
    <module>branding</module>
    <module>services</module>
    <module>docs</module>
    <module>welcome</module>
  </modules>

  <dependencies>
    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec</groupId>
      <artifactId>jboss-javaee-6.0</artifactId>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-depchain</artifactId>
      <scope>test</scope>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
      <version>1.0.0.CR8</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-core</artifactId>
      <version>1.1.5.Final</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.6.4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <excludes>**/RsdlManager.java,**/RsdlIOManager.java</excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
class Rule < ActiveRecord::Base
  belongs_to :account
  belongs_to :new_account,        :class_name => "Account"
  belongs_to :new_sender,         :class_name => "Contact"
  belongs_to :new_recipient,      :class_name => "Contact"
  belongs_to :matched_sender,     :class_name => "Contact"
  belongs_to :matched_recipient,  :class_name => "Contact"

  validates_associated    :new_sender, :new_recipient, :matched_sender, :matched_recipient, :account, :new_account
  validates_presence_of   :account, :new_account
  validates_inclusion_of  :matched_debit, :in => [true, false]

  validate  :must_have_at_least_one_matcher,
            :must_either_match_or_assign_contacts

  after_save :apply_to_ledger

  def apply_to_ledger
    self.account.ledger_items.unmatched.send( self.matched_debit ? :debit : :credit).each { |i| self.match!(i) }
  end

  def match!(ledger_item)
    # Match sign
    if ledger_item.total_amount * (self.matched_debit? ? 1 : -1) < 0
      return false
    end

    # Match description
    unless self.matched_description.nil? || (!self.matched_sender_id.nil? && !self.matched_recipient_id.nil?)
      regexp = Regexp.new(self.matched_description, true)
      unless ledger_item.description =~ regexp
        return false
      end
    end

    # Match sender
    unless self.matched_sender_id.nil?
      unless ledger_item.sender_id == self.matched_sender_id
        return false
      end
    end

    # Match recipient
    unless self.matched_recipient_id.nil?
      unless ledger_item.recipient_id == self.matched_recipient_id
        return false
      end
    end

    # Populate contacts
    ledger_item.sender_id = self.new_sender_id if ledger_item.sender_id.nil?
    ledger_item.recipient_id = self.new_recipient_id if ledger_item.recipient_id.nil?

    # Create matching ledger item
    new_ledger_item = LedgerItem.new(
      :transacted_on  => ledger_item.transacted_on,
      :total_amount   => ledger_item.total_amount * -1.0,
      :currency       => ledger_item.currency,
      :account_id     => self.new_account_id,
      :sender_id      => ledger_item.recipient_id,
      :recipient_id   => ledger_item.sender_id
    )

    # Create match and save ledger items
    match = Match.create!(
      :ledger_items => [ledger_item, new_ledger_item]
    )
  end

  private

  def must_have_at_least_one_matcher
    if self.matched_description.blank? && self.matched_sender_id.nil? && self.matched_recipient_id.nil?
      errors.add_to_base('Rule must have at least one matcher')
    end
  end

  def must_either_match_or_assign_contacts
    unless (self.matched_sender_id.nil? ^ self.new_sender_id.nil?) && (self.matched_recipient_id.nil? ^ self.new_recipient_id.nil?)
      errors.add_to_base('Rule must either match or assign contacts')
    end
  end
end


text:
package com.meisolsson.githubsdk.model.payload;

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Nullable;

import com.meisolsson.githubsdk.model.Repository;
import com.google.auto.value.AutoValue;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;

@AutoValue
public abstract class ForkPayload extends GitHubPayload<ForkPayload.Builder> implements Parcelable {

    @Nullable
    public abstract Repository forkee();

    public abstract Builder toBuilder();

    public static JsonAdapter<ForkPayload> jsonAdapter(Moshi moshi) {
        return new AutoValue_ForkPayload.MoshiJsonAdapter(moshi);
    }

    public static ForkPayload createFromParcel(Parcel in) {
        return AutoValue_ForkPayload.CREATOR.createFromParcel(in);
    }

    public static Builder builder() {
        return new AutoValue_ForkPayload.Builder();
    }

    @AutoValue.Builder
    public abstract static class Builder extends GitHubPayload.Builder<ForkPayload, Builder> {
        public abstract Builder forkee(Repository forkee);

        public abstract ForkPayload build();
    }
}


text:
package org.jetbrains.plugins.scala.actions

import java.awt.Rectangle

import com.intellij.openapi.actionSystem._
import com.intellij.psi.util.PsiUtilBase
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction
import org.jetbrains.plugins.scala.util.IntentionUtils

/**
 * @author Ksenia.Sautina
 * @since 6/20/12
 */

object MakeExplicitAction {
  final val MAKE_EXPLICIT = "Make explicit"
  final val MAKE_EXPLICIT_STATICALLY = "Make explicit (Import method)"

}

class MakeExplicitAction  extends AnAction("Replace implicit conversion action") {

  def actionPerformed(e: AnActionEvent) {
    val context = e.getDataContext
    val project = CommonDataKeys.PROJECT.getData(context)
    val selectedItem = PlatformDataKeys.SELECTED_ITEM.getData(context) match {
      case s: Parameters => s
      case _ => null
    }
    if (selectedItem == null || selectedItem.getNewExpression == null) return
    val function = selectedItem.getNewExpression match {
      case f: ScFunction => f
      case _ => null
    }
    val expression = selectedItem.getOldExpression
    val editor = selectedItem.getEditor
    val secondPart = selectedItem.getSecondPart

    if (project == null || editor == null || secondPart == null) return
    val file = PsiUtilBase.getPsiFileInEditor(editor, project)
    if (!file.isInstanceOf[ScalaFile]) return

    IntentionUtils.showMakeExplicitPopup(project, expression, function, editor, secondPart, getCurrentItemBounds _)
  }

  def getCurrentItemBounds: Rectangle = {
    val index: Int = GoToImplicitConversionAction.getList.getSelectedIndex
    if (index < 0) {
      throw new RuntimeException("Index = " + index + " is less than zero.")
    }
    val itemBounds: Rectangle = GoToImplicitConversionAction.getList.getCellBounds(index, index)
    if (itemBounds == null) {
      throw new RuntimeException("No bounds for index = " + index + ".")
    }
    itemBounds
  }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Travels Carolina 171. 1791 "<I>Anona incarna</I>"

#### Original name
null

### Remarks
null


text:
import {ActionTypes} from 'Popup/Actions/ActionTypes';
import {ObjectUtility} from 'Core/ObjectUtility';
import {TickerInterface} from 'Core/Interfaces/TickerInterface';

import {TickerStateInterface} from 'Popup/Reducer/Interfaces/TickerStateInterface';

const initialTickerState: TickerStateInterface = {
    tickers: ({} as Map<string, TickerInterface>),
    currentTickerKey: null
};

interface ActionInterface {
    type: string

    ticker?: TickerInterface
    tickers?: Map<string, TickerInterface>
    tickerKey?: string
}

function updateTicker(state: TickerStateInterface, ticker: TickerInterface) {
    const {tickers} = state;
    tickers[ticker.key] = ticker;

    return ObjectUtility.updateObject(state, {tickers: tickers});
}

export default function tickerState(state: TickerStateInterface = initialTickerState,
                                    action: ActionInterface = null) {
    switch (action.type) {
        case ActionTypes.FETCH_TICKERS: {
            return ObjectUtility.updateObject(state, {tickers: action.tickers});
        }

        case ActionTypes.UPDATE_TICKER: {
            return updateTicker(state, action.ticker);
        }

        case ActionTypes.SET_CURRENT_TICKER: {
            return ObjectUtility.updateObject(state, {currentTickerKey: action.tickerKey});
        }
    }

    return state;
}


text:
package com.twitter.app.command

import java.io.File
import scala.jdk.CollectionConverters._

/**
 * CommandExecutor is a private trait used for testing so that the actual forking of the
 * command can be mocked out.
 */
private[command] trait CommandExecutor {
  def apply(
    cmd: Seq[String],
    workingDirectory: Option[File],
    extraEnv: Map[String, String]
  ): Process
}

private[command] class CommandExecutorImpl extends CommandExecutor {

  /**
   *
   * @param cmd A [[Seq]] of [[String]] for the actual command
   * @param workingDirectory The directory in which the command will be run
   * @param extraEnv A map of extra environment variables to set for the command to be run
   * @return a [[java.lang.Process]] representing the subprocess kicked off
   */
  def apply(
    cmd: Seq[String],
    workingDirectory: Option[File],
    extraEnv: Map[String, String]
  ): Process = {
    val processBuilder = new java.lang.ProcessBuilder(cmd: _*)
    workingDirectory.foreach(dir => processBuilder.directory(dir))
    processBuilder.environment().putAll(extraEnv.asJava)
    processBuilder.start()
  }
}


text:
package runtime

import (
	"runtime/internal/atomic"
	"unsafe"
)

// A profBuf is a lock-free buffer for profiling events,
// safe for concurrent use by one reader and one writer.
// The writer may be a signal handler running without a user g.
// The reader is assumed to be a user g.
//
// Each logged event corresponds to a fixed size header, a list of
// uintptrs (typically a stack), and exactly one unsafe.Pointer tag.
// The header and uintptrs are stored in the circular buffer data and the
// tag is stored in a circular buffer tags, running in parallel.
// In the circular buffer data, each event takes 2+hdrsize+len(stk)
// words: the value 2+hdrsize+len(stk), then the time of the event, then
// hdrsize words giving the fixed-size header, and then len(stk) words
// for the stack.
//
// The current effective offsets into the tags and data circular buffers
// for reading and writing are stored in the high 30 and low 32 bits of r and w.
// The bottom bits of the high 32 are additional flag bits in w, unused in r.
// "Effective" offsets means the total number of reads or writes, mod 2^length.
// The offset in the buffer is the effective offset mod the length of the buffer.
// To make wraparound mod 2^length match wraparound mod length of the buffer,
// the length of the buffer must be a power of two.
//
// If the reader catches up to the writer, a flag passed to read controls
// whether the read blocks until more data is available. A read returns a
// pointer to the buffer data itself; the caller is assumed to be done with
// that data at the next read. The read offset rNext tracks the next offset to
// be returned by read. By definition, r ≤ rNext ≤ w (before wraparound),
// and rNext is only used by the reader, so it can be accessed without atomics.
//
// If the writer gets ahead of the reader, so that the buffer fills,
// future writes are discarded and replaced in the output stream by an
// overflow entry, which has size 2+hdrsize+1, time set to the time of
// the first discarded write, a header of all zeroed words, and a "stack"
// containing one word, the number of discarded writes.
//
// Between the time the buffer fills and the buffer becomes empty enough
// to hold more data, the overflow entry is stored as a pending overflow
// entry in the fields overflow and overflowTime. The pending overflow
// entry can be turned into a real record by either the writer or the
// reader. If the writer is called to write a new record and finds that
// the output buffer has room for both the pending overflow entry and the
// new record, the writer emits the pending overflow entry and the new
// record into the buffer. If the reader is called to read data and finds
// that the output buffer is empty but that there is a pending overflow
// entry, the reader will return a synthesized record for the pending
// overflow entry.
//
// Only the writer can create or add to a pending overflow entry, but
// either the reader or the writer can clear the pending overflow entry.
// A pending overflow entry is indicated by the low 32 bits of 'overflow'
// holding the number of discarded writes, and overflowTime holding the
// time of the first discarded write. The high 32 bits of 'overflow'
// increment each time the low 32 bits transition from zero to non-zero
// or vice versa. This sequence number avoids ABA problems in the use of
// compare-and-swap to coordinate between reader and writer.
// The overflowTime is only written when the low 32 bits of overflow are
// zero, that is, only when there is no pending overflow entry, in
// preparation for creating a new one. The reader can therefore fetch and
// clear the entry atomically using
//
//	for {
//		overflow = load(&b.overflow)
//		if uint32(overflow) == 0 {
//			// no pending entry
//			break
//		}
//		time = load(&b.overflowTime)
//		if cas(&b.overflow, overflow, ((overflow>>32)+1)<<32) {
//			// pending entry cleared
//			break
//		}
//	}
//	if uint32(overflow) > 0 {
//		emit entry for uint32(overflow), time
//	}
type profBuf struct {
	// accessed atomically
	r, w         profAtomic
	overflow     atomic.Uint64
	overflowTime atomic.Uint64
	eof          atomic.Uint32

	// immutable (excluding slice content)
	hdrsize uintptr
	data    []uint64
	tags    []unsafe.Pointer

	// owned by reader
	rNext       profIndex
	overflowBuf []uint64 // for use by reader to return overflow record
	wait        note
}

// A profAtomic is the atomically-accessed word holding a profIndex.
type profAtomic uint64

// A profIndex is the packet tag and data counts and flags bits, described above.
type profIndex uint64

const (
	profReaderSleeping profIndex = 1 << 32 // reader is sleeping and must be woken up
	profWriteExtra     profIndex = 1 << 33 // overflow or eof waiting
)

func (x *profAtomic) load() profIndex {
	return profIndex(atomic.Load64((*uint64)(x)))
}

func (x *profAtomic) store(new profIndex) {
	atomic.Store64((*uint64)(x), uint64(new))
}

func (x *profAtomic) cas(old, new profIndex) bool {
	return atomic.Cas64((*uint64)(x), uint64(old), uint64(new))
}

func (x profIndex) dataCount() uint32 {
	return uint32(x)
}

func (x profIndex) tagCount() uint32 {
	return uint32(x >> 34)
}

// countSub subtracts two counts obtained from profIndex.dataCount or profIndex.tagCount,
// assuming that they are no more than 2^29 apart (guaranteed since they are never more than
// len(data) or len(tags) apart, respectively).
// tagCount wraps at 2^30, while dataCount wraps at 2^32.
// This function works for both.
func countSub(x, y uint32) int {
	// x-y is 32-bit signed or 30-bit signed; sign-extend to 32 bits and convert to int.
	return int(int32(x-y) << 2 >> 2)
}

// addCountsAndClearFlags returns the packed form of "x + (data, tag) - all flags".
func (x profIndex) addCountsAndClearFlags(data, tag int) profIndex {
	return profIndex((uint64(x)>>34+uint64(uint32(tag)<<2>>2))<<34 | uint64(uint32(x)+uint32(data)))
}

// hasOverflow reports whether b has any overflow records pending.
func (b *profBuf) hasOverflow() bool {
	return uint32(b.overflow.Load()) > 0
}

// takeOverflow consumes the pending overflow records, returning the overflow count
// and the time of the first overflow.
// When called by the reader, it is racing against incrementOverflow.
func (b *profBuf) takeOverflow() (count uint32, time uint64) {
	overflow := b.overflow.Load()
	time = b.overflowTime.Load()
	for {
		count = uint32(overflow)
		if count == 0 {
			time = 0
			break
		}
		// Increment generation, clear overflow count in low bits.
		if b.overflow.CompareAndSwap(overflow, ((overflow>>32)+1)<<32) {
			break
		}
		overflow = b.overflow.Load()
		time = b.overflowTime.Load()
	}
	return uint32(overflow), time
}

// incrementOverflow records a single overflow at time now.
// It is racing against a possible takeOverflow in the reader.
func (b *profBuf) incrementOverflow(now int64) {
	for {
		overflow := b.overflow.Load()

		// Once we see b.overflow reach 0, it's stable: no one else is changing it underfoot.
		// We need to set overflowTime if we're incrementing b.overflow from 0.
		if uint32(overflow) == 0 {
			// Store overflowTime first so it's always available when overflow != 0.
			b.overflowTime.Store(uint64(now))
			b.overflow.Store((((overflow >> 32) + 1) << 32) + 1)
			break
		}
		// Otherwise we're racing to increment against reader
		// who wants to set b.overflow to 0.
		// Out of paranoia, leave 2³²-1 a sticky overflow value,
		// to avoid wrapping around. Extremely unlikely.
		if int32(overflow) == -1 {
			break
		}
		if b.overflow.CompareAndSwap(overflow, overflow+1) {
			break
		}
	}
}

// newProfBuf returns a new profiling buffer with room for
// a header of hdrsize words and a buffer of at least bufwords words.
func newProfBuf(hdrsize, bufwords, tags int) *profBuf {
	if min := 2 + hdrsize + 1; bufwords < min {
		bufwords = min
	}

	// Buffer sizes must be power of two, so that we don't have to
	// worry about uint32 wraparound changing the effective position
	// within the buffers. We store 30 bits of count; limiting to 28
	// gives us some room for intermediate calculations.
	if bufwords >= 1<<28 || tags >= 1<<28 {
		throw("newProfBuf: buffer too large")
	}
	var i int
	for i = 1; i < bufwords; i <<= 1 {
	}
	bufwords = i
	for i = 1; i < tags; i <<= 1 {
	}
	tags = i

	b := new(profBuf)
	b.hdrsize = uintptr(hdrsize)
	b.data = make([]uint64, bufwords)
	b.tags = make([]unsafe.Pointer, tags)
	b.overflowBuf = make([]uint64, 2+b.hdrsize+1)
	return b
}

// canWriteRecord reports whether the buffer has room
// for a single contiguous record with a stack of length nstk.
func (b *profBuf) canWriteRecord(nstk int) bool {
	br := b.r.load()
	bw := b.w.load()

	// room for tag?
	if countSub(br.tagCount(), bw.tagCount())+len(b.tags) < 1 {
		return false
	}

	// room for data?
	nd := countSub(br.dataCount(), bw.dataCount()) + len(b.data)
	want := 2 + int(b.hdrsize) + nstk
	i := int(bw.dataCount() % uint32(len(b.data)))
	if i+want > len(b.data) {
		// Can't fit in trailing fragment of slice.
		// Skip over that and start over at beginning of slice.
		nd -= len(b.data) - i
	}
	return nd >= want
}

// canWriteTwoRecords reports whether the buffer has room
// for two records with stack lengths nstk1, nstk2, in that order.
// Each record must be contiguous on its own, but the two
// records need not be contiguous (one can be at the end of the buffer
// and the other can wrap around and start at the beginning of the buffer).
func (b *profBuf) canWriteTwoRecords(nstk1, nstk2 int) bool {
	br := b.r.load()
	bw := b.w.load()

	// room for tag?
	if countSub(br.tagCount(), bw.tagCount())+len(b.tags) < 2 {
		return false
	}

	// room for data?
	nd := countSub(br.dataCount(), bw.dataCount()) + len(b.data)

	// first record
	want := 2 + int(b.hdrsize) + nstk1
	i := int(bw.dataCount() % uint32(len(b.data)))
	if i+want > len(b.data) {
		// Can't fit in trailing fragment of slice.
		// Skip over that and start over at beginning of slice.
		nd -= len(b.data) - i
		i = 0
	}
	i += want
	nd -= want

	// second record
	want = 2 + int(b.hdrsize) + nstk2
	if i+want > len(b.data) {
		// Can't fit in trailing fragment of slice.
		// Skip over that and start over at beginning of slice.
		nd -= len(b.data) - i
		i = 0
	}
	return nd >= want
}

// write writes an entry to the profiling buffer b.
// The entry begins with a fixed hdr, which must have
// length b.hdrsize, followed by a variable-sized stack
// and a single tag pointer *tagPtr (or nil if tagPtr is nil).
// No write barriers allowed because this might be called from a signal handler.
func (b *profBuf) write(tagPtr *unsafe.Pointer, now int64, hdr []uint64, stk []uintptr) {
	if b == nil {
		return
	}
	if len(hdr) > int(b.hdrsize) {
		throw("misuse of profBuf.write")
	}

	if hasOverflow := b.hasOverflow(); hasOverflow && b.canWriteTwoRecords(1, len(stk)) {
		// Room for both an overflow record and the one being written.
		// Write the overflow record if the reader hasn't gotten to it yet.
		// Only racing against reader, not other writers.
		count, time := b.takeOverflow()
		if count > 0 {
			var stk [1]uintptr
			stk[0] = uintptr(count)
			b.write(nil, int64(time), nil, stk[:])
		}
	} else if hasOverflow || !b.canWriteRecord(len(stk)) {
		// Pending overflow without room to write overflow and new records
		// or no overflow but also no room for new record.
		b.incrementOverflow(now)
		b.wakeupExtra()
		return
	}

	// There's room: write the record.
	br := b.r.load()
	bw := b.w.load()

	// Profiling tag
	//
	// The tag is a pointer, but we can't run a write barrier here.
	// We have interrupted the OS-level execution of gp, but the
	// runtime still sees gp as executing. In effect, we are running
	// in place of the real gp. Since gp is the only goroutine that
	// can overwrite gp.labels, the value of gp.labels is stable during
	// this signal handler: it will still be reachable from gp when
	// we finish executing. If a GC is in progress right now, it must
	// keep gp.labels alive, because gp.labels is reachable from gp.
	// If gp were to overwrite gp.labels, the deletion barrier would
	// still shade that pointer, which would preserve it for the
	// in-progress GC, so all is well. Any future GC will see the
	// value we copied when scanning b.tags (heap-allocated).
	// We arrange that the store here is always overwriting a nil,
	// so there is no need for a deletion barrier on b.tags[wt].
	wt := int(bw.tagCount() % uint32(len(b.tags)))
	if tagPtr != nil {
		*(*uintptr)(unsafe.Pointer(&b.tags[wt])) = uintptr(unsafe.Pointer(*tagPtr))
	}

	// Main record.
	// It has to fit in a contiguous section of the slice, so if it doesn't fit at the end,
	// leave a rewind marker (0) and start over at the beginning of the slice.
	wd := int(bw.dataCount() % uint32(len(b.data)))
	nd := countSub(br.dataCount(), bw.dataCount()) + len(b.data)
	skip := 0
	if wd+2+int(b.hdrsize)+len(stk) > len(b.data) {
		b.data[wd] = 0
		skip = len(b.data) - wd
		nd -= skip
		wd = 0
	}
	data := b.data[wd:]
	data[0] = uint64(2 + b.hdrsize + uintptr(len(stk))) // length
	data[1] = uint64(now)                               // time stamp
	// header, zero-padded
	i := uintptr(copy(data[2:2+b.hdrsize], hdr))
	for ; i < b.hdrsize; i++ {
		data[2+i] = 0
	}
	for i, pc := range stk {
		data[2+b.hdrsize+uintptr(i)] = uint64(pc)
	}

	for {
		// Commit write.
		// Racing with reader setting flag bits in b.w, to avoid lost wakeups.
		old := b.w.load()
		new := old.addCountsAndClearFlags(skip+2+len(stk)+int(b.hdrsize), 1)
		if !b.w.cas(old, new) {
			continue
		}
		// If there was a reader, wake it up.
		if old&profReaderSleeping != 0 {
			notewakeup(&b.wait)
		}
		break
	}
}

// close signals that there will be no more writes on the buffer.
// Once all the data has been read from the buffer, reads will return eof=true.
func (b *profBuf) close() {
	if b.eof.Load() > 0 {
		throw("runtime: profBuf already closed")
	}
	b.eof.Store(1)
	b.wakeupExtra()
}

// wakeupExtra must be called after setting one of the "extra"
// atomic fields b.overflow or b.eof.
// It records the change in b.w and wakes up the reader if needed.
func (b *profBuf) wakeupExtra() {
	for {
		old := b.w.load()
		new := old | profWriteExtra
		if !b.w.cas(old, new) {
			continue
		}
		if old&profReaderSleeping != 0 {
			notewakeup(&b.wait)
		}
		break
	}
}

// profBufReadMode specifies whether to block when no data is available to read.
type profBufReadMode int

const (
	profBufBlocking profBufReadMode = iota
	profBufNonBlocking
)

var overflowTag [1]unsafe.Pointer // always nil

func (b *profBuf) read(mode profBufReadMode) (data []uint64, tags []unsafe.Pointer, eof bool) {
	if b == nil {
		return nil, nil, true
	}

	br := b.rNext

	// Commit previous read, returning that part of the ring to the writer.
	// First clear tags that have now been read, both to avoid holding
	// up the memory they point at for longer than necessary
	// and so that b.write can assume it is always overwriting
	// nil tag entries (see comment in b.write).
	rPrev := b.r.load()
	if rPrev != br {
		ntag := countSub(br.tagCount(), rPrev.tagCount())
		ti := int(rPrev.tagCount() % uint32(len(b.tags)))
		for i := 0; i < ntag; i++ {
			b.tags[ti] = nil
			if ti++; ti == len(b.tags) {
				ti = 0
			}
		}
		b.r.store(br)
	}

Read:
	bw := b.w.load()
	numData := countSub(bw.dataCount(), br.dataCount())
	if numData == 0 {
		if b.hasOverflow() {
			// No data to read, but there is overflow to report.
			// Racing with writer flushing b.overflow into a real record.
			count, time := b.takeOverflow()
			if count == 0 {
				// Lost the race, go around again.
				goto Read
			}
			// Won the race, report overflow.
			dst := b.overflowBuf
			dst[0] = uint64(2 + b.hdrsize + 1)
			dst[1] = uint64(time)
			for i := uintptr(0); i < b.hdrsize; i++ {
				dst[2+i] = 0
			}
			dst[2+b.hdrsize] = uint64(count)
			return dst[:2+b.hdrsize+1], overflowTag[:1], false
		}
		if b.eof.Load() > 0 {
			// No data, no overflow, EOF set: done.
			return nil, nil, true
		}
		if bw&profWriteExtra != 0 {
			// Writer claims to have published extra information (overflow or eof).
			// Attempt to clear notification and then check again.
			// If we fail to clear the notification it means b.w changed,
			// so we still need to check again.
			b.w.cas(bw, bw&^profWriteExtra)
			goto Read
		}

		// Nothing to read right now.
		// Return or sleep according to mode.
		if mode == profBufNonBlocking {
			return nil, nil, false
		}
		if !b.w.cas(bw, bw|profReaderSleeping) {
			goto Read
		}
		// Committed to sleeping.
		notetsleepg(&b.wait, -1)
		noteclear(&b.wait)
		goto Read
	}
	data = b.data[br.dataCount()%uint32(len(b.data)):]
	if len(data) > numData {
		data = data[:numData]
	} else {
		numData -= len(data) // available in case of wraparound
	}
	skip := 0
	if data[0] == 0 {
		// Wraparound record. Go back to the beginning of the ring.
		skip = len(data)
		data = b.data
		if len(data) > numData {
			data = data[:numData]
		}
	}

	ntag := countSub(bw.tagCount(), br.tagCount())
	if ntag == 0 {
		throw("runtime: malformed profBuf buffer - tag and data out of sync")
	}
	tags = b.tags[br.tagCount()%uint32(len(b.tags)):]
	if len(tags) > ntag {
		tags = tags[:ntag]
	}

	// Count out whole data records until either data or tags is done.
	// They are always in sync in the buffer, but due to an end-of-slice
	// wraparound we might need to stop early and return the rest
	// in the next call.
	di := 0
	ti := 0
	for di < len(data) && data[di] != 0 && ti < len(tags) {
		if uintptr(di)+uintptr(data[di]) > uintptr(len(data)) {
			throw("runtime: malformed profBuf buffer - invalid size")
		}
		di += int(data[di])
		ti++
	}

	// Remember how much we returned, to commit read on next call.
	b.rNext = br.addCountsAndClearFlags(skip+di, ti)

	if raceenabled {
		// Match racereleasemerge in runtime_setProfLabel,
		// so that the setting of the labels in runtime_setProfLabel
		// is treated as happening before any use of the labels
		// by our caller. The synchronization on labelSync itself is a fiction
		// for the race detector. The actual synchronization is handled
		// by the fact that the signal handler only reads from the current
		// goroutine and uses atomics to write the updated queue indices,
		// and then the read-out from the signal handler buffer uses
		// atomics to read those queue indices.
		raceacquire(unsafe.Pointer(&labelSync))
	}

	return data[:di], tags[:ti], false
}


text:
var phantom = require('node-phantom-simple'),
    phantomjs = require('phantomjs-prebuilt'),
    assert = require('assert'),
    testutil = require('./lib/testutil'),
    one_step_timeout = 8000,
    refreshThen = testutil.refreshThen,
    asyncTest = testutil.asyncTest;

describe('new user', function() {
  var _ph, _page;
  before(function(done) {
    // Create the headless webkit browser.
    phantom.create({
      path: phantomjs.path,
      parameters: {
        // Use the test server as a proxy server, so that all requests
        // go to this server (instead of trying real DNS lookups).
        proxy: '127.0.0.1:8193',
        // Set the disk storage to zero to avoid persisting localStorage
        // between test runs.
        'local-storage-quota': 0
      }
    }, function(error, ph) {
      assert.ifError(error);
      // Open a page for browsing.
      _ph = ph;
      _ph.createPage(function(err, page) {
        _page = page;
        // Set the size to a modern laptop size.
        page.set('viewportSize', { width: 1200, height: 900 }, function(err) {
          assert.ifError(err);
          // Point it to a blank page to start
          page.open('about:blank', function(err, status){
            assert.ifError(err);
            assert.equal(status, 'success');
            done();
          });
        });
      });
    });
  });
  after(function() {
    // Be sure to kill the browser when the test is done, or else
    // we can leave orphan processes.
    _ph.exit();
  });
  it('should serve static editor HTML', function(done) {
    // Give a few milliseconds before opening this page: it seems
    // to help avoid crashing phantomjs.
    setTimeout(function() {
      // The #new hash is the magic signup URL: it should
      // show the "Create account" dialog.
      _page.open('http://pencilcode.net.dev/edit/intro#new',
          function(err, status) {
        assert.ifError(err);
        assert.equal(status, 'success');
        _page.evaluate(function() {
          // Inject a script that clears the login cookie for a clean start.
          document.cookie='login=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
          // And also clear localStorage for this site.
          localStorage.clear();
        }, function(err) {
          assert.ifError(err);
          done();
        });
      });
    }, 100);
  });
  it('should load code', function(done) {
    asyncTest(_page, one_step_timeout, null, null, function() {
      // Poll until the element with class="editor" appears on the page.
      if (!$('.editor').length) return;
      // Poll until a dialog is shown.
      if (!$('.dialog').length) return;
      // Reach in and return the text that is shown within the editor.
      var ace_editor = ace.edit($('.droplet-ace')[0]);
      return {
        text: ace_editor.getSession().getValue(),
        active: document.activeElement &&
            document.activeElement.getAttribute('class'),
        preview: $('.preview').length,
        saved: $('#save').prop('disabled'),
        login: $('#login').length,
        logout: $('#logout').length
      };
    }, function(err, result) {
      assert.ifError(err);
      // The editor text should contain this line of code.
      assert.ok(/# Welcome/.test(result.text), 'Got ' + result.text);
      // The save button should not be disabled (even though unmodified).
      assert.equal(result.saved, false);
      // There should be one login button.
      assert.equal(result.login, 1);
      // There should be no logout buton.
      assert.equal(result.logout, 0);
      // The element with focus should NOT be the editor - it should be
      // the username field.
      assert.equal(result.active, 'username');
      done();
    });
  });
  it('should show login prompt when saving', function(done) {
    asyncTest(_page, one_step_timeout, null, function() {
      // We should not need to click on the save button:
      // The signup dialog should show already.
      // $('#save').click();
    }, function() {
      // Wait for the login dialog to pop up.
      if (!$('.dialog').is(':visible')) return;
      return {
        itext: $('.dialog .info').html(),
        udisabled: $('.username').is(':disabled'),
        uval: $('.username').val(),
        pdisabled: $('.password').is(':disabled'),
        pval: $('.password').val()
      };
    }, function(err, result) {
      assert.ifError(err);
      // The login dialog should link to terms of service and privacy policy.
      assert.ok(/href="[^"]*\/privacy.html\"/.test(result.itext));
      assert.ok(/href="[^"]*\/terms.html\"/.test(result.itext));
      // The username should be enabled and start empty.
      assert.equal(false, result.udisabled);
      assert.equal('', result.uval);
      // The password should be enabled and start empty.
      assert.equal(false, result.pdisabled);
      assert.equal('', result.pval);
      done();
    });
  });
  it('should reject a low-complexity username', function(done) {
    asyncTest(_page, one_step_timeout, null, function() {
      // Enter a low-complexity username, and click OK.
      $('.username').val('zkkg');
      $('.username').trigger('keyup');
    }, function() {
      // Wait for the info prompt to show a message without "privacy.html"
      if (!$('.info').is(':visible')) return;
      if ($('.info').html().indexOf('privacy.html') >= 0) return;
      return {
        infotext: $('.info').text()
      };
    }, function(err, result) {
      assert.ifError(err);
      // The message should report that the password is wrong.
      assert.equal('Name \"zkkg\" reserved.', result.infotext);
      done();
    });
  });
  it('should reject a too-long username', function(done) {
    asyncTest(_page, one_step_timeout, null, function() {
      // Enter a low-complexity username, and click OK.
      $('.username').val('thisusernameistwenty1');
      $('.username').trigger('keyup');
    }, function() {
      // Wait for the info prompt to show a message without "zkkg"
      if (!$('.info').is(':visible')) return;
      if ($('.info').text().match(/zkkg/)) return;
      if ($('.info').html().indexOf('privacy.html') >= 0) return;
      return {
        infotext: $('.info').text()
      };
    }, function(err, result) {
      assert.ifError(err);
      // The message should report that the password is wrong.
      assert.equal('Username too long.', result.infotext);
      done();
    });
  });
  it('should reject an email-looking username', function(done) {
    asyncTest(_page, one_step_timeout, null, function() {
      // Enter a low-complexity username, and click OK.
      $('.username').val('bobatmitedu');
      $('.username').trigger('keyup');
    }, function() {
      // Wait for the info prompt to show a message without "too long"
      if (!$('.info').is(':visible')) return;
      if ($('.info').text().match(/too long/)) return;
      if ($('.info').html().indexOf('privacy.html') >= 0) return;
      return {
        infotext: $('.info').text()
      };
    }, function(err, result) {
      assert.ifError(err);
      // The message should report that the password is wrong.
      assert.equal('Name should not end with "edu".', result.infotext);
      done();
    });
  });
  it('should accept an OK username', function(done) {
    asyncTest(_page, one_step_timeout, null, function() {
      // Enter the correct password, and click OK again.
      $('.username').val('zkgtest');
      $('.username').trigger('keyup');
    }, function() {
      // Wait for the info prompt to show a message without "zkkg"
      if (!$('.info').is(':visible')) return;
      if ($('.info').text().match(/zkkg/)) return;
      if ($('.info').html().indexOf('privacy.html') >= 0) return;
      return {
        infotext: $('.info').text()
      };
    }, function(err, result) {
      assert.ifError(err);
      // The butterbar should show that the document is saved.
      assert.ok(/Will create zkgtest/.test(result.infotext));
      done();
    });
  });
  it('is done', function(done) {
    asyncTest(_page, one_step_timeout, null, function() {
      // Final cleanup: delete local storage and the cookie.
      localStorage.clear();
      document.cookie='login=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
    }, function() {
      return {
        cookie: document.cookie
      };
    }, function(err, result) {
      assert.ifError(err);
      assert.ok(!/login=/.test(result.cookie));
      done();
    });
  });
});


text:
#include "common_tools.h"
#include "opengles.h"

typedef void (APIENTRY *glImportSemaphoreWin32HandleEXTPROC) (jint, jint, uintptr_t);
typedef void (APIENTRY *glImportSemaphoreWin32NameEXTPROC) (jint, jint, uintptr_t);

EXTERN_C_ENTER

JNIEXPORT void JNICALL Java_org_lwjgl_opengles_EXTSemaphoreWin32_nglImportSemaphoreWin32HandleEXT(JNIEnv *__env, jclass clazz, jint semaphore, jint handleType, jlong handleAddress) {
    glImportSemaphoreWin32HandleEXTPROC glImportSemaphoreWin32HandleEXT = (glImportSemaphoreWin32HandleEXTPROC)tlsGetFunction(491);
    uintptr_t handle = (uintptr_t)handleAddress;
    UNUSED_PARAM(clazz)
    glImportSemaphoreWin32HandleEXT(semaphore, handleType, handle);
}

JNIEXPORT void JNICALL Java_org_lwjgl_opengles_EXTSemaphoreWin32_nglImportSemaphoreWin32NameEXT(JNIEnv *__env, jclass clazz, jint semaphore, jint handleType, jlong nameAddress) {
    glImportSemaphoreWin32NameEXTPROC glImportSemaphoreWin32NameEXT = (glImportSemaphoreWin32NameEXTPROC)tlsGetFunction(492);
    uintptr_t name = (uintptr_t)nameAddress;
    UNUSED_PARAM(clazz)
    glImportSemaphoreWin32NameEXT(semaphore, handleType, name);
}

EXTERN_C_EXIT


text:
package endpoints
package documented
package algebra

import endpoints.algebra.BasicAuthentication.Credentials

/**
  * Algebra interface for describing HTTP Basic authentication.
  *
  * This interface is modeled after [[endpoints.algebra.BasicAuthentication]].
  */
trait BasicAuthentication extends Endpoints {

  /**
    * Credentials encoded as HTTP Basic Auth header
    *
    * In routing interpreters if header is not present it should match the route and return 401 Unauthorized.
    * @return
    */
  private[endpoints] def basicAuthentication: RequestHeaders[Credentials]

  /**
    * @param response Inner response (in case the authentication succeeds)
    * @param documentation Description of the authentication error
    */
  private[endpoints] def authenticated[A](response: Response[A], documentation: String): Response[Option[A]]

  /**
    * Describes an endpoint protected by Basic HTTP authentication
    */
  def authenticatedEndpoint[A, B, C, AB](
    method: Method,
    url: Url[A],
    requestEntity: RequestEntity[B] = emptyRequest,
    response: Response[C],
    documentation: String
  )(implicit
    tuplerAB: Tupler.Aux[A, B, AB],
    tuplerABC: Tupler[AB, Credentials]
  ): Endpoint[tuplerABC.Out, Option[C]] =
    endpoint(request(method, url, requestEntity, basicAuthentication), authenticated(response, documentation))

}


text:
/**
 * Created by gerard on 30/07/16.
 */
(function () {
    'use strict';

    var pubKeyManager = angular.module("PubKeyManager");

    pubKeyManager.factory("httpResponseInterceptor", ["$q", "$location",
        function ($q, $location) {

            return {
                responseError: function (rejection) {
                    if (rejection.status == 401) {
                        $location.path("/login");
                    }
                    return $q.reject(rejection);
                }
            };

        }]);

    pubKeyManager.config(['$httpProvider', function ($httpProvider) {
        $httpProvider.interceptors.push('httpResponseInterceptor');
    }]);
})();


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>css3d test</title>
<link rel="stylesheet" href="mocha.css">


text:
package daemon

import (
	"fmt"
	"path/filepath"

	"github.com/docker/docker/graph"
	"github.com/docker/docker/image"
	"github.com/docker/docker/pkg/parsers"
	"github.com/docker/docker/runconfig"
	"github.com/docker/libcontainer/label"
)

func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hostConfig *runconfig.HostConfig) (string, []string, error) {
	warnings, err := daemon.verifyHostConfig(hostConfig)
	if err != nil {
		return "", warnings, err
	}

	// The check for a valid workdir path is made on the server rather than in the
	// client. This is because we don't know the type of path (Linux or Windows)
	// to validate on the client.
	if config.WorkingDir != "" && !filepath.IsAbs(config.WorkingDir) {
		return "", warnings, fmt.Errorf("The working directory '%s' is invalid. It needs to be an absolute path.", config.WorkingDir)
	}

	if !daemon.SystemConfig().OomKillDisable {
		hostConfig.OomKillDisable = false
		return "", warnings, fmt.Errorf("Your kernel does not support oom kill disable.")
	}

	container, buildWarnings, err := daemon.Create(config, hostConfig, name)
	if err != nil {
		if daemon.Graph().IsNotExist(err, config.Image) {
			_, tag := parsers.ParseRepositoryTag(config.Image)
			if tag == "" {
				tag = graph.DEFAULTTAG
			}
			return "", warnings, fmt.Errorf("No such image: %s (tag: %s)", config.Image, tag)
		}
		return "", warnings, err
	}

	container.LogEvent("create")
	warnings = append(warnings, buildWarnings...)

	return container.ID, warnings, nil
}

// Create creates a new container from the given configuration with a given name.
func (daemon *Daemon) Create(config *runconfig.Config, hostConfig *runconfig.HostConfig, name string) (*Container, []string, error) {
	var (
		container *Container
		warnings  []string
		img       *image.Image
		imgID     string
		err       error
	)

	if config.Image != "" {
		img, err = daemon.repositories.LookupImage(config.Image)
		if err != nil {
			return nil, nil, err
		}
		if err = img.CheckDepth(); err != nil {
			return nil, nil, err
		}
		imgID = img.ID
	}

	if warnings, err = daemon.mergeAndVerifyConfig(config, img); err != nil {
		return nil, nil, err
	}
	if !config.NetworkDisabled && daemon.SystemConfig().IPv4ForwardingDisabled {
		warnings = append(warnings, "IPv4 forwarding is disabled.\n")
	}
	if hostConfig == nil {
		hostConfig = &runconfig.HostConfig{}
	}
	if hostConfig.SecurityOpt == nil {
		hostConfig.SecurityOpt, err = daemon.GenerateSecurityOpt(hostConfig.IpcMode, hostConfig.PidMode)
		if err != nil {
			return nil, nil, err
		}
	}
	if container, err = daemon.newContainer(name, config, imgID); err != nil {
		return nil, nil, err
	}
	if err := daemon.Register(container); err != nil {
		return nil, nil, err
	}
	if err := daemon.createRootfs(container); err != nil {
		return nil, nil, err
	}
	if hostConfig != nil {
		if err := daemon.setHostConfig(container, hostConfig); err != nil {
			return nil, nil, err
		}
	}
	if err := container.Mount(); err != nil {
		return nil, nil, err
	}
	defer container.Unmount()
	if err := container.prepareVolumes(); err != nil {
		return nil, nil, err
	}
	if err := container.ToDisk(); err != nil {
		return nil, nil, err
	}
	return container, warnings, nil
}

func (daemon *Daemon) GenerateSecurityOpt(ipcMode runconfig.IpcMode, pidMode runconfig.PidMode) ([]string, error) {
	if ipcMode.IsHost() || pidMode.IsHost() {
		return label.DisableSecOpt(), nil
	}
	if ipcContainer := ipcMode.Container(); ipcContainer != "" {
		c, err := daemon.Get(ipcContainer)
		if err != nil {
			return nil, err
		}
		if !c.IsRunning() {
			return nil, fmt.Errorf("cannot join IPC of a non running container: %s", ipcContainer)
		}

		return label.DupSecOpt(c.ProcessLabel), nil
	}
	return nil, nil
}


text: shopt -s histappend


text:
        We're sorry,
        Great,
        authorization was not successful.

        This window should now close automatically.


text:
using System;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Runtime.Serialization;
using Umbraco.Core.Models.Entities;

namespace Umbraco.Core.Models
{
    /// <summary>
    /// A group of property types, which corresponds to the properties grouped under a Tab.
    /// </summary>
    [Serializable]
    [DataContract(IsReference = true)]
    [DebuggerDisplay("Id: {Id}, Name: {Name}")]
    public class PropertyGroup : EntityBase, IEquatable<PropertyGroup>
    {
        private string _name;
        private int _sortOrder;
        private PropertyTypeCollection _propertyTypes;

        public PropertyGroup(bool isPublishing)
            : this(new PropertyTypeCollection(isPublishing))
        { }

        public PropertyGroup(PropertyTypeCollection propertyTypeCollection)
        {
            PropertyTypes = propertyTypeCollection;
        }

        private void PropertyTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            OnPropertyChanged(nameof(PropertyTypes));
        }

        /// <summary>
        /// Gets or sets the Name of the Group, which corresponds to the Tab-name in the UI
        /// </summary>
        [DataMember]
        public string Name
        {
            get => _name;
            set => SetPropertyValueAndDetectChanges(value, ref _name, nameof(Name));
        }

        /// <summary>
        /// Gets or sets the Sort Order of the Group
        /// </summary>
        [DataMember]
        public int SortOrder
        {
            get => _sortOrder;
            set => SetPropertyValueAndDetectChanges(value, ref _sortOrder, nameof(SortOrder));
        }

        /// <summary>
        /// Gets or sets a collection of PropertyTypes for this PropertyGroup
        /// </summary>
        /// <remarks>
        /// Marked DoNotClone because we will manually deal with cloning and the event handlers
        /// </remarks>
        [DataMember]
        [DoNotClone]
        public PropertyTypeCollection PropertyTypes
        {
            get => _propertyTypes;
            set
            {
                if (_propertyTypes != null)
                    _propertyTypes.CollectionChanged -= PropertyTypesChanged;
                _propertyTypes = value;

                // since we're adding this collection to this group,
                // we need to ensure that all the lazy values are set.
                foreach (var propertyType in _propertyTypes)
                    propertyType.PropertyGroupId = new Lazy<int>(() => Id);

                OnPropertyChanged(nameof(PropertyTypes));
                _propertyTypes.CollectionChanged += PropertyTypesChanged;
            }
        }

        public bool Equals(PropertyGroup other)
        {
            if (base.Equals(other)) return true;
            return other != null && Name.InvariantEquals(other.Name);
        }

        public override int GetHashCode()
        {
            var baseHash = base.GetHashCode();
            var nameHash = Name.ToLowerInvariant().GetHashCode();
            return baseHash ^ nameHash;
        }

        protected override void PerformDeepClone(object clone)
        {
            base.PerformDeepClone(clone);

            var clonedEntity = (PropertyGroup)clone;

            if (clonedEntity._propertyTypes != null)
            {
                clonedEntity._propertyTypes.CollectionChanged -= PropertyTypesChanged;             //clear this event handler if any
                clonedEntity._propertyTypes = (PropertyTypeCollection) _propertyTypes.DeepClone(); //manually deep clone
                clonedEntity._propertyTypes.CollectionChanged += clonedEntity.PropertyTypesChanged;       //re-assign correct event handler
            }
        }
    }
}


text:
package webhookd

import (
	"fmt"
)

// WebhookError implements the `error` interface for wrapping webhookd error codes and messages.
type WebhookError struct {
	error
	// A numeric status code identifying the error.
	Code int
	// A long-form string describing the error.
	Message string
}

// Error() returns a string containing both the status code and descriptive message associated with an error.
func (e WebhookError) Error() string {
	return fmt.Sprintf("%d %s", e.Code, e.Message)
}


text:
void CodeBuffer::Emit32(int32_t data) {
  ensureCapacity(getSize() + sizeof(int32_t));
  *reinterpret_cast<int32_t *>(getCursor()) = data;
  buffer_cursor += sizeof(int32_t);
  return;
}

void CodeBuffer::Emit64(int64_t data) {
  ensureCapacity(getSize() + sizeof(int64_t));
  *reinterpret_cast<int64_t *>(getCursor()) = data;
  buffer_cursor += sizeof(int64_t);
  return;
}

void CodeBuffer::FixBindLabel(int offset, int32_t disp) {
  *reinterpret_cast<uint32_t *>(buffer + offset) = disp;
  return;
}

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="d588d6fa-2dd0-49c2-a2be-612168ee5063" name="Default" comment="">
      <change beforePath="" afterPath="$PROJECT_DIR$/.idea/php.xml" />
      <change beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
      <change beforePath="" afterPath="$PROJECT_DIR$/Services/Elements.php" />
      <change beforePath="" afterPath="$PROJECT_DIR$/Services/Sections.php" />
      <change beforePath="" afterPath="$PROJECT_DIR$/composer.json" />
      <change beforePath="$PROJECT_DIR$/Controllers/BaseController.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/Controllers/CategoriesController.php" afterPath="$PROJECT_DIR$/Controllers/CategoriesController.php" />
      <change beforePath="$PROJECT_DIR$/Controllers/CategoryController.php" afterPath="$PROJECT_DIR$/Controllers/CategoryController.php" />
      <change beforePath="$PROJECT_DIR$/Controllers/ElementController.php" afterPath="$PROJECT_DIR$/Controllers/ElementController.php" />
      <change beforePath="$PROJECT_DIR$/Controllers/ElementsController.php" afterPath="$PROJECT_DIR$/Controllers/ElementsController.php" />
      <change beforePath="$PROJECT_DIR$/class.php" afterPath="$PROJECT_DIR$/class.php" />
      <change beforePath="$PROJECT_DIR$/templates/.default/404.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/.default/categories.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/.default/category.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/.default/element.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/.default/elements.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/uikit/404.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/uikit/categories.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/uikit/category.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/uikit/element.php" afterPath="" />
      <change beforePath="$PROJECT_DIR$/templates/uikit/elements.php" afterPath="" />
    </list>
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ComposerSettings">
    <pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
  </component>
  <component name="FileEditorManager">
    <leaf />
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>notFo</find>
    </findStrings>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/composer.json" />
        <option value="$PROJECT_DIR$/vendor/falur/bitrix-support/src/Component/MultiPageComponent.php" />
        <option value="$PROJECT_DIR$/class.php" />
        <option value="$PROJECT_DIR$/vendor/falur/bitrix-support/src/Component/SinglePageComponent.php" />
        <option value="$PROJECT_DIR$/vendor/falur/bitrix-iblock/src/Sections.php" />
        <option value="$PROJECT_DIR$/vendor/falur/bitrix-support/src/Component/BaseController.php" />
        <option value="$PROJECT_DIR$/Services/Elements.php" />
        <option value="$PROJECT_DIR$/Controllers/ElementsController.php" />
        <option value="$PROJECT_DIR$/Services/Sections.php" />
        <option value="$PROJECT_DIR$/Controllers/CategoriesController.php" />
        <option value="$PROJECT_DIR$/Controllers/CategoryController.php" />
        <option value="$PROJECT_DIR$/Controllers/ElementController.php" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true">
    <include_path>
      <path value="$PROJECT_DIR$/../../IDE/bxApiDocs-master" />
      <path value="$PROJECT_DIR$/vendor/psr/http-message" />
      <path value="$PROJECT_DIR$/vendor/psr/container" />
      <path value="$PROJECT_DIR$/vendor/container-interop/container-interop" />
      <path value="$PROJECT_DIR$/vendor/composer" />
      <path value="$PROJECT_DIR$/vendor/slim/slim" />
      <path value="$PROJECT_DIR$/vendor/nikic/fast-route" />
      <path value="$PROJECT_DIR$/vendor/falur/bitrix-iblock" />
      <path value="$PROJECT_DIR$/vendor/falur/bitrix-support" />
      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
      <path value="$PROJECT_DIR$/vendor/symfony/translation" />
      <path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
      <path value="$PROJECT_DIR$/vendor/pimple/pimple" />
      <path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
    </include_path>
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="x" value="1920" />
    <option name="y" value="27" />
    <option name="width" value="1920" />
    <option name="height" value="1053" />
  </component>
  <component name="ProjectLevelVcsManager">
    <ConfirmationsSetting value="2" id="Add" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="bitrix.com.iblock.multipage" type="b2602c69:ProjectViewProjectNode" />
              <item name="bitrix.com.iblock.multipage" type="2a2b976b:PhpTreeStructureProvider$1" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
      <pane id="Scope" />
      <pane id="Scratches" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/.." />
    <property name="settings.editor.selected.configurable" value="reference.webide.settings.project.settings.php" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$" />
    </key>
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="d588d6fa-2dd0-49c2-a2be-612168ee5063" name="Default" comment="" />
      <created>1515607192471</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1515607192471</updated>
      <workItem from="1515607193560" duration="7482000" />
      <workItem from="1515691105583" duration="930000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="8412000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="1920" y="27" width="1920" height="1053" extended-state="6" />
    <layout>
      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2524013" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32983193" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/templates/.default/categories.php" />
    <entry file="file://$PROJECT_DIR$/templates/.default/category.php" />
    <entry file="file://$PROJECT_DIR$/templates/bootstrap/categories.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="455">
          <caret line="13" column="16" lean-forward="true" selection-start-line="13" selection-start-column="16" selection-end-line="13" selection-end-column="16" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/vendor/falur/bitrix-iblock/src/Sections.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="63">
          <caret line="6" column="31" lean-forward="false" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/../../IDE/bxApiDocs-master/modules/iblock/lib/model/section.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="245">
          <caret line="25" column="17" lean-forward="true" selection-start-line="25" selection-start-column="17" selection-end-line="25" selection-end-column="17" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/vendor/slim/slim/Slim/App.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="311">
          <caret line="649" column="49" lean-forward="false" selection-start-line="649" selection-start-column="32" selection-end-line="649" selection-end-column="49" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/vendor/falur/bitrix-support/src/Component/MultiPageComponent.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="591">
          <caret line="33" column="33" lean-forward="false" selection-start-line="33" selection-start-column="33" selection-end-line="33" selection-end-column="33" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/vendor/falur/bitrix-support/src/Component/SinglePageComponent.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="330">
          <caret line="68" column="63" lean-forward="true" selection-start-line="68" selection-start-column="63" selection-end-line="68" selection-end-column="63" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/vendor/falur/bitrix-support/src/Component/BaseController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="626">
          <caret line="47" column="9" lean-forward="false" selection-start-line="47" selection-start-column="9" selection-end-line="47" selection-end-column="9" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
        <state split_layout="SPLIT">
          <first_editor relative-caret-position="0">
            <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          </first_editor>
          <second_editor />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Services/Sections.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1925">
          <caret line="55" column="5" lean-forward="true" selection-start-line="55" selection-start-column="5" selection-end-line="55" selection-end-column="5" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Services/Elements.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="455">
          <caret line="13" column="28" lean-forward="true" selection-start-line="13" selection-start-column="28" selection-end-line="13" selection-end-column="28" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Controllers/ElementsController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="400">
          <caret line="26" column="60" lean-forward="true" selection-start-line="26" selection-start-column="60" selection-end-line="26" selection-end-column="60" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Controllers/ElementController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="105">
          <caret line="24" column="53" lean-forward="true" selection-start-line="24" selection-start-column="53" selection-end-line="24" selection-end-column="53" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/class.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="400">
          <caret line="16" column="39" lean-forward="false" selection-start-line="16" selection-start-column="32" selection-end-line="16" selection-end-column="39" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Controllers/CategoryController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="2240">
          <caret line="85" column="0" lean-forward="true" selection-start-line="85" selection-start-column="0" selection-end-line="85" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Controllers/CategoriesController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="525">
          <caret line="21" column="76" lean-forward="true" selection-start-line="21" selection-start-column="76" selection-end-line="21" selection-end-column="76" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/templates/bootstrap/element.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="35">
          <caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="69" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/templates/bootstrap/elements.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1120">
          <caret line="32" column="0" lean-forward="true" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/templates/bootstrap/category.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="210">
          <caret line="6" column="43" lean-forward="true" selection-start-line="6" selection-start-column="43" selection-end-line="6" selection-end-column="43" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/composer.json">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-175">
          <caret line="10" column="19" lean-forward="true" selection-start-line="10" selection-start-column="19" selection-end-line="10" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>