text:
PSL1GHT
=======

PSL1GHT is a lightweight PlayStation 3 homebrew SDK that uses the open-source
PlayStation 3 toolchains to compile user applications that will run from the
XMB menu (GameOS homebrew).

Credits
-------

    AerialX     - Founder, Author
    Parlane     - Author
    phiren      - Author
    Tempus      - PSL1GHT Logo
    lousyphreak - libaudio
    Hermes      - sysmodule, libpngdec, libjpgdec
    BigBoss     - EyeToy support added to libcamera sample, libgem sample.
    ooPo        - ps3libraries
    ElSemi      - Vertex Program Compiler
    zerkman     - SPU sample code

Environment
-----------

A GCC toolchain that supports the PowerPC 64bit architecture is required to
build PSL1GHT and its samples. It also requires the toolchain to provide
a patched newlib environment; at the moment only one toolchain does so:

* [ps3toolchain](http://github.com/ps3dev/ps3toolchain)

The SDK also includes a few standalone tools to help compilation. A host gcc
is required to build raw2h, ps3load, and sprxlinker requires libelf. ps3load
requires zlib installed. Python 2.x is required to run fself.py, sfo.py, and
pkg.py. Nvidia's [Cg Toolkit](http://developer.nvidia.com/object/cg_toolkit.html)
is reqired for compiling vertex programs. The signing tools require libgmp.

Most of the PSL1GHT samples included in the samples/ directory require various
libraries from [ps3libraries](http://github.com/ps3dev/ps3libraries) to be
installed.

Building
--------

Run make install in the psl1ght directory to build it all, and make sure to
set the environment variable $PSL1GHT to the folder where you wish to
install it to, for example...

    cd /path/to/psl1ght.git/
    export PSL1GHT=/path/to/psl1ght.git/build
    make
    make install

... for a local build of it. Ensure that $PSL1GHT is set when you are
building any of the examples or other apps that use PSL1GHT.

Current Status
--------------

### Graphics

PSL1GHT supports hardware acclerated 3d graphics.
Vertex shaders are a work in progress and Fragment shaders don't exsist yet.

### Input

PS3 controllers are fully supported, and pressing the PS button brings up the
in-game XMB menu, assuming the framebuffer is working.

Quitting from the XMB requires the application to register a callback ot handle the event. An example using this is the camera example.

### Filesystem Access

Full filesystem support is available, with access to the internal PS3 hard
drive, game disc contents, and external devices like USB drives. Only directory
iteration is missing, though it can be done using the lv2 filesystem interface
directly (see include/psl1ght/lv2/filesystem.h)

### Networking

Berkeley sockets are available for use in PSL1GHT, though some of the
implementation remains incomplete at this time (hostname lookups, for example).

### STDOUT Debugging

By default, PSL1GHT applications redirect stdout and stderr to the lv2 TTY
interface. Kammy's ethdebug module can be used to retrieve this live debugging
information over UDP broadcast packets.
See [Kammy](http://github.com/AerialX/Kammy) for more information and a
precompiled ethdebug hook loader.

### SPUs

PSL1GHT provides access to running programs on the raw SPUs, and communication
with it from the PPU. See sputest in the samples directory for a simple
example.

### SPRX Linking

Any dynamic libraries available to normal PS3 applications can be used with
PSL1GHT, they just need to be made into a stub library and have the exports
filled out. See any of the examples in sprx/ for information on the
creation of SPRX stub libraries.

The following libraries are currently supported:

* libio
    * libpad
    * libmouse
* liblv2
* libsysutil
* libgcm_sys
* libsysmodule
* libpngdec
* libjpgdec
* libgem


text:
my-website-1-reflection.md

Paste a link to your [USERNAME].github.io repository:
http://mfhan.github.io/

Explain how to create a repository on GitHub and clone the repository to your local computer to a non-technical person.

Open an account on GitHub and click on "new" under Repositories to create a new one. Copy the repository's URL and use the "git clone" command so that the version can live in your local computer.

Describe what open source means.

An open source program lets users see how it was made and allows anyone to customize it as needed. While some platforms, like the Mozilla Foundation, created the open source Firefox browser as a non-profit community, Automattic makes money by selling users services associated with the Wordpress blogging platform such as blog hosting and custom blog templates. In a third instance, social coding site GitHub lets developers put their source code up on its platform, and allows anyone to copy it, make changes, and attempt to persuade the original developer to use those changes.

What do you think about Open Source? Does it make you nervous or protective? Does it feel like utopia?

Assess the importance of using licenses.

Instead of having a programmer just plop down a piece of work in the whole wide world, open source licenses allow others to contribute to a shared item without need for a special permission It protects the original creator and prevent others from taking credit for the work.

What concepts were solidified in the challenge? Did you have any "aha" moments? What did you struggle with?

I struggled mightily during the entire Git/GitHub challenge with keeping track of branches and directories. I had to create a second branch to troubleshoot a stubborn lack of communication between master and the first branch.
I am now more than ever vigilant on WHERE I am in the shell and how to keep my repositories as clean as possible.
I had an "Aha" moment when, after mindlessly erasing a document on GitHub, I realized I couldn't re-upload a new version of that doc from the existing branch. So I ended up creating another branch and committing from there.

Did you find any resources on your own that helped you better understand a topic? If so, please list it.

Girl Develop It has a great series of slides on GitHub. So does Skillcrush.

Using your new git and GitHub skills, commit and push your changes to your remote repository and go through the pull request process! Make sure you can see your reflection on GitHub.

redpajama_set_name: RedPajamaGithub


text:
import React, { Component } from 'react';
import ClockComponent from '../components/Clock';
import ConnectedStoreHOC from '../utils/connect.store.hoc';
import * as Actions from '../utils/actions';

class ClockContainer extends Component {
    componentDidMount() {
        // lazy initialize the state object
        setTimeout(() => Actions.refresh(), 0);
    }

    render() {
        const {
            tewelveHourFormat,
            blinkForSeconds,
            showDate,
            showClock
        } = this.props;
        const props = { tewelveHourFormat, blinkForSeconds, showDate };

        if (!showClock) return null;

        return (
            showClock && <ClockComponent {...props} />
        );
    }
}

export default ConnectedStoreHOC(ClockContainer);


text:
/*
 * 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.
 */
package io.airlift.bootstrap;

import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Test;

import java.util.Map;

import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping;
import static io.airlift.configuration.testing.ConfigAssertions.assertRecordedDefaults;
import static io.airlift.configuration.testing.ConfigAssertions.recordDefaults;

public class TestBootstrapConfig
{
    @Test
    public void testDefaults()
    {
        assertRecordedDefaults(recordDefaults(BootstrapConfig.class)
                .setQuiet(null));
    }

    @Test
    public void testExplicitPropertyMappings()
    {
        Map<String, String> properties = new ImmutableMap.Builder<String, String>()
                .put("bootstrap.quiet", "false")
                .build();

        BootstrapConfig expected = new BootstrapConfig()
                .setQuiet(false);

        assertFullMapping(properties, expected);
    }
}


text:
Simple comments parser from Steam community

# Install
    pip install steam_comments

# Usage:
    from steam_comments.post import Post
    url = "https://steamcommunity.com/groups/ns2rus/discussions/0/527273452871150509/"
    p = Post(url=url)
    print p.count_comments()

    for comment in p.comments():
        print comment
    # {'profile_url':'..', 'image_url'='..', 'text':'...', 'id'='..', 'author'='..'}

# Details
* profile_url - Absolute url to steam profile
* image_url - Absolute url to author avatar
* text - html code of  comment
* id - Steam id
* author - Author of comment


text:
package gridsim.net.fnb;

import gridsim.net.fnb.*;
import gridsim.net.*;
import java.util.*;
import java.io.*;
import gridsim.*;

/**
 * This is an utility class, which parses a file and constructs the
 * network topology automatically, using the SCFQ packet scheduler
 * for network buffers ({@link gridsim.net.fnb.FnbSCFQScheduler}).
 * Note that this class is based on the {@link gridsim.util.NetworkReader} class.
 *

 * The file that defines the network has the following form:

 * <tt>
 * # specify the number of routers

 * number_of_routers

 *

 * # specify the name of each router and (optional) logging facility

 * router_name1 [true/false]

 * router_name2 [true/false]

 * router_name3 [true/false]

 * ... // other router names

 *

 * # linking two routers. NOTE: the router name is case sensitive!

 * router_name1 router_name2 baud_rate(GB/s) prop_delay(ms) mtu(byte)

 * router_name1 router_name3 baud_rate(GB/s) prop_delay(ms) mtu(byte)

 * ... // linking other routers

 * </tt>
 *

 * NOTE: <tt>[]</tt> means an optional parameter for logging activities
 * inside a router.
 * If it is not given, then by default the value is false.
 *
 * @see gridsim.net.fnb.FnbSCFQScheduler
 * @since GridSim Toolkit 4.2
 * @author  Agustin Caminero, Universidad de Castilla-La Mancha (UCLM) (Spain).
 */
public class FnbNetworkReader
{
    /**
     * Creates a network topology that uses a SCFQ packet scheduler
     * @param filename  the name of the file containing the description of
     *                  the network topology
     * @param weight    a linear array of the weights to be assigned to
     *                  different classes of traffic.
     * @param max_buf_size maximum buffer size for routers
     * @param drop_alg the algorithm used to drop packets at routers
     * @param min_th minimum threshold for RED
     * @param max_th maximum threshold for RED
     * @param max_p  maximum drop probability for RED
     * @param queue_weight queue weight for RED
     * @param stats whether we want to store stats or not
     * @return the list of finiteBufferRouters of the network or
     *         <tt>null</tt> if an error occurs
     * @see gridsim.net.fnb.FnbSCFQScheduler
     */
    public static LinkedList createSCFQ(String filename, double[] weight,
                                        int max_buf_size, int drop_alg,
                                        int min_th, int max_th, double max_p,
                                        double queue_weight, boolean stats)
    {
        if (weight == null)
        {
            return null;
        }

        LinkedList routerList = null;
        try
        {
            FileReader fileReader = new FileReader(filename);
            BufferedReader buffer = new BufferedReader(fileReader);

            routerList = createNetworkSCFQ(buffer, weight, max_buf_size,
                                           drop_alg, min_th, max_th, max_p,
                                           queue_weight, stats);
        }
        catch (Exception exp)
        {
            System.out.println("NetworkReader: File not found or " +
                               "weight[] is null.");
            routerList = null;
        }

        return routerList;
    }

    /**
     * Gets a {@link gridsim.net.Router} object from the list
     * @param name          a router name
     * @param routerList    a list containing the finiteBufferRouter objects
     * @return a {@link gridsim.net.Router} object or
     *         <tt>null</tt> if not found
     */
    public static Router getRouter(String name, LinkedList routerList)
    {
        if (name == null || routerList == null || name.length() == 0) {
            return null;
        }

        Router router = null;
        try
        {
            Iterator it = routerList.iterator();
            while ( it.hasNext() )
            {
                router = (Router) it.next();
                if (router.get_name().equals(name)) {
                    break;
                }
                else {
                    router = null;
                }
            }
        }
        catch (Exception e) {
            router = null;
        }

        return router;
    }

    /**
     * Creates a number of routers from a given buffered reader
     * @param buf   a Buffered Reader object
     * @param rate  a flag denotes the type of Router will be using
     * @param stats true if we want to store statistics
     * @return a list of {@link gridsim.net.fnb.FnbRIPRouter} objects or
     *         <tt>null</tt> if an error occurs
     */
    private static LinkedList createRouter(BufferedReader buf, boolean rate,
                                           boolean stats) throws Exception
    {
        String line = null;
        StringTokenizer str = null;
        int num_router = -1;    // num of routers

        // parse each line
        while ((line = buf.readLine()) != null)
        {
            str = new StringTokenizer(line);
            if (!str.hasMoreTokens()) {     // ignore newlines
                continue;
            }

            String num = str.nextToken();           // get next token
            if (num.startsWith("#")) {      // ignore comments
                continue;
            }

            // get the num of router
            if (num_router == -1)
            {
                num_router = (new Integer(num)).intValue();
                break;
            }
        }

        LinkedList routerList = new LinkedList();
        Router router = null;   // a Router object
        String name = null;     // router name
        String flag = null;     // a flag to denote logging router or not
        boolean log = false;

        // then for each line, get the router name
        for (int i = 1; i <= num_router; i++)
        {
            log = false;
            line = buf.readLine();
            str = new StringTokenizer(line);
            if (!str.hasMoreTokens())       // ignore newlines
            {
                i--;
                continue;
            }

            name = str.nextToken();                 // get next token
            if (name.startsWith("#"))       // ignore comments
            {
                i--;
                continue;
            }

            if (str.hasMoreTokens())
            {
                flag = str.nextToken(); // get the optional entry
                if (flag.equalsIgnoreCase("true"))
                {
                    log = true;
                }
            }

            // The name of a roputer is "Router10", so the my_id is 10
            int endRouter = name.lastIndexOf('r');
            String my_id_str = name.substring(endRouter + 1);

            int my_id = (Integer.decode(my_id_str)).intValue();

            // create a specific Router object
            if (rate)
            {
                System.out.println(" ****** FnbNetworkReader.createRouter(): " +
                    "RateControlledScheduler is not available for the finite "
                    + "network buffers functionality");

            }
            else {
                router = new FnbRIPRouter(name, log, my_id, stats);
            }
            routerList.add(router);     // add the router into the list
        }

        return routerList;
    }

    /**
     * Creates a network topology from a given buffered reader
     * @param buf   a Buffered Reader object
     * @param weight    a linear array of the weights to be assigned to
     *                  different classes of traffic.
     * @param max_buf_size the maximum size for network buffers
     * @param drop_alg the algorithm used to drop packets at routers
     * @param min_th minimum threshold for RED
     * @param max_th maximum threshold for RED
     * @param max_p  maximum drop probability for RED
     * @param queue_weight queue weight for RED
     * @param stats true if we want to store statistics
     * @return a list of {@link gridsim.net.fnb.FnbRIPRouter} objects or
     *         <tt>null</tt> if an error occurs
     */
    private static LinkedList createNetworkSCFQ(BufferedReader buf, double[] weight,
                                    int max_buf_size, int drop_alg, int min_th,
                                    int max_th, double max_p, double queue_weight,
                                    boolean stats) throws Exception
    {
        if (buf == null)
        {
            return null;
        }

        // create the Router objects first
        LinkedList routerList = createRouter(buf, false, stats);

        int GB = 1000000000;  // 1 GB in bits
        String line;
        String name1, name2;
        StringTokenizer str = null;
        Router r1, r2;
        Link tempLink = null;

        // creating the linking between two routers
        while ((line = buf.readLine()) != null)
        {
            str = new StringTokenizer(line);
            if (!str.hasMoreTokens()) {     // ignore newlines
                continue;
            }

            // parse the name of the connected routers
            name1 = str.nextToken();    // router name
            if (name1.startsWith("#")) {    // ignore comments
                continue;
            }

            name2 = str.nextToken();    // router name
            r1 = getRouter(name1, routerList);
            r2 = getRouter(name2, routerList);

            if (r1 == null || r2 == null)
            {
                System.out.println("NetworkReader.createNetworkSCFQ(): " +
                    "Warning - unable to connect both "+name1+" and "+name2);
                continue;
            }

            // get baud rate of the link
            String baud = str.nextToken();       // bandwidth (Gbps)
            String propDelay = str.nextToken();  // latency (in millisec)
            String mtu = str.nextToken();        // link MTU (in byte)

            tempLink = new SimpleLink(r1.get_name() + "_" + r2.get_name(),
                    Double.parseDouble(baud) * GB,
                    Double.parseDouble(propDelay), Integer.parseInt(mtu));

            FnbSCFQScheduler r1Sched;

            FnbSCFQScheduler r2Sched;

            if (GridSimTags.FNB_ARED == drop_alg)
            {
                r1Sched = (FnbSCFQScheduler)new ARED(r1.get_name()
                                                    + "_to_" + r2.get_name(),
                                                    tempLink.getBaudRate(), max_p,
                                                    max_buf_size, queue_weight, stats);

                r2Sched = (FnbSCFQScheduler)new ARED(r2.get_name()
                                                    + "_to_" + r1.get_name(),
                                                    tempLink.getBaudRate(), max_p,
                                                    max_buf_size,  queue_weight, stats);
            }
            else if (GridSimTags.FNB_RED == drop_alg)
            {
                r1Sched = (FnbSCFQScheduler)new RED(r1.get_name()
                                                    + "_to_" + r2.get_name(),
                                                    tempLink.getBaudRate(),
                                                    max_buf_size, min_th, max_th, max_p,
                                                    queue_weight, stats);

                r2Sched = (FnbSCFQScheduler)new RED(r2.get_name()
                                                    + "_to_" + r1.get_name(),
                                                    tempLink.getBaudRate(),
                                                    max_buf_size, min_th, max_th, max_p,
                                                    queue_weight, stats);
            }
            else //if (GridSimTags.FNB_FIFO == drop_alg)
            {
                r1Sched = (FnbSCFQScheduler)new FIFO(r1.get_name()
                                                     + "_to_" + r2.get_name(),
                                                      tempLink.getBaudRate(),
                                                     max_buf_size,
                                                     queue_weight, stats);

                r2Sched = (FnbSCFQScheduler)new FIFO(r2.get_name()
                                                     + "_to_" + r1.get_name(),
                                                      tempLink.getBaudRate(),
                                                     max_buf_size,
                                                     queue_weight, stats);
            }

            r1Sched.setWeights(weight);
            r2Sched.setWeights(weight);
            r1.attachRouter(r2, tempLink, r1Sched, r2Sched);
        }

        return routerList;
    }

}


text:
.class Lcom/android/server/power/ShutdownThread$6$1;
.super Ljava/lang/Object;
.source "ShutdownThread.java"

# interfaces
.implements Landroid/media/MediaPlayer$OnCompletionListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/server/power/ShutdownThread$6;->handleMessage(Landroid/os/Message;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$1:Lcom/android/server/power/ShutdownThread$6;

# direct methods
.method constructor <init>(Lcom/android/server/power/ShutdownThread$6;)V
    .locals 0

    .prologue
    .line 777
    iput-object p1, p0, Lcom/android/server/power/ShutdownThread$6$1;->this$1:Lcom/android/server/power/ShutdownThread$6;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onCompletion(Landroid/media/MediaPlayer;)V
    .locals 3
    .param p1, "mp"    # Landroid/media/MediaPlayer;

    .prologue
    .line 780
    iget-object v0, p0, Lcom/android/server/power/ShutdownThread$6$1;->this$1:Lcom/android/server/power/ShutdownThread$6;

    iget-object v0, v0, Lcom/android/server/power/ShutdownThread$6;->this$0:Lcom/android/server/power/ShutdownThread;

    # getter for: Lcom/android/server/power/ShutdownThread;->mActionDoneSync:Ljava/lang/Object;
    invoke-static {v0}, Lcom/android/server/power/ShutdownThread;->access$600(Lcom/android/server/power/ShutdownThread;)Ljava/lang/Object;

    move-result-object v1

    monitor-enter v1

    .line 781
    :try_start_0
    iget-object v0, p0, Lcom/android/server/power/ShutdownThread$6$1;->this$1:Lcom/android/server/power/ShutdownThread$6;

    iget-object v0, v0, Lcom/android/server/power/ShutdownThread$6;->this$0:Lcom/android/server/power/ShutdownThread;

    const/4 v2, 0x0

    # setter for: Lcom/android/server/power/ShutdownThread;->isShutdownMusicPlaying:Z
    invoke-static {v0, v2}, Lcom/android/server/power/ShutdownThread;->access$702(Lcom/android/server/power/ShutdownThread;Z)Z

    .line 782
    iget-object v0, p0, Lcom/android/server/power/ShutdownThread$6$1;->this$1:Lcom/android/server/power/ShutdownThread$6;

    iget-object v0, v0, Lcom/android/server/power/ShutdownThread$6;->this$0:Lcom/android/server/power/ShutdownThread;

    # getter for: Lcom/android/server/power/ShutdownThread;->mActionDoneSync:Ljava/lang/Object;
    invoke-static {v0}, Lcom/android/server/power/ShutdownThread;->access$600(Lcom/android/server/power/ShutdownThread;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->notifyAll()V

    .line 783
    monitor-exit v1

    .line 784
    return-void

    .line 783
    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method


text:
/**
 * @file
 *   This file contains definitions for a UART based NCP interface to the OpenThread stack.
 */

#ifndef NCP_UART_HPP_
#define NCP_UART_HPP_

#include "openthread-core-config.h"

#include "ncp/hdlc.hpp"
#include "ncp/ncp_base.hpp"

#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
#include "spinel_encrypter.hpp"
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER

namespace ot {
namespace Ncp {

class NcpUart : public NcpBase
{
    typedef NcpBase super_t;

public:
    /**
     * Constructor
     *
     * @param[in]  aInstance  The OpenThread instance structure.
     *
     */
    NcpUart(Instance *aInstance);

    /**
     * This method is called when uart tx is finished. It prepares and sends the next data chunk (if any) to uart.
     *
     */
    void HandleUartSendDone(void);

    /**
     * This method is called when uart received a data buffer.
     *
     */
    void HandleUartReceiveDone(const uint8_t *aBuf, uint16_t aBufLength);

private:

    enum
    {
        kUartTxBufferSize = OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE,           // Uart tx buffer size.
        kRxBufferSize = OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE +             // Rx buffer size (should be large enough to fit
                        OPENTHREAD_CONFIG_NCP_SPINEL_ENCRYPTER_EXTRA_DATA_SIZE, // one whole (decoded) received frame).
    };

    enum UartTxState
    {
        kStartingFrame,          // Starting a new frame.
        kEncodingFrame,          // In middle of encoding a frame.
        kFinalizingFrame,        // Finalizing a frame.
    };

    class UartTxBuffer : public Hdlc::Encoder::BufferWriteIterator
    {
    public:
        UartTxBuffer(void);

        void           Clear(void);
        bool           IsEmpty(void) const;
        uint16_t       GetLength(void) const;
        const uint8_t *GetBuffer(void) const;

    private:
        uint8_t        mBuffer[kUartTxBufferSize];
    };

#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
    /**
     * Wraps NcpFrameBuffer allowing to read data through spinel encrypter.
     * Creates additional buffers to allow transforming of the whole spinel frames.
     */
    class NcpFrameBufferEncrypterReader
    {
    public:
        /**
         * C-tor.
         * Takes a reference to NcpFrameBuffer in order to read spinel frames.
         */
        explicit NcpFrameBufferEncrypterReader(NcpFrameBuffer &aTxFrameBuffer);
        bool IsEmpty() const;
        otError OutFrameBegin();
        bool OutFrameHasEnded();
        uint8_t OutFrameReadByte();
        otError OutFrameRemove();

    private:
        void Reset();

        NcpFrameBuffer &mTxFrameBuffer;
        uint8_t mDataBuffer[kRxBufferSize];
        size_t mDataBufferReadIndex;
        size_t mOutputDataLength;
    };
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER

    void            EncodeAndSendToUart(void);
    void            HandleFrame(uint8_t *aBuf, uint16_t aBufLength);
    void            HandleError(otError aError, uint8_t *aBuf, uint16_t aBufLength);
    void            TxFrameBufferHasData(void);
    void            HandleFrameAddedToNcpBuffer(void);

    static void     EncodeAndSendToUart(Tasklet &aTasklet);
    static void     HandleFrame(void *context, uint8_t *aBuf, uint16_t aBufLength);
    static void     HandleError(void *context, otError aError, uint8_t *aBuf, uint16_t aBufLength);
    static void     HandleFrameAddedToNcpBuffer(void *aContext, NcpFrameBuffer::FrameTag aTag,
                                                NcpFrameBuffer::Priority aPriority, NcpFrameBuffer *aNcpFrameBuffer);

    Hdlc::Encoder   mFrameEncoder;
    Hdlc::Decoder   mFrameDecoder;
    UartTxBuffer    mUartBuffer;
    UartTxState     mState;
    uint8_t         mByte;
    uint8_t         mRxBuffer[kRxBufferSize];
    bool            mUartSendImmediate;
    Tasklet         mUartSendTask;

#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
    NcpFrameBufferEncrypterReader    mTxFrameBufferEncrypterReader;
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
};

}  // namespace Ncp
}  // namespace ot

#endif  // NCP_UART_HPP_


text:
using System;
using System.Collections.Generic;

namespace Confuser.Core.Project.Patterns {
	/// <summary>
	///     A pattern operator.
	/// </summary>
	public abstract class PatternOperator : PatternExpression {
		/// <summary>
		///     Gets the name of operator.
		/// </summary>
		/// <value>The name.</value>
		public abstract string Name { get; }

		/// <summary>
		///     Gets a value indicating whether this is an unary operator.
		/// </summary>
		/// <value><c>true</c> if this is an unary operator; otherwise, <c>false</c>.</value>
		public abstract bool IsUnary { get; }

		/// <summary>
		///     Gets or sets the first operand.
		/// </summary>
		/// <value>The first operand.</value>
		public PatternExpression OperandA { get; set; }

		/// <summary>
		///     Gets or sets the second operand.
		/// </summary>
		/// <value>The second operand.</value>
		public PatternExpression OperandB { get; set; }

		/// <inheritdoc />
		public override void Serialize(IList<PatternToken> tokens) {
			if (IsUnary) {
				tokens.Add(new PatternToken(TokenType.Identifier, Name));
				OperandA.Serialize(tokens);
			}
			else {
				OperandA.Serialize(tokens);
				tokens.Add(new PatternToken(TokenType.Identifier, Name));
				OperandB.Serialize(tokens);
			}
		}
	}
}


text:
![TravisCI Status](https://travis-ci.org/bioritmo/bedi.svg?branch=master)

**bedi** is a gem for parsing the many different type of EDI files out there.
It aims to provide a similar parsed interface to all of them.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'bedi'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install bedi

## Usage

```ruby
parser = Bedi::Cielo.new
result = parser.parse_file('cielo_return.txt')
# ...
parser = Bedi::Redecard.new
result = parser.parse_file('redecard_return.txt')
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/bioritmo/bedi.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2012 Eric Niebler

  Distributed under the Boost
  Software License, Version 1.0. (See accompanying
  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  -->
<header name="boost/proto/functional/std/utility.hpp">
  <para>Defines Proto callables <computeroutput><classname>boost::proto::functional::make_pair</classname></computeroutput>,
  <computeroutput><classname>boost::proto::functional::first</classname></computeroutput> and
  <computeroutput><classname>boost::proto::functional::second</classname></computeroutput>.</para>

  <namespace name="boost">
    <namespace name="proto">
      <namespace name="functional">

        <!-- proto::functional::make_pair -->
        <struct name="make_pair">
          <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes
            <computeroutput>std::make_pair()</computeroutput> on its arguments.</purpose>
          <description>
            <para>
              A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes
              <computeroutput>std::make_pair()</computeroutput> on its arguments.</para>
          </description>
          <inherit>
            <type><classname>proto::callable</classname></type>
          </inherit>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="First"/>
              <template-type-parameter name="Second"/>
            </template>
            <specialization>
              <template-arg>This(First, Second)</template-arg>
            </specialization>
            <typedef name="type">
              <type>std::pair<
        typename boost::remove_const<typename boost::remove_reference<First>::type>::type
      , typename boost::remove_const<typename boost::remove_reference<Second>::type>::type
    ></type>
            </typedef>
          </struct-specialization>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename std::pair< First, Second ></type>
              <template>
                <template-type-parameter name="First"/>
                <template-type-parameter name="Second"/>
              </template>
              <parameter name="first">
                <paramtype>First const &</paramtype>
              </parameter>
              <parameter name="second">
                <paramtype>Second const &</paramtype>
              </parameter>
              <returns>
                <para><computeroutput>std::make_pair(first, second)</computeroutput></para>
              </returns>
            </method>
          </method-group>
        </struct>

        <!-- proto::functional::first -->
        <struct name="first">
          <purpose>
            A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
            the first element of a <computeroutput>std::pair<></computeroutput>.
          </purpose>
          <description>
            <para>
              A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
              the first element of a <computeroutput>std::pair<></computeroutput>.</para>
          </description>
          <inherit><type><classname>proto::callable</classname></type>
          </inherit>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Pair"/>
            </template>
            <specialization>
              <template-arg>This(Pair)</template-arg>
            </specialization>
            <typedef name="type">
              <type>typename Pair::first_type</type>
            </typedef>
          </struct-specialization>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Pair"/>
            </template>
            <specialization>
              <template-arg>This(Pair &)</template-arg>
            </specialization>
            <typedef name="type">
              <type>typename Pair::first_type &</type>
            </typedef>
          </struct-specialization>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Pair"/>
            </template>
            <specialization>
              <template-arg>This(Pair const &)</template-arg>
            </specialization>
            <typedef name="type">
              <type>typename Pair::first_type const &</type>
            </typedef>
          </struct-specialization>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename Pair::first_type &</type>
              <template>
                <template-type-parameter name="Pair"/>
              </template>
              <parameter name="pair">
                <paramtype>Pair &</paramtype>
              </parameter>
              <returns>
                <para>
                  <computeroutput>pair.first</computeroutput>
                </para>
              </returns>
            </method>
            <method name="operator()" cv="const">
              <type>typename Pair::first_type const &</type>
              <template>
                <template-type-parameter name="Pair"/>
              </template>
              <parameter name="pair">
                <paramtype>Pair const &</paramtype>
              </parameter>
              <returns>
                <para>
                  <computeroutput>pair.first</computeroutput>
                </para>
              </returns>
            </method>
          </method-group>
        </struct>

        <!-- proto::functional::second -->
        <struct name="second">
          <purpose>
            A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
            the second element of a <computeroutput>std::pair<></computeroutput>.
          </purpose>
          <description>
            <para>
              A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
              the second element of a <computeroutput>std::pair<></computeroutput>.
            </para>
          </description>
          <inherit><type><classname>proto::callable</classname></type></inherit>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Pair"/>
            </template>
            <specialization>
              <template-arg>This(Pair)</template-arg>
            </specialization>
            <typedef name="type">
              <type>typename Pair::second_type</type>
            </typedef>
          </struct-specialization>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Pair"/>
            </template>
            <specialization>
              <template-arg>This(Pair &)</template-arg>
            </specialization>
            <typedef name="type">
              <type>typename Pair::second_type &</type>
            </typedef>
          </struct-specialization>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Pair"/>
            </template>
            <specialization>
              <template-arg>This(Pair const &)</template-arg>
            </specialization>
            <typedef name="type">
              <type>typename Pair::second_type const &</type>
            </typedef>
          </struct-specialization>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename Pair::second_type &</type>
              <template>
                <template-type-parameter name="Pair"/>
              </template>
              <parameter name="pair">
                <paramtype>Pair &</paramtype>
              </parameter>
              <returns>
                <para>
                  <computeroutput>pair.second</computeroutput>
                </para>
              </returns>
            </method>
            <method name="operator()" cv="const">
              <type>typename Pair::second_type const &</type>
              <template>
                <template-type-parameter name="Pair"/>
              </template>
              <parameter name="pair">
                <paramtype>Pair const &</paramtype>
              </parameter>
              <returns>
                <para>
                  <computeroutput>pair.second</computeroutput>
                </para>
              </returns>
            </method>
          </method-group>
        </struct>

      </namespace>
    </namespace>
  </namespace>

</header>


text:
from __future__ import absolute_import
from collections import Iterable, Mapping, OrderedDict

import atexit
import datetime
import time
import os
import re
import warnings

import alembic.ddl
import sqlalchemy
import six

DATABASE_NAME = os.environ.get("SCRAPERWIKI_DATABASE_NAME",
                               "sqlite:///scraperwiki.sqlite")

DATABASE_TIMEOUT = float(os.environ.get("SCRAPERWIKI_DATABASE_TIMEOUT", 300))
SECONDS_BETWEEN_COMMIT = 2

class Blob(str):

    """
    Represents a blob as a string.
    """
PYTHON_SQLITE_TYPE_MAP = {
    six.text_type: sqlalchemy.types.Text,
    str: sqlalchemy.types.Text,

    int: sqlalchemy.types.BigInteger,
    bool: sqlalchemy.types.Boolean,
    float: sqlalchemy.types.Float,

    datetime.date: sqlalchemy.types.Date,
    datetime.datetime: sqlalchemy.types.DateTime,

    Blob: sqlalchemy.types.LargeBinary,
}

try:
    PYTHON_SQLITE_TYPE_MAP[long] = sqlalchemy.types.BigInteger
except NameError:
    pass

class _State(object):

    """
    This class maintains global state relating to the database such as
    connection. It does not form part of the public interface.
    """
    db_path = DATABASE_NAME
    engine = None
    _connection = None
    _transaction = None
    metadata = None
    table = None
    # Whether or not we need to create the table. It's set by
    # _set_table(); it's left unassigned here to catch
    # accidental uses of it.
    # table_pending = None
    vars_table_name = 'swvariables'
    last_commit = None
    echo = False

    @classmethod
    def connection(cls):
        if cls._connection is None:
            create = sqlalchemy.create_engine
            cls.engine = create(cls.db_path, echo=cls.echo,
                                connect_args={'timeout': DATABASE_TIMEOUT})
            cls._connection = cls.engine.connect()
            cls.new_transaction()
        if cls.table is None:
            cls.reflect_metadata()
            cls.table = sqlalchemy.Table('swdata', _State.metadata,
                                         extend_existing=True)
        if cls._transaction is None:
            cls.new_transaction()
        return cls._connection

    @classmethod
    def new_transaction(cls):
        cls.last_commit = time.time()
        if cls._transaction is not None:
            cls._transaction.commit()
        cls._transaction = cls._connection.begin()

    @classmethod
    def reflect_metadata(cls):
        if cls.metadata is None:
            cls.metadata = sqlalchemy.MetaData(bind=cls.engine)
        cls.metadata.reflect()

    @classmethod
    def check_last_committed(cls):
        if time.time() - cls.last_commit > SECONDS_BETWEEN_COMMIT:
            cls.new_transaction()

class Transaction(object):

    """
    This context manager must be used when other services need
    to connect to the database.
    """

    def __enter__(self):
        _State.connection()
        _State.new_transaction()

    def __exit__(self, *args):
        _State._transaction.commit()
        _State._transaction = None

@atexit.register
def commit_transactions():
    """
    Ensure any outstanding transactions are committed on exit
    """
    if _State._transaction is not None:
        _State._transaction.commit()
        _State._transaction = None

def execute(query, data=None):
    """
    Execute an arbitrary SQL query given by query, returning any
    results as a list of OrderedDicts. A list of values can be supplied as an,
    additional argument, which will be substituted into question marks in the
    query.
    """
    connection = _State.connection()
    _State.new_transaction()

    if data is None:
        data = []

    result = connection.execute(query, data)

    _State.table = None
    _State.metadata = None
    try:
        del _State.table_pending
    except AttributeError:
        pass

    if not result.returns_rows:
        return {u'data': [], u'keys': []}

    return {u'data': result.fetchall(), u'keys': list(result.keys())}

def select(query, data=None):
    """
    Perform a sql select statement with the given query (without 'select') and
    return any results as a list of OrderedDicts.
    """
    connection = _State.connection()
    _State.new_transaction()
    if data is None:
        data = []

    result = connection.execute('select ' + query, data)

    rows = []
    for row in result:
        rows.append(dict(list(row.items())))

    return rows

def save(unique_keys, data, table_name='swdata'):
    """
    Save the given data to the table specified by `table_name`
    (which defaults to 'swdata'). The data must be a mapping
    or an iterable of mappings. Unique keys is a list of keys that exist
    for all rows and for which a unique index will be created.
    """

    _set_table(table_name)

    connection = _State.connection()

    if isinstance(data, Mapping):
        # Is a single datum
        data = [data]
    elif not isinstance(data, Iterable):
        raise TypeError("Data must be a single mapping or an iterable "
                        "of mappings")

    insert = _State.table.insert(prefixes=['OR REPLACE'])
    for row in data:
        if not isinstance(row, Mapping):
            raise TypeError("Elements of data must be mappings, got {}".format(
                            type(row)))
        fit_row(connection, row, unique_keys)
        connection.execute(insert.values(row))
    _State.check_last_committed()

def _set_table(table_name):
    """
    Specify the table to work on.
    """
    _State.connection()
    _State.reflect_metadata()
    _State.table = sqlalchemy.Table(table_name, _State.metadata,
                                    extend_existing=True)

    if list(_State.table.columns.keys()) == []:
        _State.table_pending = True
    else:
        _State.table_pending = False

def show_tables():
    """
    Return the names of the tables currently in the database.
    """
    _State.connection()
    _State.reflect_metadata()
    metadata = _State.metadata

    response = select('name, sql from sqlite_master where type="table"')

    return {row['name']: row['sql'] for row in response}

def save_var(name, value):
    """
    Save a variable to the table specified by _State.vars_table_name. Key is
    the name of the variable, and value is the value.
    """
    connection = _State.connection()
    _State.reflect_metadata()

    vars_table = sqlalchemy.Table(
        _State.vars_table_name, _State.metadata,
        sqlalchemy.Column('name', sqlalchemy.types.Text, primary_key=True),
        sqlalchemy.Column('value_blob', sqlalchemy.types.LargeBinary),
        sqlalchemy.Column('type', sqlalchemy.types.Text),
        keep_existing=True
    )

    vars_table.create(bind=connection, checkfirst=True)

    column_type = get_column_type(value)

    values = dict(name=name,
                  value_blob=Blob(value),
                  type=column_type.__visit_name__.lower())

    vars_table.insert(prefixes=['OR REPLACE']).values(**values).execute()

def get_var(name, default=None):
    """
    Returns the variable with the provided key from the
    table specified by _State.vars_table_name.
    """
    connection = _State.connection()
    _State.new_transaction()

    if _State.vars_table_name not in list(_State.metadata.tables.keys()):
        return None

    table = sqlalchemy.Table(_State.vars_table_name, _State.metadata)

    s = sqlalchemy.select([table.c.value_blob, table.c.type])
    s = s.where(table.c.name == name)
    result = connection.execute(s).fetchone()

    if not result:
        return None

    # This is to do the variable type conversion through the SQL engine
    execute = connection.execute
    execute("CREATE TEMPORARY TABLE _sw_tmp ('value' {})".format(result.type))
    execute("INSERT INTO _sw_tmp VALUES (:value)", value=result.value_blob)
    var = execute('SELECT value FROM _sw_tmp').fetchone().value
    execute("DROP TABLE _sw_tmp")

    return var

def create_index(column_names, unique=False):
    """
    Create a new index of the columns in column_names, where column_names is
    a list of strings. If unique is True, it will be a
    unique index.
    """
    connection = _State.connection()
    _State.reflect_metadata()
    table_name = _State.table.name

    table = _State.table

    index_name = re.sub(r'[^a-zA-Z0-9]', '', table_name) + '_'
    index_name += '_'.join(re.sub(r'[^a-zA-Z0-9]', '', x)
                           for x in column_names)

    if unique:
        index_name += '_unique'

    columns = []
    for column_name in column_names:
        columns.append(table.columns[column_name])

    current_indices = [x.name for x in table.indexes]
    index = sqlalchemy.schema.Index(index_name, *columns, unique=unique)
    if index.name not in current_indices:
        index.create(bind=_State.engine)

def fit_row(connection, row, unique_keys):
    """
    Takes a row and checks to make sure it fits in the columns of the
    current table. If it does not fit, adds the required columns.
    """
    new_columns = []
    for column_name, column_value in list(row.items()):
        new_column = sqlalchemy.Column(column_name,
                                       get_column_type(column_value))

        if not str(new_column) in list(_State.table.columns.keys()):
            new_columns.append(new_column)
            _State.table.append_column(new_column)

    if _State.table_pending:
        create_table(unique_keys)
        return

    for new_column in new_columns:
        add_column(connection, new_column)

def create_table(unique_keys):
    """
    Save the table currently waiting to be created.
    """
    _State.new_transaction()
    _State.table.create(bind=_State.engine, checkfirst=True)
    if unique_keys != []:
        create_index(unique_keys, unique=True)
    _State.table_pending = False
    _State.reflect_metadata()

def add_column(connection, column):
    """
    Add a column to the current table.
    """
    stmt = alembic.ddl.base.AddColumn(_State.table.name, column)
    connection.execute(stmt)
    _State.reflect_metadata()

def get_column_type(column_value):
    """
    Return the appropriate SQL column type for the given value.
    """
    return PYTHON_SQLITE_TYPE_MAP.get(type(column_value),
      sqlalchemy.types.Text)

def commit():
    warnings.warn("scraperwiki.sql.commit is now a no-op")

def drop():
    """
    Drop the current table if it exists
    """
    # Ensure the connection is up
    _State.connection()
    _State.table.drop(checkfirst=True)
    _State.metadata.remove(_State.table)
    _State.table = None
    _State.new_transaction()


text:
import type {ReactElement} from 'shared/ReactElementType';
import type {Fiber} from './ReactFiber';
import type {FiberRoot} from './ReactFiberRoot';
import type {Instance} from './ReactFiberHostConfig';

import {
  flushSync,
  scheduleWork,
  flushPassiveEffects,
} from './ReactFiberWorkLoop';
import {Sync} from './ReactFiberExpirationTime';
import {
  ClassComponent,
  FunctionComponent,
  ForwardRef,
  HostComponent,
  HostPortal,
  HostRoot,
  MemoComponent,
  SimpleMemoComponent,
} from 'shared/ReactWorkTags';
import {
  REACT_FORWARD_REF_TYPE,
  REACT_MEMO_TYPE,
  REACT_LAZY_TYPE,
} from 'shared/ReactSymbols';

export type Family = {|
  current: any,
|};

export type HotUpdate = {|
  resolveFamily: (any => Family | void) | null,
  staleFamilies: Set<Family>,
  updatedFamilies: Set<Family>,
|};

let resolveFamily: (any => Family | void) | null = null;
// $FlowFixMe Flow gets confused by a WeakSet feature check below.
let failedBoundaries: WeakSet<Fiber> | null = null;

export function resolveFunctionForHotReloading(type: any): any {
  if (__DEV__) {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }
    let family = resolveFamily(type);
    if (family === undefined) {
      return type;
    }
    // Use the latest known implementation.
    return family.current;
  } else {
    return type;
  }
}

export function resolveClassForHotReloading(type: any): any {
  // No implementation differences.
  return resolveFunctionForHotReloading(type);
}

export function resolveForwardRefForHotReloading(type: any): any {
  if (__DEV__) {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }
    let family = resolveFamily(type);
    if (family === undefined) {
      // Check if we're dealing with a real forwardRef. Don't want to crash early.
      if (
        type !== null &&
        type !== undefined &&
        typeof type.render === 'function'
      ) {
        // ForwardRef is special because its resolved .type is an object,
        // but it's possible that we only have its inner render function in the map.
        // If that inner render function is different, we'll build a new forwardRef type.
        const currentRender = resolveFunctionForHotReloading(type.render);
        if (type.render !== currentRender) {
          const syntheticType = {
            $$typeof: REACT_FORWARD_REF_TYPE,
            render: currentRender,
          };
          if (type.displayName !== undefined) {
            (syntheticType: any).displayName = type.displayName;
          }
          return syntheticType;
        }
      }
      return type;
    }
    // Use the latest known implementation.
    return family.current;
  } else {
    return type;
  }
}

export function isCompatibleFamilyForHotReloading(
  fiber: Fiber,
  element: ReactElement,
): boolean {
  if (__DEV__) {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return false;
    }

    const prevType = fiber.elementType;
    const nextType = element.type;

    // If we got here, we know types aren't === equal.
    let needsCompareFamilies = false;

    const $$typeofNextType =
      typeof nextType === 'object' && nextType !== null
        ? nextType.$$typeof
        : null;

    switch (fiber.tag) {
      case ClassComponent: {
        if (typeof nextType === 'function') {
          needsCompareFamilies = true;
        }
        break;
      }
      case FunctionComponent: {
        if (typeof nextType === 'function') {
          needsCompareFamilies = true;
        } else if ($$typeofNextType === REACT_LAZY_TYPE) {
          // We don't know the inner type yet.
          // We're going to assume that the lazy inner type is stable,
          // and so it is sufficient to avoid reconciling it away.
          // We're not going to unwrap or actually use the new lazy type.
          needsCompareFamilies = true;
        }
        break;
      }
      case ForwardRef: {
        if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
          needsCompareFamilies = true;
        } else if ($$typeofNextType === REACT_LAZY_TYPE) {
          needsCompareFamilies = true;
        }
        break;
      }
      case MemoComponent:
      case SimpleMemoComponent: {
        if ($$typeofNextType === REACT_MEMO_TYPE) {
          // TODO: if it was but can no longer be simple,
          // we shouldn't set this.
          needsCompareFamilies = true;
        } else if ($$typeofNextType === REACT_LAZY_TYPE) {
          needsCompareFamilies = true;
        }
        break;
      }
      default:
        return false;
    }

    // Check if both types have a family and it's the same one.
    if (needsCompareFamilies) {
      // Note: memo() and forwardRef() we'll compare outer rather than inner type.
      // This means both of them need to be registered to preserve state.
      // If we unwrapped and compared the inner types for wrappers instead,
      // then we would risk falsely saying two separate memo(Foo)
      // calls are equivalent because they wrap the same Foo function.
      const prevFamily = resolveFamily(prevType);
      if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
        return true;
      }
    }
    return false;
  } else {
    return false;
  }
}

export function markFailedErrorBoundaryForHotReloading(fiber: Fiber) {
  if (__DEV__) {
    if (resolveFamily === null) {
      // Not hot reloading.
      return;
    }
    if (typeof WeakSet !== 'function') {
      return;
    }
    if (failedBoundaries === null) {
      failedBoundaries = new WeakSet();
    }
    failedBoundaries.add(fiber);
  }
}

export function scheduleHotUpdate(root: FiberRoot, hotUpdate: HotUpdate): void {
  if (__DEV__) {
    // TODO: warn if its identity changes over time?
    resolveFamily = hotUpdate.resolveFamily;

    const {staleFamilies, updatedFamilies} = hotUpdate;
    flushPassiveEffects();
    flushSync(() => {
      scheduleFibersWithFamiliesRecursively(
        root.current,
        updatedFamilies,
        staleFamilies,
      );
    });
  }
}

function scheduleFibersWithFamiliesRecursively(
  fiber: Fiber,
  updatedFamilies: Set<Family>,
  staleFamilies: Set<Family>,
) {
  if (__DEV__) {
    const {alternate, child, sibling, tag, type} = fiber;

    let candidateType = null;
    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;
      case ForwardRef:
        candidateType = type.render;
        break;
      default:
        break;
    }

    if (resolveFamily === null) {
      throw new Error('Expected resolveFamily to be set during hot reload.');
    }

    let needsRender = false;
    let needsRemount = false;
    if (candidateType !== null) {
      const family = resolveFamily(candidateType);
      if (family !== undefined) {
        if (staleFamilies.has(family)) {
          needsRemount = true;
        } else if (updatedFamilies.has(family)) {
          needsRender = true;
        }
      }
    }
    if (failedBoundaries !== null) {
      if (
        failedBoundaries.has(fiber) ||
        (alternate !== null && failedBoundaries.has(alternate))
      ) {
        needsRemount = true;
      }
    }

    if (needsRemount) {
      fiber._debugNeedsRemount = true;
    }
    if (needsRemount || needsRender) {
      scheduleWork(fiber, Sync);
    }
    if (child !== null && !needsRemount) {
      scheduleFibersWithFamiliesRecursively(
        child,
        updatedFamilies,
        staleFamilies,
      );
    }
    if (sibling !== null) {
      scheduleFibersWithFamiliesRecursively(
        sibling,
        updatedFamilies,
        staleFamilies,
      );
    }
  }
}

export function findHostNodesForHotUpdate(
  root: FiberRoot,
  families: Array<Family>,
): Set<Instance> {
  if (__DEV__) {
    const hostNodes = new Set();
    const types = new Set(families.map(family => family.current));
    findHostNodesForMatchingFibersRecursively(root.current, types, hostNodes);
    return hostNodes;
  } else {
    throw new Error(
      'Did not expect findHostNodesForHotUpdate to be called in production.',
    );
  }
}

function findHostNodesForMatchingFibersRecursively(
  fiber: Fiber,
  types: Set<any>,
  hostNodes: Set<Instance>,
) {
  if (__DEV__) {
    const {child, sibling, tag, type} = fiber;

    let candidateType = null;
    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;
      case ForwardRef:
        candidateType = type.render;
        break;
      default:
        break;
    }

    let didMatch = false;
    if (candidateType !== null) {
      if (types.has(candidateType)) {
        didMatch = true;
      }
    }

    if (didMatch) {
      // We have a match. This only drills down to the closest host components.
      // There's no need to search deeper because for the purpose of giving
      // visual feedback, "flashing" outermost parent rectangles is sufficient.
      findHostNodesForFiberShallowly(fiber, hostNodes);
    } else {
      // If there's no match, maybe there will be one further down in the child tree.
      if (child !== null) {
        findHostNodesForMatchingFibersRecursively(child, types, hostNodes);
      }
    }

    if (sibling !== null) {
      findHostNodesForMatchingFibersRecursively(sibling, types, hostNodes);
    }
  }
}

function findHostNodesForFiberShallowly(
  fiber: Fiber,
  hostNodes: Set<Instance>,
): void {
  if (__DEV__) {
    const foundHostNodes = findChildHostNodesForFiberShallowly(
      fiber,
      hostNodes,
    );
    if (foundHostNodes) {
      return;
    }
    // If we didn't find any host children, fallback to closest host parent.
    let node = fiber;
    while (true) {
      switch (node.tag) {
        case HostComponent:
          hostNodes.add(node.stateNode);
          return;
        case HostPortal:
          hostNodes.add(node.stateNode.containerInfo);
          return;
        case HostRoot:
          hostNodes.add(node.stateNode.containerInfo);
          return;
      }
      if (node.return === null) {
        throw new Error('Expected to reach root first.');
      }
      node = node.return;
    }
  }
}

function findChildHostNodesForFiberShallowly(
  fiber: Fiber,
  hostNodes: Set<Instance>,
): boolean {
  if (__DEV__) {
    let node: Fiber = fiber;
    let foundHostNodes = false;
    while (true) {
      if (node.tag === HostComponent) {
        // We got a match.
        foundHostNodes = true;
        hostNodes.add(node.stateNode);
        // There may still be more, so keep searching.
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      if (node === fiber) {
        return foundHostNodes;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === fiber) {
          return foundHostNodes;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  }
  return false;
}


text:
package pro.hirooka.chukasa.domain.config.aaa;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "aaa")
public class AaaConfiguration {

    private boolean enabled;
    private String initialUsername;
    private String initialPassword;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getInitialUsername() {
        return initialUsername;
    }

    public void setInitialUsername(String initialUsername) {
        this.initialUsername = initialUsername;
    }

    public String getInitialPassword() {
        return initialPassword;
    }

    public void setInitialPassword(String initialPassword) {
        this.initialPassword = initialPassword;
    }
}


text:
<?php

namespace Linter;

use function \Linter\FileSystem\getFileList;
use function \Linter\FileSystem\setFileName;

function fileLinter($path, $fix = false)
{
    $fileList = getFileList($path);

    $func = function ($file) use ($fix) {
        $code = file_get_contents($file);
        return lint($code, $fix);
    };
    $result = array_map($func, $fileList);

    $errors = array_map(function ($item) {
        return $item['errors'];
    }, $result);
    $errors = array_combine($fileList, $errors);

    if ($fix) {
        $fixedCode = array_map(function ($item) {
            return $item['fixedCode'];
        }, $result);
        $fixedCode = array_combine($fileList, $fixedCode);
        foreach ($fixedCode as $file => $code) {
            if (!empty($code)) {
                $fileName = setFileName($file);
                file_put_contents($fileName, $code);
            }
        }
    }
    return $errors;
}


text:
import Masonry = require("masonry-layout");

// responsive layouts
function testResponsiveLayouts() {
    $(document).ready(() => {
        $('.grid').masonry({
            itemSelector: '.grid-item',
            columnWidth: '.grid-sizer',
            percentPosition: true
        });
    });
}

// recommended Options
function testRecommendedOptions() {
    $(document).ready(() => {
        $('.grid').masonry({
            columnWidth: 200,
            itemSelector: '.grid-item'
        });
    });

    const msnry = new Masonry('.grid', {
        columnWidth: 200,
        itemSelector: '.grid-item'
    });
}

// extended Options
function testExtendedOptions() {
    const msnry = new Masonry('.grid', {
        itemSelector: '.grid-item',
        columnWidth: '.grid-sizer',
        percentPosition: true,
        gutter: '.gutter-sizer',
        stamp: '.stamp',
        fitWidth: true,
        originLeft: true,
        originTop: true,
        containerStyle: {
            position: 'relative'
        },
        transitionDuration: '0.4s',
        resize: true,
        initLayout: true,
        horizontalOrder: true
    });
}


text:
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
)

type Config struct {
	Versions []string
}

func main() {
	var conf Config
	file, err := ioutil.ReadFile("versions.json")
	if err != nil {
		fmt.Println(err)
	}

	err = json.Unmarshal(file, &conf)
	if err != nil {
		fmt.Println("Error:", err)
	}

	fmt.Println(conf)

}


text:
package com.krishagni.catissueplus.core.biospecimen.events;

public class VisitSpecimensQueryCriteria {
	private Long cprId;

	private Long eventId;

	private Long visitId;

	public Long getCprId() {
		return cprId;
	}

	public void setCprId(Long cprId) {
		this.cprId = cprId;
	}

	public Long getEventId() {
		return eventId;
	}

	public void setEventId(Long eventId) {
		this.eventId = eventId;
	}

	public Long getVisitId() {
		return visitId;
	}

	public void setVisitId(Long visitId) {
		this.visitId = visitId;
	}
}


text:
use strict;
use warnings;
use JSON;
use Bio::KBase::workspace::ScriptHelpers qw(printObjectInfo get_ws_client workspace workspaceURL parseObjectMeta parseWorkspaceMeta printObjectMeta);
use Bio::KBase::fbaModelServices::ScriptHelpers qw(fbaws get_fba_client runFBACommand universalFBAScriptCode );
#Defining globals describing behavior
my $primaryArgs = ["Pangenome/Proteome comparison"];
my $servercommand = "compare_genomes";
my $script = "ga-compare-genomes";
my $translation = {
	workspace => "workspace",
	outputid => "output_id"
};
#Defining usage and options
my $specs = [
    [ 'outputid|o:s', 'ID for genome comparison in workspace' ],
    [ 'isproteomecomp', 'Input object is a proteome comparison' ],
    [ 'workspace|w=s', 'Workspace to save merged model', { "default" => fbaws() } ],
];
my ($opt,$params) = universalFBAScriptCode($specs,$script,$primaryArgs,$translation);
if (defined($opt->{isproteomecomp}) && $opt->{isproteomecomp} == 1) {
	$params->{protcomp_id} = $opt->{"Pangenome/Proteome comparison"};
} else {
	$params->{pangenome_id} = $opt->{"Pangenome/Proteome comparison"};
}
#Calling the server
my $output = runFBACommand($params,$servercommand,$opt);
#Checking output and report results
if (!defined($output)) {
	print "Genome comparison failed!\n";
} else {
	print "Genome comparison successful:\n";
	printObjectInfo($output);
}


text:
'use strict'

const hooks = require('../hooks')

describe('Settings menu', function () {
  hooks.createApp.bind(this)()

  before(function () {
    return hooks.beforeBlock.bind(this)()
  })

  after(function () {
    return hooks.afterBlock.bind(this)()
  })

  describe('setting to play sound', function () {
    const playSoundSelector = 'md-switch[aria-label="Play sound when receiving transactions?"]'

    before(function () {
      this.app.client.addCommand('clickPlaySound', function () {
        return this
          .openSettingsMenu()
          .click(playSoundSelector)
          .pause(1000)
      })

      this.app.client.addCommand('getPlaySoundState', function () {
        return this.getAttribute(playSoundSelector, 'aria-checked')
      })
    })

    context('when is clicked', function () {
      let wasEnabled

      before(function () {
        return this.app.client.getLocalStorage('storage-mainnet')
          .then(storage => {
            wasEnabled = storage.playFundsReceivedSound
            return this.app.client.clickPlaySound()
          })
      })

      it('toggles the button', function () {
        const isEnabled = this.app.client.getPlaySoundState()
        if (wasEnabled) {
          return (isEnabled).should.not.be
        } else {
          return (isEnabled).should.equal('true')
        }
      })

      it('stores the new state inmediatly', function () {
        return this.app.client.getLocalStorage('storage-mainnet')
          .then(storage => {
            if (wasEnabled) {
              return (storage).should.not.have.key('playFundsReceivedSound')
            } else {
              return (storage.playFundsReceivedSound).should.be.true
            }
          })
      })
    })
  })
})


text:
package org.thymeleaf.templateengine.springintegration;

import java.util.Arrays;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
import org.thymeleaf.dialect.IDialect;
import org.thymeleaf.templateengine.springintegration.context.ErrorsSpringIntegrationWebProcessingContextBuilder;
import org.thymeleaf.templateengine.springintegration.context.SpringIntegrationWebProcessingContextBuilder;
import org.thymeleaf.templateengine.springintegration.dialect.binding.BindingDialect;
import org.thymeleaf.testing.templateengine.context.IProcessingContextBuilder;
import org.thymeleaf.testing.templateengine.engine.TestExecutor;
import org.thymeleaf.testing.templateengine.engine.TestExecutorFactory;
import org.thymeleaf.testing.templateengine.spring6.context.web.SpringMVCWebProcessingContextBuilder;
import org.thymeleaf.util.SpringStandardDialectUtils;
import org.thymeleaf.util.ThrottleArgumentsProvider;

public class SpringIntegrationTest {

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testForm(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new SpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/form");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testFormCompiledSpEL(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new SpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/form");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testHiddenMarkers(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new SpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(false, true)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/hiddenmarkers");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testErrors(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new ErrorsSpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/errors");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testBindingDialect(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new ErrorsSpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(
                Arrays.asList(new IDialect[] {
                        SpringStandardDialectUtils.createSpringStandardDialectInstance(),
                        new BindingDialect() }));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/bindingdialect");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testErrorsCompiledSpEL(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new ErrorsSpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/errors");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testBindingDialectCompiledSpEL(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new ErrorsSpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(
                Arrays.asList(new IDialect[] {
                        SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false),
                        new BindingDialect() }));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/bindingdialect");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testBeans(final int throttleStep) throws Exception {

        final IProcessingContextBuilder processingContextBuilder =
                new SpringIntegrationWebProcessingContextBuilder("classpath:templateengine/springintegration/applicationContext-beans.xml");
        final TestExecutor executor = TestExecutorFactory.createTestExecutor(processingContextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/beans");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testBeansCompiledSpEL(final int throttleStep) throws Exception {

        final IProcessingContextBuilder processingContextBuilder =
                new SpringIntegrationWebProcessingContextBuilder("classpath:templateengine/springintegration/applicationContext-beans.xml");
        final TestExecutor executor = TestExecutorFactory.createTestExecutor(processingContextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/beans");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testExpression(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new SpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/expression");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testExpressionCompiledSpEL(final int throttleStep) throws Exception {

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(new SpringIntegrationWebProcessingContextBuilder());
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/expression");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testMvc(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/mvc/applicationContext.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/mvc");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testMvcCompiledSpEL(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/mvc/applicationContext.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/mvc");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testXmlNs(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation(null);

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/xmlns");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testXmlNsCompiledSpEL(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation(null);

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/xmlns");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataFormWith(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-with.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/formwith");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataFormWithCompiledSpEL(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-with.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/formwith");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataFormWithout(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-without.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/formwithout");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataFormWithoutCompiledSpEL(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-without.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/formwithout");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataUrlsWith(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-with.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/urlswith");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataUrlsWithCompiledSpEL(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-with.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/urlswith");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataUrlsWithout(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-without.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/urlswithout");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestDataUrlsWithoutCompiledSpEL(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-without.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/urlswithout");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestUrlsExpOobject(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-with.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance()}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/urlsexpobject");

        Assertions.assertTrue(executor.isAllOK());

    }

    @ParameterizedTest
    @ArgumentsSource(ThrottleArgumentsProvider.class)
    public void testRequestUrlsExpOobjectCompiledSpEL(final int throttleStep) throws Exception {

        final SpringMVCWebProcessingContextBuilder contextBuilder = new SpringMVCWebProcessingContextBuilder();
        contextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springintegration/requestdata/applicationContext-with.xml");

        final TestExecutor executor = TestExecutorFactory.createTestExecutor(contextBuilder);
        executor.setDialects(Arrays.asList(new IDialect[] { SpringStandardDialectUtils.createSpringStandardDialectInstance(true, false)}));
        executor.setThrottleStep(throttleStep);
        executor.execute("classpath:templateengine/springintegration/requestdata/urlsexpobject");

        Assertions.assertTrue(executor.isAllOK());

    }

}


text:
var page = tabris.create("Page", {
  title: "Styling with class selector",
  topLevel: true
});

["normal", "interactive", "prio-high", "missing", "prio-high missing"].forEach(function(style) {
  tabris.create("TextView", {
    layoutData: {left: 10, top: "prev() 10"},
    class: style,
    text: "class \"" + style + "\""
  }).appendTo(page);
});

// This example has inline styles. To re-use styles, you can extract them as modules, e.g.
// page.apply(require("../styles.json));
page.apply({
  "TextView": {font: "24px Arial, sans-serif", textColor: "#333"},
  ".interactive": {textColor: "blue"},
  ".prio-high": {font: "bold 24px Arial, Sans-Serif"},
  ".missing": {textColor: "#ccc"}
});
page.open();


text:
{% assign is_post = page.date %}
<!DOCTYPE>

    <meta content='{{ page.title }} - {{ site.title }}' name='title' />
    <meta content='{{ page.title }} - {{ site.title }}' name='og:title' />
    <title>{{ page.title }} - {{ site.title }}</title>
    {% include head.html %}

            {% for link in site.links %}
            {{ link.name }}
                {% endfor %}

            <form id="cb-search-btn" role="search">

         <input type="text" class="input" id="cb-search-content" required="true" placeholder="标题 标签..." maxlength="30" autocomplete="off">

            </form>

               {% for link in site.links %}

{{ link.name }}

                 {% endfor %}

	{{ page.title }}

	 <time datetime="{{ page.date | date: '%F %H:%M:%S'}}" itemprop="datePublished">发布时间:{{ page.date | date: "%F %H:%M:%S"}}</time>
     博客分类: {{ page.category }}
     阅读次数: comments

                {% unless page.tags == empty %}
      {% assign tags_list = page.tags %}
      {% if tags_list.first[0] == null %}
      {% for tag in tags_list %}

          {{ tag }} ({{ site.tags[tag].size }})
          {% unless forloop.last %}{% endunless %}

      {% endfor %}
      {% else %}
      {% for tag in tags_list %}

            {{ tag[0] }} ({{ tag[1].size }})
            {% unless forloop.last %}{% endunless %}

      {% endfor %}
      {% endif %}
      {% assign tags_list = nil %}
    {% endunless %}

			{{ page.title }}

				<time datetime="{{ page.date | date: '%F %H:%M:%S'}}" itemprop="datePublished">{{ page.date | date: "%F %H:%M:%S"}}</time>

    {% unless page.tags == empty %}
      {% assign tags_list = page.tags %}
      {% if tags_list.first[0] == null %}
      {% for tag in tags_list %}

          {{ tag }} ({{ site.tags[tag].size }})
          {% unless forloop.last %}{% endunless %}
      {% endfor %}
      {% else %}
      {% for tag in tags_list %}

            {{ tag[0] }} ({{ tag[1].size }})
            {% unless forloop.last %}{% endunless %}

      {% endfor %}
      {% endif %}
      {% assign tags_list = nil %}
    {% endunless %}

{{ content }}

			本文由 liberxue 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为:{{ page.date | date: "%F %H:%M:%S"}}

{% include foot.html %}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>create-environment — AWS CLI 1.0.0 documentation</title>
  <link rel="stylesheet" type="text/css" href="../../_static/bootstrap.min.css" />

    <link rel="stylesheet" href="../../_static/guzzle.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="top" title="AWS CLI 1.0.0 documentation" href="../../index.html" />
    <link rel="up" title="elasticbeanstalk" href="index.html" />
    <link rel="next" title="create-storage-location" href="create-storage-location.html" />
    <link rel="prev" title="create-configuration-template" href="create-configuration-template.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" type="text/css" href="../../_static/bootstrap-responsive.min.css" />

        AWS CLI

Home

Documentation

Forum

GitHub

Navigation

          index

          next |

          previous |

AWS CLI 1.0.0 documentation »

aws »

elasticbeanstalk »

          ← create-configuration-template
          /

create-storage-location →

Table Of Contents

create-environment

Description

Synopsis

Options

Quick search

    <form class="form-search margin-top-1em" action="../../search.html" method="get">
        <input type="text" name="q" style="width: 105px" class="input-small search-query" />
        <button type="submit" class="btn btn-small">Search</button>
        <input type="hidden" name="check_keywords" value="yes" />
        <input type="hidden" name="area" value="default" />
    </form>

Feedback

Did you find this page useful? Do you have a suggestion? Give us feedback or
  send us a pull request on GitHub.

[ aws . elasticbeanstalk ]

create-environment¶

Description¶

Launches an environment for the specified application using the specified configuration.

Synopsis¶

  create-environment
--application-name <value>
[--version-label <value>]
--environment-name <value>
[--template-name <value>]
[--solution-stack-name <value>]
[--cname-prefix <value>]
[--description <value>]
[--option-settings <value>]
[--options-to-remove <value>]

Options¶

<tt class="docutils literal">--application-name</tt> (string)

The name of the application that contains the version to be deployed.

If no application is found with this name, <tt class="docutils literal">create-environment</tt>  returns an <tt class="docutils literal">InvalidParameterValue</tt>  error.

<tt class="docutils literal">--version-label</tt> (string)

The name of the application version to deploy.

If the specified application has no associated application versions, AWS Elastic Beanstalk <tt class="docutils literal">update-environment</tt>  returns an <tt class="docutils literal">InvalidParameterValue</tt>  error.

Default: If not specified, AWS Elastic Beanstalk attempts to launch the most recently created application version.

<tt class="docutils literal">--environment-name</tt> (string)

A unique name for the deployment environment. Used in the application URL.

Constraint: Must be from 4 to 23 characters in length. The name can contain only letters, numbers, and hyphens. It cannot start or end with a hyphen. This name must be unique in your account. If the specified name already exists, AWS Elastic Beanstalk returns an <tt class="docutils literal">InvalidParameterValue</tt>  error.

Default: If the CNAME parameter is not specified, the environment name becomes part of the CNAME, and therefore part of the visible URL for your application.

<tt class="docutils literal">--template-name</tt> (string)

The name of the configuration template to use in deployment. If no configuration template is found with this name, AWS Elastic Beanstalk returns an <tt class="docutils literal">InvalidParameterValue</tt>  error.

Condition: You must specify either this parameter or a <tt class="docutils literal">--solution-stack-name</tt>  , but not both. If you specify both, AWS Elastic Beanstalk returns an <tt class="docutils literal">InvalidParameterCombination</tt>  error. If you do not specify either, AWS Elastic Beanstalk returns a <tt class="docutils literal">MissingRequiredParameter</tt>  error.

<tt class="docutils literal">--solution-stack-name</tt> (string)

This is an alternative to specifying a configuration name. If specified, AWS Elastic Beanstalk sets the configuration values to the default values associated with the specified solution stack.

Condition: You must specify either this or a <tt class="docutils literal">--template-name</tt>  , but not both. If you specify both, AWS Elastic Beanstalk returns an <tt class="docutils literal">InvalidParameterCombination</tt>  error. If you do not specify either, AWS Elastic Beanstalk returns a <tt class="docutils literal">MissingRequiredParameter</tt>  error.

<tt class="docutils literal">--cname-prefix</tt> (string)

If specified, the environment attempts to use this value as the prefix for the CNAME. If not specified, the CNAME is generated automatically by appending a random alphanumeric string to the environment name.

<tt class="docutils literal">--description</tt> (string)

Describes this environment.

<tt class="docutils literal">--option-settings</tt> (list)

If specified, AWS Elastic Beanstalk sets the specified configuration options to the requested value in the configuration set for the new environment. These override the values obtained from the solution stack or the configuration template.

Shorthand Syntax:

  Key value pairs, with multiple values separated by a space.
--option-settings Namespace=string,OptionName=string,Value=string

JSON Syntax:

[
  {
    "Namespace": "string",
    "OptionName": "string",
    "Value": "string"
  }
  ...
]

<tt class="docutils literal">--options-to-remove</tt> (list)

A list of custom user-defined configuration options to remove from the configuration set for this new environment.

Shorthand Syntax:

  Key value pairs, with multiple values separated by a space.
--options-to-remove Namespace=string,OptionName=string

JSON Syntax:

[
  {
    "Namespace": "string",
    "OptionName": "string"
  }
  ...
]

          ← create-configuration-template
          /

create-storage-location →

Navigation

          index

          next |

          previous |

AWS CLI 1.0.0 documentation »

aws »

elasticbeanstalk »

    © Copyright 2013, Amazon Web Services. Created using Sphinx.