text:
#include "vk_test.h"

RD_TEST(VK_Robustness2, VulkanGraphicsTest)
{
  static constexpr const char *Description =
      "Checks handling of NULL descriptors and NULL vertex buffers for VK_EXT_robustness2.";

  std::string common = R"EOSHADER(

#version 460 core

struct v2f
{
	vec4 pos;
	vec4 col;
	vec4 uv;
};

)EOSHADER";

  const std::string vertex = R"EOSHADER(

layout(location = 0) in vec3 Position;
layout(location = 1) in vec4 Color;
layout(location = 2) in vec4 UV;

layout(location = 0) out v2f vertOut;

void main()
{
	vertOut.pos = vec4(Position.xyz*vec3(1,-1,1), 1);
	gl_Position = vertOut.pos;
	vertOut.col = Color;
	vertOut.uv = UV;
}

)EOSHADER";

  const std::string pixel = R"EOSHADER(

layout(push_constant) uniform PushData {
  ivec4 coord;
} push;

layout(set = 0, binding = 2, std430) buffer oobbuftype
{
  vec4 arr[];
} oobbuf;

layout(set = 0, binding = 3, rgba32f) uniform coherent image2D oobImage;

layout(set = 0, binding = 10, std140) uniform constsbuf
{
  vec4 data;
} cbuf;

layout(set = 0, binding = 11) uniform sampler2D linearSampledImage;

layout(set = 0, binding = 12, std430) buffer storebuftype
{
  vec4 arr[];
} storebuf;

layout(set = 0, binding = 13, rgba32f) uniform coherent image2D storeImage;

layout(set = 1, binding = 5) uniform sampler2D linearSampledImage2;

layout(set = 1, binding = 10, std140) uniform constsbuf2
{
  vec4 data;
} cbuf2;

layout(set = 1, binding = 20, std140) uniform constsbuf3
{
  vec4 data;
} cbuf3;

layout(location = 0) in v2f vertIn;

layout(location = 0, index = 0) out vec4 Color;

void main()
{
  imageStore(oobImage, push.coord.xy, vec4(1,2,3,4));
  oobbuf.arr[push.coord.z] = vec4(1,2,3,4);
  Color = vertIn.col + storebuf.arr[0] + imageLoad(storeImage, ivec2(0, 0)) + texture(linearSampledImage, vec2(0, 0))
        + texture(linearSampledImage2, vec2(0, 0)) + cbuf.data + cbuf2.data + cbuf3.data
        + vec4(0,1,0,1);
}

)EOSHADER";

  VkPhysicalDeviceRobustness2FeaturesEXT robustnessFeatures = {
      VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT,
  };

  void Prepare(int argc, char **argv)
  {
    // require descriptor indexing
    devExts.push_back(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME);

    optDevExts.push_back(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME);

    features.robustBufferAccess = VK_TRUE;

    features.fragmentStoresAndAtomics = VK_TRUE;

    VulkanGraphicsTest::Prepare(argc, argv);

    if(!Avail.empty())
      return;

    getPhysFeatures2(&robustnessFeatures);

    if(!robustnessFeatures.nullDescriptor)
      Avail = "Feature 'nullDescriptor' not available";

    devInfoNext = &robustnessFeatures;
  }

  int main()
  {
    // initialise, create window, create context, etc
    if(!Init())
      return 3;

    bool KHR_push_descriptor = hasExt(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME);

    VkDescriptorSetLayout setlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({
        {2, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
        {3, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1, VK_SHADER_STAGE_FRAGMENT_BIT},

        {10, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
        {11, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
        {12, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
        {13, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
    }));

    VkPipelineLayout layout;

    if(KHR_push_descriptor)
    {
      VkDescriptorSetLayout pushlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo(
          {
              {5, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
              {10, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
              {20, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT},
          },
          VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));

      layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo(
          {setlayout, pushlayout},
          {
              vkh::PushConstantRange(VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Vec4i)),
          }));
    }
    else
    {
      layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo(
          {setlayout},
          {
              vkh::PushConstantRange(VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Vec4i)),
          }));
    }

    vkh::GraphicsPipelineCreateInfo pipeCreateInfo;

    pipeCreateInfo.layout = layout;
    pipeCreateInfo.renderPass = mainWindow->rp;

    pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V),
                                                                 vkh::vertexBind(1, DefaultA2V)};
    pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = {
        vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 1, DefaultA2V, col),
        vkh::vertexAttr(2, 1, DefaultA2V, uv),
    };

    pipeCreateInfo.stages = {
        CompileShaderModule(common + vertex, ShaderLang::glsl, ShaderStage::vert, "main"),
        CompileShaderModule(common + pixel, ShaderLang::glsl, ShaderStage::frag, "main"),
    };

    VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo);

    AllocatedBuffer vb(
        this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT |
                                                            VK_BUFFER_USAGE_TRANSFER_DST_BIT),
        VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}));

    vb.upload(DefaultTri);

    AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT,
                                                     VK_IMAGE_USAGE_STORAGE_BIT),
                          VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY}));
    VkImageView store_view = createImageView(vkh::ImageViewCreateInfo(
        offimg.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT));

    AllocatedBuffer store_buffer(this,
                                 vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT),
                                 VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY}));

    VkDescriptorSet descset = allocateDescriptorSet(setlayout);

    VkSampler pointsampler = createSampler(vkh::SamplerCreateInfo(VK_FILTER_NEAREST));

    while(Running())
    {
      vkh::updateDescriptorSets(
          device,
          {
              vkh::WriteDescriptorSet(descset, 2, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
                                      {vkh::DescriptorBufferInfo(store_buffer.buffer)}),
              vkh::WriteDescriptorSet(
                  descset, 3, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
                  {vkh::DescriptorImageInfo(store_view, VK_IMAGE_LAYOUT_GENERAL, VK_NULL_HANDLE)}),

              vkh::WriteDescriptorSet(descset, 10, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
                                      {vkh::DescriptorBufferInfo(VK_NULL_HANDLE)}),
              vkh::WriteDescriptorSet(descset, 11, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
                                      {vkh::DescriptorImageInfo(
                                          VK_NULL_HANDLE, VK_IMAGE_LAYOUT_UNDEFINED, pointsampler)}),
              vkh::WriteDescriptorSet(descset, 12, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
                                      {vkh::DescriptorBufferInfo(VK_NULL_HANDLE)}),
              vkh::WriteDescriptorSet(descset, 13, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
                                      {vkh::DescriptorImageInfo(
                                          VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL, VK_NULL_HANDLE)}),
          });

      VkCommandBuffer cmd = GetCommandBuffer();

      vkBeginCommandBuffer(cmd, vkh::CommandBufferBeginInfo());

      VkImage swapimg =
          StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL);

      vkCmdClearColorImage(cmd, swapimg, VK_IMAGE_LAYOUT_GENERAL,
                           vkh::ClearColorValue(0.2f, 0.2f, 0.2f, 1.0f), 1,
                           vkh::ImageSubresourceRange());

      vkh::cmdPipelineBarrier(
          cmd, {
                   vkh::ImageMemoryBarrier(0, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_UNDEFINED,
                                           VK_IMAGE_LAYOUT_GENERAL, offimg.image),
               });

      vkCmdBeginRenderPass(
          cmd, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor),
          VK_SUBPASS_CONTENTS_INLINE);

      Vec4i push = {};

      if(robustnessFeatures.robustBufferAccess2)
      {
        push.z = 1000000;
        setMarker(cmd, "robustBufferAccess2");
      }

      if(robustnessFeatures.robustImageAccess2)
      {
        push.x = push.y = 1000000;
        setMarker(cmd, "robustImageAccess2");
      }

      vkh::cmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, {descset}, {});
      vkCmdPushConstants(cmd, layout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Vec4i), &push);

      if(KHR_push_descriptor)
      {
        vkCmdPushDescriptorSetKHR(
            cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 1, 1,
            vkh::WriteDescriptorSet(
                VK_NULL_HANDLE, 5, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
                {vkh::DescriptorImageInfo(VK_NULL_HANDLE, VK_IMAGE_LAYOUT_UNDEFINED, pointsampler)}));
        vkCmdPushDescriptorSetKHR(
            cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 1, 1,
            vkh::WriteDescriptorSet(VK_NULL_HANDLE, 10, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
                                    {vkh::DescriptorBufferInfo(VK_NULL_HANDLE)}));
        vkCmdPushDescriptorSetKHR(
            cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 1, 1,
            vkh::WriteDescriptorSet(VK_NULL_HANDLE, 20, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
                                    {vkh::DescriptorBufferInfo(VK_NULL_HANDLE)}));
      }

      vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe);
      vkCmdSetViewport(cmd, 0, 1, &mainWindow->viewport);
      vkCmdSetScissor(cmd, 0, 1, &mainWindow->scissor);
      vkh::cmdBindVertexBuffers(cmd, 0, {vb.buffer, VK_NULL_HANDLE}, {0, 0});
      vkCmdDraw(cmd, 3, 1, 0, 0);

      vkCmdEndRenderPass(cmd);

      FinishUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL);

      vkEndCommandBuffer(cmd);

      Submit(0, 1, {cmd});

      Present();

      // idle the device so we can update descriptor sets every frame without needing to
      // double-buffer.
      vkDeviceWaitIdle(device);
    }

    return 0;
  }
};

REGISTER_TEST();


text:
package org.apache.ivy.plugins.repository;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

import javax.swing.event.EventListenerList;

import org.apache.ivy.core.module.descriptor.Artifact;
import org.apache.ivy.core.settings.TimeoutConstraint;

public abstract class AbstractRepository implements Repository {
    private EventListenerList listeners = new EventListenerList();

    private String name;

    private TransferEvent evt;

    private final TimeoutConstraint timeoutConstraint;

    public AbstractRepository() {
        this(null);
    }

    protected AbstractRepository(final TimeoutConstraint timeoutConstraint) {
        this.timeoutConstraint = timeoutConstraint;
    }

    public void addTransferListener(TransferListener listener) {
        listeners.add(TransferListener.class, listener);
    }

    public void removeTransferListener(TransferListener listener) {
        listeners.remove(TransferListener.class, listener);
    }

    public boolean hasTransferListener(TransferListener listener) {
        return Arrays.asList(listeners.getListeners(TransferListener.class)).contains(listener);
    }

    protected void fireTransferInitiated(Resource res, int requestType) {
        evt = new TransferEvent(this, res, TransferEvent.TRANSFER_INITIATED, requestType);
        fireTransferEvent(evt);
    }

    protected void fireTransferStarted() {
        evt.setEventType(TransferEvent.TRANSFER_STARTED);
        fireTransferEvent(evt);
    }

    protected void fireTransferStarted(long totalLength) {
        evt.setEventType(TransferEvent.TRANSFER_STARTED);
        evt.setTotalLength(totalLength);
        evt.setTotalLengthSet(true);
        fireTransferEvent(evt);
    }

    protected void fireTransferProgress(long length) {
        evt.setEventType(TransferEvent.TRANSFER_PROGRESS);
        evt.setLength(length);
        if (!evt.isTotalLengthSet()) {
            evt.setTotalLength(evt.getTotalLength() + length);
        }
        fireTransferEvent(evt);
    }

    protected void fireTransferCompleted() {
        evt.setEventType(TransferEvent.TRANSFER_COMPLETED);
        if (evt.getTotalLength() > 0 && !evt.isTotalLengthSet()) {
            evt.setTotalLengthSet(true);
        }
        fireTransferEvent(evt);
    }

    protected void fireTransferCompleted(long totalLength) {
        evt.setEventType(TransferEvent.TRANSFER_COMPLETED);
        evt.setTotalLength(totalLength);
        evt.setTotalLengthSet(true);
        fireTransferEvent(evt);
    }

    protected void fireTransferError() {
        evt.setEventType(TransferEvent.TRANSFER_ERROR);
        fireTransferEvent(evt);
    }

    protected void fireTransferError(Exception ex) {
        evt.setEventType(TransferEvent.TRANSFER_ERROR);
        evt.setException(ex);
        fireTransferEvent(evt);
    }

    protected void fireTransferEvent(TransferEvent evt) {
        Object[] listeners = this.listeners.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == TransferListener.class) {
                ((TransferListener) listeners[i + 1]).transferProgress(evt);
            }
        }
    }

    public String getFileSeparator() {
        return "/";
    }

    public String standardize(String source) {
        return source.replace('\\', '/');
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public TimeoutConstraint getTimeoutConstraint() {
        return this.timeoutConstraint;
    }

    @Override
    public String toString() {
        return getName();
    }

    public void put(Artifact artifact, File source, String destination, boolean overwrite)
            throws IOException {
        put(source, destination, overwrite);
    }

    protected void put(File source, String destination, boolean overwrite) throws IOException {
        throw new UnsupportedOperationException("put in not supported by " + getName());
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?><module codename="org.netbeans.modules.websvc.restapi/0">
    <module_version install_time="1370465726344" last="true" origin="installer" specification_version="1.24">
        <file crc="567035595" name="config/Modules/org-netbeans-modules-websvc-restapi.xml"/>
        <file crc="3924131800" name="modules/locale/org-netbeans-modules-websvc-restapi_ja.jar"/>
        <file crc="1867822461" name="modules/locale/org-netbeans-modules-websvc-restapi_pt_BR.jar"/>
        <file crc="3724026511" name="modules/locale/org-netbeans-modules-websvc-restapi_ru.jar"/>
        <file crc="1976247070" name="modules/locale/org-netbeans-modules-websvc-restapi_zh_CN.jar"/>
        <file crc="931694834" name="modules/org-netbeans-modules-websvc-restapi.jar"/>
    </module_version>
</module>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
using Windows.Storage.Search;

namespace SuperMap.WinRT.Utilities
{
    internal static class StorageHelper
    {
        public async static Task<bool> FolderExist(this StorageFolder folder, string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return false;
            }
            try
            {
                StorageFolder childFolder = await folder.GetFolderAsync(path);
                if (childFolder != null)
                {
                    return true;
                }
                return false;
            }
            catch
            {
                return false;
            }
            //QueryOptions options = new QueryOptions();
            //options.FolderDepth = FolderDepth.Deep;
            //options.UserSearchFilter = "path:" + path;
            //StorageFolderQueryResult result = folder.CreateFolderQueryWithOptions(options);
            //uint count = await result.GetItemCountAsync();
            //return count > 0;
        }

        public async static Task<bool> FileExist(this StorageFolder folder, string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return false;
            }
            try
            {
                StorageFile file = await folder.GetFileAsync(path);
                if (file != null)
                {
                    return true;
                }
                return false;
            }
            catch
            {
                return false;
            }
        }

        public async static Task FolderDelete(this StorageFolder storageFolder)
        {
            IReadOnlyList<StorageFile> files = await storageFolder.GetFilesAsync();
            foreach (StorageFile file in files)
            {
                await file.DeleteAsync(StorageDeleteOption.PermanentDelete);
            }

            IReadOnlyList<StorageFolder> folders = await storageFolder.GetFoldersAsync();
            foreach (StorageFolder folder in folders)
            {
                await folder.FolderDelete();
            }
            await storageFolder.DeleteAsync(StorageDeleteOption.PermanentDelete);
        }
    }
}


text:
'use strict';

angular.module('confusionApp')

        .controller('MenuController', ['$scope', 'menuFactory', function($scope, menuFactory) {

            $scope.tab = 1;
            $scope.filtText = '';
            $scope.showDetails = false;
            $scope.showMenu = false;
            $scope.message = "Loading ...";

            menuFactory.getDishes().query(
                function(response){
                    $scope.dishes = response;
                    $scope.showMenu = true;
                    $scope.message = "Loading ...";
                },
                function(response){
                    $scope.message = "Error: " + response.status + " " + response.statusText;
                    $scope.showMenu = false;
                }
            );

            $scope.select = function(setTab) {
                $scope.tab = setTab;

                if (setTab === 2) {
                    $scope.filtText = "appetizer";
                }
                else if (setTab === 3) {
                    $scope.filtText = "mains";
                }
                else if (setTab === 4) {
                    $scope.filtText = "dessert";
                }
                else {
                    $scope.filtText = "";
                }
            };

            $scope.isSelected = function (checkTab) {
                return ($scope.tab === checkTab);
            };

            $scope.toggleDetails = function() {
                $scope.showDetails = !$scope.showDetails;
            };
        }])

        .controller('ContactController', ['$scope', function($scope) {

            $scope.feedback = {mychannel:"", firstName:"", lastName:"", agree:false, email:"" };

            var channels = [{value:"tel", label:"Tel."}, {value:"Email",label:"Email"}];

            $scope.channels = channels;
            $scope.invalidChannelSelection = false;

        }])

        .controller('FeedbackController', ['$scope','feedbackFactory', function($scope, feedbackFactory) {

            $scope.sendFeedback = function() {

                if ($scope.feedback.agree && ($scope.feedback.mychannel == "")) {
                    $scope.invalidChannelSelection = true;
                }
                else {
                    feedbackFactory.getFeedbacks().save($scope.feedback);
                    $scope.invalidChannelSelection = false;
                    $scope.feedback = {mychannel:"", firstName:"", lastName:"", agree:false, email:"" };
                    $scope.feedback.mychannel="";
                    $scope.feedbackForm.$setPristine();
                }
            };
        }])

        .controller('DishDetailController', ['$scope', '$stateParams', 'menuFactory', function($scope, $stateParams, menuFactory) {

            $scope.showMenu = false;
            $scope.message = "Loading ...";

            $scope.dish =  menuFactory.getDishes().get(
                {id:parseInt($stateParams.id,10)},
                function(response){
                    $scope.dishes = response;
                    $scope.showMenu = true;
                    $scope.message = "Loading ...";
                },
                function(response){
                    $scope.message = "Error: " + response.status + " " + response.statusText;
                    $scope.showMenu = false;
                }
            );

        }])

        .controller('DishCommentController', ['$scope', 'menuFactory', function($scope, menuFactory) {
            $scope.mycomment = {rating:5, comment:"", author:"", date:""};
            $scope.submitComment = function () {
                $scope.mycomment.date = new Date().toISOString();
                $scope.mycomment.rating = parseInt( $scope.mycomment.rating,10);
                $scope.dish.comments.push($scope.mycomment);
                menuFactory.getDishes().update({id:$scope.dish.id}, $scope.dish);
                $scope.commentForm.$setPristine();
                $scope.mycomment = {rating:5, comment:"", author:"", date:""};
            }
        }])

        .controller('AboutController', ['$scope', 'corporateFactory', function($scope, corporateFactory){
            $scope.leaderMessage = "Loading ...";
            $scope.showLeader = false;

            corporateFactory.getLeaders().query(
                function(response){
                    $scope.leaders = response;
                    $scope.showLeader = true;
                    $scope.leaderMessage = "Loading ...";
                },
                function(response){
                    $scope.leaderMessage = "Error: " + response.status + " " + response.statusText;
                    $scope.showLeader = false;
                }
            );
        }])

        // implement the IndexController and About Controller here
        .controller('IndexController', ['$scope', 'menuFactory', 'corporateFactory', function($scope, menuFactory, corporateFactory){

            $scope.showMenu = false;
            $scope.showPromotion = false;
            $scope.showLeader = false;
            $scope.message = "Loading ...";
            $scope.promoMessage = "Loading ...";
            $scope.leaderMessage = "Loading ...";

            menuFactory.getDishes().get(
                {id:0},
                function(response){
                    $scope.featured = response;
                    $scope.showMenu = true;
                    $scope.message = "Loading ...";
                },
                function(response){
                    $scope.message = "Error: " + response.status + " " + response.statusText;
                    $scope.showMenu = false;
                }
            );

            menuFactory.getPromotions().get(
                {id:0},
                function(response){
                    $scope.promotion = response;
                    $scope.showPromotion = true;
                    $scope.promoMessage = "Loading ...";
                },
                function(response){
                    $scope.promoMessage = "Error: " + response.status + " " + response.statusText;
                    $scope.showPromotion = false;
                }
            );

            corporateFactory.getLeaders().get(
                {id:3},
                function(response){
                    $scope.chef = response;
                    $scope.showLeader = true;
                    $scope.leaderMessage = "Loading ...";
                },
                function(response){
                    $scope.leaderMessage = "Error: " + response.status + " " + response.statusText;
                    $scope.showLeader = false;
                }
            );
        }])
;


text:
<?php

namespace Anton\ShopBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\Request;
use Anton\ShopBundle\Form\ProductType;
use Anton\ShopBundle\Entity\Product;

class ProductController extends Controller
{
    /**
     * @Route("/product/page/{sku}", name="pageProduct")
     */
    public function productPageAction($sku = null)
    {
        $entityManager = $this->getDoctrine()->getManager();
        $product = $entityManager->getRepository('AntonShopBundle:Product')->findOneBySku($sku);
        if (!$product) {
            return $this->redirectToRoute('catalogue');
        }
        return $this->render('product/page_product.html.twig', [
            'product' => $product,
        ]);
    }

    /**
     * @Route("/product/add/{categoryId}", name="newProduct")
     */
    public function productNewAction(Request $request, $categoryId = null)
    {
        $entityManager = $this->getDoctrine()->getManager();
        $product = new Product();
        if ($categoryId) {
            $product->setCategory($entityManager->getReference('Anton\ShopBundle\Entity\Category', $categoryId));
        }
        $form = $this->createForm(ProductType::class, $product);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $file = $product->getPicture();
            $fileName = md5(uniqid()) . '.' . $file->guessExtension();

            $file->move(
                $this->getParameter('pictures_directory'),
                $fileName
            );
            $product->setCreatedAt(new \DateTime());
            $product->setUpdatedAt(new \DateTime());

            $product->setSku(uniqid());
            $product->setPicture($fileName);

            $entityManager->persist($product);
            $entityManager->flush();
            return $this->redirectToRoute('catalogue');
        }

        return $this->render('product/new_product.html.twig', [
            'form' => $form->createView(),
            'title_text' => 'New product',
        ]);
    }

    /**
     * @Route("/product/{sku}/edit", name="editProduct")
     */
    public function productEditAction(Request $request, $sku = null)
    {
        $entityManager = $this->getDoctrine()->getManager();
        $product = $entityManager->getRepository('AntonShopBundle:Product')->findOneBySku($sku);
        if (!$product) {
            return $this->redirectToRoute('catalogue');
        }
        $oldImagePath = $product->getPicture();
        $product->setPicture(
            new File($this->getParameter('pictures_directory') . '/' . $product->getPicture())
        );
        $form = $this->createForm(ProductType::class, $product);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $filePath = $this->getParameter('pictures_directory').'/'.$oldImagePath;
            if(file_exists($filePath)) unlink($filePath);
            $file = $product->getPicture();
            $fileName = md5(uniqid()) . '.' . $file->guessExtension();
            $file->move(
                $this->getParameter('pictures_directory'),
                $fileName
            );

            $product->setPicture($fileName);
            $product->setUpdatedAt(new \DateTime());

            $entityManager->persist($product);
            $entityManager->flush();

            return $this->redirectToRoute('catalogue');
        }

        return $this->render('product/new_product.html.twig', [
            'form' => $form->createView(),
            'title_text' => 'Edit product',
        ]);
    }

    /**
     * @Route("/product/{sku}/remove", name="removeProduct")
     */
    public function productRemoveAction(Request $request, $sku = null)
    {
        $entityManager = $this->getDoctrine()->getManager();
        $product = $entityManager->getRepository('AntonShopBundle:Product')->findOneBySku($sku);
        if (!$product) {
            return $this->redirectToRoute('catalogue');
        }
        $entityManager->remove($product);
        $entityManager->flush();
        return $this->redirectToRoute('catalogue');
    }
}


text:
package org.gradle.api.publication.maven.internal.action;

import java.io.File;

public interface MavenPublishAction {
    void setPomArtifact(File file);

    void setMainArtifact(File file);

    void addAdditionalArtifact(File file, String type, String classifier);

    void publish();
}


text:
<!doctype html>

<meta charset="utf-8">
<title>simple bingo - free online bingo web application</title>
<meta name="description" content="simple bingo is flee online game.here is no bother need to prepare the bingo machine and card.Enjoy the bingo while chatting with friends.Enjoy the game with confidence in various scenes, such as a year-end party, a New Year's party, a birthday party, a welcome party and a pick-up meeting.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/fa/favicon.ico" type="image/vnd.microsoft.icon">
<link rel="icon" href="/fa/favicon.ico" type="image/vnd.microsoft.icon">
<link rel="apple-touch-icon" sizes="57x57" href="/fa/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/fa/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/fa/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/fa/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/fa/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/fa/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/fa/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/fa/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/fa/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="/fa/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/fa/favicon-48x48.png" sizes="48x48">
<link rel="icon" type="image/png" href="/fa/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/fa/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/fa/favicon-32x32.png" sizes="32x32">
<link rel="manifest" href="/fa/manifest.json">
<base href="/">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link async href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="base.css">

simple bingo

Let's play free online bingo.

  <load *ngIf="pcFlg"></load>

Web Application

              To make a game with simple bingo , let's invite a friend.
              Number bingo card is dealt to the invited friend will be delivered.
              There is no bother need to prepare the bingo machine and card.
              Enjoy the bingo while chatting with friends.

All Free

              Simple Bingo is a WEB application (WEB site ).

              you can play by  web browser of all of the device , such as smartphone(iPhone,android) , pc(mac,windows) , tablet(iPhone,android tablet).

Bingo Machine

              Simple Bingo are all free to make the game , to invite friends , to chat with friends.

              Enjoy the game with confidence in various scenes, such as a year-end party, a New Year's party, a birthday party, a welcome party and a pick-up meeting.

          © 2016 simplebingo...

<app-root></app-root>


text:
var http = require('http')
  , express = require('express')
  , getRawBody = require('raw-body');

// Forwards any data POSTed to /events to an event-stream at /events.
// Serves files from /static otherwise.
function createServer() {
  var app = express();

  app.get('/events', function(req, res) {
    // Max timeout that fits in signed int32.
    var TIMEOUT_MAX = 0x7FFFFFFF; // 2^31-1
    req.socket.setTimeout(TIMEOUT_MAX);
    res.writeHead(200, {
      'Content-Type': 'text/event-stream',
      'Cache-Control': 'no-cache',
      'Connection': 'keep-alive',
    });
    res.write('\n\n');

    function forwardEvent(data) {
      res.write('data: ');
      res.write(data);
      res.write('\n\n');
    }

    // exploit the fact that app is an EventEmitter
    app.on('update', forwardEvent);
    req.once('close', function() {
      app.removeListener('update', forwardEvent);
    });
  });

  app.post('/events', function(req, res, next) {
    getRawBody(req, {
      length: req.headers['content-length'],
      limit: '20mb',
    }, function(err, body) {
      if (err) return next(err);
      app.emit('update', body);
      res.status(200).end();
    });
  });

  app.use(express.static(__dirname + '/static'));

  return app;
};

module.exports = createServer;


text:
package org.jboss.as.quickstarts.gwthelloworld.client.local;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsonUtils;
import com.google.gwt.dom.client.InputElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;

/**
 * Companion class to the UI declared in {@linkplain HelloWorldClient.ui.xml}.
 * Handles events and updates the DOM in response.
 *
 * @author Jonathan Fuerth <jfuerth@redhat.com>
 * @author Christian Sadilek <csadilek@redhat.com>
 */
public class HelloWorldClient {

  interface MyUiBinder extends UiBinder<Panel, HelloWorldClient> {}
  private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);

  @UiField Panel root;
  @UiField Label result;
  @UiField InputElement name;
  @UiField Button sayHelloButton;

  HelloWorldClient() {
    uiBinder.createAndBindUi(this);
    DOM.setElementAttribute(sayHelloButton.getElement(), "name", "sayHelloButton");
  }

  /**
   * Handles a click of the button by sending an AJAX request to the
   * HelloWorldResource and then updating the {@code result} label in response.
   *
   * @param e Details of the click event. Ignored by this handler.
   */
  @UiHandler("sayHelloButton")
  public void onButtonClick(ClickEvent e) {
    try {
      new RequestBuilder(RequestBuilder.GET, "hello/json/" + URL.encodePathSegment(name.getValue()))
        .sendRequest(null, new RequestCallback() {

        @Override
        public void onResponseReceived(Request request, Response response) {
          if (response.getStatusCode() == Response.SC_OK) {
            HelloResponse r = (HelloResponse) JsonUtils.safeEval(response.getText());
            result.setText(r.getResult());
          } else {
            handleError("Server responded with status code " + response.getStatusCode());
          }
        }

        @Override
        public void onError(Request request, Throwable exception) {
          handleError(exception.getMessage());
        }
      });
    } catch (RequestException exception) {
      handleError(exception.getMessage());
    }
  }

  private void handleError(String details) {
    result.setText("Sorry, can't say hello now. " + details);
  }

  /**
   * Returns the DOM fragment that this
   * @return
   */
  public Panel getElement() {
    return root;
  }

}


text:
/* @flow */

import React from 'react';
import { Field, reduxForm } from 'redux-form';
import Button from '@boldr/ui/Button';
import { Form, FormField, Control, TextFormField, SelectFormField } from '@boldr/ui/Form';

const style = {
  margin: 12,
};
type Props = {
  handleSubmit?: Function,
  reset?: Function,
  submitting?: boolean,
  fields?: Object,
  pristine?: boolean,
  input: Object,
};
const roles = [
  {
    value: 1,
    text: 'Member',
  },
  {
    value: 2,
    text: 'Staff',
  },
  {
    value: 3,
    text: 'Admin',
  },
];
const EditMemberForm = (props: Props) => {
  const { handleSubmit, reset } = props;
  return (
    <Form onSubmit={handleSubmit} className="boldr-form__generic">
      <Field id="email" name="email" type="email" label="Email" component={TextFormField} />
      <Field
        id="firstName"
        name="firstName"
        type="text"
        label="First name"
        component={TextFormField}
      />
      <Field
        id="lastName"
        name="lastName"
        type="text"
        label="Last name"
        component={TextFormField}
      />
      <Field id="username" name="username" type="text" label="Username" component={TextFormField} />
      <Field
        id="avatarUrl"
        name="avatarUrl"
        type="text"
        label="Avatar URL"
        component={TextFormField}
      />
      <Field
        id="user-role"
        name="role"
        type="select"
        component={SelectFormField}
        label="Role"
        options={roles}
      />
      <FormField isGrouped>
        <Control>
          <Button htmlType="submit" style={style} kind="primary">
            Save
          </Button>
        </Control>
        <Control>
          <Button onClick={reset} style={style} kind="secondary">
            Reset
          </Button>
        </Control>
      </FormField>
    </Form>
  );
};

export default reduxForm({
  form: 'editMemberForm',
})(EditMemberForm);


text:
echo "=========================================================="
echo "CREATE DOCKER IMAGE FOR ef_oracle_database-migrate"
echo "=========================================================="
echo "Copying the db scripts to the docker context..."
mkdir -p docker/ef_oracle_database-migrate/db_scripts
if [ -d db_scripts ]; then
  cp -R db_scripts/* docker/ef_oracle_database-migrate/db_scripts
fi

cd docker/ef_oracle_database-migrate

echo "Building a docker image of the database migrator..."
docker build -t bmcrlm/ef_oracle_database-migrate:${COMPONENT_VERSION} .

#echo "Pushing the docker image to the docker hub..."
#docker push bmcrlm/ef_oracle_database-migrate:${COMPONENT_VERSION}

#echo "Removing the image from the local repository..."
#docker rmi bmcrlm/ef_oracle_database-migrate:${COMPONENT_VERSION}


text:
<?php

// begins template. -------------------------------------------------------------------------
get_header();
get_sidebar();
?>

                <?php
                the_archive_title('
', '
');
                the_archive_description('
', '
');
                ?>

            <?php
            if (have_posts()) {
                $Bsb4Design = new \BootstrapBasic4\Bsb4Design();
                while (have_posts()) {
                    the_post();
                    get_template_part('template-parts/content', 'page');
                    echo "\n\n";

                    $Bsb4Design->pagination();
                    echo "\n\n";

                    // If comments are open or we have at least one comment, load up the comment template
                    if (comments_open() || '0' != get_comments_number()) {
                        comments_template();
                    }
                    echo "\n\n";
                }// endwhile;

                unset($Bsb4Design);
            } else {
                get_template_part('template-parts/section', 'no-results');
            }// endif;
            ?>

<?php
get_sidebar();
get_footer();


text:
<?php

/*
 * This file is part of Sulu.
 *
 * (c) Sulu GmbH
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Sulu\Bundle\FormBundle\Dynamic\Types;

use Sulu\Bundle\FormBundle\Dynamic\FormFieldTypeConfiguration;
use Sulu\Bundle\FormBundle\Dynamic\FormFieldTypeInterface;
use Sulu\Bundle\FormBundle\Entity\FormField;
use Symfony\Component\Form\Extension\Core\Type\EmailType as TypeEmailType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\Email as EmailConstraint;

/**
 * The Email form field type.
 */
class EmailType implements FormFieldTypeInterface
{
    use SimpleTypeTrait;

    public function getConfiguration(): FormFieldTypeConfiguration
    {
        return new FormFieldTypeConfiguration(
            'sulu_form.email',
            __DIR__ . '/../../Resources/config/form-fields/field_example_default.xml'
        );
    }

    public function build(FormBuilderInterface $builder, FormField $field, string $locale, array $options): void
    {
        $options['constraints'][] = new EmailConstraint();
        $type = TypeEmailType::class;
        $builder->add($field->getKey(), $type, $options);
    }
}


text:
import ExpandWorker from './expand.worker';

import React from 'react';
import PropTypes from 'prop-types';
import RafCanvas from './RafCanvas';

class RafCanvasRenderView extends React.Component {
  constructor(props) {
    super(props);
    this.canvas = null;
    this.renderer = null;
    this.isCancelling = false;
  }

  shouldComponentUpdate() {
    return false;
  }

  draw() {
    const { params, commands, rules, axiom, iterations } = this.props;
    this.renderer = new RafCanvas(this.canvas, params, commands);

    // Expanding the l-system can be a very heavy task, so run it in a seperate thread.
    const worker = new ExpandWorker();
    worker.postMessage({
      type: 'RUN',
      value: {
        rules,
        axiom,
        iterations,
      }
    })

    worker.onmessage = (e) => {
      // Teardown the worker
      worker.postMessage({ type: 'CLOSE' });

      const instructions = e.data;

      this.renderer.draw(instructions, () => {
        if (!this.isCancelling) {
          this.props.onFinish();
        }

        this.isCancelling = false;
      });
    }
  }

  cancel(onCancelDone) {
    this.isCancelling = true;
    this.renderer.cancel(onCancelDone);
  }

  render() {
    return (
      <canvas ref={(c) => { this.canvas = c; }} />
    );
  }
}

RafCanvasRenderView.defaultProps = {
};

RafCanvasRenderView.propTypes = {
  params: PropTypes.object,
  commands: PropTypes.object,
  axiom: PropTypes.string.isRequired,
  rules: PropTypes.array.isRequired,
  iterations: PropTypes.number.isRequired,
};

export default RafCanvasRenderView;


text:
/**
 * This file contains validation and AJAX script relate to Login, Register and Forgot Password forms
 */
(function ($) {
    "use strict";

    /**
     * Modal dialog for Login and Register
     */
    $('.activate-section').click(function(e){
        e.preventDefault();
        var $this = $(this);
        var target_section = $this.data('section');
        $this.closest('.modal-section').hide();
        $this.closest('.forms-modal').find('.'+target_section).show();
    });

    if ( jQuery().validate && jQuery().ajaxSubmit ) {

        /**
         * AJAX Login Form
         */

        var loginButton = $('#login-button'),
            loginAjaxLoader = $('#login-loader'),
            loginError = $("#login-error" ),
            loginMessage = $('#login-message');

        var loginOptions = {
            beforeSubmit: function () {
                loginMessage.fadeOut( 50 );
                loginError.fadeOut( 50 );
                loginButton.attr('disabled', 'disabled');
                loginAjaxLoader.fadeIn( 200 );
            },
            success: function (ajax_response, statusText, xhr, $form) {
                var response = $.parseJSON( ajax_response );
                loginAjaxLoader.fadeOut( 100 );
                loginButton.removeAttr('disabled');
                if ( response.success ) {
                    loginMessage.html( response.message ).fadeIn( 200 );
                    if ( window.location.href == response.redirect ) {
                        window.location.reload( true );
                    } else {
                        window.location.replace( response.redirect );
                    }
                } else {
                    loginError.html( response.message ).fadeIn( 200 );
                }
            }
        };

        $('#login-form').validate({
            submitHandler: function ( form ) {
                $(form).ajaxSubmit( loginOptions );
            }
        });

        /**
         * AJAX Register Form
         */
        var registerButton = $('#register-button'),
            registerAjaxLoader = $('#register-loader'),
            registerError = $("#register-error" ),
            registerMessage = $('#register-message');

        var registerOptions = {
            beforeSubmit: function () {
                registerButton.attr('disabled', 'disabled');
                registerAjaxLoader.fadeIn('fast');
                registerMessage.fadeOut('fast');
                registerError.fadeOut('fast');
            },
            success: function (ajax_response, statusText, xhr, $form) {
                var response = $.parseJSON( ajax_response );
                registerAjaxLoader.fadeOut('fast');
                registerButton.removeAttr('disabled');
                if ( response.success ) {
                    registerMessage.html( response.message ).fadeIn('fast');
                    $form.resetForm();
                } else {
                    registerError.html( response.message ).fadeIn('fast');
                }
            }
        };

        $('#register-form').validate({
            rules: {
                register_username: {
                    required: true
                },
                register_email: {
                    required: true,
                    email: true
                }
            },
            submitHandler: function ( form ) {
                $(form).ajaxSubmit( registerOptions );
            }
        });

        /**
         * Forgot Password Form
         */
        var forgotButton = $('#forgot-button'),
            forgotAjaxLoader = $('#forgot-loader'),
            forgotError = $("#forgot-error" ),
            forgotMessage = $('#forgot-message');

        var forgotOptions = {
            beforeSubmit: function () {
                forgotButton.attr('disabled', 'disabled');
                forgotAjaxLoader.fadeIn('fast');
                forgotMessage.fadeOut('fast');
                forgotError.fadeOut('fast');
            },
            success: function (ajax_response, statusText, xhr, $form) {
                var response = $.parseJSON( ajax_response );
                forgotAjaxLoader.fadeOut('fast');
                forgotButton.removeAttr('disabled');
                if ( response.success ) {
                    forgotMessage.html( response.message ).fadeIn('fast');
                    $form.resetForm();
                } else {
                    forgotError.html( response.message ).fadeIn('fast');
                }
            }
        };

        $('#forgot-form').validate({
            submitHandler: function ( form ) {
                $(form).ajaxSubmit( forgotOptions );
            }
        });

    }

    /**
     * Forgot Form
     */
    $('.login-register #forgot-form').slideUp('fast');
    $('.login-register .toggle-forgot-form').click(function(event){
        event.preventDefault();
        $('.login-register #forgot-form').slideToggle('fast');
    });

})(jQuery);


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Build.Tasks
{
    /// <summary>
    /// Main class for the COM reference resolution task
    /// </summary>
    public sealed partial class ResolveComReference
    {
        /// <summary>
        /// Passed to the "Transform" property on the TlbImp task to indicate
        /// what transforms, if any, to apply to the type library during
        /// assembly generation
        /// </summary>
        internal enum TlbImpTransformFlags
        {
            /// <summary>
            /// No transforms should be applied.
            /// </summary>
            None,

            /// <summary>
            /// Transforms [out, retval] parameters of methods on dispatch-only
            /// interfaces into return values.
            /// </summary>
            TransformDispRetVals,

            /// <summary>
            /// Mark all value classes as serializable.
            /// </summary>
            SerializableValueClasses
        }

        /// <summary>
        /// Defines the "TlbImp" MSBuild task, which enables using TlbImp.exe
        /// to generate assemblies from type libraries.
        /// </summary>
        internal class TlbImp : AxTlbBaseTask
        {
            #region Properties

            /// <summary>
            /// Type library being imported to an assembly.
            /// </summary>
            public string TypeLibName
            {
                get => (string)Bag[nameof(TypeLibName)];
                set => Bag[nameof(TypeLibName)] = value;
            }

            /// <summary>
            /// Namespace of the generated assembly
            /// </summary>
            public string AssemblyNamespace
            {
                get => (string)Bag[nameof(AssemblyNamespace)];
                set => Bag[nameof(AssemblyNamespace)] = value;
            }

            /// <summary>
            /// Version of the generated assembly
            /// </summary>
            public Version AssemblyVersion
            {
                get => (Version)Bag[nameof(AssemblyVersion)];
                set => Bag[nameof(AssemblyVersion)] = value;
            }

            /// <summary>
            /// Create an assembly for the specified machine type
            /// Supported machine types:
            ///  X86
            ///  X64
            ///  Itanium
            ///  Agnostic
            /// </summary>
            public string Machine
            {
                get => (string)Bag[nameof(Machine)];
                set => Bag[nameof(Machine)] = value;
            }

            /// <summary>
            /// If true, suppresses displaying the logo
            /// </summary>
            public bool NoLogo
            {
                get => GetBoolParameterWithDefault(nameof(NoLogo), false);
                set => Bag[nameof(NoLogo)] = value;
            }

            /// <summary>
            /// File name of assembly to be produced.
            /// </summary>
            public string OutputAssembly
            {
                get => (string)Bag[nameof(OutputAssembly)];
                set => Bag[nameof(OutputAssembly)] = value;
            }

            /// <summary>
            /// If true, prevents TlbImp from adding members to classes
            /// </summary>
            public bool PreventClassMembers
            {
                get => GetBoolParameterWithDefault(nameof(PreventClassMembers), false);
                set => Bag[nameof(PreventClassMembers)] = value;
            }

            /// <summary>
            /// If true, import the SAFEARRAY type as System.Arrays
            /// </summary>
            public bool SafeArrayAsSystemArray
            {
                get => GetBoolParameterWithDefault(nameof(SafeArrayAsSystemArray), false);
                set => Bag[nameof(SafeArrayAsSystemArray)] = value;
            }

            /// <summary>
            /// If true, prevents AxImp from displaying success message.
            /// </summary>
            public bool Silent
            {
                get => GetBoolParameterWithDefault(nameof(Silent), false);
                set => Bag[nameof(Silent)] = value;
            }

            /// <summary>
            /// Transformation to be applied to the resulting assembly.
            /// </summary>
            public TlbImpTransformFlags Transform
            {
                get => GetTlbImpTransformFlagsParameterWithDefault(nameof(Transform), TlbImpTransformFlags.None);
                set => Bag[nameof(Transform)] = value;
            }

            /// <summary>
            /// If true, AxImp prints more information.
            /// </summary>
            public bool Verbose
            {
                get => GetBoolParameterWithDefault(nameof(Verbose), false);
                set => Bag[nameof(Verbose)] = value;
            }

            /// <summary>
            /// References to dependency assemblies.
            /// </summary>
            public string[] ReferenceFiles
            {
                get => (string[])Bag[nameof(ReferenceFiles)];
                set => Bag[nameof(ReferenceFiles)] = value;
            }

            #endregion // Properties

            #region ToolTask Members

            /// <summary>
            /// Returns the name of the tool to execute
            /// </summary>
            protected override string ToolName => "TlbImp.exe";

            /// <summary>
            /// Fills the provided CommandLineBuilderExtension with all the command line options used when
            /// executing this tool
            /// </summary>
            /// <param name="commandLine">Gets filled with command line commands</param>
            protected internal override void AddCommandLineCommands(CommandLineBuilderExtension commandLine)
            {
                // .ocx file being imported
                commandLine.AppendFileNameIfNotNull(TypeLibName);

                // options
                commandLine.AppendSwitchIfNotNull("/asmversion:", (AssemblyVersion != null) ? AssemblyVersion.ToString() : null);
                commandLine.AppendSwitchIfNotNull("/namespace:", AssemblyNamespace);
                commandLine.AppendSwitchIfNotNull("/machine:", Machine);
                commandLine.AppendWhenTrue("/noclassmembers", Bag, "PreventClassMembers");
                commandLine.AppendWhenTrue("/nologo", Bag, "NoLogo");
                commandLine.AppendSwitchIfNotNull("/out:", OutputAssembly);
                commandLine.AppendWhenTrue("/silent", Bag, "Silent");
                commandLine.AppendWhenTrue("/sysarray", Bag, "SafeArrayAsSystemArray");
                commandLine.AppendSwitchIfNotNull("/transform:", ConvertTransformFlagsToCommandLineCommand(Transform));
                commandLine.AppendWhenTrue("/verbose", Bag, "Verbose");
                if (ReferenceFiles != null)
                {
                    foreach (var referenceFile in ReferenceFiles)
                    {
                        commandLine.AppendSwitchIfNotNull("/reference:", referenceFile);
                    }
                }

                base.AddCommandLineCommands(commandLine);
            }

            /// <summary>
            /// Validates the parameters passed to the task
            /// </summary>
            /// <returns>True if parameters are valid</returns>
            protected override bool ValidateParameters()
            {
                // Verify that we were actually passed a .tlb to import
                if (String.IsNullOrEmpty(TypeLibName))
                {
                    Log.LogErrorWithCodeFromResources("TlbImp.NoInputFileSpecified");
                    return false;
                }

                // Verify that an allowed combination of TlbImpTransformFlags has been
                // passed to the Transform property.
                if (!ValidateTransformFlags())
                {
                    Log.LogErrorWithCodeFromResources("TlbImp.InvalidTransformParameter", Transform.ToString());
                    return false;
                }

                return base.ValidateParameters();
            }

            /// <summary>
            /// Returns the TlbImpTransformFlags value stored in the hashtable under the provided
            /// parameter, or the default value passed if the value in the hashtable is null
            /// </summary>
            /// <param name="parameterName">The parameter used to retrieve the value from the hashtable</param>
            /// <param name="defaultValue">The default value to return if the hashtable value is null</param>
            /// <returns>The value contained in the hashtable, or if that's null, the default value passed to the method</returns>
            private TlbImpTransformFlags GetTlbImpTransformFlagsParameterWithDefault(string parameterName, TlbImpTransformFlags defaultValue)
            {
                object obj = Bag[parameterName];
                return (obj == null) ? defaultValue : (TlbImpTransformFlags)obj;
            }

            /// <summary>
            /// Verifies that an allowed combination of TlbImpTransformFlags has been
            /// passed to the Transform property.
            /// </summary>
            /// <returns>True if Transform is valid and false otherwise</returns>
            private bool ValidateTransformFlags()
            {
                // Any flag on its own is fine ...
                switch (Transform)
                {
                    case TlbImpTransformFlags.None:
                        return true;
                    case TlbImpTransformFlags.SerializableValueClasses:
                        return true;
                    case TlbImpTransformFlags.TransformDispRetVals:
                        return true;
                }

                // ... But any and all other combinations of flags are disallowed.
                return false;
            }

            /// <summary>
            /// Converts a given flag to the equivalent parameter passed to the /transform:
            /// option of tlbimp.exe
            /// </summary>
            /// <param name="flags">The TlbImpTransformFlags being converted</param>
            /// <returns>A string that can be passed to /transform: on the command line</returns>
            private static string ConvertTransformFlagsToCommandLineCommand(TlbImpTransformFlags flags)
            {
                switch (flags)
                {
                    case TlbImpTransformFlags.None:
                        return null;
                    case TlbImpTransformFlags.SerializableValueClasses:
                        return "SerializableValueClasses";
                    case TlbImpTransformFlags.TransformDispRetVals:
                        return "DispRet";
                }

                return null;
            }

            #endregion // ToolTask Members
        }
    }
}


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee181361d24">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Eastern District of Pennsylvania</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2011-12-23</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2011-01-18</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-paed-2_10-cv-01457</identifier>
<identifier type="local">P0b002ee181361d24</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2011-12-23</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2011-12-23</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-paed-2_10-cv-01457</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-paed-2_10-cv-01457</accessId>
 <courtType>District</courtType>
 <courtCode>paed</courtCode>
 <courtCircuit>3rd</courtCircuit>
 <courtState>Pennsylvania</courtState>
 <courtSortOrder>2421</courtSortOrder>
 <caseNumber>2:10-cv-01457</caseNumber>
 <caseOffice>Philadelphia</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>442</natureSuitCode>
 <natureSuit>Civil Rights Employment</natureSuit>
 <party fullName="KEYSTONE HELICOPTER CORPORATION" lastName="KEYSTONE HELICOPTER CORPORATION" role="Defendant"></party>
 <party fullName="KEYSTONE HELICOPTER HOLDINGS, INC." lastName="KEYSTONE HELICOPTER HOLDINGS, INC." role="Defendant"></party>
 <party firstName="LAURIE" fullName="LAURIE ROOT" lastName="ROOT" role="Plaintiff"></party>
 <party fullName="SIKORSKY AIRCRAFT CORPORATION" lastName="SIKORSKY AIRCRAFT CORPORATION" role="Defendant"></party>
 <party fullName="UNITED TECHNOLOGIES CORPORATION" lastName="UNITED TECHNOLOGIES CORPORATION" role="Defendant"></party>
</extension>
<titleInfo>
 <title>ROOT v. KEYSTONE HELICOPTER CORPORATION</title>
 <partNumber>2:10-cv-01457</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-paed-2_10-cv-01457/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">2:10-cv-01457;10-1457</identifier>
<name type="corporate">
 <namePart>United States District Court Eastern District of Pennsylvania</namePart>
 <namePart>3rd Circuit</namePart>
 <namePart>Philadelphia</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>KEYSTONE HELICOPTER CORPORATION</displayForm>
 <namePart type="family">KEYSTONE HELICOPTER CORPORATION</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>KEYSTONE HELICOPTER HOLDINGS, INC.</displayForm>
 <namePart type="family">KEYSTONE HELICOPTER HOLDINGS, INC.</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>LAURIE ROOT</displayForm>
 <namePart type="family">ROOT</namePart>
 <namePart type="given">LAURIE</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>SIKORSKY AIRCRAFT CORPORATION</displayForm>
 <namePart type="family">SIKORSKY AIRCRAFT CORPORATION</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>UNITED TECHNOLOGIES CORPORATION</displayForm>
 <namePart type="family">UNITED TECHNOLOGIES CORPORATION</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-paed-2_10-cv-01457</accessId>
 <courtType>District</courtType>
 <courtCode>paed</courtCode>
 <courtCircuit>3rd</courtCircuit>
 <courtState>Pennsylvania</courtState>
 <courtSortOrder>2421</courtSortOrder>
 <caseNumber>2:10-cv-01457</caseNumber>
 <caseOffice>Philadelphia</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>442</natureSuitCode>
 <natureSuit>Civil Rights Employment</natureSuit>
 <party fullName="KEYSTONE HELICOPTER CORPORATION" lastName="KEYSTONE HELICOPTER CORPORATION" role="Defendant"></party>
 <party fullName="KEYSTONE HELICOPTER HOLDINGS, INC." lastName="KEYSTONE HELICOPTER HOLDINGS, INC." role="Defendant"></party>
 <party firstName="LAURIE" fullName="LAURIE ROOT" lastName="ROOT" role="Plaintiff"></party>
 <party fullName="SIKORSKY AIRCRAFT CORPORATION" lastName="SIKORSKY AIRCRAFT CORPORATION" role="Defendant"></party>
 <party fullName="UNITED TECHNOLOGIES CORPORATION" lastName="UNITED TECHNOLOGIES CORPORATION" role="Defendant"></party>
 <state>Pennsylvania</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-paed-2_10-cv-01457-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_10-cv-01457/USCOURTS-paed-2_10-cv-01457-0/mods.xml">
 <titleInfo>
  <title>ROOT v. KEYSTONE HELICOPTER CORPORATION</title>
  <subTitle>MEMORANDUM AND ORDER THAT DEFENDANT KEYSTONE HELICOPTER CORPORATION MOTION FOR SUMMARY JUDGMENT IS DENIED; ETC.. SIGNED BY HONORABLE ROBERT F. KELLY ON 1/18/11. 1/18/11 ENTERED AND E-MAILED.(jl, )</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2011-01-18</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-paed-2_10-cv-01457-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1814683ca</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_10-cv-01457/USCOURTS-paed-2_10-cv-01457-0</identifier>
 <identifier type="former granule identifier">paed-2_10-cv-01457_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_10-cv-01457/USCOURTS-paed-2_10-cv-01457-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-paed-2_10-cv-01457/pdf/USCOURTS-paed-2_10-cv-01457-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:10-cv-01457; ROOT v. KEYSTONE HELICOPTER CORPORATION; </searchTitle>
  <courtName>United States District Court Eastern District of Pennsylvania</courtName>
  <state>Pennsylvania</state>
  <accessId>USCOURTS-paed-2_10-cv-01457-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2011-01-18</dateIssued>
  <docketText>MEMORANDUM AND ORDER THAT DEFENDANT KEYSTONE HELICOPTER CORPORATION MOTION FOR SUMMARY JUDGMENT IS DENIED; ETC.. SIGNED BY HONORABLE ROBERT F. KELLY ON 1/18/11. 1/18/11 ENTERED AND E-MAILED.(jl, )</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-paed-2_10-cv-01457-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_10-cv-01457/USCOURTS-paed-2_10-cv-01457-1/mods.xml">
 <titleInfo>
  <title>ROOT v. KEYSTONE HELICOPTER CORPORATION</title>
  <subTitle>ORDER THAT DEFENDANT KEYSTONE HELICOPTER CORPORATION'S MOTION FOR SUMMARY JUDGMENT IS DENIED; ETC.. SIGNED BY HONORABLE ROBERT F. KELLY ON 1/18/11. 1/18/11 ENTERED AND E-MAILED.(jl, )</subTitle>
  <partNumber>1</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2011-01-18</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-paed-2_10-cv-01457-1.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1814683cb</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_10-cv-01457/USCOURTS-paed-2_10-cv-01457-1</identifier>
 <identifier type="former granule identifier">paed-2_10-cv-01457_1.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_10-cv-01457/USCOURTS-paed-2_10-cv-01457-1/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-paed-2_10-cv-01457/pdf/USCOURTS-paed-2_10-cv-01457-1.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:10-cv-01457; ROOT v. KEYSTONE HELICOPTER CORPORATION; </searchTitle>
  <courtName>United States District Court Eastern District of Pennsylvania</courtName>
  <state>Pennsylvania</state>
  <accessId>USCOURTS-paed-2_10-cv-01457-1</accessId>
  <sequenceNumber>1</sequenceNumber>
  <dateIssued>2011-01-18</dateIssued>
  <docketText>ORDER THAT DEFENDANT KEYSTONE HELICOPTER CORPORATION'S MOTION FOR SUMMARY JUDGMENT IS DENIED; ETC.. SIGNED BY HONORABLE ROBERT F. KELLY ON 1/18/11. 1/18/11 ENTERED AND E-MAILED.(jl, )</docketText>
</extension>
</relatedItem>
</mods>


text:
import logging

from ginga import GingaPlugin
from ginga.gtkw import GtkHelp
import gtk
import pango

class Log(GingaPlugin.GlobalPlugin):

    def __init__(self, fv):
        # superclass defines some variables for us, like logger
        super(Log, self).__init__(fv)

        self.histlimit = 100
        self.histmax = 10000
        self.levels = (('Error', logging.ERROR),
                       ('Warn',  logging.WARN),
                       ('Info',  logging.INFO),
                       ('Debug', logging.DEBUG))

    def build_gui(self, container):
        self.msgFont = pango.FontDescription("Fixed 10")
        tw = gtk.TextView()
        tw.set_wrap_mode(gtk.WRAP_NONE)
        tw.set_left_margin(4)
        tw.set_right_margin(4)
        tw.set_editable(False)
        tw.set_left_margin(4)
        tw.set_right_margin(4)
        tw.modify_font(self.msgFont)
        self.tw = tw
        self.buf = self.tw.get_buffer()

        sw = gtk.ScrolledWindow()
        sw.set_border_width(2)
        sw.set_policy(gtk.POLICY_AUTOMATIC,
                      gtk.POLICY_AUTOMATIC)
        sw.add(self.tw)

        container.pack_start(sw, fill=True, expand=True)

        hbox = gtk.HBox()

        lbl = gtk.Label('Level:')
        hbox.pack_start(lbl, fill=False, expand=False)
        combobox = GtkHelp.combo_box_new_text()
        for (name, level) in self.levels:
            combobox.append_text(name)
        combobox.set_active(1)
        combobox.sconnect('changed', self.set_loglevel_cb)
        hbox.pack_start(combobox, fill=False, expand=False,
                        padding=4)

        lbl = gtk.Label('History:')
        hbox.pack_start(lbl, fill=False, expand=False)
        spinbox = GtkHelp.SpinButton()
        adj = spinbox.get_adjustment()
        adj.configure(self.histlimit, 100, self.histmax, 10, 100, 0)
        spinbox.sconnect('value-changed', self.set_history_cb)
        hbox.pack_start(spinbox, fill=False, expand=False,
                        padding=4)

        btn = gtk.Button("Clear")
        btn.connect('clicked', lambda w: self.clear())
        hbox.pack_end(btn, fill=False, expand=False)
        container.pack_end(hbox, fill=False, expand=False)

    def set_history(self, histlimit):
        assert histlimit <= self.histmax, \
               Exception("Limit exceeds maximum value of %d" % (self.histmax))
        self.histlimit = histlimit
        self.logger.debug("Logging history limit set to %d" % (
            histlimit))
        self.history_housekeeping()

    def set_history_cb(self, rng):
        histlimit = rng.get_value()
        self.set_history(histlimit)

    def history_housekeeping(self):
        # remove some lines to keep us within our history limit
        numlines = self.buf.get_line_count()
        if numlines > self.histlimit:
            rmcount = int(numlines - self.histlimit)
            start = self.buf.get_iter_at_line(0)
            end   = self.buf.get_iter_at_line(rmcount)
            self.buf.delete(start, end)

    def set_loglevel_cb(self, w):
        index = w.get_active()
        name, level = self.levels[index]
        self.fv.set_loglevel(level)
        self.logger.info("GUI log level changed to '%s'" % (
            name))

    def log(self, text):
        end = self.buf.get_end_iter()
        self.buf.insert(end, text + '\n')

        self.history_housekeeping()

        # scroll window to end of buffer
        end = self.buf.get_end_iter()
        mark = self.buf.get_insert()
        #self.tw.scroll_to_iter(end, 0.5)
        # TODO: this is causing a segfault if the text widget is
        # not mapped yet!
        #self.buf.move_mark(mark, end)
        #res = self.tw.scroll_to_mark(mark, 0.2, True)

    def clear(self):
        start = self.buf.get_start_iter()
        end = self.buf.get_end_iter()
        self.buf.delete(start, end)
        return True

    def __str__(self):
        return 'log'

#END


text:
Furgovw SMF Topic Competition
===========

Best Topic Annual Competition (SMF)

Online at [www.furgovw.org/concurso/](http://www.furgovw.org/concurso/)


text:
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';
import Img from 'gatsby-image';

import * as Styled from './styles';

const Logo = () => {
  const { site, placeholderImage } = useStaticQuery(graphql`
    query {
      site {
        siteMetadata {
          title
        }
      }
      placeholderImage: file(relativePath: { eq: "profile.jpg" }) {
        childImageSharp {
          fluid(maxWidth: 80) {
            ...GatsbyImageSharpFluid
          }
        }
      }
    }
  `);

  const logoTitle = site.siteMetadata.title;
  const logoImage = placeholderImage.childImageSharp.fluid;

  return (
    <Styled.Logo to="/">
      <Styled.Image>
        <Img fluid={logoImage} alt={logoTitle} />
      </Styled.Image>
      <Styled.Text>{logoTitle}</Styled.Text>
    </Styled.Logo>
  );
};

export default Logo;


text:
import asyncio

async def phase(i):
    print('in phase {}'.format(i))
    await asyncio.sleep(0.5 - (0.1 * i))
    print('done with phase {}'.format(i))
    return 'phase {} result'.format(i)

async def main(num_phases):
    print('starting main')
    phases = [
        phase(i)
        for i in range(num_phases)
    ]
    print('waiting for phases to complete')
    results = []
    for next_to_complete in asyncio.as_completed(phases):
        answer = await next_to_complete
        print('received answer {!r}'.format(answer))
        results.append(answer)
    print('results: {!r}'.format(results))
    return results

event_loop = asyncio.get_event_loop()
try:
    event_loop.run_until_complete(main(3))
finally:
    event_loop.close()


text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview
 * A class for attempting some unreliable operation until it succeeds.  Sort of
 * an asynchronous while loop.
 *
 *   (new mr.Retry(attempt, 500, 10)).start().then(onSuccess, onFailure);
 *
 * The next attempt is driven by the failure of current attempt. Thus, there is
 * at most one attempt invocation at any time.
 */

goog.module('mr.Retry');

const PromiseResolver = goog.require('mr.PromiseResolver');
const {assert} = goog.require('mr.Assertions');

const BACKOFF_FACTOR = 2;

/**
 * An object that attempts some operation until it succeeds.
 *
 * @template R
 */
class Retry {
  /**
   * @param {function():!Promise<R>} onAttempt An
   *     idempotent function to call repeatedly until it succeeds.
   * @param {number} retryDelay The number of milliseconds to wait between the
   *     start of one attempt and the start of the next. It must be positive.
   *     More precisely, this is the amount of time to wait between the failure
   *     of one call to onAttempt().
   * @param {number} maxAttempts The maximum number of attempts.
   *     It must be positive.
   */
  constructor(onAttempt, retryDelay, maxAttempts) {
    assert(maxAttempts > 0);
    assert(retryDelay > 0);

    /** @private @const */
    this.onAttempt_ = onAttempt;

    /** @private {number} */
    this.retryDelay_ = retryDelay;

    /** @private @const */
    this.maxAttempts_ = maxAttempts;

    /**
     * The number of times `onAttempt_` has been called.
     * @private {number}
     */
    this.numAttemptsStarted_ = 0;

    /** @private {boolean} */
    this.isFinished_ = false;

    /**
     * The ID of the most recently created timer.
     * @private {?number}
     */
    this.timerId_ = null;

    /** @private {?PromiseResolver} */
    this.resolver_ = null;
  }

  /**
   * Starts running this object.
   *
   * This method starts an asynchronous process that repeatedly calls
   * `onAttempt`.
   *
   * For each attempt, `onAttempt` is called. When `onAttempt`
   * resolves, the returned promise is resolved with the same result.
   * The returned promise rejects if `abort` is called on this object,
   * or the number of attempts specified by `setMaxAttempts` is reached.
   *
   * @return {!Promise<R>}
   * @template R
   */
  start() {
    if (this.resolver_ != null) {
      throw new Error('Cannot call Retry.start more than once.');
    }
    this.resolver_ = new PromiseResolver();
    this.retryOnce_();
    return this.resolver_.promise;
  }

  /**
   * Makes the next call to `onAttempt_`.
   * @private
   */
  retryOnce_() {
    this.timerId_ = null;
    if (this.isFinished_) {
      // The abort method has been called, don't start a new attempt.
      return;
    }

    this.numAttemptsStarted_++;
    this.onAttempt_().then(
        result => {
          this.cleanup_();
          this.resolver_.resolve(result);
        },
        error => {
          if (this.numAttemptsStarted_ >= this.maxAttempts_) {
            // Maximum number of attempts has been reached, do not try again.
            this.cleanup_();
            this.resolver_.reject(error);
          } else {
            this.timerId_ =
                setTimeout(this.retryOnce_.bind(this), this.retryDelay_);
            this.retryDelay_ *= BACKOFF_FACTOR;
          }
        });
  }

  /**
   * Causes this object to stop making attempts and puts it in a
   * finished state.  May be called any time after `start`.
   * @param {*=} error
   */
  abort(error = undefined) {
    this.cleanup_();
    this.resolver_.reject(error === undefined ? new Error('abort') : error);
  }

  /**
   * @private
   */
  cleanup_() {
    if (this.timerId_ != null) {
      // Clean up any timer, because it will be a no-op when it fires.
      clearTimeout(this.timerId_);
      this.timerId_ = null;
    }

    this.isFinished_ = true;
  }
}

exports = Retry;


text:
Package.describe({
  summary: 'A solution for the allow/deny vs methods dilemma',
  name: 'mquandalle:collection-mutations',
  version: '0.1.0',
  documentation: null,
});

Package.onUse(function(api) {
  api.versionsFrom('1.2-rc.7');
  api.use('mongo');
  api.use('ecmascript');
  api.use('underscore');
  api.use('dburles:collection-helpers@1.0.0');
  api.addFiles('mutations.js');
});


text:
import json
import logging
import ochopod
import os
import pykka
import sys
import tempfile
import time
import shutil

from flask import Flask, request, render_template
from ochopod.core.fsm import diagnostic, spin_lock
from ochopod.core.utils import shell
from os.path import join
from subprocess import Popen, PIPE

logger = logging.getLogger('ochopod')
web = Flask(__name__)

if __name__ == '__main__':

    try:

        #
        # - parse our ochopod hints
        # - enable CLI logging
        # - pass down the ZK ensemble coordinate
        #
        env = os.environ
        hints = json.loads(env['ochopod'])
        ochopod.enable_cli_log(debug=hints['debug'] == 'true')
        env['OCHOPOD_ZK'] = hints['zk']

        @web.route('/shell', methods=['POST'])
        def _from_curl():
            tmp = tempfile.mkdtemp()
            try:

                #
                # - download each multi-part file to a temporary folder
                #
                for tag, upload in request.files.items():
                    where = join(tmp, tag)
                    logger.debug('http -> upload @ %s' % where)
                    upload.save(where)

                #
                # - get the shell snippet to run from the X-Shell header
                # - use the 'toolset' python package that's installed in the container
                # - open it
                #
                ts = time.time()
                line = request.headers['X-Shell']
                logger.debug('http -> shell request "%s"' % line)
                pid = Popen('toolset %s' % line, shell=True, stdout=PIPE, stderr=PIPE, env=env, cwd=tmp)

                #
                # - wait for completion
                # - return as json ('out' contains the verbatim dump from the sub-process stdout)
                #
                pid.wait()
                ms = 1000 * (time.time() - ts)
                return json.dumps({'ok': pid.returncode == 0, 'ms': int(ms), 'out': pid.stdout.read()})

            except Exception as failure:

                why = diagnostic(failure)
                logger.warning('unexpected failure -> %s' % why)
                return json.dumps({'ok': False, 'out': 'unexpected failure -> %s' % why})

            finally:

                #
                # - make sure to cleanup our temporary directory
                #
                shutil.rmtree(tmp)

        @web.route('/shell', methods=['GET'])
        def _from_web_shell():
            tmp = tempfile.mkdtemp()
            try:

                #
                # - get the shell snippet from the uri
                # - use the 'toolset' python package that's installed in the container
                # - open it
                #
                ts = time.time()
                line = request.args.get('line', 0, type=str)
                logger.debug('http -> shell request "%s"' % line)
                pid = Popen('toolset %s' % line, shell=True, stdout=PIPE, stderr=PIPE, env=env, cwd=tmp)

                #
                # - wait for completion
                # - return as json ('out' contains the verbatim dump from the sub-process stdout)
                #
                pid.wait()
                ms = 1000 * (time.time() - ts)
                return json.dumps({'ok': pid.returncode == 0, 'ms': int(ms), 'out': pid.stdout.read()})

            except Exception as failure:

                why = diagnostic(failure)
                logger.warning('unexpected failure -> %s' % why)
                return json.dumps({'ok': False, 'out': 'unexpected failure -> %s' % why})

            finally:

                #
                # - make sure to cleanup our temporary directory
                #
                shutil.rmtree(tmp)

        @web.route('/')
        def index():

            #
            # - index.html contains all the jquery magic that will run the shell and
            #   use ajax to I/O with us
            #
            return render_template('index.html')

        #
        # - run our flask endpoint on TCP 9000
        #
        web.run(host='0.0.0.0', port=9000, threaded=True)

    except Exception as failure:

        logger.fatal('unexpected condition -> %s' % diagnostic(failure))

    finally:

        sys.exit(1)


text:
/*
 * EIoBufferWrapper.hh
 *
 *  Created on: 2016-7-6
 *      Author: cxxjava@lotuseed.com
 */

#ifndef EIOBUFFERWRAPPER_HH_
#define EIOBUFFERWRAPPER_HH_

#include "./EIoBuffer.hh"

namespace efc {
namespace eio {

/**
 * A {@link IoBuffer} that wraps a buffer and proxies any operations to it.
 *

 * You can think this class like a {@link FilterOutputStream}.  All operations
 * are proxied by default so that you can extend this class and override existing
 * operations selectively.  You can introduce new operations, too.
 *
 * @author Apache MINA Project
 */

class EIoBufferWrapper: public EIoBuffer {
public:
	virtual ~EIoBufferWrapper();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* duplicate();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* slice();

	/**
	 * {@inheritDoc}
	 */
	virtual void free();

	/**
	 * {@inheritDoc}
	 */
	virtual EIOByteBuffer* buf();

	/**
	 * {@inheritDoc}
	 */
	virtual boolean isDerived();

	/**
	 * {@inheritDoc}
	 */
	virtual boolean isReadOnly();

	/**
	 * {@inheritDoc}
	 */
	virtual int minimumCapacity();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* minimumCapacity(int minimumCapacity);

	/**
	 * {@inheritDoc}
	 */
	virtual int capacity();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* capacity(int newCapacity);

	/**
	 * {@inheritDoc}
	 */
	virtual boolean isAutoExpand();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* setAutoExpand(boolean autoExpand);

	/**
	 * {@inheritDoc}
	 */
	virtual boolean isAutoShrink();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* setAutoShrink(boolean autoShrink);

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* expand(int expectedRemaining);

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* expand(int position, int expectedRemaining);

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* shrink();

	/**
	 * {@inheritDoc}
	 */
	virtual int position();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* position(int newPosition);

	/**
	 * {@inheritDoc}
	 */
	virtual int limit();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* limit(int newLimit);

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* mark();

	/**
	 * {@inheritDoc}
	 */
	virtual int markValue();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* reset();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* clear();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* sweep();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* sweep(byte value);

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* flip();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* rewind();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* compact();

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* skip(int size);

	/**
	 * {@inheritDoc}
	 */
	virtual int indexOf(byte b);

	/**
	 * {@inheritDoc}
	 */
	virtual int remaining();

	/**
	 * {@inheritDoc}
	 */
	virtual boolean hasRemaining();

	/**
	 * {@inheritDoc}
	 */
	virtual EString getHexdump(int lengthLimit=16);

	/**
	 * {@inheritDoc}
	 */
	virtual int compareTo(EIoBuffer* that);

	/**
	 * {@inheritDoc}
	 */
	virtual EString toString();

	/**
	 * {@inheritDoc}
	 */
	virtual void* address();

	/**
	 * {@inheritDoc}
	 */
	virtual void* current();

public:
	/**
	 * {@inheritDoc}
	 */
	virtual byte get();

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* put(byte b);

    /**
	 * {@inheritDoc}
	 */
	virtual byte get(int index);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* put(int index, byte b);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* get(void* dst, int size, int length);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* get(EA<byte>* dst);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* getSlice(int index, int length); //!

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* getSlice(int length); //!

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* put(EIOByteBuffer* src);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* put(EIoBuffer* src);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* put(const void* src, int length);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* put(EA<byte>* src);

    /**
	 * {@inheritDoc}
	 */
	virtual char getChar();

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putChar(char value);

    /**
	 * {@inheritDoc}
	 */
	virtual char getChar(int index);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putChar(int index, char value);

    /**
	 * {@inheritDoc}
	 */
	virtual short getShort();

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putShort(short value);

    /**
	 * {@inheritDoc}
	 */
	virtual short getShort(int index);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putShort(int index, short value);

    /**
	 * {@inheritDoc}
	 */
	virtual int getInt();

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putInt(int value);

    /**
	 * {@inheritDoc}
	 */
	virtual int getInt(int index);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putInt(int index, int value);

    /**
	 * {@inheritDoc}
	 */
	virtual llong getLLong();

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putLLong(llong value);

    /**
	 * {@inheritDoc}
	 */
	virtual llong getLLong(int index);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putLLong(int index, llong value);

    /**
	 * {@inheritDoc}
	 */
	virtual float getFloat();

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putFloat(float value);

    /**
	 * {@inheritDoc}
	 */
	virtual float getFloat(int index);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putFloat(int index, float value);

    /**
	 * {@inheritDoc}
	 */
	virtual double getDouble();

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putDouble(double value);

    /**
	 * {@inheritDoc}
	 */
	virtual double getDouble(int index);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putDouble(int index, double value);

    /**
	 * {@inheritDoc}
	 */
	virtual EString getString();

    /**
	 * {@inheritDoc}
	 */
	virtual EString getString(int fieldSize);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putString(const char* val);

    /**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* putString(const char* val, int fieldSize);

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* fill(byte value, int size);

	/**
	 * {@inheritDoc}
	 */
	virtual EIoBuffer* fillAndReset(byte value, int size);

public:
    /**
	 * {@inheritDoc}
	 */
	virtual EInputStream* asInputStream();

    /**
	 * {@inheritDoc}
	 */
	virtual EOutputStream* asOutputStream();

protected:
	/**
	 * Create a new instance.
	 * @param buf the buffer to be proxied
	 */
	EIoBufferWrapper(EIoBuffer* buf);

	/**
	 * @return the parent buffer that this buffer wrapped.
	 */
	EIoBuffer* getParentBuffer();

private:
	/**
	 * The buffer proxied by this proxy.
	 */
	EIoBuffer* buf_;
};

} /* namespace eio */
} /* namespace efc */
#endif /* EIOBUFFERWRAPPER_HH_ */


text:
/**
 * @provides aphront-tokenizer-control-css
 * @requires aphront-typeahead-control-css
 * @requires phui-tag-view-css
 */

body div.jx-tokenizer {
  background: transparent;
  position: relative;
  width: 100%;
  overflow: hidden;
}

body div.jx-tokenizer-container {
  position: relative;
  display: block;
  padding: 0 0 2px 0;
  min-height: 30px;
  height: auto;
}

var.jx-tokenizer-metrics {
  position: absolute;
  left: 20px;
  top: 20px;
}

body input.jx-tokenizer-input {
  border: 1px solid transparent;
  border-width: 1px 0px;
  padding: 3px;
  outline: none;
  float: left;
  width: 100%;
  border-shadow: none;
  box-shadow: none;
  -webkit-box-shadow: none;
  font-size: {$normalfontsize};
  color: #333;
  height: 26px;
}

body input.jx-tokenizer-input:focus {
  box-shadow: none;
  -webkit-box-shadow: none;
  border-color: transparent;
}

body input.jx-typeahead-placeholder {
  margin-left: 4px;
  color: {$greytext};
}

a.jx-tokenizer-x {
  margin-left: 4px;
  color: {$bluetext};
  float: right;
}

a.jx-tokenizer-x:hover {
  color: {$darkbluetext};
  text-decoration: none;
}

a.jx-tokenizer-token {
  padding: 2px 6px;
  border:  1px solid {$lightblueborder};
  margin: 3px 2px 0 4px;
  background-color: {$sh-bluebackground};
  float: left;
  cursor: pointer;
  border-radius: 3px;
  color: {$sh-bluetext};
  min-height: 16px;
}

a.jx-tokenizer-token:hover {
  text-decoration: none;
  border-color: {$sh-blueborder};
}

.jx-tokenizer-token .phui-icon-view {
  display: inline-block;
  margin: 2px 4px -3px 0;
  color: {$sh-blueicon};
}

a.jx-tokenizer-token-function {
  border-color: {$sh-lightgreyborder};
  background: #fff;
}

a.jx-tokenizer-token-function:hover {
  background: #fff;
}

a.jx-tokenizer-token-disabled {
  background-color: {$sh-disabledbackground};
  border-color: {$sh-lightdisabledborder};
  color: {$sh-disabledtext};
}

a.jx-tokenizer-token-disabled:hover {
  border-color: {$sh-disabledborder};
  background-color: {$sh-disabledbackground};
}

.jx-tokenizer-token-disabled .phui-icon-view {
  color: {$sh-disabledicon};
}

a.jx-tokenizer-token-invalid {
  border-color: {$sh-lightredborder};
  background: {$sh-redbackground};
  color: {$sh-redtext};
}

a.jx-tokenizer-token-invalid:hover {
  border-color: {$sh-redborder};
  background: {$sh-redbackground};
}

.jx-tokenizer-token-invalid .phui-icon-view {
  color: {$sh-redicon};
}

.tokenizer-result {
  position: relative;
  padding: 5px 8px 5px 28px;
}

.tokenizer-result .phui-icon-view {
  display: inline-block;
  width: 24px;
  height: 24px;
  position: absolute;
  top: 5px;
  left: 8px;
}

.tokenizer-result-closed {
  color: {$greytext};
}

.tokenizer-closed {
  margin-top: 2px;
}

.jx-tokenizer-frame .button.tokenizer-browse-button {
  display: none;
}

.jx-tokenizer-frame.has-browse .button.tokenizer-browse-button {
  display: block;
}

.jx-tokenizer-frame.has-browse {
  position: relative;
}

.jx-tokenizer-frame.has-browse div.jx-tokenizer-container {
  padding-right: 32px;
}

.button.tokenizer-browse-button {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  border-radius: 0;
  border-right: none;
  border-top: none;
  border-bottom: none;
  padding: 0;
  width: 30px;
}

.button.tokenizer-browse-button .phui-icon-view {
  top: 7px;
  left: 9px;
}


text:
CREATE TABLE `user` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) DEFAULT NULL,
  `lastloggedin` int(10) DEFAULT NULL,
  `balance` decimal(9,2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;


text:
**Severity Level: Warning**

## Description

Empty catch blocks are considered a poor design choice as they result in the errors occurring in a `try` block not being acted upon.

While this does not inherently lead to issues, they should be avoided wherever possible.

## How

Use ```Write-Error``` or ```throw``` statements within the catch block.

## Example

### Wrong

``` PowerShell
try
{
	1/0
}
catch [DivideByZeroException]
{
}
```

### Correct

``` PowerShell
try
{
	1/0
}
catch [DivideByZeroException]
{
	Write-Error "DivideByZeroException"
}

try
{
	1/0
}
catch [DivideByZeroException]
{
	Throw "DivideByZeroException"
}
```


text:
HtmlConverter is a PHP library that provides easy HTML-to-Text conversion. This is useful, for example, for
automatically creating plain text parts of HTML emails.

[![Build Status](https://travis-ci.org/bicpi/HtmlConverter.svg?branch=master)](https://travis-ci.org/bicpi/HtmlConverter)

## Usage

1. Create converter
2. Call `->convert($html)` method
3. Enjoy returned plain text

### SimpleConverter

The `SimpleConverter` works on every PHP enabled system by using PHP's `strip_tags()` function and putting some HTML
entity decoding on top.

```php
<?php

use bicpi\HtmlConverter\Converter\SimpleConverter;

$html = '... <h1>... you HTML content ...</h1> ...';
$converter = new SimpleConverter();
$plain = $converter->convert($html);
```

### LynxConverter

The `LynxConverter` works on every system with the `lynx` text browser package installed. The converted plain text
is equivalent to what you would see when opening the HTML in `lynx`. This is currently the most useful converter as
it provides the best results and includes all links as references.

```php
<?php

use bicpi\HtmlConverter\Converter\LynxConverter;

$html = '... <h1>... you HTML content ...</h1> ...';
$converter = new LynxConverter();
$plain = $converter->convert($html);
```

### Html2TextConverter

The `Html2TextConverter` works on every system with the `html2text` package installed. The converted plain text
is equivalent to what you would see when passing the HTML on the command line to the `html2text` command. The result
is quite nice but be aware that links will be removed. Hence, this should not be used for converting a whole web page
or marketing email. May be useful for small chunks of HTML code.

```php
<?php

use bicpi\HtmlConverter\Converter\Html2TextConverter;

$html = '... <h1>... you HTML content ...</h1> ...';
$converter = new Html2TextConverter();
$plain = $converter->convert($html);
```

### ChainConverter

The `ChainConverter` offers converter chaining so that the first appropriate converter will handle the conversion.

```php
<?php

use bicpi\HtmlConverter\Converter\ChainConverter;
use bicpi\HtmlConverter\Converter\LynxConverter;
use bicpi\HtmlConverter\Converter\SimpleConverter;

$html = '... <h1>... you HTML content ...</h1> ...';
$converter = new ChainConverter();
$converter->addConverter(new LynxConverter());
$converter->addConverter(new SimpleConverter());
$plain = $converter->convert($html);
```
In the above example the conversion will be handled by the `LynxConverter` - provided that the `lynx` package is
available. If not, the `SimpleConverter` will be used as a fallback. This for instance would be useful when deploying
to a machine without `lynx` installed but a development machine without the package - e.g. Windows.

## Running unit tests

To setup and run tests follow these steps:

1. Go to the root directory of this library
2. Run: `composer install`
3. Run: `./vendor/bin/phpunit`


text:
'use strict'

// NOTE: change test info in package.json

const db = require('APP/db')
const User = db.model('user')

import chai from 'chai'
// import chaiProperties from 'chai-properties'
// import chaiThings from 'chai-things'
// chai.use(chaiProperties)
// chai.use(chaiThings)
const expect = chai.expect
import supertest from 'supertest'
import sinon from 'sinon'

/* global describe it before afterEach */

console.log('testing users!')

describe('User', () => {
  before('Await database sync', () => db.didSync)
  afterEach('Sync and clear database', () => db.sync({force: true}))

  describe('User model validations', () => {
    it('requires email', () => {
      const user = User.build()
      return user.validate()
        .then(err => {
          expect(err).to.be.an('object')
        })
    })
  })

  describe('User authentication', () => {
    it('resolves true if the password matches', () =>
      User.create({ password: 'ok' })
        .then(user => user.authenticate('ok'))
        .then(result => expect(result).to.be.true))

    it("resolves false if the password doesn't match", () =>
      User.create({ password: 'ok' })
        .then(user => user.authenticate('not ok'))
        .then(result => expect(result).to.be.false))
  })
})