text:
package api.swagger;

import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = ApiSwaggerAutoConfigurationTest.TestConfiguration.class,
        webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = {
        "spring.application.name=sampleSwagger",
        "api.swagger.title=API Starter Swagger",
        "api.swagger.description=API Swagger",
        "api.swagger.version=1.0",
        "api.swagger.paths=/rest.*|/api.*",
        "api.swagger.license: Apache License Version 2.0"
})
public class ApiSwaggerAutoConfigurationTest {

    @SpringBootApplication
    @ComponentScan(basePackageClasses = ApiSwaggerAutoConfigurationTest.class)
    static class TestConfiguration {
        public static void main(String[] args) {
            SpringApplication.run(TestConfiguration.class, args);
        }
    }

}


text:
package com.github.edipermadi.security.blobfish.codec;

import com.github.edipermadi.security.blobfish.exc.BlobfishCryptoException;
import com.github.edipermadi.security.blobfish.exc.BlobfishEncodeException;
import com.github.edipermadi.security.blobfish.exc.KeyProtectionException;
import com.github.edipermadi.security.blobfish.exc.SignerSetupException;
import com.github.edipermadi.security.blobfish.generated.BlobfishProto;
import com.google.protobuf.ByteString;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.io.IOException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.X509Certificate;
import java.util.HashSet;
import java.util.Set;
import java.util.zip.GZIPOutputStream;

/**
 * Container encoder base implementation
 *
 * @author Edi Permadi
 */
abstract class ContainerEncoderBase extends ContainerBase {
    protected final PrivateKey signingPrivateKey;
    protected final int version;
    private final boolean compressed;
    protected Set<String> paths = new HashSet<>();

    /**
     * Class constructor
     *
     * @param builder    builder object
     * @param version    container encoding version
     * @param compressed set to true to enable compression
     */
    ContainerEncoderBase(final ContainerEncoderBuilder builder, final int version, final boolean compressed) {
        this.compressed = compressed;
        this.version = version;
        signingPrivateKey = builder.signingPrivateKey;
    }

    /**
     * Encode metadata into byte array
     *
     * @param path     path of blob
     * @param tags     tags of blob
     * @param mimeType mime-type of blob
     * @return serialized blob metadata
     */
    byte[] encodeMetadata(final String path, final Set<String> tags, final String mimeType) throws BlobfishEncodeException {
        final byte[] encoded = BlobfishProto.Blobfish.Body.Metadata.newBuilder()
                .setPath(path)
                .setMimeType(mimeType)
                .addAllTags(filterTags(tags))
                .build()
                .toByteArray();
        if (!compressed) {
            return encoded;
        }

        try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             final GZIPOutputStream gzos = new GZIPOutputStream(baos)) {
            gzos.write(encoded);
            gzos.finish();
            gzos.flush();
            return baos.toByteArray();
        } catch (final IOException ex) {
            throw new BlobfishEncodeException("failed to encode metadata", ex);
        }
    }

    /**
     * Encode payload
     *
     * @param inputStream input stream of payload
     * @return byte array of encoded payload
     * @throws IOException when encoding failed
     */
    byte[] encodePayload(final InputStream inputStream) throws IOException {
        final byte[] payload = IOUtils.toByteArray(inputStream);
        final byte[] encoded = BlobfishProto.Blobfish.Body.Payload.newBuilder()
                .setData(ByteString.copyFrom(payload))
                .build()
                .toByteArray();
        if (!compressed) {
            return encoded;
        }

        try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             final GZIPOutputStream gzos = new GZIPOutputStream(baos)) {
            gzos.write(encoded);
            gzos.finish();
            gzos.flush();
            return baos.toByteArray();
        }
    }

    /**
     * Protect symmetric key with RSA
     *
     * @param secureRandom secure random object
     * @param keyBytes     symmetric key to be protected
     * @param certificate  symmetric-key protection certificate
     * @return byte string of protected symmetric key
     * @throws KeyProtectionException when key protection failed
     */
    ByteString protectKey(final SecureRandom secureRandom, final byte[] keyBytes, final X509Certificate certificate) throws BlobfishEncodeException {
        try {
            final Cipher cipher = Cipher.getInstance(KEY_PROTECTION_ALGORITHM);
            cipher.init(Cipher.ENCRYPT_MODE, certificate, secureRandom);
            return ByteString.copyFrom(cipher.doFinal(keyBytes));
        } catch (final NoSuchAlgorithmException | InvalidKeyException | NoSuchPaddingException | BadPaddingException | IllegalBlockSizeException ex) {
            throw new KeyProtectionException(ex);
        }
    }

    /**
     * Get signer object
     *
     * @param privateKey signing private key
     * @return signer object
     * @throws BlobfishCryptoException when signer setup failed
     */
    Signature getSigner(final PrivateKey privateKey) throws BlobfishCryptoException {
        try {
            final Signature signer = Signature.getInstance(SIGNING_ALGORITHM);
            signer.initSign(privateKey);
            return signer;
        } catch (final NoSuchAlgorithmException | InvalidKeyException ex) {
            throw new SignerSetupException(ex);
        }
    }

    /**
     * Derive salt
     *
     * @param secureRandom secure random as salt source
     * @return byte array of salt
     */
    byte[] deriveSalt(SecureRandom secureRandom) {
        final byte[] salt = new byte[32];
        secureRandom.nextBytes(salt);
        return salt;
    }

    /**
     * Convert tags to lowercase
     *
     * @param tags source tags
     * @return converted tags
     */
    private Set<String> filterTags(final Set<String> tags) {
        final Set<String> result = new HashSet<>();
        for (final String tag : tags) {
            result.add(tag.toLowerCase());
        }

        return result;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package news.androidtv.subchannel;

import android.app.Activity;
import android.os.Bundle;

/**
 * Created by Nick on 10/28/2016.
 */

public class SetupActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setup);
        if (getActionBar() != null) {
            getActionBar().hide();
        }
    }
}


text:
/*global YUI*/

YUI.add('yslow-config', function (Y) {
    Y.namespace('YSLOW').config = {
        /* make sure host has trailing slash */
        host: 'http://localhost:8000/',
        //host: 'http://secondbelong-lm.corp.yahoo.com:8000/',
        /* do no include scheme nor colon and double slashes */
        /* comment out to use the default provided by YUI YQL */
        //yql: 'staging.query.yahooapis.com/v1/public/yql?',
        /* yql opentable url */
        /* comment out to use the default YQL community table data.headers */
        //table: 'http://sandbox.javascriptrules.com/yql/data.headers.xml',
        js: '{{BOOKMARKLET_JS}}',
        css: '{{BOOKMARKLET_CSS}}'
    };
});


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test" >
    <uses-sdk android:targetSdkVersion="16" />
    <application>
        <activity android:name=".TestActivity" />
    </application>
</manifest>


text:
package br.mil.mar.casnav.mclm.dto;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

public class SceneryDTO implements IScenery {

    private Integer sceneryId;
    private String sceneryName;
    private int zoomLevel;
    private String mapCenter;
    private String mapCenterHDMS;
    private String mapBbox;
    private String userName;
    private String baseMap;
    private String baseServerURL;
    private String description;
    private boolean baseMapActive;
    private boolean isPublic;
    private String userCpf;
    private boolean graticule;
    private Set<SceneryNodeDTO> sceneryNodes;
    private List<Integer> groups;
    private List<String> individualGroups = new ArrayList<>();

    @Override
    public String getBaseMap() {
        return baseMap;
    }

    public void setBaseMap(String baseMap) {
        this.baseMap = baseMap;
    }

    public String getBaseServerURL() {
        return baseServerURL;
    }

    public void setBaseServerURL(String baseServerURL) {
        this.baseServerURL = baseServerURL;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public String getMapBbox() {
        return mapBbox;
    }

    public void setMapBbox(String mapBbox) {
        this.mapBbox = mapBbox;
    }

    @Override
    public String getMapCenter() {
        return mapCenter;
    }

    public void setMapCenter(String mapCenter) {
        this.mapCenter = mapCenter;
    }

    @Override
    public String getMapCenterHDMS() {
        return mapCenterHDMS;
    }

    public void setMapCenterHDMS(String mapCenterHDMS) {
        this.mapCenterHDMS = mapCenterHDMS;
    }

    @Override
    public String getSceneryName() {
        return sceneryName;
    }

    public void setSceneryName(String sceneryName) {
        this.sceneryName = sceneryName;
    }

    @Override
    public String getUserCpf() {
        return userCpf;
    }

    public void setUserCpf(String userCpf) {
        this.userCpf = userCpf;
    }

    @Override
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public boolean isBaseMapActive() {
        return baseMapActive;
    }

    public void setBaseMapActive(boolean baseMapActive) {
        this.baseMapActive = baseMapActive;
    }

    @Override
    public boolean isGraticule() {
        return graticule;
    }

    public void setGraticule(boolean graticule) {
        this.graticule = graticule;
    }

    @Override
    public boolean isIsPublic() {
        return isPublic;
    }

    public void setIsPublic(boolean isPublic) {
        this.isPublic = isPublic;
    }

    @Override
    public Integer getSceneryId() {
        return sceneryId;
    }

    public void setSceneryId(Integer sceneryId) {
        this.sceneryId = sceneryId;
    }

    @Override
    public int getZoomLevel() {
        return zoomLevel;
    }

    public void setZoomLevel(int zoomLevel) {
        this.zoomLevel = zoomLevel;
    }

    @Override
    public Set<SceneryNodeDTO> getSceneryNodes() {
        return sceneryNodes;
    }

    public void setSceneryNodes(Set<SceneryNodeDTO> sceneryNodes) {
        this.sceneryNodes = sceneryNodes;
    }

    public List<Integer> getGroups() {
        return groups;
    }

    public void setGroups(List<Integer> groups) {
        this.groups = groups;
    }

    public List<String> getIndividualGroups() {
        return individualGroups;
    }

    public void setIndividualGroups(List<String> individualGroups) {
        this.individualGroups = individualGroups;
    }

}


text:
import { ConnectionStatus, DuplexConnection, Frame } from 'rsocket-types';

import { Flowable } from 'rsocket-flowable';
import { Encoders } from 'rsocket-core';

export interface ClientOptions {
    url: string;
    wsCreator?: (url: string) => WebSocket;
    debug?: boolean;
    lengthPrefixedFrames?: boolean;
}

/**
 * A WebSocket transport client for use in browser environments.
 */
export default class RSocketWebSocketClient implements DuplexConnection {
                   constructor(options: ClientOptions, encoders?: Encoders<any>);
                   close(): void;
                   connect(): void;
                   connectionStatus(): Flowable<ConnectionStatus>;
                   receive(): Flowable<Frame>;
                   sendOne(frame: Frame): void;
                   send(frames: Flowable<Frame>): void;
               }


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

<title>lfsom.output</title>
<meta name="date" content="2015-09-02">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

lfsom.output

Classes

XMLOutputter


text:
package com.github.pradine.hydra.phase;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import com.github.pradine.hydra.CommandLineArgs;
import com.github.pradine.hydra.Phase;

/**
 * The purpose of this class is to create and populate the source directory, used to store
 * the input files to the transformation process including a BPEL file; WSDLs and XSDs used
 * within the BPEL process description; and an XML catalog file used to locate the WSDL and
 * XSD files.
 */
public class Setup implements Phase {
    private static final String PREFIX = "hydra-";

    private static final String SOURCE_DIR = "src/main/resources/com/github/pradine/hydra/source";

    private static final String SETUP_XML = "com/github/pradine/hydra/xsl/setup.xsl";

    private final CommandLineArgs cla;

    private final Path bpelFile;

    private final Path catalogFile;

    private final Path inputDir;

    private final Path workingDir;

    private Path projectDir;

    private Path sourceDir;

    public Setup(CommandLineArgs cla) {
        this.cla = cla;
        this.bpelFile = cla.getBpelFile();
        this.catalogFile = cla.getCatalogFile();
        this.inputDir = cla.getInputDir();
        this.workingDir = cla.getWorkingDir();
    }

    @Override
    public void execute() {
        //TODO if (bpelFile || catalogFile) && inputDir are all specified then throw an error.

        //TODO if bpelFile is null and inputDir is null then throw an error.

        try {
            projectDir = Files.createTempDirectory(workingDir, PREFIX);
            projectDir.toFile().deleteOnExit();

            //TODO Check that trailing separators, if present, do not cause problems
            String temp = projectDir.toString();
            Path path = Paths.get(temp, SOURCE_DIR);
            sourceDir = Files.createDirectories(path);
        } catch (Exception e) {
            e.printStackTrace();
            //TODO Throw a suitable exception
        }

        cla.setProjectDir(projectDir);
        cla.setSourceDir(sourceDir);

        //TODO Copy the BPEL file to the source directory after retrieving any imported files

    }
}


text:
SCENARIO("all emits true if every item emitted by the source observable evaluated as true", "[all][operators]") {
    GIVEN("a source") {
        auto sc = rxsc::make_test();
        auto w = sc.create_worker();
        const rxsc::test::messages<int> on;
        const rxsc::test::messages<bool> on_all;

        auto xs = sc.make_hot_observable({
            on.next(150, 1),
            on.next(210, 2),
            on.next(220, 2),
            on.completed(250)
        });

        WHEN("a predicate function is passed to the all operator") {

            auto res = w.start(
                [xs]() {
                    return xs
                        | rxo::all([](int n) { return n == 2; })
                        | rxo::as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013
                }
            );

            THEN("the output only contains true") {
                auto required = rxu::to_vector({
                    on_all.next(250, true),
                    on_all.completed(250)
                });
                auto actual = res.get_observer().messages();
                REQUIRE(required == actual);
            }

            THEN("there was 1 subscription/unsubscription to the source") {
                auto required = rxu::to_vector({
                    on.subscribe(200, 250)
                });
                auto actual = xs.subscriptions();
                REQUIRE(required == actual);
            }

        }
    }
}

SCENARIO("all emits false if any item emitted by the source observable evaluated as false", "[all][operators]") {
    GIVEN("a source") {
        auto sc = rxsc::make_test();
        auto w = sc.create_worker();
        const rxsc::test::messages<int> on;
        const rxsc::test::messages<bool> on_all;

        auto xs = sc.make_hot_observable({
            on.next(150, 1),
            on.next(210, 2),
            on.next(220, 3),
            on.completed(250)
        });

        WHEN("a predicate function is passed to the all operator") {

            auto res = w.start(
                [xs]() {
                    return xs
                        .all([](int n) { return n == 2; })
                        .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013

                }
            );

            THEN("the output only contains false") {
                auto required = rxu::to_vector({
                    on_all.next(220, false),
                    on_all.completed(220)
                });
                auto actual = res.get_observer().messages();
                REQUIRE(required == actual);
            }

            THEN("there was 1 subscription/unsubscription to the source") {
                auto required = rxu::to_vector({
                    on.subscribe(200, 220)
                });
                auto actual = xs.subscriptions();
                REQUIRE(required == actual);
            }

        }
    }
}

SCENARIO("all emits true if the source observable is empty", "[all][operators]") {
    GIVEN("a source") {
        auto sc = rxsc::make_test();
        auto w = sc.create_worker();
        const rxsc::test::messages<int> on;
        const rxsc::test::messages<bool> on_all;

        auto xs = sc.make_hot_observable({
            on.completed(250)
        });

        WHEN("a predicate function is passed to the all operator") {

            auto res = w.start(
                [xs]() {
                    return xs
                        .all([](int n) { return n == 2; })
                        .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013
                }
            );

            THEN("the output only contains true") {
                auto required = rxu::to_vector({
                    on_all.next(250, true),
                    on_all.completed(250)
                });
                auto actual = res.get_observer().messages();
                REQUIRE(required == actual);
            }

            THEN("there was 1 subscription/unsubscription to the source") {
                auto required = rxu::to_vector({
                    on.subscribe(200, 250)
                });
                auto actual = xs.subscriptions();
                REQUIRE(required == actual);
            }

        }
    }
}

SCENARIO("all never emits if the source observable never emits any items", "[all][operators]") {
    GIVEN("a source") {
        auto sc = rxsc::make_test();
        auto w = sc.create_worker();
        const rxsc::test::messages<int> on;
        const rxsc::test::messages<bool> on_all;

        auto xs = sc.make_hot_observable({
            on.next(150, 1)
        });

        WHEN("a predicate function is passed to the all operator") {

            auto res = w.start(
                [xs]() {
                    return xs
                        .all([](int n) { return n == 2; })
                        .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013
                }
            );

            THEN("the output is empty") {
                auto required = std::vector<rxsc::test::messages<bool>::recorded_type>();
                auto actual = res.get_observer().messages();
                REQUIRE(required == actual);
            }

            THEN("there was 1 subscription/unsubscription to the source") {
                auto required = rxu::to_vector({
                    on.subscribe(200, 1000)
                });
                auto actual = xs.subscriptions();
                REQUIRE(required == actual);
            }
        }
    }
}

SCENARIO("all emits an error if the source observable emit an error", "[all][operators]") {
    GIVEN("a source") {
        auto sc = rxsc::make_test();
        auto w = sc.create_worker();
        const rxsc::test::messages<int> on;
        const rxsc::test::messages<bool> on_all;

        std::runtime_error ex("all on_error from source");

        auto xs = sc.make_hot_observable({
            on.next(150, 1),
            on.error(250, ex)
        });

        WHEN("a predicate function is passed to the all operator") {

            auto res = w.start(
                [xs]() {
                    return xs
                        .all([](int n) { return n == 2; })
                        .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013
                }
            );

            THEN("the output only contains an error") {
                auto required = rxu::to_vector({
                    on_all.error(250, ex)
                });
                auto actual = res.get_observer().messages();
                REQUIRE(required == actual);
            }

            THEN("there was 1 subscription/unsubscription to the source") {
                auto required = rxu::to_vector({
                    on.subscribe(200, 250)
                });
                auto actual = xs.subscriptions();
                REQUIRE(required == actual);
            }

        }
    }
}


text:
Run `dotnet build /t:GenerateCode` to generate code.

``` yaml

azure-arm: true
csharp: true
library-name: OperationalInsights
namespace: Azure.ResourceManager.OperationalInsights
require: https://github.com/Azure/azure-rest-api-specs/blob/7d5d1db0c45d6fe0934c97b6a6f9bb34112d42d1/specification/operationalinsights/resource-manager/readme.md
output-folder: $(this-folder)/Generated
clear-output-folder: true
skip-csproj: true
modelerfour:
  flatten-payloads: false

format-by-name-rules:
  'tenantId': 'uuid'
  'ETag': 'etag'
  'location': 'azure-location'
  '*Uri': 'Uri'
  '*Uris': 'Uri'

rename-rules:
  CPU: Cpu
  CPUs: Cpus
  Os: OS
  Ip: IP
  Ips: IPs|ips
  ID: Id
  IDs: Ids
  VM: Vm
  VMs: Vms
  Vmos: VmOS
  VMScaleSet: VmScaleSet
  DNS: Dns
  VPN: Vpn
  NAT: Nat
  WAN: Wan
  Ipv4: IPv4|ipv4
  Ipv6: IPv6|ipv6
  Ipsec: IPsec|ipsec
  SSO: Sso
  URI: Uri
  Etag: ETag|etag

directive:
  - remove-operation: OperationStatuses_Get
  # Dup model `SystemData` in this RP, should use the common type
  - from: QueryPackQueries.json
    where: $.definitions
    transform: >
      delete $.SystemData;
      delete $.IdentityType;
      $.AzureResourceProperties.properties.systemData['$ref'] = '../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse';
  # Codegen can't handle integter enum properly, should be fixed before GA
  - from: Workspaces.json
    where: $.definitions
    transform: >
      delete $.WorkspaceSku.properties.capacityReservationLevel['enum'];
      delete $.WorkspaceSku.properties.capacityReservationLevel['x-ms-enum'];
  # Codegen can't handle integter enum properly, should be fixed before GA
  - from: Clusters.json
    where: $.definitions
    transform: >
      delete $.ClusterSku.properties.capacity['enum'];
      delete $.ClusterSku.properties.capacity['x-ms-enum'];
  # The `type` is reserved name
  - from: Tables.json
    where: $.definitions
    transform: >
      $.Column.properties.type['x-ms-client-name'] = 'ColumnType';

```


text:
package org.apache.hadoop.fs.azurebfs.contract;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.contract.AbstractContractRenameTest;
import org.apache.hadoop.fs.contract.AbstractFSContract;

/**
 * Contract test for rename operation.
 */
public class ITestAbfsFileSystemContractRename extends AbstractContractRenameTest {
  private final boolean isSecure;
  private final ABFSContractTestBinding binding;

  public ITestAbfsFileSystemContractRename() throws Exception {
    binding = new ABFSContractTestBinding();
    this.isSecure = binding.isSecureMode();
  }

  @Override
  public void setup() throws Exception {
    binding.setup();
    super.setup();
    // Base rename contract test class re-uses the test folder
    // This leads to failures when the test is re-run as same ABFS test
    // containers are re-used for test run and creation of source and
    // destination test paths fail, as they are already present.
    binding.getFileSystem().delete(binding.getTestPath(), true);
  }

  @Override
  protected Configuration createConfiguration() {
    return binding.getRawConfiguration();
  }

  @Override
  protected AbstractFSContract createContract(final Configuration conf) {
    return new AbfsFileSystemContract(conf, isSecure);
  }
}


text:
#pragma once

typedef KEVENT MdEvent;

#include "MxEvent.h"

__inline
MxEvent::MxEvent()
{
    //
    // Make sure that m_Event is the first member. That way if someone passes
    // address of MxEvent to Ke*Event functions, it would still work.
    //
    // If this statement causes compilation failure, check if you added a field
    // before m_Event.
    //
    C_ASSERT(FIELD_OFFSET(MxEvent, m_Event) == 0);

    CLEAR_DBGFLAG_INITIALIZED;
}

__inline
MxEvent::~MxEvent()
{
}

__inline
NTSTATUS
#pragma prefast(suppress:__WARNING_UNMATCHED_DECL_ANNO, "_Must_inspect_result_ not needed in kernel mode as the function always succeeds");
MxEvent::Initialize(
    __in EVENT_TYPE Type,
    __in BOOLEAN InitialState
    )
{
    KeInitializeEvent(&m_Event, Type, InitialState);

    SET_DBGFLAG_INITIALIZED;

    return STATUS_SUCCESS;
}

__inline
PVOID
MxEvent::GetEvent(
    )
{
    ASSERT_DBGFLAG_INITIALIZED;

    return &m_Event;
}

__inline
VOID
MxEvent::SetWithIncrement(
    __in KPRIORITY Priority
    )
{
    ASSERT_DBGFLAG_INITIALIZED;

    KeSetEvent(&m_Event, Priority, FALSE);
}

__inline
VOID
MxEvent::Set(
    )
{
    ASSERT_DBGFLAG_INITIALIZED;

    KeSetEvent(&m_Event, IO_NO_INCREMENT, FALSE);
}

__inline
VOID
MxEvent::Clear(
    )
{
    ASSERT_DBGFLAG_INITIALIZED;

    KeClearEvent(&m_Event);
}

__drv_when(Timeout == NULL && Alertable == FALSE, __drv_valueIs(==0))
__drv_when(Timeout != NULL && Alertable == FALSE, __drv_valueIs(==0;==258))
__drv_when(Timeout != NULL || Alertable == TRUE, _Must_inspect_result_)
__inline
NTSTATUS
MxEvent::WaitFor(
    __in     KWAIT_REASON  WaitReason,
    __in     KPROCESSOR_MODE  WaitMode,
    __in     BOOLEAN  Alertable,
    __in_opt PLARGE_INTEGER  Timeout
    )
{
    ASSERT_DBGFLAG_INITIALIZED;

    return KeWaitForSingleObject(
                    &m_Event,
                    WaitReason,
                    WaitMode,
                    Alertable,
                    Timeout
                    );
}

LONG
__inline
MxEvent::ReadState(
    )
{
    ASSERT_DBGFLAG_INITIALIZED;

    return KeReadStateEvent(&m_Event);
}

__inline
VOID
MxEvent::Uninitialize(
    )
{
    CLEAR_DBGFLAG_INITIALIZED;
}


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

    <title>Open Test help</title>
    <para>This Screen shows the list of completed backlogs that's mean all implementation tasks are set to completed.
       Select a project you want and 'Find'. After result appear Click on backlog to view backlog's details and you will see
       the 'How to test' field that will describe how you could test the backlog. You can also make an error task on the backlog's overview screen
       incase you found en error while you're testing. So the backlog will be disappear from the list.
    </para>

        <title>The Open test screen consists of.</title>
        <orderedlist>
            <listitem><para>Find Backlog</para></listitem>
            <listitem><para>Backlog List</para></listitem>
        </orderedlist>

        <title>Find Backlog</title>
        <para>
            To find the backlog which remains the task status is "test".
        </para>

        <title>Backlog List</title>
        <para>
            On the backlog list shows Sprint Name - click on sprint's name the action will go to sprint's overview,
            Backlog item - click on Backlog's name the action will go to the backlog's overview,
            and Status - to notify the backlog's status.
        </para>


text:
/************************************************************************************
 * arch/arm/src/stm32/chip/stm32_sdio.h
 *
 *   Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <gnutt@nuttx.org>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ************************************************************************************/

#ifndef __ARCH_ARM_SRC_STM32_CHIP_STM32_SDIO_H
#define __ARCH_ARM_SRC_STM32_CHIP_STM32_SDIO_H

/************************************************************************************
 * Pre-processor Definitions
 ************************************************************************************/

/* Register Offsets *****************************************************************/

#define STM32_SDIO_POWER_OFFSET   0x0000	/* SDIO power control register */
#define STM32_SDIO_CLKCR_OFFSET   0x0004	/* SDI clock control register */
#define STM32_SDIO_ARG_OFFSET     0x0008	/* SDIO argument register */
#define STM32_SDIO_CMD_OFFSET     0x000c	/* SDIO command register */
#define STM32_SDIO_RESPCMD_OFFSET 0x0010	/* SDIO command response register */
#define STM32_SDIO_RESP_OFFSET(n) (0x0010 + 4 * (n))
#define STM32_SDIO_RESP1_OFFSET   0x0014	/* SDIO response 1 register */
#define STM32_SDIO_RESP2_OFFSET   0x0018	/* SDIO response 2 register */
#define STM32_SDIO_RESP3_OFFSET   0x001c	/* SDIO response 3 register */
#define STM32_SDIO_RESP4_OFFSET   0x0020	/* SDIO response 4 register */
#define STM32_SDIO_DTIMER_OFFSET  0x0024	/* SDIO data timer register */
#define STM32_SDIO_DLEN_OFFSET    0x0028	/* SDIO data length register */
#define STM32_SDIO_DCTRL_OFFSET   0x002c	/* SDIO data control register */
#define STM32_SDIO_DCOUNT_OFFSET  0x0030	/* SDIO data counter register */
#define STM32_SDIO_STA_OFFSET     0x0034	/* SDIO status register */
#define STM32_SDIO_ICR_OFFSET     0x0038	/* SDIO interrupt clear register */
#define STM32_SDIO_MASK_OFFSET    0x003c	/* SDIO mask register */
#define STM32_SDIO_FIFOCNT_OFFSET 0x0048	/* SDIO FIFO counter register */
#define STM32_SDIO_FIFO_OFFSET    0x0080	/* SDIO data FIFO register */

/* Register Addresses ***************************************************************/

#define STM32_SDIO_POWER          (STM32_SDIO_BASE + STM32_SDIO_POWER_OFFSET)
#define STM32_SDIO_CLKCR          (STM32_SDIO_BASE + STM32_SDIO_CLKCR_OFFSET)
#define STM32_SDIO_ARG            (STM32_SDIO_BASE + STM32_SDIO_ARG_OFFSET)
#define STM32_SDIO_CMD            (STM32_SDIO_BASE + STM32_SDIO_CMD_OFFSET)
#define STM32_SDIO_RESPCMD        (STM32_SDIO_BASE + STM32_SDIO_RESPCMD_OFFSET)
#define STM32_SDIO_RESP(n)        (STM32_SDIO_BASE + STM32_SDIO_RESP_OFFSET(n))
#define STM32_SDIO_RESP1          (STM32_SDIO_BASE + STM32_SDIO_RESP1_OFFSET)
#define STM32_SDIO_RESP2          (STM32_SDIO_BASE + STM32_SDIO_RESP2_OFFSET)
#define STM32_SDIO_RESP3          (STM32_SDIO_BASE + STM32_SDIO_RESP3_OFFSET)
#define STM32_SDIO_RESP4          (STM32_SDIO_BASE + STM32_SDIO_RESP4_OFFSET)
#define STM32_SDIO_DTIMER         (STM32_SDIO_BASE + STM32_SDIO_DTIMER_OFFSET)
#define STM32_SDIO_DLEN           (STM32_SDIO_BASE + STM32_SDIO_DLEN_OFFSET)
#define STM32_SDIO_DCTRL          (STM32_SDIO_BASE + STM32_SDIO_DCTRL_OFFSET)
#define STM32_SDIO_DCOUNT         (STM32_SDIO_BASE + STM32_SDIO_DCOUNT_OFFSET)
#define STM32_SDIO_STA            (STM32_SDIO_BASE + STM32_SDIO_STA_OFFSET)
#define STM32_SDIO_ICR            (STM32_SDIO_BASE + STM32_SDIO_ICR_OFFSET)
#define STM32_SDIO_MASK           (STM32_SDIO_BASE + STM32_SDIO_MASK_OFFSET)
#define STM32_SDIO_FIFOCNT        (STM32_SDIO_BASE + STM32_SDIO_FIFOCNT_OFFSET)
#define STM32_SDIO_FIFO           (STM32_SDIO_BASE + STM32_SDIO_FIFO_OFFSET)

/* Bit-band (BB) base addresses ****************************************************/

#define STM32_SDIO_OFFSET         (STM32_SDIO_BASE-STM32_PERIPH_BASE)

#define STM32_SDIO_POWER_BB       (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_POWER_OFFSET) << 5))
#define STM32_SDIO_CLKCR_BB       (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_CLKCR_OFFSET) << 5))
#define STM32_SDIO_ARG_BB         (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_ARG_OFFSET) << 5))
#define STM32_SDIO_CMD_BB         (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_CMD_OFFSET) << 5))
#define STM32_SDIO_RESPCMD_BB     (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_RESPCMD_OFFSET) << 5))
#define STM32_SDIO_RESP_BB(n)     (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_RESP_OFFSET(n)) << 5))
#define STM32_SDIO_RESP1_BB       (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_RESP1_OFFSET) << 5))
#define STM32_SDIO_RESP2_BB       (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_RESP2_OFFSET) << 5))
#define STM32_SDIO_RESP3_BB       (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_RESP3_OFFSET) << 5))
#define STM32_SDIO_RESP4_BB       (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_RESP4_OFFSET) << 5))
#define STM32_SDIO_DTIMER_BB      (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_DTIMER_OFFSET) << 5))
#define STM32_SDIO_DLEN_BB        (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_DLEN_OFFSET) << 5))
#define STM32_SDIO_DCTRL_BB       (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_DCTRL_OFFSET) << 5))
#define STM32_SDIO_DCOUNT_BB      (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_DCOUNT_OFFSET) << 5))
#define STM32_SDIO_STA_BB         (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_STA_OFFSET) << 5))
#define STM32_SDIO_ICR_BB         (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_ICR_OFFSET) << 5))
#define STM32_SDIO_MASK_BB        (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_MASK_OFFSET) << 5))
#define STM32_SDIO_FIFOCNT_BB     (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_FIFOCNT_OFFSET) << 5))
#define STM32_SDIO_FIFO_BB        (STM32_PERIPHBB_BASE + ((STM32_SDIO_OFFSET + STM32_SDIO_FIFO_OFFSET) << 5))

/* Register Bitfield Definitions ****************************************************/

#define SDIO_POWER_PWRCTRL_SHIFT       (0)	/* Bits 0-1: Power supply control bits */
#define SDIO_POWER_PWRCTRL_MASK        (3 << SDIO_POWER_PWRCTRL_SHIFT)
#define SDIO_POWER_PWRCTRL_OFF       (0 << SDIO_POWER_PWRCTRL_SHIFT)	/* 00: Power-off: card clock stopped */
#define SDIO_POWER_PWRCTRL_PWRUP     (2 << SDIO_POWER_PWRCTRL_SHIFT)	/* 10: Reserved power-up */
#define SDIO_POWER_PWRCTRL_ON        (3 << SDIO_POWER_PWRCTRL_SHIFT)	/* 11: Power-on: card is clocked */

#define SDIO_POWER_RESET               (0)	/* Reset value */

#define SDIO_CLKCR_CLKDIV_SHIFT        (0)	/* Bits 7-0: Clock divide factor */
#define SDIO_CLKCR_CLKDIV_MASK         (0xff << SDIO_CLKCR_CLKDIV_SHIFT)
#define SDIO_CLKCR_CLKEN               (1 << 8)	/* Bit 8: Clock enable bit */
#define SDIO_CLKCR_PWRSAV              (1 << 9)	/* Bit 9: Power saving configuration bit */
#define SDIO_CLKCR_BYPASS              (1 << 10)	/* Bit 10: Clock divider bypass enable bit */
#define SDIO_CLKCR_WIDBUS_SHIFT        (11)	/* Bits 12-11: Wide bus mode enable bits */
#define SDIO_CLKCR_WIDBUS_MASK         (3 << SDIO_CLKCR_WIDBUS_SHIFT)
#define SDIO_CLKCR_WIDBUS_D1         (0 << SDIO_CLKCR_WIDBUS_SHIFT)	/* 00: Default (SDIO_D0) */
#define SDIO_CLKCR_WIDBUS_D4         (1 << SDIO_CLKCR_WIDBUS_SHIFT)	/* 01: 4-wide (SDIO_D[3:0]) */
#define SDIO_CLKCR_WIDBUS_D8         (2 << SDIO_CLKCR_WIDBUS_SHIFT)	/* 10: 8-wide (SDIO_D[7:0]) */
#define SDIO_CLKCR_NEGEDGE             (1 << 13)	/* Bit 13: SDIO_CK dephasing selection bit */
#define SDIO_CLKCR_HWFC_EN             (1 << 14)	/* Bit 14: HW Flow Control enable */

#define SDIO_CLKCR_RESET               (0)	/* Reset value */
#define SDIO_ARG_RESET                 (0)	/* Reset value */

#define SDIO_CLKCR_CLKEN_BB            (STM32_SDIO_CLKCR_BB + (8 * 4))
#define SDIO_CLKCR_PWRSAV_BB           (STM32_SDIO_CLKCR_BB + (9 * 4))
#define SDIO_CLKCR_BYPASS_BB           (STM32_SDIO_CLKCR_BB + (10 * 4))
#define SDIO_CLKCR_NEGEDGE_BB          (STM32_SDIO_CLKCR_BB + (13 * 4))
#define SDIO_CLKCR_HWFC_EN_BB          (STM32_SDIO_CLKCR_BB + (14 * 4))

#define SDIO_CMD_CMDINDEX_SHIFT        (0)
#define SDIO_CMD_CMDINDEX_MASK         (0x3f << SDIO_CMD_CMDINDEX_SHIFT)
#define SDIO_CMD_WAITRESP_SHIFT        (6)	/* Bits 7-6: Wait for response bits */
#define SDIO_CMD_WAITRESP_MASK         (3 << SDIO_CMD_WAITRESP_SHIFT)
#define SDIO_CMD_NORESPONSE          (0 << SDIO_CMD_WAITRESP_SHIFT)	/* 00/10: No response */
#define SDIO_CMD_SHORTRESPONSE       (1 << SDIO_CMD_WAITRESP_SHIFT)	/* 01: Short response */
#define SDIO_CMD_LONGRESPONSE        (3 << SDIO_CMD_WAITRESP_SHIFT)	/* 11: Long response */
#define SDIO_CMD_WAITINT               (1 << 8)	/* Bit 8: CPSM waits for interrupt request */
#define SDIO_CMD_WAITPEND              (1 << 9)	/* Bit 9: CPSM Waits for ends of data transfer */
#define SDIO_CMD_CPSMEN                (1 << 10)	/* Bit 10: Command path state machine enable */
#define SDIO_CMD_SUSPEND               (1 << 11)	/* Bit 11: SD I/O suspend command */
#define SDIO_CMD_ENDCMD                (1 << 12)	/* Bit 12: Enable CMD completion */
#define SDIO_CMD_NIEN                  (1 << 13)	/* Bit 13: not Interrupt Enable */
#define SDIO_CMD_ATACMD                (1 << 14)	/* Bit 14: CE-ATA command */

#define SDIO_CMD_RESET                 (0)	/* Reset value */

#define SDIO_CMD_WAITINT_BB            (STM32_SDIO_CMD_BB + (8 * 4))
#define SDIO_CMD_WAITPEND_BB           (STM32_SDIO_CMD_BB + (9 * 4))
#define SDIO_CMD_CPSMEN_BB             (STM32_SDIO_CMD_BB + (10 * 4))
#define SDIO_CMD_SUSPEND_BB            (STM32_SDIO_CMD_BB + (11 * 4))
#define SDIO_CMD_ENCMD_BB              (STM32_SDIO_CMD_BB + (12 * 4))
#define SDIO_CMD_NIEN_BB               (STM32_SDIO_CMD_BB + (13 * 4))
#define SDIO_CMD_ATACMD_BB             (STM32_SDIO_CMD_BB + (14 * 4))

#define SDIO_RESPCMD_SHIFT             (0)
#define SDIO_RESPCMD_MASK              (0x3f << SDIO_RESPCMD_SHIFT)

#define SDIO_DTIMER_RESET              (0)	/* Reset value */

#define SDIO_DLEN_SHIFT                (0)
#define SDIO_DLEN_MASK                 (0x01ffffff << SDIO_DLEN_SHIFT)

#define SDIO_DLEN_RESET                (0)	/* Reset value */

#define SDIO_DCTRL_DTEN                (1 << 0)	/* Bit 0: Data transfer enabled bit */
#define SDIO_DCTRL_DTDIR               (1 << 1)	/* Bit 1: Data transfer direction */
#define SDIO_DCTRL_DTMODE              (1 << 2)	/* Bit 2: Data transfer mode */
#define SDIO_DCTRL_DMAEN               (1 << 3)	/* Bit 3: DMA enable bit */
#define SDIO_DCTRL_DBLOCKSIZE_SHIFT    (4)	/* Bits 7-4: Data block size */
#define SDIO_DCTRL_DBLOCKSIZE_MASK     (15 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_1BYTE             (0 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_2BYTES            (1 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_4BYTES            (2 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_8BYTES            (3 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_16BYTES           (4 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_32BYTES           (5 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_64BYTES           (6 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_128BYTES          (7 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_256BYTES          (8 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_512BYTES          (9 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_1KBYTE            (10 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_2KBYTES           (11 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_4KBYTES           (12 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_8KBYTES           (13 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_16KBYTES          (14 << SDIO_DCTRL_DBLOCKSIZE_SHIFT)
#define SDIO_DCTRL_RWSTART             (1 << 8)	/* Bit 8: Read wait start */
#define SDIO_DCTRL_RWSTOP              (1 << 9)	/* Bit 9: Read wait stop */
#define SDIO_DCTRL_RWMOD               (1 << 10)	/* Bit 10: Read wait mode */
#define SDIO_DCTRL_SDIOEN              (1 << 11)	/* Bit 11: SD I/O enable functions */

#define SDIO_DCTRL_RESET               (0)	/* Reset value */

#define SDIO_DCTRL_DTEN_BB             (STM32_SDIO_DCTRL_BB + (0 * 4))
#define SDIO_DCTRL_DTDIR_BB            (STM32_SDIO_DCTRL_BB + (1 * 4))
#define SDIO_DCTRL_DTMODE_BB           (STM32_SDIO_DCTRL_BB + (2 * 4))
#define SDIO_DCTRL_DMAEN_BB            (STM32_SDIO_DCTRL_BB + (3 * 4))
#define SDIO_DCTRL_RWSTART_BB          (STM32_SDIO_DCTRL_BB + (8 * 4))
#define SDIO_DCTRL_RWSTOP_BB           (STM32_SDIO_DCTRL_BB + (9 * 4))
#define SDIO_DCTRL_RWMOD_BB            (STM32_SDIO_DCTRL_BB + (10 * 4))
#define SDIO_DCTRL_SDIOEN_BB           (STM32_SDIO_DCTRL_BB + (11 * 4))

#define SDIO_DATACOUNT_SHIFT           (0)
#define SDIO_DATACOUNT_MASK            (0x01ffffff << SDIO_DATACOUNT_SHIFT)

#define SDIO_STA_CCRCFAIL              (1 << 0)	/* Bit 0: Command response CRC fail */
#define SDIO_STA_DCRCFAIL              (1 << 1)	/* Bit 1: Data block CRC fail */
#define SDIO_STA_CTIMEOUT              (1 << 2)	/* Bit 2: Command response timeout */
#define SDIO_STA_DTIMEOUT              (1 << 3)	/* Bit 3: Data timeout */
#define SDIO_STA_TXUNDERR              (1 << 4)	/* Bit 4: Transmit FIFO underrun error */
#define SDIO_STA_RXOVERR               (1 << 5)	/* Bit 5: Received FIFO overrun error */
#define SDIO_STA_CMDREND               (1 << 6)	/* Bit 6: Command response received  */
#define SDIO_STA_CMDSENT               (1 << 7)	/* Bit 7: Command sent  */
#define SDIO_STA_DATAEND               (1 << 8)	/* Bit 8: Data end */
#define SDIO_STA_STBITERR              (1 << 9)	/* Bit 9: Start bit not detected  */
#define SDIO_STA_DBCKEND               (1 << 10)	/* Bit 10: Data block sent/received  */
#define SDIO_STA_CMDACT                (1 << 11)	/* Bit 11: Command transfer in progress */
#define SDIO_STA_TXACT                 (1 << 12)	/* Bit 12: Data transmit in progress */
#define SDIO_STA_RXACT                 (1 << 13)	/* Bit 13: Data receive in progress */
#define SDIO_STA_TXFIFOHE              (1 << 14)	/* Bit 14: Transmit FIFO half empty */
#define SDIO_STA_RXFIFOHF              (1 << 15)	/* Bit 15: Receive FIFO half full */
#define SDIO_STA_TXFIFOF               (1 << 16)	/* Bit 16: Transmit FIFO full */
#define SDIO_STA_RXFIFOF               (1 << 17)	/* Bit 17: Receive FIFO full */
#define SDIO_STA_TXFIFOE               (1 << 18)	/* Bit 18: Transmit FIFO empty */
#define SDIO_STA_RXFIFOE               (1 << 19)	/* Bit 19: Receive FIFO empty */
#define SDIO_STA_TXDAVL                (1 << 20)	/* Bit 20: Data available in transmit FIFO */
#define SDIO_STA_RXDAVL                (1 << 21)	/* Bit 21: Data available in receive FIFO */
#define SDIO_STA_SDIOIT                (1 << 22)	/* Bit 22: SDIO interrupt received */
#define SDIO_STA_CEATAEND              (1 << 23)	/* Bit 23: CMD6 CE-ATA command completion */

#define SDIO_ICR_CCRCFAILC             (1 << 0)	/* Bit 0: CCRCFAIL flag clear bit */
#define SDIO_ICR_DCRCFAILC             (1 << 1)	/* Bit 1: DCRCFAIL flag clear bit */
#define SDIO_ICR_CTIMEOUTC             (1 << 2)	/* Bit 2: CTIMEOUT flag clear bit */
#define SDIO_ICR_DTIMEOUTC             (1 << 3)	/* Bit 3: DTIMEOUT flag clear bit */
#define SDIO_ICR_TXUNDERRC             (1 << 4)	/* Bit 4: TXUNDERR flag clear bit */
#define SDIO_ICR_RXOVERRC              (1 << 5)	/* Bit 5: RXOVERR flag clear bit */
#define SDIO_ICR_CMDRENDC              (1 << 6)	/* Bit 6: CMDREND flag clear bit */
#define SDIO_ICR_CMDSENTC              (1 << 7)	/* Bit 7: CMDSENT flag clear bit */
#define SDIO_ICR_DATAENDC              (1 << 8)	/* Bit 8: DATAEND flag clear bit */
#define SDIO_ICR_STBITERRC             (1 << 9)	/* Bit 9: STBITERR flag clear bit */
#define SDIO_ICR_DBCKENDC              (1 << 10)	/* Bit 10: DBCKEND flag clear bit */
#define SDIO_ICR_SDIOITC               (1 << 22)	/* Bit 22: SDIOIT flag clear bit */
#define SDIO_ICR_CEATAENDC             (1 << 23)	/* Bit 23: CEATAEND flag clear bit */

#define SDIO_ICR_RESET                 0x00c007ff
#define SDIO_ICR_STATICFLAGS           0x000005ff

#define SDIO_MASK_CCRCFAILIE           (1 << 0)	/* Bit 0: Command CRC fail interrupt enable */
#define SDIO_MASK_DCRCFAILIE           (1 << 1)	/* Bit 1: Data CRC fail interrupt enable */
#define SDIO_MASK_CTIMEOUTIE           (1 << 2)	/* Bit 2: Command timeout interrupt enable */
#define SDIO_MASK_DTIMEOUTIE           (1 << 3)	/* Bit 3: Data timeout interrupt enable */
#define SDIO_MASK_TXUNDERRIE           (1 << 4)	/* Bit 4: Tx FIFO underrun error interrupt enable */
#define SDIO_MASK_RXOVERRIE            (1 << 5)	/* Bit 5: Rx FIFO overrun error interrupt enable */
#define SDIO_MASK_CMDRENDIE            (1 << 6)	/* Bit 6: Command response received interrupt enable */
#define SDIO_MASK_CMDSENTIE            (1 << 7)	/* Bit 7: Command sent interrupt enable */
#define SDIO_MASK_DATAENDIE            (1 << 8)	/* Bit 8: Data end interrupt enable */
#define SDIO_MASK_STBITERRIE           (1 << 9)	/* Bit 9: Start bit error interrupt enable */
#define SDIO_MASK_DBCKENDIE            (1 << 10)	/* Bit 10: Data block end interrupt enable */
#define SDIO_MASK_CMDACTIE             (1 << 11)	/* Bit 11: Command acting interrupt enable */
#define SDIO_MASK_TXACTIE              (1 << 12)	/* Bit 12: Data transmit acting interrupt enable */
#define SDIO_MASK_RXACTIE              (1 << 13)	/* Bit 13: Data receive acting interrupt enable */
#define SDIO_MASK_TXFIFOHEIE           (1 << 14)	/* Bit 14: Tx FIFO half empty interrupt enable */
#define SDIO_MASK_RXFIFOHFIE           (1 << 15)	/* Bit 15: Rx FIFO half full interrupt enable */
#define SDIO_MASK_TXFIFOFIE            (1 << 16)	/* Bit 16: Tx FIFO full interrupt enable */
#define SDIO_MASK_RXFIFOFIE            (1 << 17)	/* Bit 17: Rx FIFO full interrupt enable */
#define SDIO_MASK_TXFIFOEIE            (1 << 18)	/* Bit 18: Tx FIFO empty interrupt enable */
#define SDIO_MASK_RXFIFOEIE            (1 << 19)	/* Bit 19: Rx FIFO empty interrupt enable */
#define SDIO_MASK_TXDAVLIE             (1 << 20)	/* Bit 20: Data available in Tx FIFO interrupt enable */
#define SDIO_MASK_RXDAVLIE             (1 << 21)	/* Bit 21: Data available in Rx FIFO interrupt enable */
#define SDIO_MASK_SDIOITIE             (1 << 22)	/* Bit 22: SDIO mode interrupt received interrupt enable */
#define SDIO_MASK_CEATAENDIE           (1 << 23)	/* Bit 23: CE-ATA command completion interrupt enable */

#define SDIO_MASK_RESET                (0)

#define SDIO_FIFOCNT_SHIFT             (0)
#define SDIO_FIFOCNT_MASK              (0x01ffffff << SDIO_FIFOCNT_SHIFT)

#endif							/* __ARCH_ARM_SRC_STM32_CHIP_STM32_SDIO_H */


text:
'use strict';
importScripts("./modules/noti/tpl/js/NotiStore.js");

var notiStore = NotiStoreContainer.getInstance();

var getDocumentSrl = function(url) {
	var regex = [
		':\\/\\/(?:\\.?\\w+)+\\/[a-zA-Z_\\-]\\w+/(\\d+)',
		':\\/\\/(?:\\.?\\w+)+\\/(\\d+)',
		'(?!target_)(?:^.{0,})document_srl=(\\d+)'
	];
	if(url) {
		for(var i=0; i<regex.length; i++) {
			var eachRegex = new RegExp(regex[i]);
			var result = eachRegex.exec(url);
			if(result) {
				return parseInt(result[1], 10);
			}
		}
	}

	return null;
}

var sendEvent = function(evtObj) {
	// push_srl, endpoint
	var data = new FormData();
	Object.keys(evtObj).forEach(function(key){
		data.append(key, evtObj[key]);
	});

	return fetch('/index.php?act=procNotiServiceWorkerEvent', {
		method: "POST",
		body: data,
		cache: 'no-cache',
		credentials: 'omit',
		headers: {
			'Accept': 'application/json'
		}
	}).then(function(response){
		return response.json();
	});
};

var notiEventHandler = function(eventName, push_srl, data) {
	return Promise.all([self.registration.pushManager.getSubscription(), notiStore.get('endpoint_srl')]).then(function(resolveData) {
		var subscription = resolveData[0];
		var endpoint_srl = resolveData[1];
		if(!subscription || !subscription.endpoint) {
			return Promise.resolve();
		}

		var endpoint = subscription.endpoint;
		var obj = {
			eventName: eventName,
			endpoint: endpoint,
			endpoint_srl: endpoint_srl,
			push_srl: push_srl
		};

		Object.keys(data).forEach(function(key){
			obj[key] = data[key];
		});

		return sendEvent(obj);
	});
}

var getClientPriority = function (clientObj) {
	return ((clientObj.isUrlMatched ? 1 : 0) << 3) +
		((clientObj.focused && clientObj.visibilityState === "visible" ? 1 : 0) << 2) +
		((clientObj.visibilityState === "visible" ? 1 : 0) << 1);
};

self.addEventListener('push', function(event) {
	var payload = null;
	var eventObj = {
		timestamp: Date.now()
	};

	event.waitUntil(new Promise(function(resolve, reject){
			var error = null;
			try {
				if(event.data) {
					payload = event.data.json();
					return notiStore.insertPushLog(payload).then(function(){
						return notiStore.deleteOldPushLog();
					}).then(function() {
						resolve(payload);
					});
				}
			} catch(err) {
				error = err;
			}
			if(!payload) {
				fetch('/index.php?act=getNotiPushDefaultMessage', {
					method: "POST",
					cache: 'no-cache',
					credentials: 'omit',
					headers: {
						'Accept': 'application/json'
					}
				}).then(function(resp){
					return resp.json();
				}).then(function(data){
					payload = data;
					if(payload) {
						resolve(data);
					} else {
						reject(error);
					}
				})['catch'](function(err){
					reject(err);
				});
			}
		}).then(function(){
			return Promise.all([self.registration.pushManager.getSubscription(), notiEventHandler('push', payload.push_srl, eventObj), notiStore.get('config')]);
		}).then(function(retData) {
			var subscription = retData[0];
			var pushMessageType = retData[2] && retData[2].pushMessageType || "push";
			if(!subscription) {
				throw new Error('PushManager: Can\'t get endpoint info.');
			}

			var notificationArgs = ['title', 'body', 'icon', 'image', 'badge', 'requireInteraction', 'silent', 'renotify', 'tag'];
			var actions = payload.actions;
			var title = payload.title;
			var body = payload.body;
			var icon = payload.icon;
			var image = payload.image;
			var badge = payload.badge;
			var data = payload.data;
			var requireInteraction = payload.requireInteraction;
			var renotify = payload.renotify;
			var silent = payload.silent;
			var tag = payload.tag;
			var pushGroup = payload.pushGroup;
			var maxNotificationCount = pushGroup.max_count;
			var useCountSummary = pushGroup.use_count_summary;
			var countSummaryTemplate = pushGroup.count_summary_template;
			var timestamp = Date.now();

			var notificationData = {};
			var sw = {};
			notificationData.__sw = sw;
			Object.keys(payload).forEach(function(key) {
				if(notificationArgs.indexOf(key) === -1) {
					notificationData[key] = payload[key];
				}
			});

			return clients.matchAll({
				type: "window",
				includeUncontrolled: true
			}).then(function(clientList){

				var targetClient = clientList.find(function(eachClient){
					return eachClient.focused && eachClient.visibilityState === "visible";
				});
				if(targetClient && (pushMessageType === "mix" || pushMessageType === "both")) {
					targetClient.postMessage({
						name: 'push',
						type: payload.type,
						pushSrl: payload.push_srl || 0,
						title: title,
						body: body,
						icon: icon,
						image: image,
						launchUrl: payload.launchUrl || null,
						timestamp: timestamp,
					});
				}

				if(pushMessageType === "both" ||
					((pushMessageType === "push_without_focus" || pushMessageType === "mix") && !targetClient) ||
					pushMessageType === "push"
				) {
					return registration.getNotifications({}).then(function(notifications) {
						var prevNotificationInfo = notifications.filter(function(notification) {
							var split = notification.tag ? notification.tag.split('@') : null;
							return notification.tag && notification.data && notification.data.__sw && (notification.tag == tag || (split && split.length && split[0] == tag) );
						}).sort(function(a, b){
							return a.data.__sw.timestamp - b.data.__sw.timestamp;
						}).reduce(function(val, current, idx, arr){
							var data = current.data;
							var __sw = data ? data.__sw : null;
							var removed = false;
							if(__sw) {
								if(arr.length-val.removeCount >= maxNotificationCount) {
									current.close();
									removed = true;
									val.removeCount++;
								}

								if(__sw.notReadedMessageCount) {
									val.notReadedMessageMaxCount = Math.max(val.notReadedMessageMaxCount, __sw.notReadedMessageCount);
								} else if(!removed) {
									val.nonCountNotification++;
								}
							}

							return val;
						}, {
							notReadedMessageMaxCount: 0,
							nonCountNotification: 0,
							removeCount: 0
						});

						var notificationBody = body;
						var notificationTag = maxNotificationCount > 1 ? tag + "@" + Date.now() + "." + Math.random().toString(36).substr(2) : tag;
						sw.notReadedMessageCount = (prevNotificationInfo.notReadedMessageMaxCount ? prevNotificationInfo.notReadedMessageMaxCount : prevNotificationInfo.nonCountNotification) + prevNotificationInfo.removeCount;
						sw.pushTimestamp = timestamp;
						if(sw.notReadedMessageCount > 0 && useCountSummary && countSummaryTemplate && body) {
							notificationBody = countSummaryTemplate.replace('[@content_summary]', body.substring(0, 45));
							notificationBody = notificationBody.replace('[@count]', sw.notReadedMessageCount);
						}
						var notificationOptions = {
							actions: actions,
							body: notificationBody,
							icon: icon,
							data: notificationData,
							image: image,
							badge: badge,
							requireInteraction: requireInteraction,
							silent: silent,
							renotify: renotify,
							tag: notificationTag
						};
						Object.keys(notificationOptions).forEach(function(eachKey){
							if(notificationOptions[eachKey] === null || notificationOptions[eachKey] === void 0) {
								delete(notificationOptions[eachKey]);
							}
						});

						return self.registration.showNotification(title, notificationOptions);
					})
				}

				return Promise.resolve();
			});

		}).catch(function(e) {
			console.error(e);
		})

	);
});

self.addEventListener('notificationclick', function (event) {
	var notification = event.notification;
	var data = notification.data;
	var launchUrl = data ? data.launchUrl : null;
	var push_srl = data ? data.push_srl : null;
	if(event.action && data && data.actions) {
		var targetAction = data.actions.find(function(eachAction){
			return eachAction.action === event.action;
		});
		if(targetAction) {
			launchUrl = targetAction.launchUrl;
		}
	}
	notification.close();

	var timestamp = Date.now();
	var eventObj = {
		timestamp: timestamp
	};
	var document_srl = getDocumentSrl(launchUrl);
	event.waitUntil(Promise.all([
		launchUrl ? clients.matchAll({
		type: "window",
		includeUncontrolled: true
	}).then(function (clientList) {
		var targetClient = clientList.reduce(function(val, client) {
			if(client.frameType === "top-level") {
				var eachVal = {
					client: client,
					isUrlMatched: (document_srl && document_srl === getDocumentSrl(client.url)) || (launchUrl === client.url),
					focused: client.focused,
					visibilityState: client.visibilityState
				};
				if(!val) {
					val = eachVal;
				} else {
					val = getClientPriority(eachVal) >= getClientPriority(val) ? eachVal : val;
				}
			}

			return val;
		}, null);
		if(targetClient) {
			targetClient.client.postMessage({
				name: 'notificationclick',
				title: event.title,
				launchUrl: launchUrl,
				timestamp: timestamp,
				isUrlMatched: targetClient.isUrlMatched
			});

			return targetClient.client.focus();
		}
		if(clients.openWindow) {
			return clients.openWindow(launchUrl);
		}
	}) : Promise.resolve(),
		notiEventHandler('notificationclick', push_srl, eventObj),
		notiStore.onClickPushNotification(push_srl)
	]));
});

self.addEventListener('notificationclose', function(event) {
	event.waitUntil(
		Promise.all([])
	);
});

self.addEventListener('install', function(event) {
	return self.skipWaiting();
});

self.addEventListener('pushsubscriptionchange', function(evt) {
	var data = new FormData();
	data.append('oldEndpoint', evt.oldSubscription ? evt.oldSubscription.endpoint : null);
	data.append('newEndpoint', evt.newSubscription ? evt.newSubscription.endpoint : null);
	data.append('key', evt.newSubscription ? event.newSubscription.toJSON().keys.p256dh : null);
	data.append('auth', evt.newSubscription ? event.newSubscription.toJSON().keys.auth : null);
	data.append('expirationTime', evt.newSubscription ? event.newSubscription.toJSON().expirationTime : null);
	evt.waitUntil(
		fetch('/index.php?act=procNotiPushSubscriptionChange', {
			method: "POST",
			body: data,
			cache: 'no-cache',
			credentials: 'omit',
			headers: {
				'Accept': 'application/json'
			}
		}).then(function(response){
			return response.json();
		}).then(function(data){
			if(!data || data.endpoint_srl === -1) {
				return notiStore.clear();
			}
			if(evt.newSubscription) {
				notiStore.set('endpoint', evt.newSubscription.endpoint);
			}
		})
	);
});


text:
(function () {
    TRAFFICSIM_APP.game = TRAFFICSIM_APP.game || {};
    TRAFFICSIM_APP.game.traffic_light = TRAFFICSIM_APP.game.traffic_light|| {};

    var NS = TRAFFICSIM_APP.game.traffic_light;
    var logger = TRAFFICSIM_APP.utils.logger;
    var math = TRAFFICSIM_APP.utils.math;
    var LightBall = TRAFFICSIM_APP.game.traffic_light_ball.TrafficLightBall;
    var Vector3 = TRAFFICSIM_APP.utils.vector3.Vector3;

    NS.TrafficLightPosition = {
        "TOP": 0,
        "RIGHT": 1,
        "BOTTOM": 2,
        "LEFT": 3
    };

    NS.CurrentLightState = {
        "RED": 0,
        "YELLOW": 1,
        "GREEN": 2,
        "RED_YELLOW": 3
    };

    NS.LightStateMs = {
        "YELLOW": 3000,
        "GREEN": 5000,
        "RED_YELLOW": 1000
    };

    NS.TrafficLight = function (trafficLightController, nextTrafficLight, routeDirection, position) {
        TRAFFICSIM_APP.game.gameplay_object.GameplayObject.call(this,
            trafficLightController.getRoad().getWorldController(),
            trafficLightController.getRoad().getWorldController().getGameplayScene().getApplication().getModelContainer().getModelByName("traffic_light").clone());

        this._trafficLightController = trafficLightController;
        this._lastStateChangeTimestamp = 0;
        this._nextTrafficLight = nextTrafficLight;
        this._isActive = false;
        this._routeDirection = routeDirection;
        this._currentLightState = NS.CurrentLightState.RED;

        this.setPosition(position);
        switch (this._routeDirection) {
            case NS.TrafficLightPosition.TOP:
                this.setAngle(math.radians(90));
                break;
            case NS.TrafficLightPosition.RIGHT:
                this.setAngle(math.radians(0));
                break;
            case NS.TrafficLightPosition.BOTTOM:
                this.setAngle(math.radians(270));
                break;
            case NS.TrafficLightPosition.LEFT:
                this.setAngle(math.radians(180));
                break;
        }

        var lightGreenPosition = new Vector3(
            this._position.x + Math.cos(this._angle) * 0.2,
            this._position.y + 2.9,
            this._position.z - Math.sin(this._angle) * 0.2);
        var lightYellowPosition = new Vector3(
            this._position.x + Math.cos(this._angle) * 0.2,
            this._position.y + 3.4,
            this._position.z - Math.sin(this._angle) * 0.2);
        var lightRedPosition = new Vector3(
            this._position.x + Math.cos(this._angle) * 0.2,
            this._position.y + 3.9,
            this._position.z - Math.sin(this._angle) * 0.2);
        this._lightGreen = new LightBall(this, 0x006000, this._worldController, lightGreenPosition);
        this._lightYellow = new LightBall(this, 0x606000, this._worldController, lightYellowPosition);
        this._lightRed = new LightBall(this, 0x600000, this._worldController, lightRedPosition);
    };

    NS.TrafficLight.prototype = Object.create(TRAFFICSIM_APP.game.gameplay_object.GameplayObject.prototype);

    NS.TrafficLight.prototype.update = function () {
        if (this._isActive) {
            this._updateState();
        }

        this._updateLightBallsState();
        this._handleRouteState();
    };

    NS.TrafficLight.prototype._updateState = function () {
        if (this._currentLightState == NS.CurrentLightState.RED) {
            this._currentLightState = NS.CurrentLightState.RED_YELLOW;
            this._lastStateChangeTimestamp = Date.now();
        } else if (this._currentLightState == NS.CurrentLightState.RED_YELLOW
            && this._lastStateChangeTimestamp + NS.LightStateMs.RED_YELLOW < Date.now()) {
            this._currentLightState = NS.CurrentLightState.GREEN;
            this._lastStateChangeTimestamp = Date.now();
        } else if (this._currentLightState == NS.CurrentLightState.GREEN
            && this._lastStateChangeTimestamp + NS.LightStateMs.GREEN < Date.now()) {
            this._currentLightState = NS.CurrentLightState.YELLOW;
            this._lastStateChangeTimestamp = Date.now();
        } else if (this._currentLightState == NS.CurrentLightState.YELLOW
            && this._lastStateChangeTimestamp + NS.LightStateMs.YELLOW < Date.now()) {
            this._currentLightState = NS.CurrentLightState.RED;
            this._lastStateChangeTimestamp = Date.now();
            this._isActive = false;
            this._nextTrafficLight.setActive(true);
        }
    };

    NS.TrafficLight.prototype._updateLightBallsState = function () {
        if (this._currentLightState == NS.CurrentLightState.RED) {
            this._lightRed.changeColor(0xff0000);
            this._lightGreen.changeColor(0x006000);
            this._lightYellow.changeColor(0x606000);
        } else if (this._currentLightState == NS.CurrentLightState.RED_YELLOW) {
            this._lightRed.changeColor(0xff0000);
            this._lightGreen.changeColor(0x006000);
            this._lightYellow.changeColor(0xffff00);
        } else if (this._currentLightState == NS.CurrentLightState.GREEN) {
            this._lightRed.changeColor(0x600000);
            this._lightGreen.changeColor(0x00ff00);
            this._lightYellow.changeColor(0x606000);
        } else if (this._currentLightState == NS.CurrentLightState.YELLOW) {
            this._lightRed.changeColor(0x600000);
            this._lightGreen.changeColor(0x006000);
            this._lightYellow.changeColor(0xffff00);
        }
    };

    NS.TrafficLight.prototype._handleRouteState = function () {
        if (this._currentLightState == NS.CurrentLightState.GREEN) {
            this._changeRouteFreeStateById(this._getRouteIdsByCurrentDirection(), true);
        } else {
            this._changeRouteFreeStateById(this._getRouteIdsByCurrentDirection(), false);
        }
    };

    NS.TrafficLight.prototype._getRouteIdsByCurrentDirection = function () {
        switch (this._routeDirection) {
            case NS.TrafficLightPosition.TOP:
                return ["from-top-to-bottom", "from-top-to-right", "from-top-to-left"];
            case NS.TrafficLightPosition.RIGHT:
                return ["from-right-to-left", "from-right-to-top", "from-right-to-bottom"];
            case NS.TrafficLightPosition.BOTTOM:
                return ["from-bottom-to-top", "from-bottom-to-right", "from-bottom-to-left"];
            case NS.TrafficLightPosition.LEFT:
                return ["from-left-to-right", "from-left-to-top", "from-left-to-bottom"];
        }
    };

    NS.TrafficLight.prototype._changeRouteFreeStateById = function (routeIds, newState) {
        var foundRoutes = this._trafficLightController.getRoad().getRoutes().filter(function (route) {
            return routeIds.some(function (routeId) {
                return routeId == route.getRouteId();
            });
        });

        foundRoutes.forEach(function (route) {
            route.setFree(newState);
        });
    };

    NS.TrafficLight.prototype.setNextTrafficLight = function (nextTrafficLight) {
        this._nextTrafficLight = nextTrafficLight;
    };

    NS.TrafficLight.prototype.setActive = function (boolean) {
        this._isActive = boolean;
    };

    NS.TrafficLight.prototype.die = function () {
        TRAFFICSIM_APP.game.gameplay_object.GameplayObject.prototype.die.call(this);

        this._lightGreen.die();
        this._lightRed.die();
        this._lightYellow.die();
    };

})();


text:
#include <stdio.h>
#include <assert.h>

#include <lua.h>
#include <lauxlib.h>

/* from lua source, needed for reference to file handle metatable */
typedef luaL_Stream LStream;

static
int lua_fdclose(lua_State *L)
{
  LStream *lstream = (LStream *) luaL_checkudata(L, 1, LUA_FILEHANDLE);
  lua_pop(L, 1);
  fclose(lstream->f);
  return 0;
}

/*
 * Open a file descriptor to a Lua filehandle
 */
static
int lua_fdopen(lua_State *L)
{
  int fd = luaL_checkint(L, 1);
  const char *mode = luaL_checkstring(L, 2);
  LStream *lstream;
  lua_pop(L, 2);
  lstream = (LStream *) lua_newuserdata(L, sizeof(LStream));
  assert(lstream);
  lstream->f = fdopen(fd, mode);
  assert(lstream->f);
  luaL_setmetatable(L, LUA_FILEHANDLE);
  lstream->closef = lua_fdclose;
  return 1;
}

LUALIB_API
int luaopen_fdopen(lua_State *L)
{
  lua_register(L, "fdopen", lua_fdopen);
  return 0;
}


text:
'use strict';

var Animations = function() {

	this.offsetX = 0;
	this.offsetY = 0;
	this.widthBK = 0;
	this.heightBK = 0;

	this.publicCards = [];
	this.light;
	this.stopShake = true;
}

Animations.prototype = {

	setPosParam:function(width, height, offsetX, offsetY) {
		this.widthBK = width;
		this.heightBK = height;
		this.offsetX = offsetX;
		this.offsetY = offsetY;
	},

	setPublicCard:function(lstPublicCard) {
		this.publicCards = lstPublicCard;
	},

	showPublicCard:function(lstIndex, lstKey, showBK, callback) {
		if(lstIndex.length > this.publicCards.length)
		{
			return;
		}

		var nIndex = 0;
		var animationTime = 100;
		var that = this;
		var showAnimation = function (index, key, showBK) {
			var cardWidth = that.publicCards[index].width;
			if(showBK)
			{
				that.publicCards[index].loadTexture("cardBK", that.publicCards[index].frame);
				var tween = game.add.tween(that.publicCards[index]);
				tween.to({ width:0 }, animationTime, Phaser.Easing.Linear.None, true);
				tween.onComplete.add(function() {
					that.publicCards[index].loadTexture(key, that.publicCards[index].frame);
					var tween2 = game.add.tween(that.publicCards[index]);
					tween2.to({ width:cardWidth }, animationTime, Phaser.Easing.Linear.None, true);
					nIndex++;
					if(nIndex < lstIndex.length)
					{
						tween2.onComplete.add(function() {
							showAnimation(lstIndex[nIndex], lstKey[nIndex], showBK);
						}, that);
					}
				}, that);
			}
			else
			{
				that.publicCards[index].width = 0;
				that.publicCards[index].loadTexture(key, that.publicCards[index].frame);
				var tween = game.add.tween(that.publicCards[index]);
				tween.to({ width:cardWidth }, animationTime, Phaser.Easing.Linear.None, true);
				nIndex++;
				if(nIndex < lstIndex.length)
				{
					tween.onComplete.add(function() {
						showAnimation(lstIndex[nIndex], lstKey[nIndex], showBK);
					}, that);
				}
			}
		};

		if(callback != undefined) {
			callback();
		}

		showAnimation(lstIndex[nIndex], lstKey[nIndex], showBK);
	},

	//this.animation.showShake(this.selfCards[0]);
	//this.animation.showShake(this.selfCards[1]);
	//this.animation.stopShake = true;

	showShake:function(target, time, frequency, offset) {
		var shakeTime = 20000;
		if(time)
		{
			shakeTime = time;
		}
		var shakeFrequency = 10;
		if(frequency)
		{
			shakeFrequency = frequency;
		}
		var shakeOffset = Math.min(target.width, target.height) / 50;
		if(offset)
		{
			shakeOffset = offset;
		}

		this.stopShake = false;
		var that = this;
		var targetX = target.x;
		var targetY = target.y;
		var pt = [{x:targetX - shakeOffset, y:targetY - shakeOffset}
				, {x:targetX, y:targetY - shakeOffset}
				, {x:targetX + shakeOffset, y:targetY - shakeOffset}
				, {x:targetX - shakeOffset, y:targetY}
				, {x:targetX + shakeOffset, y:targetY}
				, {x:targetX - shakeOffset, y:targetY + shakeOffset}
				, {x:targetX, y:targetY + shakeOffset}
				, {x:targetX + shakeOffset, y:targetY + shakeOffset}];

		var nCount = 0;
		var showAnimation = function () {
			var tween = game.add.tween(target);
			var nextPt = pt[Math.floor(Math.random() * pt.length)];
			tween.to({ x:nextPt.x, y: nextPt.y }, shakeFrequency, Phaser.Easing.Linear.None, true);
			nCount++;
			tween.onComplete.add(function() {

				if(nCount * shakeFrequency <= shakeTime && !that.stopShake)
				{
					showAnimation();
				}
				else
				{
					target.x = targetX;
					target.y = targetY;
				}
			}, this);
		};

		showAnimation(nCount);
	},

	setLight:function(light) {
		this.light = light;
	},

	showLight:function(targetX, targetY)
	{
		var animationTime = 500;
		var xOffset = this.offsetX;
		var yOffset = this.offsetY;
		var length = Math.sqrt((this.light.x - targetX) * (this.light.x - targetX) + (this.light.y - targetY) * (this.light.y - targetY));
		var angleFinal = Math.atan2((targetY - this.light.y), (targetX - this.light.x)) * 180 / 3.1415926;

		while(angleFinal < this.light.angle)
		{
			angleFinal += 360;
		}
		if(angleFinal - this.light.angle > 180)
		{
			angleFinal -= 360;
		}
		if(!this.light.visible)
		{
			this.light.visible = true;
			this.light.width = length;
			this.light.angle = angleFinal;
		}
		else
		{
			var tween = game.add.tween(this.light);
			tween.to({ width:length, angle: angleFinal }, animationTime, Phaser.Easing.Linear.None, true);
		}
	},

	showChipMove:function(target, targetX, targetY, time)
	{
		var animationTime = 100;
		if(time != undefined && time != null) {
			animationTime = time
		}

		var tween = game.add.tween(target);
		tween.to({ x:targetX, y: targetY }, animationTime, Phaser.Easing.Linear.None, true);
	},

	//this.chipPoolCoins = this.animation.showCollectChip(this.userList, this.chipPoolBK.x + this.chipPoolBK.width * 0.14, this.chipPoolBK.y + this.chipPoolBK.height * 0.5, this.chipPoolCoins);

	showCollectChip:function(userList, targetX, targetY, existCoin)
	{
		var animationTime = 50;
		var coinSpace = 0.1111;
		var totalCoins = [];
		for(var i = 0; i < userList.length; i++)
		{
			var user = userList[i];
			for(var j = 0; j < user.imageCoin.length; j++)
			{
				var coin = user.imageCoin[user.imageCoin.length - 1 - j];
				totalCoins.push(coin);
			}
			user.imageCoin = [];
		}

		var nIndex = 0;
		var showAnimation = function (index) {
			if (totalCoins.length <= index) {
				return
			};

			totalCoins[index].bringToTop();

			var tween = game.add.tween(totalCoins[index]);
			tween.to({ x:targetX, y: targetY - (index + existCoin.length) * totalCoins[index].height * coinSpace }, animationTime, Phaser.Easing.Linear.None, true);
			nIndex++;
			if(nIndex < totalCoins.length)
			{
				tween.onComplete.add(function() {
					showAnimation(nIndex);
				}, this);
			}
		};

		showAnimation(nIndex);

		return existCoin.concat(totalCoins);
	},

	//Demo
	demoShowPublicCard:function() {
		var publicCards = ["SA", "H2", "C3"];
		var lstCardID = [];
		var lstCardImage = [];
		for (var i = 0; i < publicCards.length; i++) {
			this.publicCards[i].visible = true;
			lstCardID.push(i);
			lstCardImage.push(publicCards[i]);
		}
		this.showPublicCard(lstCardID, lstCardImage, true);
	}
}


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

namespace IoContent.Sdk.Interfaces
{
	public interface IMemoryCacheService
	{
		T Get<T>(string cacheKey, Func<T> getCacheObjCallback, DateTime? absoluteExpirationDate = null, TimeSpan? slidingExpiration = null) where T : class;

		void Remove(string cacheKey);

		void RemoveAllWithPrefix(string prefix);
    }
}


text:
include_recipe "postgresql::server"

package "postgis"
package "postgresql-#{node.postgresql.version}-postgis" if %w( debian ubuntu ).include?(node.platform)


text:
id: queryAll
title: .queryAll()
tags: [traversal]
excerpt: finds all the elements matching selectors
type: "Elements ParentNode.queryAll(String relativeSelectors)"
polyfill: https://github.com/barberboy/dom-elements
---

Finds all element matching the supplied relative selectors, returns an [Elements]({{ site.baseurl }}/Elements) collection, which is a sub-class of Array and has all the usual Array methods (eg. `filter`, `map`, etc.)

{% highlight javascript %}
node.queryAll(relativeSelector);
{% endhighlight %}

Returns all the elements that are descedents of <var>node</var> that match <var>relativeSelectors</var>.

To query the entire document, simply do:

{% highlight javascript %}
document.queryAll(relativeSelector);
{% endhighlight %}

See also: [.query()]({{ site.baseurl }}/query)

### Examples

HTML:

{% highlight html %}

Item 1

Item 2

Item 3

{% endhighlight %}

#### Example 1

JavaScript:

{% highlight javascript %}
let result = document.queryAll(".two");
{% endhighlight %}

Result is an Elements list with one element: `<li class="two">Item 2</li>`.

#### Example 2
JavaScript:

{% highlight javascript %}
let ul = document.query("ul");
let result = ul.query("> *");
{% endhighlight %}

Result is an Elements list with two elements: `<li class="one">Item 1</li>` and `<li><ul class="list-two">...</ul></li>`.


text:
using Spark.Engine.FhirResponseFactory;
using Spark.Engine.Interfaces;
using Spark.Engine.Service;
using Spark.Service;
using Resource = Spark.Store.Sql.Model.Resource;

namespace Spark.Store.Sql
{
    //public interface IInterceptableFhirStore : IFhirStore
    //{
    //    void AddInterceptor(IResourceSavingInterceptor resourceSavingInterceptor);
    //}

    //public interface IResourceSavingInterceptor
    //{
    //    void BeforeSavingResource(Hl7.Fhir.Model.Resource resource, Resource cuurentResource);
    //}

    //public class SqlScopedFhirService<T> : ScopedFhirService<T>
    //{
    //    public SqlScopedFhirService(SqlScopedFhirStore<T> fhirStore, IFhirResponseFactory responseFactory, ITransfer transfer) : base(fhirStore, responseFactory, transfer)
    //    {
    //    }
    //}

    //public class SqlFhirStore
    //{
    //    private readonly IFhirDbContext context;
    //    private readonly IFormatId formatId;

    //    public SqlFhirStore(IUnitOfWork repository, IFormatId formatId)
    //    {
    //        this.context = new IFhirDbContext();
    //        this.formatId = formatId;
    //    }

    //    public void Add(Entry entry)
    //    {
    //        Resource resource = new Resource()
    //        {
    //            Content = FhirSerializer.SerializeResourceToXml(entry.Resource),
    //            ResourceType = entry.Endpoint.ResourceType,
    //            ResourceId = formatId.ParseResourceId(entry.Endpoint.ResourceId),
    //            InternalVersionId = formatId.ParseVersionId(entry.Endpoint.InternalVersionId),
    //            CreationDate = DateTime.Now,
    //            Endpoint = entry.Resource.Id
    //        };

    //        context.Resources.Add(resource);
    //        context.SaveChanges();
    //    }

    //    public Entry Get(IKey key)
    //    {
    //        IQueryable<Resource> resources =
    //            context.Resources
    //                .Where(r => r.ResourceType == key.ResourceType && r.ResourceId == formatId.ParseResourceId(key.ResourceId));
    //        Resource resource;
    //        if (key.HasVersionId())
    //        {
    //            resource = resources.SingleOrDefault(r => r.InternalVersionId == formatId.ParseVersionId(key.InternalVersionId));
    //        }
    //        else
    //        {
    //            resource = resources.OrderBy(r => r.InternalVersionId).Take(1).SingleOrDefault();
    //        }

    //        return ParseEntry(resource);
    //    }

    //    public IList<Entry> Get(IEnumerable<string> identifiers, string sortby)
    //    {
    //        IList<Resource> resources =
    //            context.Resources.Where(r => identifiers.Contains(r.Endpoint)).ToList();

    //        return resources.Select(ParseEntry).ToList();
    //    }

    //    private Entry ParseEntry(Resource resource)
    //    {
    //        Entry entry = null;

    //        if (resource != null)
    //        {
    //            entry = Entry.Create((Bundle.HTTPVerb)Enum.Parse(typeof(Bundle.HTTPVerb), resource.Method),
    //                new Endpoint()
    //                {
    //                    ResourceType = resource.ResourceType,
    //                    ResourceId = formatId.GetResourceId(resource.ResourceId),
    //                    InternalVersionId = formatId.GetVersionId(resource.InternalVersionId)
    //                },
    //                resource.CreationDate);
    //            entry.Resource = FhirParser.ParseResourceFromXml(resource.Content);
    //        }
    //        return entry;
    //    }
    //}

}


text:
{% extends "pressgang/options/blog_option.php" %}

{% load pressgang_options %}

{% block code %}

	// Update the blog's description
	update_option( 'is_public', {{ value|as_php }} );

{% endblock %}


text:
Rails.application.config.assets.version = '0.1'

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w{locales/*.json templates/*.slim}
Rails.application.assets.register_mime_type 'text/html', '.html'
Rails.application.assets.register_engine '.slim', Slim::Template

class Sprockets::DirectiveProcessor
  def process_depend_on_config_directive(file)
    path = File.expand_path(file, Rails.root.join('config'))
    context.depend_on(path)
  end
end

# register .json for assets pipeline
Rails.application.assets.register_mime_type 'application/json', '.json'
# enable to use sprockets directive processor in .json
Rails.application.assets.register_preprocessor 'application/json', Sprockets::DirectiveProcessor


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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>wlan-decoder-java: fr.bmartel.protocol.wlan.WlanDecoder Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

wlan-decoder-java
    1.0

Main Page

Packages

Classes

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

 All Classes Namespaces Functions Variables Pages

fr

bmartel

protocol

wlan

WlanDecoder

Public Member Functions |
Static Public Attributes |
List of all members

fr.bmartel.protocol.wlan.WlanDecoder Class Reference

Inheritance diagram for fr.bmartel.protocol.wlan.WlanDecoder:

<map name="fr_8bmartel_8protocol_8wlan_8_wlan_decoder_inherit__map" id="fr_8bmartel_8protocol_8wlan_8_wlan_decoder_inherit__map">
<area shape="rect" id="node2" href="interfacefr_1_1bmartel_1_1protocol_1_1wlan_1_1inter_1_1_i_wlan802dot11_radiotap.html" title="fr.bmartel.protocol.wlan.inter.\lIWlan802dot11Radiotap" alt="" coords="5,6,195,53"/></map>
[legend]

Collaboration diagram for fr.bmartel.protocol.wlan.WlanDecoder:

<map name="fr_8bmartel_8protocol_8wlan_8_wlan_decoder_coll__map" id="fr_8bmartel_8protocol_8wlan_8_wlan_decoder_coll__map">
<area shape="rect" id="node2" href="interfacefr_1_1bmartel_1_1protocol_1_1wlan_1_1inter_1_1_i_wlan802dot11_radiotap.html" title="fr.bmartel.protocol.wlan.inter.\lIWlan802dot11Radiotap" alt="" coords="5,6,195,53"/></map>
[legend]

Public Member Functions

 	WlanDecoder (byte[] dataFrame)

void 	decodeWithRadiotap ()

void 	decode ()

void 	radioTapDecode (byte[] frame)

void 	wlan802dot11Decode (byte[] frame, int offset)

IRadioTapFrame 	getRadioTap ()

IWlanFrameControl 	getFrameControl ()

IWlanFrame 	getFrame ()

Static Public Attributes

static final boolean 	DISPLAY_ELEMENT_NOT_DECODED = true

Detailed Description

Wlan decoder

Author

Bertrand Martel

Constructor & Destructor Documentation

          fr.bmartel.protocol.wlan.WlanDecoder.WlanDecoder
          (
          byte[]
          dataFrame)

initialize wlan driver

Member Function Documentation

          void fr.bmartel.protocol.wlan.WlanDecoder.radioTapDecode
          (
          byte[]
          frame)

Decode radio tap frames

Parameters

frame

          void fr.bmartel.protocol.wlan.WlanDecoder.wlan802dot11Decode
          (
          byte[]
          frame,

          int
          offset

          )

Decode wlan 802.11 frames

Parameters

frame	byte aray data frames

offset	offset defined to remove radio tap frames if necessary

The documentation for this class was generated from the following file:

/home/abathur/Bureau/wlandecoder/wlandecoder/src/fr/bmartel/protocol/wlan/WlanDecoder.java

<address class="footer">
Generated on Tue May 5 2015 23:30:27 for wlan-decoder-java by

 1.8.4
</address>


text:
<?php

namespace Pipe\Test;

use Pipe\SafetyColons;

class SafetyColonsTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider dataProvider
     */
    function test($message, $expected, $data)
    {
        $templ = new SafetyColons(function() use ($data) {
            return $data;
        });

        $this->assertEquals($expected, $templ->render(), $message);
    }

    function dataProvider()
    {
        return array(
            array("Adds semicolon when none found", "foo;", "foo"),
            array("Adds no semicolon when found", "foo;", "foo;"),
            array("Leave empty strings alone", "", ""),
            array("Matches semicolon also when whitespace at the end of file", "foo;".str_repeat(' ', 4), "foo;".str_repeat(' ', 4))
        );
    }
}