text:
using log4net;
using System;
using System.Collections.ObjectModel;
using System.Data.SQLite;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;
using Vulnerator.Model.DataAccess;
using Vulnerator.Helper;
using Vulnerator.Model.Object;

namespace Vulnerator.Model.BusinessLogic
{
    class XmlWasspReader
    {
        private string fileNameWithoutPath = string.Empty;
        private DatabaseInterface databaseInterface = new DatabaseInterface();
        string _groupName = null;

        public string ReadXmlWassp(Object.File file, string groupName)
        {
            try
            {
                if (file.FilePath.IsFileInUse())
                {
                    LogWriter.LogError($"'{file.FileName}' is in use; please close any open instances and try again.");
                    return "Failed; File In Use";
                }

                ParseWasspWithXmlReader(file);
                return "Processed";
            }
            catch (Exception exception)
            {
                string error = $"Unable to process WASSP file '{file.FileName}'.";
                LogWriter.LogErrorWithDebug(error, exception);
                return "Failed; See Log";
            }
        }

        private void ParseWasspWithXmlReader(Object.File file)
        {
            try
            {
                XmlReaderSettings xmlReaderSettings = GenerateXmlReaderSettings();
                if (DatabaseBuilder.sqliteConnection.State.ToString().Equals("Closed"))
                {
                    DatabaseBuilder.sqliteConnection.Open();
                }

                using (SQLiteTransaction sqliteTransaction = DatabaseBuilder.sqliteConnection.BeginTransaction())
                {
                    using (SQLiteCommand sqliteCommand = DatabaseBuilder.sqliteConnection.CreateCommand())
                    {
                        databaseInterface.InsertParameterPlaceholders(sqliteCommand);
                        sqliteCommand.Parameters["FindingType"].Value = "WASSP";
                        sqliteCommand.Parameters["GroupName"].Value = string.IsNullOrWhiteSpace(_groupName) ? "All" : _groupName;
                        sqliteCommand.Parameters["SourceName"].Value =
                            "Windows Automated Security Scanning Program (WASSP)";
                        sqliteCommand.Parameters["SourceVersion"].Value = string.Empty;
                        sqliteCommand.Parameters["SourceRelease"].Value = string.Empty;
                        databaseInterface.InsertParsedFileSource(sqliteCommand, file);
                        using (XmlReader xmlReader = XmlReader.Create(file.FilePath, xmlReaderSettings))
                        {
                            ParseVulnerabilityInfoFromWassp(sqliteCommand, xmlReader);
                        }
                    }

                    sqliteTransaction.Commit();
                }
            }
            catch (Exception exception)
            {
                LogWriter.LogError($"Unable to parse WASSP file '{file.FileName}' using XML reader.");
                throw exception;
            }
            finally
            {
                DatabaseBuilder.sqliteConnection.Close();
            }
        }

        private void ParseVulnerabilityInfoFromWassp(SQLiteCommand sqliteCommand, XmlReader xmlReader)
        {
            try
            {
                while (xmlReader.Read())
                {
                    if (xmlReader.IsStartElement())
                    {
                        switch (xmlReader.Name)
                        {
                            case "scanner":
                            {
                                ObtainWasspVersion(xmlReader, sqliteCommand);
                                break;
                            }
                            case "date":
                            {
                                sqliteCommand.Parameters["FirstDiscovered"].Value =
                                    sqliteCommand.Parameters["LastObserved"].Value =
                                        xmlReader.ObtainCurrentNodeValue(false);
                                break;
                            }
                            case "host":
                            {
                                sqliteCommand.Parameters["IP_Address"].Value = xmlReader.GetAttribute("ip");
                                sqliteCommand.Parameters["DiscoveredHostName"].Value = xmlReader.GetAttribute("name").Trim();
                                sqliteCommand.Parameters["DisplayedHostName"].Value = sqliteCommand.Parameters["DiscoveredHostName"].Value;
                                sqliteCommand.Parameters["MAC_Address"].Value = xmlReader.GetAttribute("mac");
                                break;
                            }
                            case "test":
                            {
                                sqliteCommand.Parameters["UniqueVulnerabilityIdentifier"].Value =
                                    xmlReader.GetAttribute("id");
                                break;
                            }
                            case "check":
                            {
                                sqliteCommand.Parameters["VulnerabilityTitle"].Value =
                                    xmlReader.ObtainCurrentNodeValue(false);
                                break;
                            }
                            case "description":
                            {
                                sqliteCommand.Parameters["VulnerabilityDescription"].Value =
                                    xmlReader.ObtainCurrentNodeValue(false);
                                break;
                            }
                            case "vulnerability":
                            {
                                string parsed = xmlReader.ObtainCurrentNodeValue(false).ToString();
                                Regex regex = new Regex(Properties.Resources.RegexWasspRawRisk);
                                sqliteCommand.Parameters["PrimaryRawRiskIndicator"].Value =
                                    regex.Match(parsed).Value.ToRawRisk();
                                break;
                            }
                            case "control":
                            {
                                switch (xmlReader.GetAttribute("regulation"))
                                {
                                    case "NIST":
                                    {
                                        break;
                                    }
                                    case "DOD":
                                    {
                                        break;
                                    }
                                }

                                break;
                            }
                            case "result":
                            {
                                sqliteCommand.Parameters["Status"].Value =
                                    xmlReader.ObtainCurrentNodeValue(false).ToString().ToVulneratorStatus();
                                break;
                            }
                            case "recommendation":
                            {
                                sqliteCommand.Parameters["FixText"].Value = xmlReader.ObtainCurrentNodeValue(false);
                                break;
                            }
                        }
                    }
                    else if (xmlReader.NodeType == XmlNodeType.EndElement && xmlReader.Name.Equals("test"))
                    {
                        sqliteCommand.Parameters["DeltaAnalysisIsRequired"].Value = "False";
                        if (sqliteCommand.Parameters["VulnerabilityVersion"].Value == DBNull.Value)
                        { sqliteCommand.Parameters["VulnerabilityVersion"].Value = string.Empty; }
                        if (sqliteCommand.Parameters["VulnerabilityRelease"].Value == DBNull.Value)
                        { sqliteCommand.Parameters["VulnerabilityRelease"].Value = string.Empty; }
                        databaseInterface.InsertVulnerabilitySource(sqliteCommand);
                        databaseInterface.InsertHardware(sqliteCommand);
                        databaseInterface.InsertAndMapIpAddress(sqliteCommand);
                        databaseInterface.InsertAndMapMacAddress(sqliteCommand);
                        databaseInterface.InsertVulnerability(sqliteCommand);
                        databaseInterface.MapVulnerabilityToSource(sqliteCommand);
                        databaseInterface.UpdateUniqueFinding(sqliteCommand);
                        databaseInterface.InsertUniqueFinding(sqliteCommand);
                    }
                }
            }
            catch (Exception exception)
            {
                LogWriter.LogError("Unable to parse vulnerability information.");
                throw exception;
            }
        }

        private void ObtainWasspVersion(XmlReader xmlReader, SQLiteCommand sqliteCommand)
        {
            try
            {
                while (xmlReader.Read())
                {
                    if (xmlReader.IsStartElement() && xmlReader.Name.Equals("version"))
                    {
                        sqliteCommand.Parameters["SourceVersion"].Value =
                            xmlReader.ObtainCurrentNodeValue(false);
                        return;
                    }
                    if (xmlReader.NodeType == XmlNodeType.EndElement && xmlReader.Name.Equals("scanner"))
                    { return; }
                }

            }
            catch (Exception exception)
            {
                LogWriter.LogError("Unable to obtain WASSP version information.");
                throw exception;
            }
        }

        private XmlReaderSettings GenerateXmlReaderSettings()
        {
            try
            {
                XmlReaderSettings xmlReaderSettings = new XmlReaderSettings();
                xmlReaderSettings.IgnoreWhitespace = true;
                xmlReaderSettings.IgnoreComments = true;
                xmlReaderSettings.DtdProcessing = DtdProcessing.Parse;
                xmlReaderSettings.ValidationType = ValidationType.Schema;
                xmlReaderSettings.ValidationFlags = System.Xml.Schema.XmlSchemaValidationFlags.ProcessInlineSchema;
                xmlReaderSettings.ValidationFlags = System.Xml.Schema.XmlSchemaValidationFlags.ProcessSchemaLocation;
                return xmlReaderSettings;
            }
            catch (Exception exception)
            {
                LogWriter.LogError("Unable to generate XmlReaderSettings.");
                throw exception;
            }
        }
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package referencelibrary.util;

import java.util.List;
import referencelibrary.io.IO;
import referencelibrary.reference.Reference;

/**
 *
 * @author sjsarsa
 */
public class FieldValidator {

    private IO io;

    public FieldValidator(IO io) {
        this.io = io;
    }

    public boolean fieldNameIsValid(String fieldName, Reference reference) {
        if (!reference.getRequiredFields().contains(fieldName)
                && !reference.getOptionalFields().contains(fieldName)) {
            io.print(fieldName + " is not a valid field");
            return false;
        }
        return true;
    }

    public boolean fieldValueIsValid(String fieldValue) {
        if (fieldValue.isEmpty()) {
            io.print("Field value must not be empty");
            return false;
        }
        return true;
    }

    public boolean referenceNameIsUnique(String referenceName, List<Reference> referenceList) {
        for (Reference reference : referenceList) {
            if(reference.hasReferenceName(referenceName)) return false;
        }
        return true;
    }

    public boolean referenceNameIsNotEmpty(String referenceName) {
        return referenceName.trim().length() > 0;
    }
}

redpajama_set_name: RedPajamaGithub


text:
/// <reference path="base.js"/>
/// <reference path="event.js"/>

/**
 * A class that represents a progress event sent by the createjs.LoadQueue
 * object.
 * @param {string} type
 * @param {boolean} bubbles
 * @param {boolean} cancelable
 * @param {number} loaded
 * @param {number} total
 * @param {number} progress
 * @extends {createjs.Event}
 * @constructor
 */
createjs.ProgressEvent =
    function(type, bubbles, cancelable, loaded, total, progress) {
  createjs.Event.call(this, type, bubbles, cancelable);
};
createjs.inherits('ProgressEvent', createjs.ProgressEvent, createjs.Event);


text:
#include "tensorflow/compiler/xla/service/transfer_manager.h"

#include <string>
#include <utility>

#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "tensorflow/compiler/xla/service/compiler.h"
#include "tensorflow/compiler/xla/service/maybe_owning_device_memory.h"
#include "tensorflow/compiler/xla/shape_util.h"
#include "tensorflow/compiler/xla/status_macros.h"
#include "tensorflow/compiler/xla/types.h"
#include "tensorflow/compiler/xla/util.h"
#include "tensorflow/core/lib/gtl/cleanup.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/notification.h"

using absl::StrCat;

namespace xla {

/* static */ tensorflow::mutex
    TransferManager::platform_transfer_manager_mutex_(
        tensorflow::LINKER_INITIALIZED);

/* static */ std::map<se::Platform::Id, TransferManager::State>*
TransferManager::GetPlatformTransferManagers() {
  static auto* r = new std::map<se::Platform::Id, TransferManager::State>;
  return r;
}

TransferManager::TransferMetadata::~TransferMetadata() {}

StatusOr<Literal> TransferManager::TransferLiteralFromDevice(
    se::Stream* stream, const ShapedBuffer& device_buffer,
    const TransferMetadata* transfer_metadata) {
  StatusOr<Literal> ret;

  se::Stream* substream = stream->GetOrCreateSubStream();
  substream->ThenWaitFor(stream);
  auto cleanup = tensorflow::gtl::MakeCleanup(
      [&]() { stream->ReturnSubStream(substream); });

  tensorflow::Notification n;
  Status s;
  Literal literal(device_buffer.on_host_shape());
  TransferLiteralFromDevice(
      substream, device_buffer, &literal,
      [&](Status status) {
        s = status;
        n.Notify();
      },
      transfer_metadata);
  n.WaitForNotification();
  if (!s.ok()) {
    return s;
  }
  return std::move(literal);
}

Status TransferManager::TransferLiteralFromDevice(
    se::Stream* stream, const ShapedBuffer& device_buffer,
    const MutableBorrowingLiteral& literal,
    const TransferMetadata* transfer_metadata) {
  se::Stream* substream = stream->GetOrCreateSubStream();
  auto cleanup = tensorflow::gtl::MakeCleanup(
      [&]() { stream->ReturnSubStream(substream); });

  Status ret;
  tensorflow::Notification n;
  TransferLiteralFromDevice(
      substream, device_buffer, literal,
      [&](Status status) {
        ret = status;
        n.Notify();
      },
      transfer_metadata);
  n.WaitForNotification();
  return ret;
}

Status TransferManager::TransferLiteralToDevice(
    se::Stream* stream, const LiteralSlice& literal,
    const ShapedBuffer& device_buffer,
    const TransferMetadata* transfer_metadata) {
  // Implement the synchronous version by waiting on the asynchronous version.
  // Use a substream so that if we are called from a HostCallback we don't
  // deadlock.
  se::Stream* substream = stream->GetOrCreateSubStream();
  substream->ThenWaitFor(stream);
  auto cleanup = tensorflow::gtl::MakeCleanup(
      [&]() { stream->ReturnSubStream(substream); });
  TF_RETURN_IF_ERROR(TransferLiteralToDeviceAsync(
      substream, literal, device_buffer, transfer_metadata));
  return substream->BlockHostUntilDone();
}

StatusOr<Literal> TransferManager::TransferArrayFromDevice(
    se::Stream* stream, const Shape& shape, const se::DeviceMemoryBase& source,
    const TransferMetadata* transfer_metadata) {
  StatusOr<Literal> ret;
  // Implement the synchronous version by waiting on the asynchronous version.
  // Use a substream so that if we are called from a HostCallback we don't
  // deadlock.
  se::Stream* substream = stream->GetOrCreateSubStream();
  auto cleanup = tensorflow::gtl::MakeCleanup(
      [&]() { stream->ReturnSubStream(substream); });

  tensorflow::Notification n;
  Literal literal(shape);
  Status s;
  TransferArrayFromDevice(
      substream, shape, source, &literal,
      [&](Status status) {
        s = status;
        n.Notify();
      },
      transfer_metadata);
  n.WaitForNotification();
  if (!s.ok()) {
    return s;
  }
  return std::move(literal);
}

Status TransferManager::TransferArrayToDevice(
    se::Stream* stream, const LiteralSlice& literal,
    const se::DeviceMemoryBase& dest,
    const TransferMetadata* transfer_metadata) {
  // Implement the synchronous version by waiting on the asynchronous version.
  // Use a substream so that if we are called from a HostCallback we don't
  // deadlock.
  se::Stream* substream = stream->GetOrCreateSubStream();
  auto cleanup = tensorflow::gtl::MakeCleanup(
      [&]() { stream->ReturnSubStream(substream); });
  TF_RETURN_IF_ERROR(
      TransferArrayToDeviceAsync(substream, literal, dest, transfer_metadata));
  return substream->BlockHostUntilDone();
}

Status TransferManager::TransferArrayToDeviceAsync(
    se::Stream* stream, const LiteralSlice& literal,
    const se::DeviceMemoryBase& dest,
    const TransferMetadata* transfer_metadata) {
  const Shape on_device_shape = HostShapeToDeviceShape(literal.shape());
  TF_RET_CHECK(on_device_shape.IsArray())
      << "On-device representation of "
      << ShapeUtil::HumanString(literal.shape())
      << " is not an array: " << ShapeUtil::HumanString(on_device_shape);
  if (dest.size() < GetByteSizeRequirement(on_device_shape)) {
    return FailedPrecondition(
        "Allocation on device not large enough for array: "
        "%d < %d",
        dest.size(), GetByteSizeRequirement(on_device_shape));
  }
  ShapedBuffer shaped_buffer(on_device_shape,
                             stream->parent()->device_ordinal());
  shaped_buffer.set_buffer(dest, /*index=*/{});
  return TransferLiteralToDevice(stream, literal, shaped_buffer,
                                 transfer_metadata);
}

void TransferManager::TransferArrayFromDevice(
    se::Stream* stream, const Shape& shape, const se::DeviceMemoryBase& source,
    const MutableBorrowingLiteral& literal, std::function<void(Status)> done,
    const TransferMetadata* transfer_metadata) {
  if (!Shape::Equal().MinorToMajorOnlyInLayout()(HostShapeToDeviceShape(shape),
                                                 shape)) {
    auto error = StrCat("Shape ", ShapeUtil::HumanString(shape),
                        " has a differently shaped representation on-device: ",
                        ShapeUtil::HumanString(HostShapeToDeviceShape(shape)));
    return done(FailedPrecondition("%s", error));
  }
  if (source.size() < GetByteSizeRequirement(shape)) {
    return done(
        FailedPrecondition("Allocation on device not large enough for array: "
                           "%d < %d",
                           source.size(), GetByteSizeRequirement(shape)));
  }
  ShapedBuffer shaped_buffer(shape, stream->parent()->device_ordinal());
  shaped_buffer.set_buffer(source, /*index=*/{});
  return TransferLiteralFromDevice(stream, shaped_buffer, literal,
                                   std::move(done), transfer_metadata);
}

Status TransferManager::ReadDynamicShapes(se::Stream* stream,
                                          ShapedBuffer* device_buffer,
                                          Shape* device_shape) {
  DCHECK(device_shape->is_dynamic());
  Shape original_device_shape = *device_shape;
  TF_RETURN_IF_ERROR(stream->BlockHostUntilDone());

  TF_ASSIGN_OR_RETURN(auto compiler,
                      Compiler::GetForPlatform(stream->parent()->platform()));
  TF_RETURN_IF_ERROR(device_buffer->buffers().ForEachMutableElementWithStatus(
      [&](const ShapeIndex& index, se::DeviceMemoryBase* buffer) {
        const Shape& buffer_shape =
            ShapeUtil::GetSubshape(*device_shape, index);
        if (buffer_shape.IsTuple()) {
          return Status::OK();
        }
        Shape& device_sub_shape =
            *ShapeUtil::GetMutableSubshape(device_shape, index);
        if (device_sub_shape.is_static()) {
          return Status::OK();
        }

        // Read the dynamic shape metadata from the device stream.
        auto shape_size_fn = compiler->ShapeSizeBytesFunction();
        Shape buffer_shape_static = ShapeUtil::MakeStaticShape(buffer_shape);
        const int64 offset = shape_size_fn(buffer_shape_static);
        int64 metadata_size = shape_size_fn(buffer_shape) - offset;
        if (metadata_size == 0) {
          return InvalidArgument("Dynamic shape metadata size should not be 0");
        }
        auto buffer_8 = se::DeviceMemory<uint8>(*buffer);
        auto metadata_buffer =
            stream->parent()->GetSubBuffer(&buffer_8, offset, metadata_size);
        TF_ASSIGN_OR_RETURN(
            auto metadata,
            TransferArrayFromDevice(
                stream,
                ShapeUtil::MakeShape(S32, {buffer_shape.dimensions_size()}),
                metadata_buffer));

        // Update shape size from metadata.
        for (int64 i = 0; i < metadata.element_count(); ++i) {
          device_sub_shape.mutable_dimensions()[i] = metadata.Get<int32>({i});
        }
        return Status::OK();
      }));
  device_shape->clear_dynamic_dimensions();

  TF_RET_CHECK(ShapeUtil::DynamicShapeIsCompatible(*device_shape,
                                                   original_device_shape));
  return Status::OK();
}

/* static */ void TransferManager::RegisterTransferManager(
    se::Platform::Id platform_id,
    TransferManagerCreationFunction creation_function) {
  tensorflow::mutex_lock lock(
      TransferManager::platform_transfer_manager_mutex_);
  auto* managers = GetPlatformTransferManagers();
  CHECK(managers->find(platform_id) == managers->end());
  (*managers)[platform_id].creation_function = creation_function;
}

/* static */ StatusOr<TransferManager*> TransferManager::GetForPlatform(
    const se::Platform* platform) {
  tensorflow::mutex_lock lock(
      TransferManager::platform_transfer_manager_mutex_);
  auto* managers = GetPlatformTransferManagers();

  auto it = managers->find(platform->id());
  if (it == managers->end()) {
    return NotFound(
        "could not find registered transfer manager for platform %s -- check "
        "target linkage",
        platform->Name());
  }

  if (it->second.manager == nullptr) {
    // Lazily create the transfer manager the first time it is needed
    it->second.manager = (*it->second.creation_function)();
  }

  return it->second.manager.get();
}

Status TransferManager::WriteTupleIndexTables(
    se::Stream* stream, const ShapedBuffer& device_buffer) {
  TF_RETURN_IF_ERROR(WriteTupleIndexTablesAsync(stream, device_buffer));
  return stream->BlockHostUntilDone();
}

Status TransferManager::WriteTupleIndexTablesAsync(
    se::Stream* stream, const ShapedBuffer& device_buffer) {
  VLOG(2) << "Writing tuple index tables for " << device_buffer;

  return ShapeUtil::ForEachSubshapeWithStatus(
      device_buffer.on_device_shape(),
      [&](const Shape& device_subshape, const ShapeIndex& index) -> Status {
        if (device_subshape.IsTuple() &&
            ShapeUtil::TupleElementCount(device_subshape) > 0) {
          se::DeviceMemoryBase device_memory = device_buffer.buffer(index);
          TF_RET_CHECK(GetByteSizeRequirement(device_subshape) ==
                       device_memory.size());

          std::vector<se::DeviceMemoryBase> elements;
          ShapeIndex element_index = index;
          for (int64 i = 0; i < ShapeUtil::TupleElementCount(device_subshape);
               ++i) {
            element_index.push_back(i);
            elements.push_back(device_buffer.buffer(element_index));
            element_index.pop_back();
          }
          return WriteSingleTupleIndexTable(stream, elements, device_subshape,
                                            &device_memory);
        }

        return Status::OK();
      });
}

Status TransferManager::WriteRootTupleIndexTable(
    se::Stream* stream, const ShapedBuffer& device_buffer) {
  TF_RET_CHECK(device_buffer.on_device_shape().IsTuple());
  if (ShapeUtil::TupleElementCount(device_buffer.on_device_shape()) == 0) {
    return Status::OK();
  }
  se::DeviceMemoryBase device_memory = device_buffer.buffer({});
  TF_RET_CHECK(GetByteSizeRequirement(device_buffer.on_device_shape()) ==
               device_memory.size());

  std::vector<se::DeviceMemoryBase> elements;
  for (int64 i = 0;
       i < ShapeUtil::TupleElementCount(device_buffer.on_device_shape()); ++i) {
    elements.push_back(device_buffer.buffer({i}));
  }
  return WriteSingleTupleIndexTable(
      stream, elements, device_buffer.on_device_shape(), &device_memory);
}

Status TransferManager::WriteRootTupleIndexTable(
    se::Stream* stream, const ShapeTree<MaybeOwningDeviceMemory>& buffer_tree) {
  TF_RET_CHECK(buffer_tree.shape().IsTuple());
  if (ShapeUtil::TupleElementCount(buffer_tree.shape()) == 0) {
    return Status::OK();
  }
  se::DeviceMemoryBase device_memory =
      buffer_tree.element({}).AsDeviceMemoryBase();
  TF_RET_CHECK(GetByteSizeRequirement(buffer_tree.shape()) ==
               device_memory.size());

  std::vector<se::DeviceMemoryBase> elements;
  for (int64 i = 0; i < ShapeUtil::TupleElementCount(buffer_tree.shape());
       ++i) {
    elements.push_back(buffer_tree.element({i}).AsDeviceMemoryBase());
  }
  return WriteSingleTupleIndexTable(stream, elements, buffer_tree.shape(),
                                    &device_memory);
}

Status TransferManager::TransferBufferFromDevice(
    se::Stream* stream, const se::DeviceMemoryBase& source, int64 size,
    void* destination) {
  if (source.size() < size) {
    return FailedPrecondition(
        "Source allocation on device not large enough for data transfer: "
        "%d < %d",
        source.size(), size);
  }
  stream->ThenMemcpy(destination, source, size);
  return Status::OK();
}

Status TransferManager::TransferBufferToDevice(
    se::Stream* stream, int64 size, const void* source,
    se::DeviceMemoryBase* destination) {
  if (destination->size() < size) {
    return FailedPrecondition(
        "Destination allocation on device not large enough for data transfer: "
        "%d < %d",
        destination->size(), size);
  }
  stream->ThenMemcpy(destination, source, size);
  return Status::OK();
}

StatusOr<ScopedShapedBuffer> TransferManager::AllocateScopedShapedBuffer(
    const Shape& on_host_shape, se::DeviceMemoryAllocator* allocator,
    int device_ordinal, DeviceShapeRepresentationFn shape_representation_fn) {
  if (!LayoutUtil::HasLayout(on_host_shape)) {
    return InvalidArgument("Shape must have a layout: %s",
                           ShapeUtil::HumanStringWithLayout(on_host_shape));
  }
  TF_RETURN_IF_ERROR(ShapeUtil::ValidateShape(on_host_shape));
  Shape on_device_shape = (shape_representation_fn == nullptr)
                              ? HostShapeToDeviceShape(on_host_shape)
                              : shape_representation_fn(on_host_shape);
  TF_RET_CHECK(LayoutUtil::HasLayout(on_device_shape));

  ScopedShapedBuffer shaped_buffer(std::move(on_device_shape), allocator,
                                   device_ordinal);

  // Allocate an appropriate sized buffer for each element in the shape
  // including the tuple pointer arrays.
  for (auto& pair : shaped_buffer.buffers()) {
    const ShapeIndex& index = pair.first;
    se::DeviceMemoryBase& memory_base = pair.second;
    const Shape& subshape =
        ShapeUtil::GetSubshape(shaped_buffer.on_device_shape(), index);
    TF_ASSIGN_OR_RETURN(auto memory,
                        allocator->Allocate(shaped_buffer.device_ordinal(),
                                            GetByteSizeRequirement(subshape),
                                            /*retry_on_failure=*/true,
                                            subshape.layout().memory_space()));
    // Move the allocated buffer into the ScopedShapedBuffer, which owns it.
    memory_base = memory.Release();
  }

  return std::move(shaped_buffer);
}

StatusOr<Shape> TransferManager::ChooseCompactLayoutForShape(
    const Shape& host_shape) const {
  return LayoutUtil::GetWithDefaultLayout(host_shape);
}

}  // namespace xla


text:
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.1 generiert
// Siehe https://javaee.github.io/jaxb-v2/
// Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2018.11.18 um 03:45:53 PM CET
//

package org.collada._2005._11.colladaschema;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 *
Java-Klasse für anonymous complex type.
 *
 *
Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="input" type="{http://www.collada.org/2005/11/COLLADASchema}InputLocal" maxOccurs="unbounded"/>
 *       </sequence>
 *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "input"
})
@XmlRootElement(name = "sampler")
public class Sampler {

    @XmlElement(required = true)
    protected List<InputLocal> input;
    @XmlAttribute(name = "id")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlID
    @XmlSchemaType(name = "ID")
    protected String id;

    /**
     * Gets the value of the input property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the input property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getInput().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link InputLocal }
     *
     *
     */
    public List<InputLocal> getInput() {
        if (input == null) {
            input = new ArrayList<InputLocal>();
        }
        return this.input;
    }

    public boolean isSetInput() {
        return ((this.input!= null)&&(!this.input.isEmpty()));
    }

    public void unsetInput() {
        this.input = null;
    }

    /**
     * Ruft den Wert der id-Eigenschaft ab.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getId() {
        return id;
    }

    /**
     * Legt den Wert der id-Eigenschaft fest.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setId(String value) {
        this.id = value;
    }

    public boolean isSetId() {
        return (this.id!= null);
    }

    public void setInput(List<InputLocal> value) {
        this.input = value;
    }

}


text:
<?php

namespace FTC\Bundle\CodeBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class ContributeToSnippetType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('comment', 'textarea', array(
                'label_render' => false,
                'attr'         => array('class' => 'code-comment-textarea', 'placeholder' => 'Refactored code to achieve more speed...'),
                'required'     =>false
            ))
            ->add('code', 'textarea', array('label_render' => false))
        ;
    }

    public function getName()
    {
        return 'ftc_bundle_codebundle_contributetype';
    }
}


text:
namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models
{
    /// <summary>
    /// Create protection intent provider specific input.
    /// Please note <see cref="CreateProtectionIntentProviderSpecificDetails"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
    /// The available derived classes include <see cref="A2ACreateProtectionIntentInput"/>.
    /// </summary>
    public abstract partial class CreateProtectionIntentProviderSpecificDetails
    {
        /// <summary> Initializes a new instance of CreateProtectionIntentProviderSpecificDetails. </summary>
        protected CreateProtectionIntentProviderSpecificDetails()
        {
        }

        /// <summary> The class type. </summary>
        internal string InstanceType { get; set; }
    }
}


text:
This library makes it quick and easy to build a real-time node backend for Backbone.js clients using Socket.io as the communication protocol.

## Installation

```bash
npm install halo
```

## Quick Start/Example

### Back-end

First, require halo

```js
var Halo = require("halo");
```

Next, create a model by calling the extend method on Halo.model.
You can give it an any properties and classProperties you'd like.
You can also give it a constructor (called an initializer). If you
override the default constructor of Halo.model, make sure to call
the parent constructor using this.parent(Halo.Model).constructor
somewhere in your function.

```js
var MyModel = Halo.Model.extend({
  initializer : function(options) {

    // Call the parent pseudo-class's constructor.
    this.parent(Halo.Model).constructor(options);

    // Initialize your model
  },

  properties : {
    defaults : {
      someProperty : "a default value"
    },

    someMethod : function() {
      // Do some stuff
    },

    someOtherMethod : function() {
      // Do some other stuff
    }
  }
});
```

Assign a collection to the new model class. Anytime this model is instantiated,
that instance will be added to the collection you specify here.

```js
MyModel.collection = new Halo.Collection({contains: MyModel});
```

Next, create a View for this model. The View specifies how your model is
represented to front-end clients and how those clients are permitted to
interact with the model.

```js
var MyModelView = Halo.views.socket.Model.extend({
  properties : {

    // The name string should be used as your Backbone.js Model's URL.
    name : "MyModels",
    obj : MyModel,

    // This dictionary defines what your front-end clients have
    // permission to do. Possible values include:
    // create, read, update, destroy, list
    routes : {
      'create'  : 'create',
      'read'    : 'read',
      'update'  : 'update',
      'list'    : 'list'
    },

    // If you have custom logic for a given action, just
    // provide a function with the name of the action.
    update : function(client, data) {

      var myModel = MyModel.collection.get(data.id);

      if (!myModel.get('someProperty' !== "a default value")) {

        // When setting properties on a model, you can pass in
        // an array limiting the names of the properties to set.
        myModel.set(data, ['someProperty']);
      }
      return this.render(client, myModel, data);
    }
  }
});
```

To allow front-end clients to interact with the view, you must create a router
and register the view with it.

```js
var router = new Halo.Router();
router.addView(new MyModelView());
router.listen(80);
```

### Front-end

In your front-end app, include Socket.io and the Halo.sync.js Backbone extension using
the following URLs. These URLs are automatically made available once router.listen() is
invoked.

```html
<script src="/socket.io/socket.io.js"></script>
<script src="/halo/halo.sync.js"></script>
```

Now your Backbone models and collections can be bound to any Halo models or collection
that have view objects registered with the Halo router.

```js
var MyBackboneModel = Backbone.Model.extend({
  url: function() { return "MyModels"; }
});
```

For example, if you created a Backbone model that returned "MyModels" as the URL,
which corresponds to the "name" property of the MyModelView, any time a client saved
a change to a MyModel instance, that change will get pushed to all other clients
who have a copy of that instance of MyModel. Similarly, creating new MyModels
will add that new instance to any Backbone collection connected to MyModels.

## Attribution/Credits

The code for Halo.sync was heavily borrowed from Backbone.ioBind, created by Jake Luer,
and distributed under the MIT license. You can find his original library at
http://alogicalparadox.com/backbone.iobind/
https://github.com/logicalparadox/backbone.iobind

## License

Released under the MIT license.  See file called LICENSE for more
details.


text:
package com.amazonaws.services.translate.model;

import javax.annotation.Generated;

/**
 *

 * The confidence that Amazon Comprehend accurately detected the source language is low. If a low confidence level is
 * acceptable for your application, you can use the language in the exception to call Amazon Translate again. For more
 * information, see the DetectDominantLanguage
 * operation in the Amazon Comprehend Developer Guide.
 *

 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DetectedLanguageLowConfidenceException extends com.amazonaws.services.translate.model.AmazonTranslateException {
    private static final long serialVersionUID = 1L;

    /**
     *

     * The language code of the auto-detected language from Amazon Comprehend.
     *

     */
    private String detectedLanguageCode;

    /**
     * Constructs a new DetectedLanguageLowConfidenceException with the specified error message.
     *
     * @param message
     *        Describes the error encountered.
     */
    public DetectedLanguageLowConfidenceException(String message) {
        super(message);
    }

    /**
     *

     * The language code of the auto-detected language from Amazon Comprehend.
     *

     *
     * @param detectedLanguageCode
     *        The language code of the auto-detected language from Amazon Comprehend.
     */

    @com.fasterxml.jackson.annotation.JsonProperty("DetectedLanguageCode")
    public void setDetectedLanguageCode(String detectedLanguageCode) {
        this.detectedLanguageCode = detectedLanguageCode;
    }

    /**
     *

     * The language code of the auto-detected language from Amazon Comprehend.
     *

     *
     * @return The language code of the auto-detected language from Amazon Comprehend.
     */

    @com.fasterxml.jackson.annotation.JsonProperty("DetectedLanguageCode")
    public String getDetectedLanguageCode() {
        return this.detectedLanguageCode;
    }

    /**
     *

     * The language code of the auto-detected language from Amazon Comprehend.
     *

     *
     * @param detectedLanguageCode
     *        The language code of the auto-detected language from Amazon Comprehend.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DetectedLanguageLowConfidenceException withDetectedLanguageCode(String detectedLanguageCode) {
        setDetectedLanguageCode(detectedLanguageCode);
        return this;
    }

}


text:
package pl.lando.asyncloop;

import pl.lando.logger.L;

public class App {

    static L l = L.sout();

    public static class State {
        public Integer x = 0;
    }

    public static void main(String[] args) throws Exception {
        AsyncLoop asyncLoop = new AsyncLoopStateful<State>(new State(), (state)->{
            state.x++;
            l.d("yeah -> "+state.x);
        }).initialize();
        asyncLoop.execute();

        Thread.sleep(2500);
        l.d("attempting to stop");
        asyncLoop.stop();

        asyncLoop = new AsyncLoopStateless(()->{
            l.d("yeah stateless");
        }).initialize();
        asyncLoop.execute();

        Thread.sleep(2500);
        l.d("attempting to stop2");
        asyncLoop.stop();

    }
}


text:
layout: page
title: Basic Archive Holdings Trade Fair
date: 2016-05-24
author: Willie Stevenson
tags: weekly links, java
status: published
summary: Nunc porttitor odio sed nisi.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 12/26/2016
  endDate: 12/28/2016
  ctyhocn: HLVVAHX
  groupCode: BAHTF
published: true
---
Sed aliquet sapien est. Fusce interdum elementum quam, ac ultricies metus pulvinar et. Praesent ornare ipsum quis lacus tempor venenatis. Maecenas nec eleifend nulla. Suspendisse euismod felis et laoreet ullamcorper. Morbi at ante et justo suscipit elementum. Fusce commodo faucibus venenatis. Maecenas mollis, ex et eleifend tempor, mauris ante aliquam tellus, pulvinar aliquet ex magna quis neque.

* Donec ac metus a velit dapibus iaculis non ut leo
* Morbi in eros a justo convallis mollis vitae vitae neque
* Aenean tempor tortor vel accumsan sodales.

Sed sodales mauris metus, sit amet suscipit arcu fermentum non. Aliquam erat volutpat. Maecenas sodales magna ut placerat molestie. Vivamus a fermentum leo, elementum iaculis lectus. Duis pellentesque ornare tellus at semper. Aliquam erat volutpat. Vestibulum facilisis magna vitae lorem maximus tincidunt a eu massa. Morbi tempus neque vitae arcu dictum, accumsan scelerisque mi sollicitudin. Integer aliquam orci vel diam bibendum pretium.
In nec sollicitudin sem. Etiam id ultrices quam. Etiam eget erat purus. Pellentesque non suscipit nibh. Curabitur in turpis eros. Phasellus eu mollis eros, non dictum libero. Ut at ante rutrum, lobortis ex quis, fringilla nisi. Maecenas eget felis odio. Sed ullamcorper quam pretium enim venenatis, in consectetur mi mattis. Nam semper quis nisi id ullamcorper. Vestibulum ultricies tempus ligula, in fermentum neque consequat luctus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec tristique neque sed quam hendrerit pellentesque. Morbi tempor odio vel turpis pharetra, eget fringilla lorem facilisis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;


text:
console.log('App setup');
var express = require('express');
var mysql = require('mysql');
var http = require('http');
var bodyParser = require('body-parser')
var exphbs  = require('express-handlebars');

var app = express();

var connection = mysql.createConnection({
  host     : '127.0.0.1',
  user     : 'root',
  password : '',
  database : 'rfid'
});

app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');

app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())

var oldrfid="000000000000";
var oldtime=new Date();
connection.connect(function(err) {
	if(!err)
		console.log("connected");
	else
		console.log("not connected");
	// body...
});
function update(rfid,id)
{
	console.log("updating!");
	connection.query('update info set checkout=NOW() where rfid="'+rfid+'" and checkin=checkout', function(err, rows, fields) {
	if (!err)
	console.log('The solution is: ', rows);
	else
	console.log('Error while performing Query.2');
	});
}
function insert(rfid,id)
{
	console.log("inserting!",id);
	var query = 'insert into info (rfid,pid) values("'+rfid+'",'+id+')';
	console.log(query);
    connection.query(query, function(err, rows, fields) {
 	if (!err)
    console.log('The solution is: ', rows);
  	else
    console.log('Error while performing Query.3');
	});
}

app.get('/api', function(req,res){
	console.log(req.query.pid);
	var curtime=new Date();
	//console.log(""+(curtime-oldtime));
	console.log(new Date().toLocaleString('en-US', { timeZone: 'Asia/Kolkata' }));
	if(req.query.name)
	{
		//var difftime;
		if(!(req.query.name==oldrfid && (curtime-oldtime)<3000))
		{
		connection.query('select * from info where rfid="'+req.query.name+'" and checkin=checkout',function(err,rows,fields){
			if (!err)
		    {
		    	console.log('The solution is: ', rows);
		    			if(rows.length==1)
							update(req.query.name,req.query.pid);
							//difftime=curtime-oldtime;
						else
							insert(req.query.name,req.query.pid);

		    }
		  	else
		    console.log('Error while performing Query.1');
		});
		}
		oldtime=curtime;
		oldrfid=req.query.name;
	    res.send("Data Received");
	    //res.send(difftime.toString());
	}
	else
		res.send("Not Received");
});

app.get('/stat', function(req,res){
	var query = 'select parkingid,t_count,occupied_count,t_count-occupied_count as av,((t_count-occupied_count)/t_count)*100 as per from stat';
	connection.query(query, function(err, rows, fields) {
		if (!err){
			console.log(rows);
			res.render('home',{'rows': rows});
		}
	  	else
	    console.log('Error while performing Query.4');
	});
});
http.createServer(app).listen(3001);


text:
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping default-lazy="false" >
    <class
        name="org.tolweb.hibernate.FeatureGroup"
        table="FeatureGroups"
        dynamic-update="false"
        dynamic-insert="false"
    >
        <cache usage="nonstrict-read-write" />

        <id
            name="id"
            column="id"
            type="java.lang.Long"
            unsaved-value="-1"
        >
            <generator class="native">
            </generator>
        </id>

        <property
            name="nodeId"
            type="java.lang.Long"
            update="true"
            insert="true"
            access="property"
            column="nodeId"
        />

        <property
            name="imageId"
            type="int"
            update="true"
            insert="true"
            access="property"
            column="imageId"
        />

        <property
            name="groupDescription"
            type="java.lang.String"
            update="true"
            insert="true"
            access="property"
            column="groupDescription"
        />

        <property
            name="featureText"
            type="java.lang.String"
            update="true"
            insert="true"
            access="property"
            column="featureText"
        />

        <property
            name="active"
            type="boolean"
            update="true"
            insert="true"
            access="property"
            column="active"
        />

        <property
            name="createdDate"
            type="java.util.Date"
            update="true"
            insert="true"
            access="property"
            column="createdDate"
        />

        <property
            name="categoryValue"
            type="int"
            update="true"
            insert="true"
            access="property"
            column="category"
        />

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-FeatureGroup.xml
            containing the additional properties and place it in your merge dir.
        -->

    </class>

</hibernate-mapping>


text:
package debop4s.data.orm.jtests.mapping.associations.onetomany.list;

import debop4s.core.ToStringHelper;
import debop4s.core.utils.Hashs;
import debop4s.data.orm.model.HibernateEntityBase;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@org.hibernate.annotations.Cache(region = "data.association", usage = CacheConcurrencyStrategy.READ_WRITE)
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
public class OneToManyFather extends HibernateEntityBase<Long> {

    @Id
    @GeneratedValue
    @Setter(AccessLevel.PROTECTED)
    private Long id;

    private String name;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinTable(name = "Father_Child")
    @OrderColumn(name = "birthday")
    List<OneToManyChild> orderedChildren = new ArrayList<OneToManyChild>();

    @Override
    public int hashCode() {
        return Hashs.compute(name);
    }

    @Override
    public ToStringHelper buildStringHelper() {
        return super.buildStringHelper()
                    .add("name", name);
    }

    private static final long serialVersionUID = -352301841645500259L;
}


text:
#include <linux/vga_switcheroo.h>
#include <linux/slab.h>
#include <acpi/acpi.h>
#include <acpi/acpi_bus.h>
#include <linux/pci.h>

#define ATPX_VERSION 0
#define ATPX_GPU_PWR 2
#define ATPX_MUX_SELECT 3
#define ATPX_I2C_MUX_SELECT 4
#define ATPX_SWITCH_START 5
#define ATPX_SWITCH_END 6

#define ATPX_INTEGRATED 0
#define ATPX_DISCRETE 1

#define ATPX_MUX_IGD 0
#define ATPX_MUX_DISCRETE 1

static struct radeon_atpx_priv {
	bool atpx_detected;
	/* handle for device - and atpx */
	acpi_handle dhandle;
	acpi_handle atpx_handle;
} radeon_atpx_priv;

static int radeon_atpx_get_version(acpi_handle handle)
{
	acpi_status status;
	union acpi_object atpx_arg_elements[2], *obj;
	struct acpi_object_list atpx_arg;
	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };

	atpx_arg.count = 2;
	atpx_arg.pointer = &atpx_arg_elements[0];

	atpx_arg_elements[0].type = ACPI_TYPE_INTEGER;
	atpx_arg_elements[0].integer.value = ATPX_VERSION;

	atpx_arg_elements[1].type = ACPI_TYPE_INTEGER;
	atpx_arg_elements[1].integer.value = ATPX_VERSION;

	status = acpi_evaluate_object(handle, NULL, &atpx_arg, &buffer);
	if (ACPI_FAILURE(status)) {
		printk("%s: failed to call ATPX: %s\n", __func__, acpi_format_exception(status));
		return -ENOSYS;
	}
	obj = (union acpi_object *)buffer.pointer;
	if (obj && (obj->type == ACPI_TYPE_BUFFER))
		printk(KERN_INFO "radeon atpx: version is %d\n", *((u8 *)(obj->buffer.pointer) + 2));
	kfree(buffer.pointer);
	return 0;
}

static int radeon_atpx_execute(acpi_handle handle, int cmd_id, u16 value)
{
	acpi_status status;
	union acpi_object atpx_arg_elements[2];
	struct acpi_object_list atpx_arg;
	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
	uint8_t buf[4] = {0};

	if (!handle)
		return -EINVAL;

	atpx_arg.count = 2;
	atpx_arg.pointer = &atpx_arg_elements[0];

	atpx_arg_elements[0].type = ACPI_TYPE_INTEGER;
	atpx_arg_elements[0].integer.value = cmd_id;

	buf[2] = value & 0xff;
	buf[3] = (value >> 8) & 0xff;

	atpx_arg_elements[1].type = ACPI_TYPE_BUFFER;
	atpx_arg_elements[1].buffer.length = 4;
	atpx_arg_elements[1].buffer.pointer = buf;

	status = acpi_evaluate_object(handle, NULL, &atpx_arg, &buffer);
	if (ACPI_FAILURE(status)) {
		printk("%s: failed to call ATPX: %s\n", __func__, acpi_format_exception(status));
		return -ENOSYS;
	}
	kfree(buffer.pointer);

	return 0;
}

static int radeon_atpx_set_discrete_state(acpi_handle handle, int state)
{
	return radeon_atpx_execute(handle, ATPX_GPU_PWR, state);
}

static int radeon_atpx_switch_mux(acpi_handle handle, int mux_id)
{
	return radeon_atpx_execute(handle, ATPX_MUX_SELECT, mux_id);
}

static int radeon_atpx_switch_i2c_mux(acpi_handle handle, int mux_id)
{
	return radeon_atpx_execute(handle, ATPX_I2C_MUX_SELECT, mux_id);
}

static int radeon_atpx_switch_start(acpi_handle handle, int gpu_id)
{
	return radeon_atpx_execute(handle, ATPX_SWITCH_START, gpu_id);
}

static int radeon_atpx_switch_end(acpi_handle handle, int gpu_id)
{
	return radeon_atpx_execute(handle, ATPX_SWITCH_END, gpu_id);
}

static int radeon_atpx_switchto(enum vga_switcheroo_client_id id)
{
	int gpu_id;

	if (id == VGA_SWITCHEROO_IGD)
		gpu_id = ATPX_INTEGRATED;
	else
		gpu_id = ATPX_DISCRETE;

	radeon_atpx_switch_start(radeon_atpx_priv.atpx_handle, gpu_id);
	radeon_atpx_switch_mux(radeon_atpx_priv.atpx_handle, gpu_id);
	radeon_atpx_switch_i2c_mux(radeon_atpx_priv.atpx_handle, gpu_id);
	radeon_atpx_switch_end(radeon_atpx_priv.atpx_handle, gpu_id);

	return 0;
}

static int radeon_atpx_power_state(enum vga_switcheroo_client_id id,
				   enum vga_switcheroo_state state)
{
	/* on w500 ACPI can't change intel gpu state */
	if (id == VGA_SWITCHEROO_IGD)
		return 0;

	radeon_atpx_set_discrete_state(radeon_atpx_priv.atpx_handle, state);
	return 0;
}

static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev)
{
	acpi_handle dhandle, atpx_handle;
	acpi_status status;

	dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
	if (!dhandle)
		return false;

	status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
	if (ACPI_FAILURE(status))
		return false;

	radeon_atpx_priv.dhandle = dhandle;
	radeon_atpx_priv.atpx_handle = atpx_handle;
	return true;
}

static int radeon_atpx_init(void)
{
	/* set up the ATPX handle */

	radeon_atpx_get_version(radeon_atpx_priv.atpx_handle);
	return 0;
}

static int radeon_atpx_get_client_id(struct pci_dev *pdev)
{
	if (radeon_atpx_priv.dhandle == DEVICE_ACPI_HANDLE(&pdev->dev))
		return VGA_SWITCHEROO_IGD;
	else
		return VGA_SWITCHEROO_DIS;
}

static struct vga_switcheroo_handler radeon_atpx_handler = {
	.switchto = radeon_atpx_switchto,
	.power_state = radeon_atpx_power_state,
	.init = radeon_atpx_init,
	.get_client_id = radeon_atpx_get_client_id,
};

static bool radeon_atpx_detect(void)
{
	char acpi_method_name[255] = { 0 };
	struct acpi_buffer buffer = {sizeof(acpi_method_name), acpi_method_name};
	struct pci_dev *pdev = NULL;
	bool has_atpx = false;
	int vga_count = 0;

	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
		vga_count++;

		has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
	}

	if (has_atpx && vga_count == 2) {
		acpi_get_name(radeon_atpx_priv.atpx_handle, ACPI_FULL_PATHNAME, &buffer);
		printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
		       acpi_method_name);
		radeon_atpx_priv.atpx_detected = true;
		return true;
	}
	return false;
}

void radeon_register_atpx_handler(void)
{
	bool r;

	/* detect if we have any ATPX + 2 VGA in the system */
	r = radeon_atpx_detect();
	if (!r)
		return;

	vga_switcheroo_register_handler(&radeon_atpx_handler);
}

void radeon_unregister_atpx_handler(void)
{
	vga_switcheroo_unregister_handler();
}


text:
package org.wso2.carbon.mediation.initializer.services;

import org.apache.synapse.config.SynapseConfiguration;
import org.apache.axis2.context.ConfigurationContext;

public class SynapseConfigurationServiceImpl implements SynapseConfigurationService {

    private SynapseConfiguration synapseConfiguration;

    private ConfigurationContext configurationContext;

    private int tenantId;

    public SynapseConfigurationServiceImpl(SynapseConfiguration synapseConfiguration,
                                           int tenantId,
                                           ConfigurationContext configurationContext) {
        this.synapseConfiguration = synapseConfiguration;
        this.tenantId = tenantId;
        this.configurationContext = configurationContext;
    }

    public SynapseConfiguration getSynapseConfiguration() {
        return synapseConfiguration;
    }

    public void setSynapseConfiguration(SynapseConfiguration synapseConfiguration) {
        this.synapseConfiguration = synapseConfiguration;
    }

    public ConfigurationContext getConfigurationContext() {
        return configurationContext;
    }

    public int getTenantId() {
        return tenantId;
    }
}


text:
"""Functions for doing principal coordinates analysis on a distance matrix

Calculations performed as described in:

Principles of Multivariate analysis: A User's Perspective. W.J. Krzanowski
Oxford University Press, 2000. p106.

Note: There are differences in the signs of some of the eigenvectors between
R's PCoA function (cmdscale) and the implementation provided here. This is due
to numpy's eigh() function. The eigenvalues returned by eigh() match those
returned by R's eigen() function, but some of the eigenvectors have swapped
signs. Numpy's eigh() function uses a different set of Fortran routines (part
of LAPACK) to calculate the eigenvectors than R does. Numpy uses DSYEVD and
ZHEEVD, while R uses DSYEVR and ZHEEV. As far as the Fortran documentation
goes, those routines should produce the same results, they just use different
algorithms to obtain them. The differences in sign do not affect the overall
results as they are just a different reflection. R's cmdscale documentation
also confirms the possibility of obtaining different signs between different R
platforms. Please feel free to send questions to jai.rideout@gmail.com.
"""
from numpy import shape, add, sum, sqrt, argsort, transpose, newaxis
from numpy.linalg import eigh
from cogent.util.dict2d import Dict2D
from cogent.util.table import Table
from cogent.cluster.UPGMA import inputs_from_dict2D

__author__ = "Catherine Lozupone"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Catherine Lozuopone", "Rob Knight", "Peter Maxwell",
               "Gavin Huttley", "Justin Kuczynski", "Daniel McDonald",
               "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Catherine Lozupone"
__email__ = "lozupone@colorado.edu"
__status__ = "Production"

def PCoA(pairwise_distances):
    """runs principle coordinates analysis on a distance matrix

    Takes a dictionary with tuple pairs mapped to distances as input.
    Returns a cogent Table object.
    """
    items_in_matrix = []
    for i in pairwise_distances:
        if i[0] not in items_in_matrix:
            items_in_matrix.append(i[0])
        if i[1] not in items_in_matrix:
            items_in_matrix.append(i[1])
    dict2d_input = [(i[0], i[1], pairwise_distances[i]) for i in \
            pairwise_distances]
    dict2d_input.extend([(i[1], i[0], pairwise_distances[i]) for i in \
            pairwise_distances])
    dict2d_input = Dict2D(dict2d_input, RowOrder=items_in_matrix, \
            ColOrder=items_in_matrix, Pad=True, Default=0.0)
    matrix_a, node_order = inputs_from_dict2D(dict2d_input)
    point_matrix, eigvals = principal_coordinates_analysis(matrix_a)
    return output_pca(point_matrix, eigvals, items_in_matrix)

def principal_coordinates_analysis(distance_matrix):
    """Takes a distance matrix and returns principal coordinate results

    point_matrix: each row is an axis and the columns are points within the axis
    eigvals: correspond to the rows and indicate the amount of the variation
        that that the axis in that row accounts for
    NOT NECESSARILY SORTED
    """
    E_matrix = make_E_matrix(distance_matrix)
    F_matrix = make_F_matrix(E_matrix)
    eigvals, eigvecs = run_eig(F_matrix)
    #drop imaginary component, if we got one
    eigvals = eigvals.real
    eigvecs = eigvecs.real
    point_matrix = get_principal_coordinates(eigvals, eigvecs)
    return point_matrix, eigvals

def make_E_matrix(dist_matrix):
    """takes a distance matrix (dissimilarity matrix) and returns an E matrix

    input and output matrices are numpy array objects of type Float

    squares and divides by -2 each element in the matrix
    """
    return (dist_matrix * dist_matrix) / -2.0

def make_F_matrix(E_matrix):
    """takes an E matrix and returns an F matrix

    input is output of make_E_matrix

    for each element in matrix subtract mean of corresponding row and
    column and add the mean of all elements in the matrix
    """
    num_rows, num_cols = shape(E_matrix)
    #make a vector of the means for each row and column
    #column_means = (add.reduce(E_matrix) / num_rows)
    column_means = (add.reduce(E_matrix) / num_rows)[:,newaxis]
    trans_matrix = transpose(E_matrix)
    row_sums = add.reduce(trans_matrix)
    row_means = row_sums / num_cols
    #calculate the mean of the whole matrix
    matrix_mean = sum(row_sums) / (num_rows * num_cols)
    #adjust each element in the E matrix to make the F matrix

    E_matrix -= row_means
    E_matrix -= column_means
    E_matrix += matrix_mean

    #for i, row in enumerate(E_matrix):
    #    for j, val in enumerate(row):
    #        E_matrix[i,j] = E_matrix[i,j] - row_means[i] - \
    #                column_means[j] + matrix_mean
    return E_matrix

def run_eig(F_matrix):
    """takes an F-matrix and returns eigenvalues and eigenvectors"""

    #use eig to get vector of eigenvalues and matrix of eigenvectors
    #these are already normalized such that
    # vi'vi = 1 where vi' is the transpose of eigenvector i
    eigvals, eigvecs = eigh(F_matrix)
    #NOTE: numpy produces transpose of Numeric!

    return eigvals, eigvecs.transpose()

def get_principal_coordinates(eigvals, eigvecs):
    """converts eigvals and eigvecs to point matrix

    normalized eigenvectors with eigenvalues"""

    #get the coordinates of the n points on the jth axis of the Euclidean
    #representation as the elements of (sqrt(eigvalj))eigvecj
    #must take the absolute value of the eigvals since they can be negative
    return eigvecs * sqrt(abs(eigvals))[:,newaxis]

def output_pca(PCA_matrix, eigvals, names):
    """Creates a string output for principal coordinates analysis results.

    PCA_matrix and eigvals are generated with the get_principal_coordinates
    function. Names is a list of names that corresponds to the columns in the
    PCA_matrix. It is the order that samples were represented in the initial
    distance matrix.

    returns a cogent Table object"""

    output = []
    #get order to output eigenvectors values. reports the eigvecs according
    #to their cooresponding eigvals from greatest to least
    vector_order = list(argsort(eigvals))
    vector_order.reverse()

    # make the eigenvector header line and append to output
    vec_num_header = ['vec_num-%d' % i for i in range(len(eigvals))]
    header = ['Label'] + vec_num_header
    #make data lines for eigenvectors and add to output
    rows = []
    for name_i, name in enumerate(names):
        row = [name]
        for vec_i in vector_order:
            row.append(PCA_matrix[vec_i,name_i])
        rows.append(row)
    eigenvectors = Table(header=header,rows=rows,digits=2,space=2,
                    title='Eigenvectors')
    output.append('\n')
    # make the eigenvalue header line and append to output
    header = ['Label']+vec_num_header
    rows = [['eigenvalues']+[eigvals[vec_i] for vec_i in vector_order]]
    pcnts = (eigvals/sum(eigvals))*100
    rows += [['var explained (%)']+[pcnts[vec_i] for vec_i in vector_order]]
    eigenvalues = Table(header=header,rows=rows,digits=2,space=2,
                    title='Eigenvalues')

    return eigenvectors.appended('Type', eigenvalues, title='')


text:
package net.idlesoft.android.apps.github.activities;

import net.idlesoft.android.apps.github.R;
import net.idlesoft.android.apps.github.adapters.BranchTreeListAdapter;

import org.idlesoft.libraries.ghapi.APIAbstract.Response;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;

public class BranchTree extends BaseActivity {
    private static class LoadTreeTask extends AsyncTask<Void, Void, Void> {
        public BranchTree activity;

        @Override
        protected Void doInBackground(final Void... params) {
            final Response r = activity.mGApi.object.tree(activity.mRepositoryOwner,
                    activity.mRepositoryName, activity.mBranchSha);
            if (r.statusCode == 200) {
                try {
                    activity.mJson = (new JSONObject(r.resp)).getJSONArray("tree");
                    activity.mAdapter.loadData(activity.mJson);
                } catch (final JSONException e) {
                    e.printStackTrace();
                }
            }
            return null;
        }

        @Override
        protected void onPostExecute(final Void result) {
            activity.mAdapter.pushData();
            activity.mAdapter.setIsLoadingData(false);
        }

        @Override
        protected void onPreExecute() {
            activity.mAdapter.setIsLoadingData(true);
        }
    }

    private BranchTreeListAdapter mAdapter;

    private String mBranchName;

    private String mBranchSha;

    public Intent mIntent;

    public JSONArray mJson;

    private ListView mListView;

    private LoadTreeTask mLoadTreeTask;

    private final OnItemClickListener mOnListItemClick = new OnItemClickListener() {
        public void onItemClick(final AdapterView<?> parent, final View v, final int position,
                final long id) {
            try {
                final JSONObject treeItem = mJson.getJSONObject(position);
                if (treeItem.getString("type").equals("tree")) {
                    final Intent i = new Intent(BranchTree.this, BranchTree.class);
                    i.putExtra("repo_owner", mRepositoryOwner);
                    i.putExtra("repo_name", mRepositoryName);
                    i.putExtra("branch_name", mBranchName);
                    i.putExtra("branch_sha", treeItem.getString("sha"));
                    startActivity(i);
                } else if (treeItem.getString("type").equals("blob")) {
                    final Intent i = new Intent(BranchTree.this, FileViewer.class);
                    i.putExtra("repo_owner", mRepositoryOwner);
                    i.putExtra("repo_name", mRepositoryName);
                    i.putExtra("tree_sha", mBranchSha);
                    i.putExtra("blob_path", treeItem.getString("name"));
                    i.putExtra("blob_sha", treeItem.getString("sha"));
                    startActivity(i);
                }
            } catch (final JSONException e) {
                e.printStackTrace();
            }
        }
    };

    private String mRepositoryName;

    private String mRepositoryOwner;

    @Override
    public void onCreate(final Bundle icicle) {
        super.onCreate(icicle, R.layout.branch_tree_list);

        setupActionBar();

        final TextView pageTitle = (TextView) findViewById(R.id.tv_page_title);
        pageTitle.setText("Tree Browser");

        mListView = (ListView) findViewById(R.id.lv_branchTreeList_list);
        mListView.setOnItemClickListener(mOnListItemClick);

        mAdapter = new BranchTreeListAdapter(BranchTree.this, mListView);
        mListView.setAdapter(mAdapter);

        final Bundle extras = getIntent().getExtras();
        if (extras != null) {
            mRepositoryName = extras.getString("repo_name");
            mRepositoryOwner = extras.getString("repo_owner");
            mBranchName = extras.getString("branch_name");
            mBranchSha = extras.getString("branch_sha");
        }
    }

    @Override
    protected void onResume() {
        mLoadTreeTask = (LoadTreeTask) getLastNonConfigurationInstance();
        if (mLoadTreeTask == null) {
            mLoadTreeTask = new LoadTreeTask();
        }
        mLoadTreeTask.activity = BranchTree.this;
        if ((mLoadTreeTask.getStatus() == AsyncTask.Status.PENDING) && !mAdapter.hasItems()) {
            mLoadTreeTask.execute();
        }
        super.onResume();
    }

    @Override
    public Object onRetainNonConfigurationInstance() {
        return mLoadTreeTask;
    }
}


text:
module SapphireCms
  class NgTemplateGenerator < Rails::Generators::NamedBase
    source_root File.expand_path('../templates', __FILE__)

    def copy_template_file
      copy_file "template.html.slim", "app/assets/templates/#{name}.html.slim"
    end
  end
end


text:
#include "config.h"
#include "core/svg/SVGFEDiffuseLightingElement.h"

#include "core/layout/LayoutObject.h"
#include "core/layout/style/LayoutStyle.h"
#include "core/svg/SVGParserUtilities.h"
#include "core/svg/graphics/filters/SVGFilterBuilder.h"
#include "platform/graphics/filters/FEDiffuseLighting.h"
#include "platform/graphics/filters/FilterEffect.h"

namespace blink {

inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(Document& document)
    : SVGFilterPrimitiveStandardAttributes(SVGNames::feDiffuseLightingTag, document)
    , m_diffuseConstant(SVGAnimatedNumber::create(this, SVGNames::diffuseConstantAttr, SVGNumber::create(1)))
    , m_surfaceScale(SVGAnimatedNumber::create(this, SVGNames::surfaceScaleAttr, SVGNumber::create(1)))
    , m_kernelUnitLength(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::kernelUnitLengthAttr))
    , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create()))
{
    addToPropertyMap(m_diffuseConstant);
    addToPropertyMap(m_surfaceScale);
    addToPropertyMap(m_kernelUnitLength);
    addToPropertyMap(m_in1);
}

DEFINE_TRACE(SVGFEDiffuseLightingElement)
{
    visitor->trace(m_diffuseConstant);
    visitor->trace(m_surfaceScale);
    visitor->trace(m_kernelUnitLength);
    visitor->trace(m_in1);
    SVGFilterPrimitiveStandardAttributes::trace(visitor);
}

DEFINE_NODE_FACTORY(SVGFEDiffuseLightingElement)

bool SVGFEDiffuseLightingElement::isSupportedAttribute(const QualifiedName& attrName)
{
    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    if (supportedAttributes.isEmpty()) {
        supportedAttributes.add(SVGNames::inAttr);
        supportedAttributes.add(SVGNames::diffuseConstantAttr);
        supportedAttributes.add(SVGNames::surfaceScaleAttr);
        supportedAttributes.add(SVGNames::kernelUnitLengthAttr);
        supportedAttributes.add(SVGNames::lighting_colorAttr); // Even though it's a SVG-CSS property, we override its handling here.
    }
    return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
}

void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
    parseAttributeNew(name, value);
}

bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName)
{
    FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect);

    if (attrName == SVGNames::lighting_colorAttr) {
        LayoutObject* renderer = this->layoutObject();
        ASSERT(renderer);
        ASSERT(renderer->style());
        return diffuseLighting->setLightingColor(renderer->style()->svgStyle().lightingColor());
    }
    if (attrName == SVGNames::surfaceScaleAttr)
        return diffuseLighting->setSurfaceScale(m_surfaceScale->currentValue()->value());
    if (attrName == SVGNames::diffuseConstantAttr)
        return diffuseLighting->setDiffuseConstant(m_diffuseConstant->currentValue()->value());
    if (attrName == SVGNames::kernelUnitLengthAttr) {
        bool changedX = diffuseLighting->setKernelUnitLengthX(m_kernelUnitLength->firstNumber()->currentValue()->value());
        bool changedY = diffuseLighting->setKernelUnitLengthY(m_kernelUnitLength->secondNumber()->currentValue()->value());
        return changedX || changedY;
    }

    LightSource* lightSource = const_cast<LightSource*>(diffuseLighting->lightSource());
    const SVGFELightElement* lightElement = SVGFELightElement::findLightElement(*this);
    ASSERT(lightSource);
    ASSERT(lightElement);
    ASSERT(effect->filter());

    if (attrName == SVGNames::azimuthAttr)
        return lightSource->setAzimuth(lightElement->azimuth()->currentValue()->value());
    if (attrName == SVGNames::elevationAttr)
        return lightSource->setElevation(lightElement->elevation()->currentValue()->value());
    if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || attrName == SVGNames::zAttr)
        return lightSource->setPosition(effect->filter()->resolve3dPoint(lightElement->position()));
    if (attrName == SVGNames::pointsAtXAttr || attrName == SVGNames::pointsAtYAttr || attrName == SVGNames::pointsAtZAttr)
        return lightSource->setPointsAt(effect->filter()->resolve3dPoint(lightElement->pointsAt()));
    if (attrName == SVGNames::specularExponentAttr)
        return lightSource->setSpecularExponent(lightElement->specularExponent()->currentValue()->value());
    if (attrName == SVGNames::limitingConeAngleAttr)
        return lightSource->setLimitingConeAngle(lightElement->limitingConeAngle()->currentValue()->value());

    ASSERT_NOT_REACHED();
    return false;
}

void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrName)
{
    if (!isSupportedAttribute(attrName)) {
        SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
        return;
    }

    SVGElement::InvalidationGuard invalidationGuard(this);

    if (attrName == SVGNames::surfaceScaleAttr
        || attrName == SVGNames::diffuseConstantAttr
        || attrName == SVGNames::kernelUnitLengthAttr
        || attrName == SVGNames::lighting_colorAttr) {
        primitiveAttributeChanged(attrName);
        return;
    }

    if (attrName == SVGNames::inAttr) {
        invalidate();
        return;
    }

    ASSERT_NOT_REACHED();
}

void SVGFEDiffuseLightingElement::lightElementAttributeChanged(const SVGFELightElement* lightElement, const QualifiedName& attrName)
{
    if (SVGFELightElement::findLightElement(*this) != lightElement)
        return;

    // The light element has different attribute names.
    primitiveAttributeChanged(attrName);
}

PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
{
    FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->currentValue()->value()));

    if (!input1)
        return nullptr;

    SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this);
    if (!lightNode)
        return nullptr;

    LayoutObject* renderer = this->layoutObject();
    if (!renderer)
        return nullptr;

    ASSERT(renderer->style());
    Color color = renderer->style()->svgStyle().lightingColor();

    RefPtr<LightSource> lightSource = lightNode->lightSource(filter);
    RefPtrWillBeRawPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, m_surfaceScale->currentValue()->value(), m_diffuseConstant->currentValue()->value(),
        kernelUnitLengthX()->currentValue()->value(), kernelUnitLengthY()->currentValue()->value(), lightSource.release());
    effect->inputEffects().append(input1);
    return effect.release();
}

} // namespace blink


text:
<Properties ModelVersion="1.1.2">
  <General Title="Lock with a clock" Version="0.1.0" Vendor="burningsoda.com" Description=""/>
  <Application Type="BlackBerry Application" MainMIDletName="" MainArgs="" HomeScreenPosition="0" StartupTier="7" IsSystemModule="false" IsAutostartup="false"/>
  <Resources hasTitleResource="false" TitleResourceBundleName="" TitleResourceBundleRelativePath="" TitleResourceBundleClassName="" TitleResourceBundleKey="" DescriptionId="">
    <Icons>
      <Icon CanonicalFileName="res/icon.png" IsFocus="false"/>
    </Icons>
  </Resources>
  <Compile OutputCompilerMessages="false" ConvertImages="false" CreateWarningForNoExportedRoutine="true" CompressResources="false" AliasList="">
    <PreprocessorDefines/>
  </Compile>
  <Packaging OutputFileName="test" OutputFolder="deliverables" PreBuildStep="" PostBuildStep="" CleanStep="" GenerateALXFile="true">
    <AlxFiles/>
  </Packaging>
  <HiddenProperties>
    <ClassProtection/>
    <PackageProtection/>
  </HiddenProperties>
  <AlternateEntryPoints/>
</Properties>


text:
package com.example.alex.restaurantx.imageloader;

import android.graphics.Bitmap;

interface IBitmapDownloadedCallback {

    void onDownload(final Bitmap pBitmap);
}


text:
import {DRAWER_TOGGLE, DRAWER_OPEN, DRAWER_CLOSE, MARKERVIEW_VISIBLE, MARKERVIEW_HIDDEN, DISABLE_GESTURES} from './Types'

export const drawerToggle = () => {
  return {
    type: DRAWER_TOGGLE
  }
}

export const drawerOpen = () => {
  return {
    type: DRAWER_OPEN
  }
}

export const drawerClose = () => {
  return {
    type: DRAWER_CLOSE
  }
}

export const disableGestures = (value) => {
  return {
    type: DISABLE_GESTURES,
    disableGestures: value
  }
}

export const setMarkerViewVisible = () => {
  return {
    type: MARKERVIEW_VISIBLE
  }
}

export const setMarkerViewHidden = () => {
  return {
    type: MARKERVIEW_HIDDEN
  }
}


text:
/* Includes ------------------------------------------------------------------*/
#include "usbd_core.h"
#include "usbd_desc.h"
#include "usbd_req.h"
#include "usbd_conf.h"
#include "usb_regs.h"

/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
  * @{
  */

/** @defgroup USBD_DESC
  * @brief USBD descriptors module
  * @{
  */

/** @defgroup USBD_DESC_Private_TypesDefinitions
  * @{
  */
/**
  * @}
  */

/** @defgroup USBD_DESC_Private_Defines
  * @{
  */

#define USBD_VID                     0x0483
#define USBD_PID                     0x5710

#define USBD_LANGID_STRING            0x409
#define USBD_MANUFACTURER_STRING      "STMicroelectronics"

#define USBD_PRODUCT_HS_STRING        "Joystick in HS mode"
#define USBD_SERIALNUMBER_HS_STRING   "00000000011B"

#define USBD_PRODUCT_FS_STRING        "Joystick in FS Mode"
#define USBD_SERIALNUMBER_FS_STRING   "00000000011C"

#define USBD_CONFIGURATION_HS_STRING  "HID Config"
#define USBD_INTERFACE_HS_STRING      "HID Interface"

#define USBD_CONFIGURATION_FS_STRING  "HID Config"
#define USBD_INTERFACE_FS_STRING      "HID Interface"
/**
  * @}
  */

/** @defgroup USBD_DESC_Private_Macros
  * @{
  */
/**
  * @}
  */

/** @defgroup USBD_DESC_Private_Variables
  * @{
  */

USBD_DEVICE USR_desc =
{
  USBD_USR_DeviceDescriptor,
  USBD_USR_LangIDStrDescriptor,
  USBD_USR_ManufacturerStrDescriptor,
  USBD_USR_ProductStrDescriptor,
  USBD_USR_SerialStrDescriptor,
  USBD_USR_ConfigStrDescriptor,
  USBD_USR_InterfaceStrDescriptor,

};

#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
  #if defined ( __ICCARM__ ) /*!< IAR Compiler */
    #pragma data_alignment=4
  #endif
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
/* USB Standard Device Descriptor */
__ALIGN_BEGIN uint8_t USBD_DeviceDesc[USB_SIZ_DEVICE_DESC] __ALIGN_END =
  {
    0x12,                       /*bLength */
    USB_DEVICE_DESCRIPTOR_TYPE, /*bDescriptorType*/
    0x00,                       /*bcdUSB */
    0x02,
    0x00,                       /*bDeviceClass*/
    0x00,                       /*bDeviceSubClass*/
    0x00,                       /*bDeviceProtocol*/
    USB_OTG_MAX_EP0_SIZE,      /*bMaxPacketSize*/
    LOBYTE(USBD_VID),           /*idVendor*/
    HIBYTE(USBD_VID),           /*idVendor*/
    LOBYTE(USBD_PID),           /*idVendor*/
    HIBYTE(USBD_PID),           /*idVendor*/
    0x00,                       /*bcdDevice rel. 2.00*/
    0x02,
    USBD_IDX_MFC_STR,           /*Index of manufacturer  string*/
    USBD_IDX_PRODUCT_STR,       /*Index of product string*/
    USBD_IDX_SERIAL_STR,        /*Index of serial number string*/
    USBD_CFG_MAX_NUM            /*bNumConfigurations*/
  } ; /* USB_DeviceDescriptor */

#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
  #if defined ( __ICCARM__ ) /*!< IAR Compiler */
    #pragma data_alignment=4
  #endif
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
/* USB Standard Device Descriptor */
__ALIGN_BEGIN uint8_t USBD_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC] __ALIGN_END =
{
  USB_LEN_DEV_QUALIFIER_DESC,
  USB_DESC_TYPE_DEVICE_QUALIFIER,
  0x00,
  0x02,
  0x00,
  0x00,
  0x00,
  0x40,
  0x01,
  0x00,
};

#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
  #if defined ( __ICCARM__ ) /*!< IAR Compiler */
    #pragma data_alignment=4
  #endif
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
/* USB Standard Device Descriptor */
__ALIGN_BEGIN uint8_t USBD_LangIDDesc[USB_SIZ_STRING_LANGID] __ALIGN_END =
{
     USB_SIZ_STRING_LANGID,
     USB_DESC_TYPE_STRING,
     LOBYTE(USBD_LANGID_STRING),
     HIBYTE(USBD_LANGID_STRING),
};
/**
  * @}
  */

/** @defgroup USBD_DESC_Private_FunctionPrototypes
  * @{
  */
/**
  * @}
  */

/** @defgroup USBD_DESC_Private_Functions
  * @{
  */

/**
* @brief  USBD_USR_DeviceDescriptor
*         return the device descriptor
* @param  speed : current device speed
* @param  length : pointer to data length variable
* @retval pointer to descriptor buffer
*/
uint8_t *  USBD_USR_DeviceDescriptor( uint8_t speed , uint16_t *length)
{
  (void)speed;

  *length = sizeof(USBD_DeviceDesc);
  return USBD_DeviceDesc;
}

/**
* @brief  USBD_USR_LangIDStrDescriptor
*         return the LangID string descriptor
* @param  speed : current device speed
* @param  length : pointer to data length variable
* @retval pointer to descriptor buffer
*/
uint8_t *  USBD_USR_LangIDStrDescriptor( uint8_t speed , uint16_t *length)
{
  (void)speed;

  *length =  sizeof(USBD_LangIDDesc);
  return USBD_LangIDDesc;
}

/**
* @brief  USBD_USR_ProductStrDescriptor
*         return the product string descriptor
* @param  speed : current device speed
* @param  length : pointer to data length variable
* @retval pointer to descriptor buffer
*/
uint8_t *  USBD_USR_ProductStrDescriptor( uint8_t speed , uint16_t *length)
{

  if(speed == 0)
  {
    USBD_GetString (USBD_PRODUCT_HS_STRING, USBD_StrDesc, length);
  }
  else
  {
    USBD_GetString (USBD_PRODUCT_FS_STRING, USBD_StrDesc, length);
  }
  return USBD_StrDesc;
}

/**
* @brief  USBD_USR_ManufacturerStrDescriptor
*         return the manufacturer string descriptor
* @param  speed : current device speed
* @param  length : pointer to data length variable
* @retval pointer to descriptor buffer
*/
uint8_t *  USBD_USR_ManufacturerStrDescriptor( uint8_t speed , uint16_t *length)
{
  (void) speed;

  USBD_GetString (USBD_MANUFACTURER_STRING, USBD_StrDesc, length);
  return USBD_StrDesc;
}

/**
* @brief  USBD_USR_SerialStrDescriptor
*         return the serial number string descriptor
* @param  speed : current device speed
* @param  length : pointer to data length variable
* @retval pointer to descriptor buffer
*/
uint8_t *  USBD_USR_SerialStrDescriptor( uint8_t speed , uint16_t *length)
{
  if(speed  == USB_OTG_SPEED_HIGH)
  {
    USBD_GetString (USBD_SERIALNUMBER_HS_STRING, USBD_StrDesc, length);
  }
  else
  {
    USBD_GetString (USBD_SERIALNUMBER_FS_STRING, USBD_StrDesc, length);
  }
  return USBD_StrDesc;
}

/**
* @brief  USBD_USR_ConfigStrDescriptor
*         return the configuration string descriptor
* @param  speed : current device speed
* @param  length : pointer to data length variable
* @retval pointer to descriptor buffer
*/
uint8_t *  USBD_USR_ConfigStrDescriptor( uint8_t speed , uint16_t *length)
{
  if(speed  == USB_OTG_SPEED_HIGH)
  {
    USBD_GetString (USBD_CONFIGURATION_HS_STRING, USBD_StrDesc, length);
  }
  else
  {
    USBD_GetString (USBD_CONFIGURATION_FS_STRING, USBD_StrDesc, length);
  }
  return USBD_StrDesc;
}

/**
* @brief  USBD_USR_InterfaceStrDescriptor
*         return the interface string descriptor
* @param  speed : current device speed
* @param  length : pointer to data length variable
* @retval pointer to descriptor buffer
*/
uint8_t *  USBD_USR_InterfaceStrDescriptor( uint8_t speed , uint16_t *length)
{
  if(speed == 0)
  {
    USBD_GetString (USBD_INTERFACE_HS_STRING, USBD_StrDesc, length);
  }
  else
  {
    USBD_GetString (USBD_INTERFACE_FS_STRING, USBD_StrDesc, length);
  }
  return USBD_StrDesc;
}

/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/


text:
module.exports = {
  $schema: "http://json-schema.org/draft-04/schema#",
  definitions: {},
  id: "bundleLinter plugin schema",
  properties: {
    column: {
      id: "/properties/column",
      type: "integer",
      required: false,
      optional: false
    },
    line: {
      id: "/properties/line",
      type: "integer",
      required: false,
      optional: false
    },
    message: {
      id: "/properties/message",
      type: "string"
    },
    nodeType: {
      id: "/properties/nodeType",
      type: "string",
      required: true,
      optional: false
    },
    ruleId: {
      id: "/properties/ruleId",
      type: "string",
      required: true,
      optional: false
    },
    severity: {
      id: "/properties/severity",
      type: "integer",
      enum: [0, 1, 2], //Severity should be one of the following: 0 = off, 1 = warning, 2 = error
      required: true,
      optional: false
    },
    source: {
      id: "/properties/source",
      type: "string"
    }
  },
  type: "object"
};


text:
package org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.tcl;

import lombok.ToString;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.UnlockStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.MySQLStatement;

/**
 * MySQL unlock statement.
 */
@ToString
public final class MySQLUnlockStatement extends UnlockStatement implements MySQLStatement {
}


text:
<?php

namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype;

use Symfony\Component\DependencyInjection\Attribute\When;

#[When(env: 'prod')]
#[When(env: 'dev')]
class Foo implements FooInterface, Sub\BarInterface
{
    public function __construct($bar = null, iterable $foo = null, object $baz = null)
    {
    }

    public function setFoo(self $foo)
    {
    }
}