text:
sap.ui.define(["sap/ui/layout/form/SimpleForm", "sap/ui/layout/VerticalLayout", "sap/m/Text", "sap/m/Label", "sap/m/Button"], function(SimpleForm, VerticalLayout, Text, Label, Button) {
	"use strict";
	sap.ui.jsview("sap.uxap.sample.SharedBlocks.goals.GoalsBlock", {
		getControllerName: function () {
			return "sap.uxap.sample.SharedBlocks.goals.GoalsBlockController";
		},
		createContent: function (oController) {
			var oForm = new SimpleForm({
				maxContainerCols: 1,
				layout: "ResponsiveGridLayout",
				width: "100%",
				content: new VerticalLayout({
					content: [
						new Label({text: "Evangelize the UI framework accross the company", design: "Bold"}),
						new Text({text: "4 days overdue Cascaded"}),
						new Text({text: " "}),
						new Label({text: "Get trained in development management direction", design: "Bold"}),
						new Text({text: "Due Nov 21"}),
						new Text({text: " "}),
						new Label({text: "Mentor junior developers", design: "Bold"}),
						new Text({text: "Due Dec 31 Cascaded"}),
						new Button({text: "Hello from a JS View", press: oController.onBtnPress})
					]
				})
			});
			return oForm;
		}
	});
});


text:
#include <aws/codeartifact/model/PackageOriginConfiguration.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace CodeArtifact
{
namespace Model
{

PackageOriginConfiguration::PackageOriginConfiguration() :
    m_restrictionsHasBeenSet(false)
{
}

PackageOriginConfiguration::PackageOriginConfiguration(JsonView jsonValue) :
    m_restrictionsHasBeenSet(false)
{
  *this = jsonValue;
}

PackageOriginConfiguration& PackageOriginConfiguration::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("restrictions"))
  {
    m_restrictions = jsonValue.GetObject("restrictions");

    m_restrictionsHasBeenSet = true;
  }

  return *this;
}

JsonValue PackageOriginConfiguration::Jsonize() const
{
  JsonValue payload;

  if(m_restrictionsHasBeenSet)
  {
   payload.WithObject("restrictions", m_restrictions.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace CodeArtifact
} // namespace Aws

redpajama_set_name: RedPajamaGithub


text:
/* Generated code */

interface File {

	sourceFile?: string;

	originalFileName?: string;
}

export default File;


text:
$global:ps_test_tag_name = 'crptestps6050'

function get_vm_config_object
{
    param ([string] $rgname, [string] $vmsize)

    $st = Write-Verbose "Creating VM Config Object - Start";

    $vmname = $rgname + 'vm';
    $p = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize;

    $st = Write-Verbose "Creating VM Config Object - End";

    return $p;
}

function get_created_storage_account_name
{
    param ([string] $loc, [string] $rgname)

    $st = Write-Verbose "Creating and getting storage account for '${loc}' and '${rgname}' - Start";

    $stoname = $rgname + 'sto';
    $stotype = 'Standard_GRS';

    $st = Write-Verbose "Creating and getting storage account for '${loc}' and '${rgname}' - '${stotype}' & '${stoname}'";

    $st = New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype;
    $st = Set-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Tags (Get-ComputeTestTag $global:ps_test_tag_name);
    $st = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname;

    $st = Write-Verbose "Creating and getting storage account for '${loc}' and '${rgname}' - End";

    return $stoname;
}

function create_and_setup_nic_ids
{
    param ([string] $loc, [string] $rgname, $vmconfig)

    $st = Write-Verbose "Creating and getting NICs for '${loc}' and '${rgname}' - Start";

    $subnet = New-AzureRmVirtualNetworkSubnetConfig -Name ($rgname + 'subnet') -AddressPrefix "10.0.0.0/24";
    $vnet = New-AzureRmVirtualNetwork -Force -Name ($rgname + 'vnet') -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -Subnet $subnet -Tag (Get-ComputeTestTag $global:ps_test_tag_name);
    $vnet = Get-AzureRmVirtualNetwork -Name ($rgname + 'vnet') -ResourceGroupName $rgname;
    $subnetId = $vnet.Subnets[0].Id;
    $nic_ids = @($null) * 1;
    $nic0 = New-AzureRmNetworkInterface -Force -Name ($rgname + 'nic0') -ResourceGroupName $rgname -Location $loc -SubnetId $subnetId -Tag (Get-ComputeTestTag $global:ps_test_tag_name);
    $nic_ids[0] = $nic0.Id;
    $vmconfig = Add-AzureRmVMNetworkInterface -VM $vmconfig -Id $nic0.Id;
    $st = Write-Verbose "Creating and getting NICs for '${loc}' and '${rgname}' - End";

    return $nic_ids;
}

function create_and_setup_vm_config_object
{
    param ([string] $loc, [string] $rgname, [string] $vmsize)

    $st = Write-Verbose "Creating and setting up the VM config object for '${loc}', '${rgname}' and '${vmsize}' - Start";

    $vmconfig = get_vm_config_object $rgname $vmsize

    $user = "Foo12";
    $password = $rgname + "BaR#123";
    $securePassword = ConvertTo-SecureString $password -AsPlainText -Force;
    $cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword);
    $computerName = $rgname + "cn";
    $vmconfig = Set-AzureRmVMOperatingSystem -VM $vmconfig -Windows -ComputerName $computerName -Credential $cred;

    $st = Write-Verbose "Creating and setting up the VM config object for '${loc}', '${rgname}' and '${vmsize}' - End";

    return $vmconfig;
}

function setup_image_and_disks
{
    param ([string] $loc, [string] $rgname, [string] $stoname, $vmconfig)

    $st = Write-Verbose "Setting up image and disks of VM config object jfor '${loc}', '${rgname}' and '${stoname}' - Start";

    $osDiskName = 'osDisk';
    $osDiskVhdUri = "https://$stoname.blob.core.windows.net/test/os.vhd";
    $osDiskCaching = 'ReadWrite';

    $vmconfig = Set-AzureRmVMOSDisk -VM $vmconfig -Name $osDiskName -VhdUri $osDiskVhdUri -Caching $osDiskCaching -CreateOption FromImage;

    # Image Reference
    $imgRef = Get-DefaultCRPImage -loc $loc;
    $vmconfig = ($imgRef | Set-AzureRmVMSourceImage -VM $vmconfig);

    # Do not add any data disks
    $vmconfig.StorageProfile.DataDisks = $null;

    $st = Write-Verbose "Setting up image and disks of VM config object jfor '${loc}', '${rgname}' and '${stoname}' - End";

    return $vmconfig;
}

function ps_vm_dynamic_test_func_2_crptestps4847
{
    # Setup
    $rgname = 'crptestps4847';

    try
    {
        $loc = 'Southeast Asia';
        $vmsize = 'Standard_A0';

        $st = Write-Verbose "Running Test ps_vm_dynamic_test_func_2_crptestps4847 - Start ${rgname}, ${loc} & ${vmsize}";

        $st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_2_crptestps4847 - Creating Resource Group';
        $st = New-AzureRmResourceGroup -Location $loc -Name $rgname -Tag (Get-ComputeTestTag $global:ps_test_tag_name) -Force;

        $vmconfig = create_and_setup_vm_config_object $loc $rgname $vmsize;

        # Setup Storage Account
        $stoname = get_created_storage_account_name $loc $rgname;

        # Setup Network Interface IDs
        $nicids = create_and_setup_nic_ids $loc $rgname $vmconfig;

        # Setup Image and Disks
        $st = setup_image_and_disks $loc $rgname $stoname $vmconfig;

        # Virtual Machine
        $st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_2_crptestps4847 - Creating VM';

        $vmname = $rgname + 'vm';

        $st = New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $vmconfig -Tags (Get-ComputeTestTag $global:ps_test_tag_name);

        # Get VM
        $st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_2_crptestps4847 - Getting VM';
        $vm1 = Get-AzureRmVM -Name $vmname -ResourceGroupName $rgname;

        # Remove
        $st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_2_crptestps4847 - Removing VM';
        $st = Remove-AzureRmVM -Name $vmname -ResourceGroupName $rgname -Force;

        $st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_2_crptestps4847 - End';
    }
    finally
    {
        # Cleanup
        Clean-ResourceGroup $rgname
    }
}


text:
[![Build Status](https://github.com/dikiaap/mangan/workflows/build/badge.svg)](https://github.com/dikiaap/mangan/actions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

![Mangan Jekyll Theme](https://files.dikiaap.id/img/open-source/mangan_preview.png)

## Requirements
- Ruby >= 3.1
- RubyGems
- Linux, Unix, or macOS
- Git

## Install

Fork, then rename to `username.github.io`, and clone to your computer.

```shell
git clone https://github.com/username/username.github.io
cd username.github.io
sudo gem install jekyll jekyll-paginate jekyll-sitemap jemoji
jekyll build
jekyll serve
```

If looks good, then deploy to GitHub.

```shell
git add -u
git add .
git commit -m "Message"
git push
```

Visit your website now and custom what you want! :sparkles:

## What's in there?

 * Fast website
 * Emoji support
 * Geek theme
 * Instagram view
 * Pagination
 * SEO friendly
 * URI
 * More!

## Demo

See demo [here](https://mangan.dikiaap.id).

More features? you can visit [Jekyll Docs](https://jekyllrb.com/docs/).

## License

MIT © [Diki Ananta](https://dikiaap.id)


text:
.. _Table-Of-Content-Feature2D:

*feature2d* module. 2D Features framework
-----------------------------------------------------------

Learn about how to use the feature points  detectors, descriptors and matching framework found inside OpenCV.

.. include:: ../../definitions/tocDefinitions.rst

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |Harris|             **Title:** :ref:`harris_detector`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        Why is it a good idea to track corners? We learn to use the Harris method to detect corners

  ===================== ==============================================

  .. |Harris| image:: images/trackingmotion/Harris_Detector_Cover.jpg
                   :height: 90pt
                   :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |ShiTomasi|          **Title:** :ref:`good_features_to_track`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        Where we use an improved method to detect corners more accuratelyI

  ===================== ==============================================

  .. |ShiTomasi| image:: images/trackingmotion/Shi_Tomasi_Detector_Cover.jpg
                      :height: 90pt
                      :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |GenericCorner|      **Title:** :ref:`generic_corner_detector`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        Here you will learn how to use OpenCV functions to make your personalized corner detector!

  ===================== ==============================================

  .. |GenericCorner| image:: images/trackingmotion/Generic_Corner_Detector_Cover.jpg
                          :height: 90pt
                          :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |Subpixel|           **Title:** :ref:`corner_subpixeles`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        Is pixel resolution enough? Here we learn a simple method to improve our accuracy.

  ===================== ==============================================

  .. |Subpixel| image:: images/trackingmotion/Corner_Subpixeles_Cover.jpg
                     :height: 90pt
                     :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |FeatureDetect|      **Title:** :ref:`feature_detection`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        In this tutorial, you will use *features2d* to detect interest points.

  ===================== ==============================================

  .. |FeatureDetect| image:: images/Feature_Detection_Tutorial_Cover.jpg
                     :height: 90pt
                     :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |FeatureDescript|    **Title:** :ref:`feature_description`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        In this tutorial, you will use *features2d* to calculate feature vectors.

  ===================== ==============================================

  .. |FeatureDescript| image:: images/Feature_Description_Tutorial_Cover.jpg
                       :height: 90pt
                       :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |FeatureFlann|       **Title:** :ref:`feature_flann_matcher`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        In this tutorial, you will use the FLANN library to make a fast matching.

  ===================== ==============================================

  .. |FeatureFlann| image:: images/Feature_Flann_Matcher_Tutorial_Cover.jpg
                    :height: 90pt
                    :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |FeatureHomo|        **Title:** :ref:`feature_homography`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_AnaH|

                        In this tutorial, you will use *features2d* and *calib3d* to detect an object in a scene.

  ===================== ==============================================

  .. |FeatureHomo| image:: images/Feature_Homography_Tutorial_Cover.jpg
                   :height: 90pt
                   :width:  90pt

+
  .. tabularcolumns:: m{100pt} m{300pt}
  .. cssclass:: toctableopencv

  ===================== ==============================================
   |DetectPlanar|       **Title:** :ref:`detectionOfPlanarObjects`

                        *Compatibility:* > OpenCV 2.0

                        *Author:* |Author_VictorE|

                        You will use *features2d* and *calib3d* modules for detecting known planar objects in scenes.

  ===================== ==============================================

  .. |DetectPlanar| image:: images/detection_of_planar_objects.png
                     :height: 90pt
                     :width:  90pt

.. raw:: latex

   \pagebreak

.. toctree::
   :hidden:

   ../feature_description/feature_description
   ../trackingmotion/harris_detector/harris_detector
   ../feature_flann_matcher/feature_flann_matcher
   ../feature_homography/feature_homography
   ../trackingmotion/good_features_to_track/good_features_to_track.rst
   ../trackingmotion/generic_corner_detector/generic_corner_detector
   ../trackingmotion/corner_subpixeles/corner_subpixeles
   ../feature_detection/feature_detection
   ../feature_flann_matcher/feature_flann_matcher
   ../feature_homography/feature_homography
   ../detection_of_planar_objects/detection_of_planar_objects


text:
/** Contiene las definiciones de los comandos APDU relacionados con la tarjeta CERES.
 * @author Tomás García-Merás */
package es.gob.jmulticard.apdu.ceres;


text:
/*
 * $Id: ts_generator.cpp 6655 2014-12-12 20:42:53Z calabrese_p $
 *
 *
 * Distributed under the OpenDDS License.
 * See: http://www.opendds.org/license.html
 */

#include "ts_generator.h"
#include "be_extern.h"

#include "utl_identifier.h"

#include "ace/OS_NS_sys_stat.h"

#include <cstring>
#include <fstream>
#include <sstream>
#include <map>
#include <iostream>

namespace {
  std::string read_template(const char* prefix)
  {
    const char* dds_root = ACE_OS::getenv("DDS_ROOT");
    if (!dds_root) {
      ACE_DEBUG((LM_ERROR, "The environment variable DDS_ROOT must be set.\n"));
      BE_abort();
    }
    std::string path = dds_root;
    path.append("/dds/idl/");
    path.append(prefix);
    path.append("Template.txt");
    std::ifstream ifs(path.c_str());
    std::ostringstream oss;
    oss << ifs.rdbuf();
    return oss.str();
  }

  void replaceAll(std::string& s,
                  const std::map<std::string, std::string>& rep) {
    typedef std::map<std::string, std::string>::const_iterator mapiter_t;
    for (size_t i = s.find("<%"); i < s.length(); i = s.find("<%", i + 1)) {
      size_t n = s.find("%>", i) - i + 2;
      mapiter_t iter = rep.find(s.substr(i + 2, n - 4));
      if (iter != rep.end()) {
        s.replace(i, n, iter->second);
      }
    }
  }

  template<size_t N>
  void add_includes(const char* (&includes)[N],
                    BE_GlobalData::stream_enum_t whichStream) {
    for (size_t i = 0; i < N; ++i) {
      be_global->add_include(includes[i], whichStream);
    }
  }

}

ts_generator::ts_generator()
  : idl_template_(read_template("IDL"))
  , h_template_(read_template("H"))
  , cpp_template_(read_template("CPP"))
{
}

bool ts_generator::gen_struct(UTL_ScopedName* name,
  const std::vector<AST_Field*>&, const char*)
{
  if (idl_global->is_dcps_type(name) == 0) {
    // no #pragma DCPS_DATA_TYPE, so nothing to generate
    return true;
  }

  static const char* idl_includes[] = {
    "dds/DdsDcpsInfrastructure.idl", "dds/DdsDcpsTopic.idl",
    "dds/DdsDcpsPublication.idl", "dds/DdsDcpsSubscriptionExt.idl",
    "dds/DdsDcpsTypeSupportExt.idl"
  };
  add_includes(idl_includes, BE_GlobalData::STREAM_IDL);

  std::string dc = be_global->header_name_.c_str();
  dc.replace(dc.end() - 6, dc.end() - 2, "C"); // s/Impl.h$/C.h/
  be_global->add_include(dc.c_str());

  static const char* h_includes[] = {
    "dds/DCPS/DataWriterImpl.h", "dds/DCPS/DataReaderImpl.h",
    "dds/DCPS/TypeSupportImpl.h",
    "dds/DCPS/Dynamic_Cached_Allocator_With_Overflow_T.h",
    "dds/DCPS/SubscriptionInstance.h"
  };
  add_includes(h_includes, BE_GlobalData::STREAM_H);

  static const char* cpp_includes[] = {
    "dds/DCPS/debug.h", "dds/DCPS/Registered_Data_Types.h",
    "dds/DdsDcpsDomainC.h", "dds/DCPS/Service_Participant.h",
    "dds/DCPS/Qos_Helper.h", "dds/DCPS/PublicationInstance.h",
    "dds/DCPS/PublisherImpl.h", "dds/DCPS/SubscriberImpl.h",
    "dds/DCPS/ReceivedDataElementList.h", "dds/DCPS/RakeResults_T.h",
    "dds/DCPS/BuiltInTopicUtils.h", "dds/DCPS/Util.h",
    "dds/DCPS/ContentFilteredTopicImpl.h", "dds/DCPS/RakeData.h",
    "dds/DCPS/MultiTopicDataReader_T.h"
  };
  add_includes(cpp_includes, BE_GlobalData::STREAM_CPP);

  std::map<std::string, std::string> replacements;
  replacements["SCOPED"] = scoped(name);
  replacements["TYPE"] = name->last_component()->get_string();
  replacements["EXPORT"] = be_global->export_macro().c_str();
  replacements["SEQ"] = be_global->sequence_suffix().c_str();

  TS_NamespaceGuard idlGuard(name, be_global->idl_, "module");
  std::string idl = idl_template_;
  replaceAll(idl, replacements);
  be_global->idl_ << idl;

  TS_NamespaceGuard hGuard(name, be_global->header_);
  std::string h = h_template_;
  replaceAll(h, replacements);
  be_global->header_ << h;

  TS_NamespaceGuard cppGuard(name, be_global->impl_);
  std::string cpp = cpp_template_;
  replaceAll(cpp, replacements);
  be_global->impl_ << cpp;
  return true;
}

bool ts_generator::gen_union(UTL_ScopedName* name,
  const std::vector<AST_UnionBranch*>&, AST_Type*, const char*)
{
  if (idl_global->is_dcps_type(name)) {
    std::cerr << "ERROR: union " << scoped(name) << " can not be used as a "
      "DCPS_DATA_TYPE (only structs can be Topic types)" << std::endl;
    return false;
  }
  return true;
}

namespace java_ts_generator {

  /// called directly by dds_visitor::visit_structure() if -Wb,java
  void generate(UTL_ScopedName* name) {
    if (idl_global->is_dcps_type(name) == 0) {
      // no #pragma DCPS_DATA_TYPE, so nothing to generate
      return;
    }

    ACE_CString output_file = be_global->java_arg();
    if (output_file.length()) {
      be_global->impl_name_ = output_file;
    }
    be_global->add_include("idl2jni_jni.h", BE_GlobalData::STREAM_CPP);

    std::string type = scoped(name);

    std::string file, jniclass, jpackage;
    for (UTL_ScopedName* sn = name; sn;
        sn = static_cast<UTL_ScopedName*>(sn->tail())) {
      std::string tmp = sn->head()->get_string();
      if (tmp != "" && sn->tail()) {
        jpackage += tmp;
        file += tmp;
        ACE_OS::mkdir(file.c_str());
      }
      for (size_t i = tmp.find('_'); i < tmp.length();
          i = tmp.find('_', i + 1)) {
        tmp.insert(++i, 1, '1');
      }
      jniclass += tmp;
      if (jniclass != "" && sn->tail()) {
        jniclass += '_';
        jpackage += '.';
        file += '/';
      }
    }

    if (jpackage[jpackage.size() - 1] == '.') {
      jpackage.resize(jpackage.size() - 1);
    }

    std::string clazz = name->last_component()->get_string();
    file += clazz + "TypeSupportImpl.java";

    std::ofstream java(file.c_str());
    java << (jpackage.size() ? "package " : "") << jpackage
      << (jpackage.size() ? ";\n" :"") <<
      "public class " << clazz << "TypeSupportImpl extends _" << clazz
      << "TypeSupportTAOPeer {\n"
      "    public " << clazz << "TypeSupportImpl() {\n"
      "        super(_jni_init());\n"
      "    }\n"
      "    private static native long _jni_init();\n"
      "}\n";
    be_global->impl_ <<
      "extern \"C\" JNIEXPORT jlong JNICALL\n"
      "Java_" << jniclass << "TypeSupportImpl__1jni_1init(JNIEnv*, jclass) {\n"
      "  return reinterpret_cast<jlong>(static_cast<CORBA::Object_ptr>(new "
      << type << "TypeSupportImpl));\n"
      "}\n\n";
  }

}


text:
ACCEPTED

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

#### Published in
Trans. Br. mycol. Soc. 68(3): 485 (1977)

#### Original name
Sphaerulomyces Marvanová

### Remarks
null


text:
void IRsend::sendSherwood(uint64_t data, uint16_t nbits,
                                            uint16_t repeat) {
  sendNEC(data, nbits, std::max((uint16_t) SHERWOOD_MIN_REPEAT, repeat));
}
#endif


text:
package com.theo.downloader.hls;

import com.theo.downloader.Task;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

/**
 * MediaPlaylistTask
 *
 * @author: theotian
 * @since: 17/10/25
 */
public class MediaPlaylistTask implements Serializable {

    /**
     * save directory
     */
    private String savePath;

    /**
     * task list waiting to download
     */
    private Queue<Task> waitingList = new LinkedList<>();
    /**
     * downloading task list
     */
    private LinkedList<Task> downloadList = new LinkedList<>();
    /**
     * complete task list
     */
    private LinkedList<Task> completeList = new LinkedList<>();

    /**
     * all complete
     */
    private boolean allComplete = false;

    /**
     * complete total size
     */
    private long completeSize = 0;

    /**
     * all tasks count
     */
    private int tasksCount = 0;

    public MediaPlaylistTask(MediaPlaylist mediaPlaylist, String savePath) {
        this.savePath = savePath;
        inflateWaitingTaskList(mediaPlaylist);
    }

    /**
     * inflate the task
     */
    private void inflateWaitingTaskList(MediaPlaylist mediaPlaylist) {
        if (mediaPlaylist == null || mediaPlaylist.getList().size() <= 0) {
            return;
        }
        tasksCount = mediaPlaylist.getList().size();
        /**
         * first inflate waiting task
         */
        int index = 0;
        for (MediaPlaylist.Segment segment : mediaPlaylist.getList()) {
            waitingList.add(new Task(segment.getUri(), segment.getUri(), savePath).setIndex(index));
            index++;
        }
    }

    /**
     * pop task from waiting queue and throw to download list
     *
     * @return
     */
    public Task popTaskToDownload() {
        Task headTask = waitingList.poll();
        if (headTask != null) {
            downloadList.add(headTask);
        }
        return headTask;
    }

    /**
     * throw task to complete list
     *
     * @param task
     * @return
     */
    public boolean throwTaskToComplete(Task task) {
        if (task == null || !downloadList.contains(task)) {
            return false;
        }
        downloadList.remove(task);
        completeList.add(task);
        completeSize += task.getDownSize();
        if (waitingList.size() <= 0 && downloadList.size() <= 0) {
            allComplete = true;
        }
        return true;
    }

    public long getCompleteSize() {
        return completeSize;
    }

    public MediaPlaylistTask setCompleteSize(long completeSize) {
        this.completeSize = completeSize;
        return this;
    }

    /**
     * is all complete
     *
     * @return
     */
    public boolean allComplete() {
        return allComplete;
    }

    /**
     * has Download Task
     *
     * @return
     */
    public boolean hasDownloadTask() {
        return downloadList.size() > 0;
    }

    /**
     * get first download task
     *
     * @return
     */
    public Task getFirstDownloadTask() {
        if (hasDownloadTask()) {
            return downloadList.getFirst();
        }
        return null;
    }

    /**
     * get download list
     *
     * @return
     */
    public List<Task> getCompelteList() {
        return completeList;
    }

    /**
     * get tasks count
     *
     * @return
     */
    public int getTasksCount() {
        return tasksCount;
    }

}


text:
define(['annotate', 'is-js'], function(annotate, is) {
    return annotate('asin', 'Returns the arcsine (in radians) of a number')
        .on(function(a) {
            return is.number(a) && -1 <= a && a <= 1;
        }, Math.asin);
});


text:
module Thrifty ; module Logger
  TRACE = 0
  DEBUG = 1
  INFO  = 2
  WARN  = 3
  ERROR = 4
  FATAL = 5

  LEVELS = ['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'].freeze

  def self.get_logger(scope, context = nil)
    App.instance.start unless App.instance.started?
    Context.new(App.instance, scope.to_s, context)
  end

  def self.stop
    App.instance.stop
  end

  def logfmt_formatter
    LogfmtFormatter.new
  end

  def simple_formatter
    SimpleFormatter.new
  end

  def io_appender(*args)
    IoAppender.new(*args)
  end
end ; end

%w{
  entry
  formatters/logfmt_formatter
  formatters/simple_formatter
  appenders/io_appender
  exception_handlers/stderr_exception_handler
  app
  context
}.each do |f|
  require File.expand_path("../logger/#{f}", __FILE__)
end


text:
package cl.ml.ceppi.core.facade.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cl.ml.ceppi.core.facade.PerfilFacade;
import cl.ml.ceppi.core.model.acceso.Acceso;
import cl.ml.ceppi.core.model.menu.Menu;
import cl.ml.ceppi.core.model.menu.MenuCompuesto;
import cl.ml.ceppi.core.model.perfil.Perfil;
import cl.ml.ceppi.core.service.PerfilService;

/**
 * @author Maldonado León
 *
 */
@Service("perfilFacade")
public class PerfilFacadeImpl implements PerfilFacade
{
	@Autowired
	private PerfilService perfilService;

	@Transactional
	public void save(Perfil perfil) {
		perfilService.save(perfil);
	}

	@Transactional
	public void saveMenu(Menu menu) {
		perfilService.saveMenu(menu);
	}

	@Transactional
	public void update(Perfil perfil) {
		perfilService.update(perfil);
	}

	@Transactional
	public void update(Menu menu) {
		perfilService.update(menu);
	}

	@Transactional
	public void delete(Perfil perfil) {
		perfilService.delete(perfil);
	}

	@Transactional
	public void delete(Menu menu) {
		perfilService.delete(menu);
	}

	@Transactional
	public List<Perfil> listPerfil() {
		return perfilService.listPerfil();
	}

	@Transactional
	public List<MenuCompuesto> listMenu() {
		return perfilService.listMenu();
	}

	@Transactional
	public List<MenuCompuesto> listMenuPerfil( int idPerfil ) {
		return perfilService.listMenuPerfil(idPerfil);
	}

	@Transactional
	public Perfil findPerfilById(int id) {
		return perfilService.findPerfilById(id);
	}

	@Transactional
	public Menu findMenuById(int id) {
		return perfilService.findMenuById(id);
	}

	@Transactional
	public List<Acceso> listaAccesoByIdPerfil(int id)
	{
		return perfilService.listaAccesoByIdPerfil(id);
	}

	@Transactional
	public void saveAcceso(Acceso acceso) {
		// TODO Auto-generated method stub
		perfilService.saveAcceso(acceso);
	}

	@Transactional
	public Acceso findAccesoById(int id) {
		// TODO Auto-generated method stub
		return perfilService.findAccesoById(id);
	}

	@Transactional
	public Menu findMenuByCodigo(String codigo) {
		// TODO Auto-generated method stub
		return perfilService.findMenuByCodigo(codigo);
	}

	@Transactional
	public void delete(Acceso acceso) {
		perfilService.delete(acceso);
	}

}


text:
package org.fhcrc.cpl.viewer.amt;

import java.util.*;
import java.io.*;

import org.fhcrc.cpl.toolbox.proteomics.feature.Feature;
import org.fhcrc.cpl.toolbox.proteomics.feature.extraInfo.MS2ExtraInfoDef;
import org.fhcrc.cpl.toolbox.proteomics.Protein;
import org.fhcrc.cpl.toolbox.proteomics.filehandler.ProtXmlReader;
import org.fhcrc.cpl.toolbox.proteomics.filehandler.ProteinGroup;
import org.apache.log4j.Logger;

public class AMTFileRestrictor
{
    private static Logger _log = Logger.getLogger(AMTFileRestrictor.class);

    public static float DEFAULT_MIN_PROTEIN_PROPHET_FOR_RESTRICTION = .95f;
    /**
     * Load all proteins with a minimum protein prophet score from a protxml file
     * @return
     */
    public static ArrayList<Protein> restrictProteinListWithProtXml(List<Protein> fullProteinList,
                                                              File protXmlFile,
                                                              float minProbability,
                                                              int minPeptidesPerProtein)
    {
        ArrayList<Protein> proteinsInProtXml = new ArrayList<Protein>();
        ProtXmlReader protXmlReader = new ProtXmlReader(protXmlFile);

        try
        {
            Iterator<ProteinGroup> iterator = protXmlReader.iterator();

            while (iterator.hasNext())
            {
                ProteinGroup group = iterator.next();
                if (group.getGroupProbability() < minProbability)
                    continue;
                for (int i = 0; i < group.getProteins().size(); i++)
                {
                    // have to check all proteins in the group
                    ProtXmlReader.Protein protXmlReaderProtein = group.getProteins().get(i);
                    for (int j = 0; j < fullProteinList.size(); j++)
                    {
                        Protein currentProtein = fullProteinList.get(j);

                        // protXml protein_name should be the whole start of the protein header
                        // up to ' ' or carriage return
                        if (currentProtein.getHeader().startsWith(protXmlReaderProtein.getProteinName()) &&
                            (currentProtein.getHeader().length() == protXmlReaderProtein.getProteinName().length() ||
                             currentProtein.getHeader().charAt(protXmlReaderProtein.getProteinName().length()) == ' '))
                        {
                            if (protXmlReaderProtein.getTotalNumberPeptides() >= minPeptidesPerProtein)
                                proteinsInProtXml.add(currentProtein);
                            break;
                        }
                    }
                }
            }
        }
        catch (Exception e)
        {
            e.printStackTrace(System.err);
            return null;
        }
        return proteinsInProtXml;
    }

    /**
     * remove all features that match features that were used to support a given list
     * of proteins in a protxml file
     * @return
     */
    public static ArrayList<Feature> removeFeaturesWithProteinsFromProtXml(
                                                              Feature[] inputFeatures,
                                                              List<Protein> proteinList,
                                                              File protXmlFile)
    {
        //our output feature list starts out with everything
        ArrayList<Feature> outputFeatureList = new ArrayList<Feature>(inputFeatures.length);
//ArrayList<Feature> matchedFeatureList = new ArrayList<Feature>(inputFeatures.length);
        for (Feature feature : inputFeatures)
            outputFeatureList.add(feature);
        ArrayList<Feature> identifiedMatchingFeatures = identifyCorrespondingProteinFeaturesInProtXml(
                inputFeatures, proteinList, protXmlFile);
        for (Feature matchingFeature : identifiedMatchingFeatures)
        {
            outputFeatureList.remove(matchingFeature);
//matchedFeatureList.add(matchingFeature);
        }
/*
//HACK!!!
FeaturePepXmlWriter pepXmlWriter = new FeaturePepXmlWriter(matchedFeatureList.toArray(new Feature[0]),
  null);
try {pepXmlWriter.write(new File("/home/dhmay/temp/outunmatched.pep.xml"));} catch (Exception e){}
//end HACK!!!
*/
        return outputFeatureList;

    }

    /**
     * identify all features that match peptides that were used to support a given list
     * of proteins in a protxml file
     * @return
     */
    public static ArrayList<Feature> identifyCorrespondingProteinFeaturesInProtXml(
            Feature[] inputFeatures,
            List<Protein> proteinList,
            File protXmlFile)
    {
        ArrayList<Feature> result = new ArrayList<Feature>();
        ProtXmlReader protXmlReader = new ProtXmlReader(protXmlFile);
int[] proteinBuckets = new int[30];
int[] peptideBuckets = new int[30];
HashMap <String,Integer> peptideHitMap = new HashMap<String,Integer>();
        try
        {
            Iterator<ProteinGroup> iterator = protXmlReader.iterator();

            while (iterator.hasNext())
            {
                ProteinGroup group = iterator.next();

                for (int i = 0; i < group.getProteins().size(); i++)
                {
                    // have to check all proteins in the group
                    ProtXmlReader.Protein protXmlReaderProtein = group.getProteins().get(i);
                    for (Protein currentProtein: proteinList)
                    {
                        // protXml protein_name should be the whole start of the protein header
                        // up to ' ' or carriage return
                        if (currentProtein.getHeader().startsWith(protXmlReaderProtein.getProteinName()) &&
                            (currentProtein.getHeader().length() == protXmlReaderProtein.getProteinName().length() ||
                             currentProtein.getHeader().charAt(protXmlReaderProtein.getProteinName().length()) == ' '))
                        {
int numPeptidesForProtein=0;
                            //found one of our proteins!  identify & remove all the peptides
                            List<ProtXmlReader.Peptide> peptideList =
                                    protXmlReaderProtein.getPeptides();
                            for (ProtXmlReader.Peptide peptide : peptideList)
                            {
                                if (!peptide.isContributingEvidence())
                                    continue;
                                //for loop on inputfeatures, not outputfeatures, so messing
                                //with the list doesn't mess up the loop
                                for (Feature feature : inputFeatures)
                                {
                                    if (peptide.getPeptideSequence().equalsIgnoreCase(MS2ExtraInfoDef.getFirstPeptide(feature)) &&
                                        peptide.getCharge() == feature.getCharge() &&
                                        peptide.getCalcNeutralPepMass() == feature.getMass())
                                    {
numPeptidesForProtein++;
Integer whee = peptideHitMap.get(peptide.getPeptideSequence());
if (whee == null) peptideHitMap.put(peptide.getPeptideSequence(), new Integer(1));
else peptideHitMap.put(peptide.getPeptideSequence(),new Integer(whee+1));
                                        result.add(feature);
      //System.err.println("Removed " + feature.getPeptide());
                                    }
                                }
                            }
proteinBuckets[numPeptidesForProtein]++;

                        }
                    }
                }
            }
        }
        catch (Exception e)
        {
            e.printStackTrace(System.err);
            return null;
        }
int a=0;
for (String whee : peptideHitMap.keySet())
{
    a++;
    peptideBuckets[peptideHitMap.get(whee)]++;
}
System.err.println("peptides: " + a);
//for (String peptide : peptideHitMap.keySet()) System.err.println(peptide);
for (int i=0; i<20; i++)
    System.err.println("Peptides: " + i + ", proteins: " + proteinBuckets[i]);
for (int i=0; i<20; i++)
    System.err.println("Proteins: " + i + ", peptides: " + peptideBuckets[i]);
        return result;

    }
}


text:
(function() {
    "use strict";

    const short_title = document.querySelector("[data-short-title]");
    const search_label = document.querySelector("label[for='q']");
    const search_field = document.getElementById("q");

    if (short_title && search_field && search_label) {
        const search_text = "Search " + short_title.dataset.shortTitle.trim();

        search_label.textContent = search_text.trim();
        search_field.setAttribute("placeholder", search_text.trim() + "...");
    }
})();


text:
package com.StreamerSpectrum.BeamTeamDiscordBot.discord.resource;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.StreamerSpectrum.BeamTeamDiscordBot.Constants;
import com.StreamerSpectrum.BeamTeamDiscordBot.beam.resource.BTBBeamChannel;
import com.StreamerSpectrum.BeamTeamDiscordBot.beam.resource.BeamTeam;
import com.StreamerSpectrum.BeamTeamDiscordBot.beam.resource.BeamTeamUser;
import com.StreamerSpectrum.BeamTeamDiscordBot.singletons.BeamManager;
import com.StreamerSpectrum.BeamTeamDiscordBot.singletons.ConstellationManager;
import com.StreamerSpectrum.BeamTeamDiscordBot.singletons.DbManager;
import com.StreamerSpectrum.BeamTeamDiscordBot.singletons.JDAManager;
import com.auth0.jwt.internal.org.apache.commons.lang3.StringUtils;

public class BTBGuild {

	private final long	id;
	private final int	shardID;

	private String		name;
	private String		goLiveChannelID						= null;
	private String		logChannelID						= null;
	private String		newMemberChannelID					= null;

	private boolean		removeOfflineChannelAnnouncements	= false;

	public BTBGuild(long id, int shardID, String name, String goLiveChannelID, String logChannelID,
			String newMemberChannelID, boolean removeOfflineChannels) {
		this.id = id;
		this.shardID = shardID;
		this.name = name;
		this.goLiveChannelID = goLiveChannelID;
		this.logChannelID = logChannelID;
		this.newMemberChannelID = newMemberChannelID;
		this.removeOfflineChannelAnnouncements = removeOfflineChannels;
	}

	@Override
	public int hashCode() {
		return new Long(id).hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		return obj instanceof BTBGuild && ((BTBGuild) obj).id == this.id;
	}

	public long getID() {
		return id;
	}

	public int getShardID() {
		return shardID;
	}

	public String getName() {
		return name;
	}

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

		update();
	}

	public String getGoLiveChannelID() {
		return goLiveChannelID;
	}

	public void setGoLiveChannelID(String goLiveChannelID) {
		this.goLiveChannelID = goLiveChannelID;

		if (StringUtils.isNotBlank(goLiveChannelID)) {
			Set<BTBBeamChannel> alreadyAnnounced = new HashSet<>();
			List<BeamTeam> teams = getTrackedTeams();

			for (BeamTeam team : teams) {
				List<BeamTeamUser> members = BeamManager.getTeamMembers(team);

				for (BeamTeamUser member : members) {
					if (member.channel.online && !alreadyAnnounced.contains(member.channel)) {
						BTBBeamChannel channel = BeamManager.getChannel(member.channel.id);

						sendGoLiveMessage(channel);

						alreadyAnnounced.add(channel);
					}
				}
			}

			List<BTBBeamChannel> channels = getTrackedChannels();

			for (BTBBeamChannel channel : channels) {
				if (!alreadyAnnounced.contains(channel)) {
					channel = BeamManager.getChannel(channel.id);

					if (channel.online) {
						sendGoLiveMessage(channel);

						alreadyAnnounced.add(channel);
					}
				}
			}
		}

		update();
	}

	public String getLogChannelID() {
		return logChannelID;
	}

	public void setLogChannelID(String logChannelID) {
		this.logChannelID = logChannelID;

		update();
	}

	public String getNewMemberChannelID() {
		return newMemberChannelID;
	}

	public void setNewMemberChannelID(String newMemberChannelID) {
		this.newMemberChannelID = newMemberChannelID;

		update();
	}

	public boolean isRemoveOfflineChannelAnnouncements() {
		return removeOfflineChannelAnnouncements;
	}

	public void setRemoveOfflineChannelAnnouncements(boolean removeOfflineChannelAnnouncements) {
		this.removeOfflineChannelAnnouncements = removeOfflineChannelAnnouncements;

		update();
	}

	private void update() {
		DbManager.updateGuild(this);
	}

	public Map<String, Object> getDbValues() {
		Map<String, Object> values = new HashMap<>();

		values.put(Constants.GUILDS_COL_ID, getID());
		values.put(Constants.GUILDS_COL_NAME, getName());
		values.put(Constants.GUILDS_COL_GOLIVECHANNELID, getGoLiveChannelID());
		values.put(Constants.GUILDS_COL_LOGCHANNELID, getLogChannelID());
		values.put(Constants.GUILDS_COL_NEWMEMBERCHANNELID, getNewMemberChannelID());
		values.put(Constants.GUILDS_COL_REMOVEOFFLINECHANNELANNOUNCEMENTS,
				isRemoveOfflineChannelAnnouncements() ? 1 : 0);

		return values;
	}

	public List<BeamTeam> getTrackedTeams() {
		List<BeamTeam> teams = new ArrayList<>();

		teams = DbManager.readTrackedTeamsForGuild(id);

		return teams;
	}

	public List<BTBBeamChannel> getTrackedChannels() {
		List<BTBBeamChannel> channels = new ArrayList<>();

		channels = DbManager.readTrackedChannelsForGuild(id);

		return channels;
	}

	public boolean addTeam(BeamTeam team) {
		boolean added = false;

		if (DbManager.readTeam(team.id) == null) {
			DbManager.createTeam(team);
		}

		added = DbManager.createTrackedTeam(id, team.id);

		if (added) {
			if (StringUtils.isNotBlank(getGoLiveChannelID())) {
				List<BeamTeamUser> members = BeamManager.getTeamMembers(team);

				for (BeamTeamUser member : members) {
					if (member.channel.online) {
						sendGoLiveMessage(BeamManager.getChannel(member.channel.id));
					}
				}
			}

			ConstellationManager.subscribeToTeam(team);
		}

		return added;
	}

	public boolean removeTeam(BeamTeam team) {
		boolean isDeleted = false;

		isDeleted = DbManager.deleteTrackedTeam(id, team.id);

		return isDeleted;
	}

	public boolean addChannel(BTBBeamChannel channel) {
		boolean added = false;

		if (DbManager.readChannel(channel.id) == null) {
			DbManager.createChannel(channel);
		}

		added = DbManager.createTrackedChannel(id, channel.id);

		if (added) {
			if (channel.online) {
				sendGoLiveMessage(channel);
			}
			ConstellationManager.subscribeToChannel(channel);
		}

		return added;
	}

	public boolean removeChannel(BTBBeamChannel channel) {
		boolean isDeleted = false;

		isDeleted = DbManager.deleteTrackedChannel(id, channel.id);

		return isDeleted;
	}

	public void sendGoLiveMessage(BTBBeamChannel channel) {
		if (StringUtils.isNotBlank(getGoLiveChannelID())) {
			JDAManager.sendGoLiveMessage(getGoLiveChannelID(), JDAManager.buildGoLiveEmbed(channel), channel);
		}
	}

	public void sendLogMessage(String text) {
		if (StringUtils.isNotBlank(getLogChannelID())) {
			JDAManager.sendMessage(getLogChannelID(),
					String.format("[%s] %s", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()), text));
		}
	}
}


text:
title: The Server instance
sidebar_position: 3
slug: /server-instance/
---

The Server instance (often called `io` in the code examples) has a few attributes that may be of use in your application.

It also inherits all the methods of the [main namespace](/docs/v3/namespaces/#Main-namespace), like [`namespace.use()`](/docs/v3/server-api/#namespace-use-fn) (see [here](/docs/v3/middlewares/)) or [`namespace.allSockets()`](/docs/v3/server-api/#namespace-allSockets).

## Server#engine

A reference to the underlying Engine.IO server.

It can be used to fetch the number of currently connected clients:

```js
const count = io.engine.clientsCount;
// may or may not be similar to the count of Socket instances in the main namespace, depending on your usage
const count2 = io.of("/").sockets.size;
```

Or to generate a custom session ID (the `sid` query parameter):

```js
const uuid = require("uuid");

io.engine.generateId = (req) => {
  return uuid.v4(); // must be unique across all Socket.IO servers
}
```

## Events

The Server instance emits one single event (well, technically two, but `connect` is an alias for `connection`):

- [`connection`](#connection)

### `connection`

This event is fired upon a new connection. The first argument is a [Socket instance](/docs/v3/server-socket-instance/).

```js
io.on("connection", (socket) => {
  // ...
});
```

## Complete API

The complete API exposed by the Server instance can be found [here](/docs/v3/server-api/#Server).


text:
package com.nullprogram.chess.pieces;

import com.nullprogram.chess.Move;
import com.nullprogram.chess.MoveList;
import com.nullprogram.chess.Piece;
import com.nullprogram.chess.Position;

/**
 * The Chess knight.
 *
 * This class describes the movement and capture behavior of the Chess
 * knight.
 */
public class Knight extends Piece {

    /** Serialization identifier. */
    private static final long serialVersionUID = -524621034L;

    /**
     * Short segment of movement.
     */
    static final int NEAR = 1;

    /**
     * Long segment of movement.
     */
    static final int FAR = 2;

    /**
     * Create a new knight on the given side.
     *
     * @param side piece owner
     */
    public Knight(final Side side) {
        super(side, "Knight");
    }

    @Override
    public final MoveList getMoves(final boolean check) {
        MoveList list = new MoveList(getBoard(), check);
        list = getMoves(this, list);
        return list;
    }

    /**
     * Determine knight moves for given situation.
     *
     * This method is here for the purposes of reuse.
     *
     * @param p     the piece being tested
     * @param list  list to be appended to
     * @return      the modified list
     */
    public static MoveList getMoves(final Piece p,
                                    final MoveList list) {
        Position pos = p.getPosition();
        list.addCapture(new Move(pos, new Position(pos,  NEAR,  FAR)));
        list.addCapture(new Move(pos, new Position(pos,  FAR,  NEAR)));
        list.addCapture(new Move(pos, new Position(pos, -FAR,  NEAR)));
        list.addCapture(new Move(pos, new Position(pos, -FAR, -NEAR)));
        list.addCapture(new Move(pos, new Position(pos,  FAR, -NEAR)));
        list.addCapture(new Move(pos, new Position(pos,  NEAR, -FAR)));
        list.addCapture(new Move(pos, new Position(pos, -NEAR, -FAR)));
        list.addCapture(new Move(pos, new Position(pos, -NEAR,  FAR)));
        return list;
    }
}


text:
namespace llvm {

/// This class implements a map that also provides access to all stored values
/// in a deterministic order. The values are kept in a std::vector and the
/// mapping is done with DenseMap from Keys to indexes in that vector.
template<typename KeyT, typename ValueT,
         typename MapType = DenseMap<KeyT, unsigned>,
         typename VectorType = std::vector<std::pair<KeyT, ValueT>>>
class MapVector {
  MapType Map;
  VectorType Vector;

  static_assert(
      std::is_integral<typename MapType::mapped_type>::value,
      "The mapped_type of the specified Map must be an integral type");

public:
  using value_type = typename VectorType::value_type;
  using size_type = typename VectorType::size_type;

  using iterator = typename VectorType::iterator;
  using const_iterator = typename VectorType::const_iterator;
  using reverse_iterator = typename VectorType::reverse_iterator;
  using const_reverse_iterator = typename VectorType::const_reverse_iterator;

  /// Clear the MapVector and return the underlying vector.
  VectorType takeVector() {
    Map.clear();
    return std::move(Vector);
  }

  size_type size() const { return Vector.size(); }

  /// Grow the MapVector so that it can contain at least \p NumEntries items
  /// before resizing again.
  void reserve(size_type NumEntries) {
    Map.reserve(NumEntries);
    Vector.reserve(NumEntries);
  }

  iterator begin() { return Vector.begin(); }
  const_iterator begin() const { return Vector.begin(); }
  iterator end() { return Vector.end(); }
  const_iterator end() const { return Vector.end(); }

  reverse_iterator rbegin() { return Vector.rbegin(); }
  const_reverse_iterator rbegin() const { return Vector.rbegin(); }
  reverse_iterator rend() { return Vector.rend(); }
  const_reverse_iterator rend() const { return Vector.rend(); }

  bool empty() const {
    return Vector.empty();
  }

  std::pair<KeyT, ValueT>       &front()       { return Vector.front(); }
  const std::pair<KeyT, ValueT> &front() const { return Vector.front(); }
  std::pair<KeyT, ValueT>       &back()        { return Vector.back(); }
  const std::pair<KeyT, ValueT> &back()  const { return Vector.back(); }

  void clear() {
    Map.clear();
    Vector.clear();
  }

  void swap(MapVector &RHS) {
    std::swap(Map, RHS.Map);
    std::swap(Vector, RHS.Vector);
  }

  ValueT &operator[](const KeyT &Key) {
    std::pair<KeyT, typename MapType::mapped_type> Pair = std::make_pair(Key, 0);
    std::pair<typename MapType::iterator, bool> Result = Map.insert(Pair);
    auto &I = Result.first->second;
    if (Result.second) {
      Vector.push_back(std::make_pair(Key, ValueT()));
      I = Vector.size() - 1;
    }
    return Vector[I].second;
  }

  // Returns a copy of the value.  Only allowed if ValueT is copyable.
  ValueT lookup(const KeyT &Key) const {
    static_assert(std::is_copy_constructible<ValueT>::value,
                  "Cannot call lookup() if ValueT is not copyable.");
    typename MapType::const_iterator Pos = Map.find(Key);
    return Pos == Map.end()? ValueT() : Vector[Pos->second].second;
  }

  std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) {
    std::pair<KeyT, typename MapType::mapped_type> Pair = std::make_pair(KV.first, 0);
    std::pair<typename MapType::iterator, bool> Result = Map.insert(Pair);
    auto &I = Result.first->second;
    if (Result.second) {
      Vector.push_back(std::make_pair(KV.first, KV.second));
      I = Vector.size() - 1;
      return std::make_pair(std::prev(end()), true);
    }
    return std::make_pair(begin() + I, false);
  }

  std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> &&KV) {
    // Copy KV.first into the map, then move it into the vector.
    std::pair<KeyT, typename MapType::mapped_type> Pair = std::make_pair(KV.first, 0);
    std::pair<typename MapType::iterator, bool> Result = Map.insert(Pair);
    auto &I = Result.first->second;
    if (Result.second) {
      Vector.push_back(std::move(KV));
      I = Vector.size() - 1;
      return std::make_pair(std::prev(end()), true);
    }
    return std::make_pair(begin() + I, false);
  }

  size_type count(const KeyT &Key) const {
    typename MapType::const_iterator Pos = Map.find(Key);
    return Pos == Map.end()? 0 : 1;
  }

  iterator find(const KeyT &Key) {
    typename MapType::const_iterator Pos = Map.find(Key);
    return Pos == Map.end()? Vector.end() :
                            (Vector.begin() + Pos->second);
  }

  const_iterator find(const KeyT &Key) const {
    typename MapType::const_iterator Pos = Map.find(Key);
    return Pos == Map.end()? Vector.end() :
                            (Vector.begin() + Pos->second);
  }

  /// Remove the last element from the vector.
  void pop_back() {
    typename MapType::iterator Pos = Map.find(Vector.back().first);
    Map.erase(Pos);
    Vector.pop_back();
  }

  /// Remove the element given by Iterator.
  ///
  /// Returns an iterator to the element following the one which was removed,
  /// which may be end().
  ///
  /// \note This is a deceivingly expensive operation (linear time).  It's
  /// usually better to use \a remove_if() if possible.
  typename VectorType::iterator erase(typename VectorType::iterator Iterator) {
    Map.erase(Iterator->first);
    auto Next = Vector.erase(Iterator);
    if (Next == Vector.end())
      return Next;

    // Update indices in the map.
    size_t Index = Next - Vector.begin();
    for (auto &I : Map) {
      assert(I.second != Index && "Index was already erased!");
      if (I.second > Index)
        --I.second;
    }
    return Next;
  }

  /// Remove all elements with the key value Key.
  ///
  /// Returns the number of elements removed.
  size_type erase(const KeyT &Key) {
    auto Iterator = find(Key);
    if (Iterator == end())
      return 0;
    erase(Iterator);
    return 1;
  }

  /// Remove the elements that match the predicate.
  ///
  /// Erase all elements that match \c Pred in a single pass.  Takes linear
  /// time.
  template <class Predicate> void remove_if(Predicate Pred);
};

template <typename KeyT, typename ValueT, typename MapType, typename VectorType>
template <class Function>
void MapVector<KeyT, ValueT, MapType, VectorType>::remove_if(Function Pred) {
  auto O = Vector.begin();
  for (auto I = O, E = Vector.end(); I != E; ++I) {
    if (Pred(*I)) {
      // Erase from the map.
      Map.erase(I->first);
      continue;
    }

    if (I != O) {
      // Move the value and update the index in the map.
      *O = std::move(*I);
      Map[O->first] = O - Vector.begin();
    }
    ++O;
  }
  // Erase trailing entries in the vector.
  Vector.erase(O, Vector.end());
}

/// A MapVector that performs no allocations if smaller than a certain
/// size.
template <typename KeyT, typename ValueT, unsigned N>
struct SmallMapVector
    : MapVector<KeyT, ValueT, SmallDenseMap<KeyT, unsigned, N>,
                SmallVector<std::pair<KeyT, ValueT>, N>> {
};

} // end namespace llvm

#endif // LLVM_ADT_MAPVECTOR_H


text:
#ifndef _CONF_TEST_H_
#define _CONF_TEST_H_

#include <stdio.h>
#include <string.h>

#include "syscfg/syscfg.h"

#include <os/os.h>
#include <testutil/testutil.h>
#include <nffs/nffs.h>
#include <fs/fs.h>
#include <fs/fsutil.h>
#include "config/config.h"
#include "config/config_file.h"
#include "config_priv.h"

#ifdef __cplusplus
extern "C" {
#endif

extern uint8_t val8;
extern int c2_var_count;
extern char val_string[64][CONF_MAX_VAL_LEN];

extern uint32_t val32;
extern uint32_t val64;

extern int test_get_called;
extern int test_set_called;
extern int test_commit_called;
extern int test_export_block;

char *ctest_handle_get(int argc, char **argv, char *val, int val_len_max);
int ctest_handle_set(int argc, char **argv, char *val);
int ctest_handle_commit(void);
int ctest_handle_export(void (*cb)(char *name, char *value),
                        enum conf_export_tgt tgt);
int ctest_get_call_state(void);
void ctest_clear_call_state(void);

void config_wipe_srcs(void);

int conf_test_file_strstr(const char *fname, char *string);

char *c2_handle_get(int argc, char **argv, char *val, int val_len_max);
int c2_handle_set(int argc, char **argv, char *val);
int c2_handle_export(void (*cb)(char *name, char *value),
                     enum conf_export_tgt tgt);

char *c3_handle_get(int argc, char **argv, char *val, int val_len_max);
int c3_handle_set(int argc, char **argv, char *val);
int c3_handle_export(void (*cb)(char *name, char *value),
                     enum conf_export_tgt tgt);

extern struct conf_handler config_test_handler;

extern struct conf_handler c2_test_handler;

extern struct conf_handler c3_test_handler;

extern struct nffs_area_desc config_nffs[];

void config_test_all(void);

#ifdef __cplusplus
}
#endif

#endif /* _CONF_TEST_H_ */


text:
<?php

use React\EventLoop\Factory;
use React\EventLoop\Loop;

require __DIR__ . '/../vendor/autoload.php';

// resolve hostname before establishing TCP/IP connection (resolving DNS is still blocking here)
// for illustration purposes only, should use react/socket or react/dns instead!
$ip = gethostbyname('www.google.com');
if (ip2long($ip) === false) {
    echo 'Unable to resolve hostname' . PHP_EOL;
    exit(1);
}

// establish TCP/IP connection (non-blocking)
// for illustraction purposes only, should use react/socket instead!
$stream = stream_socket_client('tcp://' . $ip . ':80', $errno, $errstr, null, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);
if (!$stream) {
    exit(1);
}
stream_set_blocking($stream, false);

// print progress every 10ms
echo 'Connecting';
$timer = Loop::addPeriodicTimer(0.01, function () {
    echo '.';
});

// wait for connection success/error
Loop::addWriteStream($stream, function ($stream) use ($timer) {
    Loop::removeWriteStream($stream);
    Loop::cancelTimer($timer);

    // check for socket error (connection rejected)
    if (stream_socket_get_name($stream, true) === false) {
        echo '[unable to connect]' . PHP_EOL;
        exit(1);
    } else {
        echo '[connected]' . PHP_EOL;
    }

    // send HTTP request
    fwrite($stream, "GET / HTTP/1.1\r\nHost: www.google.com\r\nConnection: close\r\n\r\n");

    // wait for HTTP response
    Loop::addReadStream($stream, function ($stream) {
        $chunk = fread($stream, 64 * 1024);

        // reading nothing means we reached EOF
        if ($chunk === '') {
            echo '[END]' . PHP_EOL;
            Loop::removeReadStream($stream);
            fclose($stream);
            return;
        }

        echo $chunk;
    });
});


text:
package cn.fiona.pet.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;

/**
 * 菜单信息
 * <p>
* Created by tom on 2017-05-19 14:29:17.
 */
@ApiModel("菜单信息")
@Entity
@Table(name = "t_menu")
@DynamicInsert
@DynamicUpdate
@Setter
@Getter
@ToString
public class Menu extends IdEntity {

    /**
     *
     */
    @ApiModelProperty(value = "", required = false)
    private String name;

    /**
     *
     */
    @ApiModelProperty(value = "", required = false)
    private String code;

    /**
     *
     */
    @ApiModelProperty(value = "", required = false)
    private String uri;

    /**
     *
     */
    @ApiModelProperty(value = "", required = false)
    private String iconClass;

    /**
     *
     */
    @ApiModelProperty(value = "", required = false)
    private String describe;
    @Column(name = "`describe`")
    private String getDescribe(){
        return this.describe;
    }

    /**
     *
     */
    @ApiModelProperty(value = "", required = false)
    private Boolean leaf;

    /**
     *
     */
    @ApiModelProperty(value = "", required = false)
    private Integer order;
    @Column(name = "`order`")
    public Integer getOrder(){
        return this.order;
    }

    /**
     * 角色菜单 信息
     */
    private Set<RoleMenu> roleMenus;
    @OneToMany(fetch= FetchType.EAGER, mappedBy = "menu")
    public Set<RoleMenu> getRoleMenus() {
        return roleMenus;
    }

    /**
     * 子组
     */
    private Set<Menu> menus = new LinkedHashSet<Menu>();
    /**
     * 父组
     */
    private Menu parentMenu;

    @JsonIgnore
    @OneToMany(cascade = CascadeType.DETACH, fetch = FetchType.LAZY, mappedBy = "parentMenu")
    public Set<Menu> getMenus() {
        return menus;
    }

    @JsonIgnore
    @ManyToOne(cascade = CascadeType.DETACH,fetch = FetchType.LAZY)
    @JoinColumn(name = "parent_id", referencedColumnName = "code")
    @NotFound(action = NotFoundAction.IGNORE)
    public Menu getParentMenu() {
        return parentMenu;
    }

}


text:
bool GetPluginNameList(std::string& strPlugin, std::vector<std::string>& pluginList, std::string& configPath)
{
	rapidxml::file<> fdoc(strPlugin.c_str());
	rapidxml::xml_document<>  doc;
	doc.parse<0>(fdoc.data());

	rapidxml::xml_node<>* pRoot = doc.first_node();
	for (rapidxml::xml_node<>* pPluginNode = pRoot->first_node("Plugin"); pPluginNode; pPluginNode = pPluginNode->next_sibling("Plugin"))
	{
		const char* strPluginName = pPluginNode->first_attribute("Name")->value();
		const char* strMain = pPluginNode->first_attribute("Main")->value();
		pluginList.push_back(std::string(strPluginName));
	}

	rapidxml::xml_node<>* pPluginAppNode = pRoot->first_node("APPID");
	if (!pPluginAppNode)
	{
		//NFASSERT(0, "There are no App ID", __FILE__, __FUNCTION__);
		return false;
	}

	const char* strAppID = pPluginAppNode->first_attribute("Name")->value();
	if (!strAppID)
	{
		//NFASSERT(0, "There are no App ID", __FILE__, __FUNCTION__);
		return false;
	}

	rapidxml::xml_node<>* pPluginConfigPathNode = pRoot->first_node("ConfigPath");
	if (!pPluginConfigPathNode)
	{
		//NFASSERT(0, "There are no ConfigPath", __FILE__, __FUNCTION__);
		return false;
	}

	if (NULL == pPluginConfigPathNode->first_attribute("Name"))
	{
		//NFASSERT(0, "There are no ConfigPath.Name", __FILE__, __FUNCTION__);
		return false;
	}

	configPath = pPluginConfigPathNode->first_attribute("Name")->value();

	return true;
}

int CopyFile(std::string& SourceFile, std::string& NewFile)
{
	ifstream in;
	ofstream out;
	in.open(SourceFile.c_str(), ios::binary);//´ò¿ªÔ´Îļþ
	if (in.fail())//´ò¿ªÔ´Îļþʧ°Ü
	{
		cout << "Error 1: Fail to open the source file." << endl;
		in.close();
		out.close();
		return 0;
	}
	out.open(NewFile.c_str(), ios::binary);//´´½¨Ä¿±êÎļþ
	if (out.fail())//´´½¨Îļþʧ°Ü
	{
		cout << "Error 2: Fail to create the new file." << endl;
		out.close();
		in.close();
		return 0;
	}
	else//¸´ÖÆÎļþ
	{
		out << in.rdbuf();
		out.close();
		in.close();
		return 1;
	}
}

std::vector<std::string> GetFileListInFolder(std::string folderPath, int depth)
{
	std::vector<std::string> result;
#if NF_PLATFORM == NF_PLATFORM_WIN
	_finddata_t FileInfo;
	std::string strfind = folderPath + "\\*";
	long long Handle = _findfirst(strfind.c_str(), &FileInfo);

	if (Handle == -1L)
	{
		std::cerr << "can not match the folder path" << std::endl;
		exit(-1);
	}
	do {
		//ÅжÏÊÇ·ñÓÐ×ÓĿ¼
		if (FileInfo.attrib & _A_SUBDIR)
		{
			//Õâ¸öÓï¾äºÜÖØÒª
			if ((strcmp(FileInfo.name, ".") != 0) && (strcmp(FileInfo.name, "..") != 0))
			{
				std::string newPath = folderPath + "\\" + FileInfo.name;
				//dfsFolder(newPath, depth);
				auto newResult = GetFileListInFolder(newPath, depth);
				result.insert(result.begin(), newResult.begin(), newResult.end());
			}
		}
		else
		{

			std::string filename = (folderPath + "\\" + FileInfo.name);
			result.push_back(filename);
		}
	} while (_findnext(Handle, &FileInfo) == 0);

	_findclose(Handle);
#else
	DIR *pDir;
	struct dirent *ent;
	char childpath[512];
	char absolutepath[512];
	pDir = opendir(folderPath.c_str());
	memset(childpath, 0, sizeof(childpath));
	while ((ent = readdir(pDir)) != NULL)
	{
		if (ent->d_type & DT_DIR)
		{
			if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
			{
				continue;
			}
			std::string childpath = folderPath + "/" + ent->d_name;
			auto newResult = GetFileListInFolder(childpath, depth);
			result.insert(result.begin(), newResult.begin(), newResult.end());
		}
		else
		{
			sprintf(absolutepath, "%s/%s", folderPath.c_str(), ent->d_name);
			result.push_back(absolutepath);
		}
	}

	sort(result.begin(), result.end());//ÅÅÐò
#endif
	return result;
}

void StringReplace(std::string &strBig, const std::string &strsrc, const std::string &strdst)
{
	std::string::size_type pos = 0;
	std::string::size_type srclen = strsrc.size();
	std::string::size_type dstlen = strdst.size();

	while ((pos = strBig.find(strsrc, pos)) != std::string::npos)
	{
		strBig.replace(pos, srclen, strdst);
		pos += dstlen;
	}
}

void printResult(int result, std::string& strName)
{
	if (result == 1)
	{
		printf("Copy file: %s success!\n", strName.c_str());
	}
	else
	{
		printf("Copy file: %s failed!\n", strName.c_str());
	}
}

int main()
{
	std::vector<std::string> fileList;
#ifdef NF_DEBUG_MODE
	fileList = GetFileListInFolder("../../Debug", 10);
#else
	fileList = GetFileListInFolder("../../Release", 10);
#endif
	for (auto fileName : fileList)
	{
		if (fileName.find("Plugin.xml") != std::string::npos)
		{
			StringReplace(fileName, "\\", "/");
			StringReplace(fileName, "//", "/");
			printf("Reading xml file: %s\n", fileName.c_str());

			std::vector<std::string> pluginList;
			std::string configPath = "";
			GetPluginNameList(fileName, pluginList, configPath);
			if (pluginList.size() > 0 && configPath != "")
			{
#if NF_PLATFORM == NF_PLATFORM_WIN
				pluginList.push_back("libprotobuf");
				pluginList.push_back("NFMessageDefine");
#else
				pluginList.push_back("NFMessageDefine");
#endif
				pluginList.push_back("NFPluginLoader");
				configPath = "../" + configPath;
				configPath = fileName.substr(0, fileName.find_last_of("/")) + "/" + configPath;

				for (std::string name : pluginList)
				{
					int result = 0;
					if (name == "NFPluginLoader")
					{
#if NF_PLATFORM == NF_PLATFORM_WIN

#ifdef NF_DEBUG_MODE
						std::string src = configPath + "Comm/Debug/" + name;
						std::string des = fileName.substr(0, fileName.find_last_of("/")) + "/" + name;
						auto strSrc = src + "_d.exe";
						auto strDes = des + "_d.exe";
						auto strSrcPDB = src + "_d.pdb";
						auto strDesPDB = des + "_d.pdb";
						printResult(CopyFile(strSrc, strDes), strSrc);
						printResult(CopyFile(strSrcPDB, strDesPDB), strSrcPDB);
#else
						std::string src = configPath + "Comm/Release/" + name;
						std::string des = fileName.substr(0, fileName.find_last_of("/")) + "/" + name;
						auto strSrc = src + ".exe";
						auto strDes = des + ".exe";
						printResult(CopyFile(strSrc, strDes), strSrc);
#endif

#else
						std::string src = configPath + "Comm/" + name;
						std::string des = fileName.substr(0, fileName.find_last_of("/")) + "/" + name;
						auto strSrc = src + "_d";
						auto strDes = des + "_d";
						printResult(CopyFile(strSrc, strDes), strSrc);
#endif

					}
					else
					{
#if NF_PLATFORM == NF_PLATFORM_WIN

#ifdef NF_DEBUG_MODE
						std::string src = configPath + "Comm/Debug/" + name;
						std::string des = fileName.substr(0, fileName.find_last_of("/")) + "/" + name;
						auto strSrc = src + "_d.dll";
						auto strDes = des + "_d.dll";
						auto strSrcPDB = src + "_d.pdb";
						auto strDesPDB = des + "_d.pdb";
						printResult(CopyFile(strSrc, strDes), strSrc);
						printResult(CopyFile(strSrcPDB, strDesPDB), strSrcPDB);
#else
						std::string src = configPath + "Comm/Release/" + name;
						std::string des = fileName.substr(0, fileName.find_last_of("/")) + "/" + name;
						auto strSrc = src + ".dll";
						auto strDes = des + ".dll";
						printResult(CopyFile(strSrc, strDes), strSrc);
#endif

#else
						std::string src = configPath + "Comm/lib" + name;
						std::string des = fileName.substr(0, fileName.find_last_of("/")) + "/" + name;
						auto strSrc = src + "_d.so";
						auto strDes = des + "_d.so";
						printResult(CopyFile(strSrc, strDes), strSrc);
#endif
					}
				}
			}
		}
	}
#if NF_PLATFORM == NF_PLATFORM_WIN
	getch();
#else

#endif
	return 0;
}


text:
typedef void (^AKCMIDICallback)(uint8_t, uint8_t, uint8_t);

@interface AKCallbackInstrumentAudioUnit : AKAudioUnit
@property (nonatomic) AKCMIDICallback callback;
- (void)destroy;
- (void)startNote:(uint8_t)note velocity:(uint8_t)velocity;
- (void)stopNote:(uint8_t)note;

@end


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFieldsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('fields', function (Blueprint $table) {

            $table->increments('id');

            $table->integer('content_id');
            $table->string('key');
            $table->string('type');
            $table->text('data');
            $table->text('meta_data')->nullable();

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('fields');
    }
}


text:
/*
 * DivSCComponent.h
 *
 *  Created on: Feb 8, 2014
 *      Author: gwue
 */

#ifndef DivSCComponent_H_
#define DivSCComponent_H_

#include <SoundComponentImpl.h>
#include <Listener.h>
#include <Synthesizer.h>
#include <SoundPort.h>
#include <ControlPort.h>
/**
 * Divide a pcm data by a control value
 *
 */
class DivSCComponent : public SoundComponentImpl {

public:

    DECLARE_COMPONENTNAME

    DECLARE_PORT3(SoundPort, SoundIn, 1);
    DECLARE_PORT3(ControlPort, ValueIn, 2);

    DECLARE_PORT3(SoundPort, SoundOut, 1);

    float divValue;

    DivSCComponent(std::vector<std::string>);
    virtual ~DivSCComponent();
    virtual void init(void);
};

#endif /* MULTIPLYCONTROL_H_ */


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using TM.Shared;

namespace TM.Data
{
   [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")]
   [SuppressMessage("ReSharper", "ClassWithVirtualMembersNeverInherited.Global")]
   public class Course : ICourseUrlNameNaturalKey
   {
      public Course()
      {
         CourseSpecializations = new List<CourseSpecialization>();
      }
      public int Id { get; set; }
      public int? ReplacementCourseId { get; set; }
      public int TrainingProviderId { get; set; }
      public int CategoryId { get; set; }

      [Required, StringLength(100)]
      public string Title { get; set; }

      [Required, StringLength((int)StringLengthConstraint.Url)]
      public string SiteUrl { get; set; }

      [Required, StringLength((int)StringLengthConstraint.UrlName)]
      public string UrlName { get; set; }

      [StringLength(3500)]
      public string Description { get; set; }

      [StringLength(3500)]
      public string ShortDescription { get; set; }

      public bool HasClosedCaptions { get; set; }
      public CourseLevel Level { get; set; }

      public CourseRating Rating { get; set; }

      public TimeSpan Duration { get; set; }

      public DateTime ReleaseDate { get; set; }

      public bool IsRetired { get; set; }

      public bool IsDeleted { get; set; }

      public Specializations Specializations
      {
         get
         {
            var specializations = CourseSpecializations
               .Aggregate(default(Specializations),
                  (accumulator, courseSpecialization) =>
                     accumulator | courseSpecialization.Specialization);

            return specializations;
         }

         set
         {
            var specializationSet = new HashSet<Specializations>(value.GetFlags());
            var specializationsCopy = new List<CourseSpecialization>(CourseSpecializations);

            foreach (var courseSpecialization in specializationsCopy)
            {
               if (specializationSet.Contains(courseSpecialization.Specialization))
               {
                  specializationSet.Remove(courseSpecialization.Specialization);
               } else
               {
                  CourseSpecializations.Remove(courseSpecialization);
               }
            }

            foreach (var specialization in specializationSet)
            {
               CourseSpecializations.Add(CourseSpecialization.Create(this, specialization));
            }
         }
      }

      public ICollection<CourseSpecialization> CourseSpecializations { get; set; }

      public virtual TrainingProvider TrainingProvider { get; set; }
      public virtual Category Category { get; set; }
      public virtual Course ReplacementCourse { get; set; }
      public virtual ICollection<CourseAuthor> CourseAuthors { get; set; }
      public virtual ICollection<Subscription> Subscriptions { get; set; }
      public virtual ICollection<Module> Modules { get; set; }

      #region Equality Comparers

      private sealed class PropertiesEqualityComparer : IEqualityComparer<Course>
      {
         public bool Equals(Course x, Course y)
         {
            if (ReferenceEquals(x, y)) return true;
            if (ReferenceEquals(x, null)) return false;
            if (ReferenceEquals(y, null)) return false;

            return string.Equals(x.Title, y.Title) &&
               string.Equals(x.SiteUrl, y.SiteUrl) &&
                   string.Equals(x.UrlName, y.UrlName) &&
                   string.Equals(x.Description, y.Description) &&
                   string.Equals(x.ShortDescription, y.ShortDescription) &&
                   x.HasClosedCaptions == y.HasClosedCaptions &&
                   x.Level == y.Level &&
                   Equals(x.Rating, y.Rating) &&
                   x.Duration.Equals(y.Duration) &&
                   x.ReleaseDate.Equals(y.ReleaseDate) &&
                   x.IsRetired == y.IsRetired &&
                   x.IsDeleted == y.IsDeleted &&
                   x.Specializations == y.Specializations;
         }

         public int GetHashCode(Course obj)
         {
            unchecked
            {
               var hashCode = (obj.Title != null ? obj.Title.GetHashCode() : 0);
               hashCode = (hashCode*397) ^ (obj.SiteUrl != null ? obj.SiteUrl.GetHashCode() : 0);
               hashCode = (hashCode*397) ^ (obj.UrlName != null ? obj.UrlName.GetHashCode() : 0);
               hashCode = (hashCode*397) ^ (obj.Description != null ? obj.Description.GetHashCode() : 0);
               hashCode = (hashCode*397) ^ (obj.ShortDescription != null ? obj.ShortDescription.GetHashCode() : 0);
               hashCode = (hashCode*397) ^ obj.HasClosedCaptions.GetHashCode();
               hashCode = (hashCode*397) ^ (int) obj.Level;
               hashCode = (hashCode*397) ^ (obj.Rating != null ? obj.Rating.GetHashCode() : 0);
               hashCode = (hashCode*397) ^ obj.Duration.GetHashCode();
               hashCode = (hashCode*397) ^ obj.ReleaseDate.GetHashCode();
               hashCode = (hashCode*397) ^ obj.IsRetired.GetHashCode();
               hashCode = (hashCode*397) ^ obj.IsDeleted.GetHashCode();
               hashCode = (hashCode*397) ^ obj.Specializations.GetHashCode();
               return hashCode;
            }
         }
      }

      private static readonly IEqualityComparer<Course> PropertiesComparerInstance = new PropertiesEqualityComparer();

      public static IEqualityComparer<Course> PropertiesComparer
      {
         get { return PropertiesComparerInstance; }
      }

      #endregion
   }
}


text:
package chapter1;

import java.util.Objects;

public class BarName {
        private String name;

        public BarName(String name) {
            this.name = name;
        }

        @Override
        public boolean equals(Object o) {
            if (null == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            BarName other = (BarName) o;

            return Objects.equals(this.name, other.name);
        }

        @Override
        public int hashCode() {
            return Objects.hash(name);
        }
}


text: unsigned int BaseComponent::_typeCounter = 0;


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>TrafficNet | Dashboard</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

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

    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

    <link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />

    <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />

    <link href="dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />

    <link href="plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />

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

    <link href="plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />

    <link href="plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />

    <link href="plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />

    <link href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />

    <link rel="icon" href="assets/icon/favicon.ico" />

        TrafficNet

            Toggle navigation

      <?php include 'pages/menubar.php';?>

            Dashboard
            Control panel

 Home

Dashboard

10.3 GB

Raw Data Size

                More info

8

Scenario Store

                More info

1

Documents

                More info

65

Website Visits

                More info

Announcement

«

1

2

3

»

                      <input type="checkbox" value="" name=""/>

                      TrafficNet is purchased by the Mcity

                       11/13/2017

                      <input type="checkbox" value="" name=""/>

                      Add primitives dataset

                       10/10/2017

                      <input type="checkbox" value="" name=""/>

                      Add pages for Lane change, Car following, and Free flow

                       04/21/2017

                      <input type="checkbox" value="" name=""/>

                      Prototyped the dashboard

                       04/06/2017

                  <button class="btn btn-default pull-right"> Add item</button>

                    <button class="btn btn-primary btn-sm daterange pull-right" data-toggle="tooltip" title="Date range"></button>
                    <button class="btn btn-primary btn-sm pull-right" data-widget='collapse' data-toggle="tooltip" title="Collapse" style="margin-right: 5px;"></button>

                    Visitors

Visitors

Online

Exists

          Version 1.0

        Copyright © 2016-2017 UMICH. All rights reserved.


text:
/*
 * @(#)PropsIO.java
 *
 * @project    : org.fugerit.java.core
 * @package    : org.fugerit.java.core.util
 * @creation   : 20-apr-2006
 */
package org.fugerit.java.core.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.Properties;

/**
 *

 *
 * @author Morozko
 *
 */
public class PropsIO {

	public static final Properties BLANK_PROPS = new Properties();

	public static void fill( Properties from, Properties to ) {
		Enumeration e = from.keys();
		while ( e.hasMoreElements() ) {
			String key = (String)e.nextElement();
			String value = from.getProperty(key);
			if ( key != null && value != null ) {
				to.setProperty(key, value);
			}
		}
	}

	public static Properties loadFromClassLoader( String path ) throws IOException {
		return loadFromStream( PropsIO.class.getResourceAsStream( path ) );
	}

	public static Properties loadFromURL( String u ) throws IOException {
		return loadFromURL( new URL( u ) );
	}

	public static Properties loadFromURL( URL u ) throws IOException {
		return loadFromStream( u.openStream() );
	}

	public static Properties loadFromFile( String f ) throws IOException {
		return loadFromStream( new FileInputStream( f ) );
	}

	public static Properties loadFromFile( File f ) throws IOException {
		return loadFromStream( new FileInputStream( f ) );
	}

	public static Properties loadFromStream( InputStream is ) throws IOException {
		Properties props = new Properties();
		props.load( is );
		is.close();
		return props;
	}

}


text:
/* Helper to perform abortable blocking operations on a socket:
 *   asocket_connect()
 *   asocket_accept()
 *   asocket_read()
 *   asocket_write()
 * These calls are similar to the regular syscalls, but can be aborted with:
 *   asocket_abort()
 *
 * Calling close() on a regular POSIX socket does not abort blocked syscalls on
 * that socket in other threads.
 *
 * After calling asocket_abort() the socket cannot be reused.
 *
 * Call asocket_destory() *after* all threads have finished with the socket to
 * finish closing the socket and free the asocket structure.
 *
 * The helper is implemented by setting the socket non-blocking to initiate
 * syscalls connect(), accept(), read(), write(), then using a blocking poll()
 * on both the primary socket and a local pipe. This makes the poll() abortable
 * by writing a byte to the local pipe in asocket_abort().
 *
 * asocket_create() sets the fd to non-blocking mode. It must not be changed to
 * blocking mode.
 *
 * Using asocket will triple the number of file descriptors required per
 * socket, due to the local pipe. It may be possible to use a global pipe per
 * process rather than per socket, but we have not been able to come up with a
 * race-free implementation yet.
 *
 * All functions except asocket_init() and asocket_destroy() are thread safe.
 */

#include <stdlib.h>
#include <sys/socket.h>

#ifndef __CUTILS_ABORT_SOCKET_H__
#define __CUTILS_ABORT_SOCKET_H__
#ifdef __cplusplus
extern "C" {
#endif

struct asocket {
    int fd;           /* primary socket fd */
    int abort_fd[2];  /* pipe used to abort */
};

/* Create an asocket from fd.
 * Sets the socket to non-blocking mode.
 * Returns NULL on error with errno set.
 */
struct asocket *asocket_init(int fd);

/* Blocking socket I/O with timeout.
 * Calling asocket_abort() from another thread will cause each of these
 * functions to immediately return with value -1 and errno ECANCELED.
 * timeout is in ms, use -1 to indicate no timeout. On timeout -1 is returned
 * with errno ETIMEDOUT.
 * EINTR is handled in-call.
 * Other semantics are identical to the regular syscalls.
 */
int asocket_connect(struct asocket *s, const struct sockaddr *addr,
        socklen_t addrlen, int timeout);

int asocket_accept(struct asocket *s, struct sockaddr *addr,
        socklen_t *addrlen, int timeout);

int asocket_read(struct asocket *s, void *buf, size_t count, int timeout);

int asocket_write(struct asocket *s, const void *buf, size_t count,
        int timeout);

/* Abort above calls and shutdown socket.
 * Further I/O operations on this socket will immediately fail after this call.
 * asocket_destroy() should be used to release resources once all threads
 * have returned from blocking calls on the socket.
 */
void asocket_abort(struct asocket *s);

/* Close socket and free asocket structure.
 * Must not be called until all calls on this structure have completed.
 */
void asocket_destroy(struct asocket *s);

#ifdef __cplusplus
}
#endif
#endif //__CUTILS_ABORT_SOCKET__H__


text:
import sys
# import and init pygame
import pygame
import random
pygame.init()

class PixelGrid:
    def __init__(self, size, scale):
        self.points = []
        self.size = size
        self.scale = scale
        for i in range(size):
            self.points.append([])
            for j in range(size):
                self.points[i].append(base_height)

    def normalize(self):
        min = self.points[0][0]
        max = min
        for i in range(self.size):
            for j in range(self.size):
                if (self.points[i][j] < min):
                    min = self.points[i][j]
                if (self.points[i][j] > max):
                    max = self.points[i][j]

        for i in range(self.size):
            for j in range(self.size):
                self.points[i][j] -= min
                self.points[i][j] = ((self.points[i][j]*1.0)/max)*255
                if(self.points[i][j] > 255):
                    self.points[i][j] = 255
                if (self.points[i][j] < 0):
                    self.points[i][j] = 0

    def apply_threshold(self, height):
        color = (height, height, height)
        if do_threshold:
            if height > 200:
                color = color  # grey for snow
            elif height > 150:
                color = (height/2, height/3, height/3)  # brown
            elif height > 75:
                color = (0, 255-height, 0)  # green
            elif height > 70:
                color = (height*2, height*2, 0)  # beach yellow
            else:
                color = (0, 0, height)   # blue to black
        return color

    def draw(self, apply_threshold=True):
        for i in range(self.size):
            for j in range(self.size):
                hc = self.points[i][j]
                color = self.apply_threshold(hc)
                pygame.draw.rect(window, color, (self.scale * i,
                                                 self.scale * j,
                                                 self.scale * i + self.scale,
                                                 self.scale * j + self.scale))

        # draw it to the screen
        pygame.display.flip()

    def random_heights(self):
        for i in range(self.size):
            for j in range(self.size):
                self.points[i][j] = random.randint(0, 255)

    def diamond_square(self):
        block = self.size
        size = self.size
        d = size/4
        self.points[0][0] = random.randint(0, 255)
        self.points[size-1][size-1] = random.randint(0, 255)
        self.points[0][size-1] = random.randint(0, 255)
        self.points[size-1][0] = random.randint(0, 255)
        while block > 1:
            # average four corners
            i = 0
            off = block/2

            while i < self.size:
                j = 0
                while j < self.size:
                    self.points[i+off][j+off] = (
                        self.points[i][j] +
                        self.points[(i+block) % size][j] +
                        self.points[i][(j+block) % size] +
                        self.points[(i+block) % size][(j+block) % size]
                    )/4 + random.randint(-d, d)
                    j += block
                i += block
            # average edges
            i = 0
            off = block/2
            while i < self.size:
                j = 0
                while j < self.size:
                    self.points[i][j+off] = (
                        self.points[i][j] +
                        self.points[i][(j+block) % size] +
                        self.points[(i+off) % size][(j+off) % size] +
                        self.points[(i-off) % size][(j+off) % size]
                    )/4 + random.randint(-d, d)
                    self.points[i+off][j] = (
                        self.points[i][j] +
                        self.points[(i+off) % size][(j+off) % size] +
                        self.points[(i+block) % size][j] +
                        self.points[(i+off) % size][(j-off) % size]
                    )/4 + random.randint(-d, d)
                    j += block
                i += block
            block = block/2
            d = int(d/2.2)

if __name__ == '__main__':
    WHITE = (255, 255, 255)
    BLACK = (0, 0, 0)

    # create the screen
    # pixel grid parameters
    grid_size = 512
    base_height = 127
    scale = 1
    screen_size = scale * grid_size
    window = pygame.display.set_mode((screen_size, screen_size))
    font = pygame.font.Font(None, 17)
    grid = PixelGrid(grid_size, scale)

    pygame.display.get_surface().fill(BLACK)
    text = font.render('Press any key to generate a new map.', True, WHITE)
    textrect = text.get_rect()
    textrect.centerx = window.get_rect().centerx
    textrect.centery = window.get_rect().centery
    window.blit(text, textrect)
    pygame.display.update()

    # whether to make thresholded map or heightmap
    do_threshold = True

    while True:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                sys.exit(0)
            elif event.type == pygame.KEYDOWN:
                pygame.display.get_surface().fill(BLACK)
                print('diamond square...')
                grid.diamond_square()
                print('normalize...')
                grid.normalize()
                print('draw...')
                grid.draw(do_threshold)
                print('done!')


text:
if ((window as any).require) {
    (window as any).require.config({
        map: {
            "*" : {
                "ipyvolume": "nbextensions/ipyvolume/index",
                "jupyter-js-widgets": "nbextensions/jupyter-js-widgets/extension",
            },
        },
    });
}

// Export the required load_ipython_extention
// tslint:disable-next-line: no-empty
export function load_ipython_extension() {}


text:
@interface PodsDummy_Pods_Tests_stacks_ios : NSObject
@end
@implementation PodsDummy_Pods_Tests_stacks_ios
@end


text:
package com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.undo;

import android.content.Context;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.OnDismissCallback;

import java.util.HashMap;
import java.util.Map;

/**
 * A {@link SimpleSwipeUndoAdapter} which automatically dismisses items after a timeout.
 */
public class TimedUndoAdapter extends SimpleSwipeUndoAdapter {

    /**
     * The default time in milliseconds before an item in the undo state should automatically dismiss.
     */
    public static final long DEFAULT_TIMEOUT_MS = 3000;

    /**
     * The time in milliseconds before an item in the undo state should automatically dismiss.
     * Defaults to {@value #DEFAULT_TIMEOUT_MS}.
     */
    private long mTimeoutMs = DEFAULT_TIMEOUT_MS;

    /**
     * A {@link Handler} to post {@link TimeoutRunnable}s to.
     */
    @NonNull
    private final Handler mHandler = new Handler();

    /**
     * The {@link TimeoutRunnable}s which are posted. Keys are positions.
     */
    //noinspection UseSparseArrays
    private final Map<Integer, TimeoutRunnable> mRunnables = new HashMap<>();

    /**
     * Creates a new {@code TimedUndoAdapterGen}, decorating given {@link BaseAdapter}.
     *
     * @param undoAdapter     the {@link BaseAdapter} that is decorated. Must implement
     *                        {@link UndoAdapter}.
     * @param context         the {@link Context}.
     * @param dismissCallback the {@link OnDismissCallback} that is notified of dismissed items.
     */
    public <V extends BaseAdapter & UndoAdapter> TimedUndoAdapter(@NonNull final V undoAdapter, @NonNull final Context context, @NonNull final OnDismissCallback
            dismissCallback) {
        super(undoAdapter, context, dismissCallback);
    }

    /**
     * Sets the time in milliseconds after which an item in the undo state should automatically dismiss.
     * Defaults to {@value #DEFAULT_TIMEOUT_MS}.
     */
    public void setTimeoutMs(final long timeoutMs) {
        mTimeoutMs = timeoutMs;
    }

    @Override
    public void onUndoShown(@NonNull final View view, final int position) {
        super.onUndoShown(view, position);
        TimeoutRunnable timeoutRunnable = new TimeoutRunnable(position);
        mRunnables.put(position, timeoutRunnable);
        mHandler.postDelayed(timeoutRunnable, mTimeoutMs);
    }

    @Override
    public void onUndo(@NonNull final View view, final int position) {
        super.onUndo(view, position);
        cancelCallback(position);
    }

    @Override
    public void onDismiss(@NonNull final View view, final int position) {
        super.onDismiss(view, position);
        cancelCallback(position);
    }

    @Override
    public void dismiss(final int position) {
        super.dismiss(position);
        cancelCallback(position);
    }

    private void cancelCallback(final int position) {
        Runnable timeoutRunnable = mRunnables.get(position);
        if (timeoutRunnable != null) {
            mHandler.removeCallbacks(timeoutRunnable);
            mRunnables.remove(position);
        }
    }

    @Override
    public void onDismiss(@NonNull final ViewGroup listView, @NonNull final int[] reverseSortedPositions) {
        super.onDismiss(listView, reverseSortedPositions);

        /* Adjust the pending timeout positions accordingly wrt the given dismissed positions */
        //noinspection UseSparseArrays
        Map<Integer, TimeoutRunnable> newRunnables = new HashMap<>();
        for (int position : reverseSortedPositions) {
            for (int key : mRunnables.keySet()) {
                TimeoutRunnable runnable = mRunnables.get(key);
                if (key > position) {
                    key--;
                    runnable.setPosition(key);
                    newRunnables.put(key, runnable);
                } else if (key != position) {
                    newRunnables.put(key, runnable);
                }
            }

            mRunnables.clear();
            mRunnables.putAll(newRunnables);
            newRunnables.clear();
        }
    }

    /**
     * A {@link Runnable} class which dismisses a position when executed.
     */
    private class TimeoutRunnable implements Runnable {

        private int mPosition;

        TimeoutRunnable(final int position) {
            mPosition = position;
        }

        @Override
        public void run() {
            dismiss(mPosition);
        }

        public int getPosition() {
            return mPosition;
        }

        public void setPosition(final int position) {
            mPosition = position;
        }
    }
}


text:
<o2 use O2CMS::ApplicationFrame/>

<o2 header title="Sitemap generated" />

<o2 addCss>
  div.shell {
    background: black;
    color: #aaff88;
    width: 600px;
    padding: 15px;
    margin: 15px;
    border: 2px inset grey;
  }
  div.shellError {
    color: red;
  }
</o2:addCss>

<o2 ApplicationFrameHeader frameTitle="Sitemap generated" showCloseButton="0" useCloseAction="confirmClose" disableScrollBar="1" showSettingsButton="0" />

  Generating sitemap. Output from script:

  $scriptOutput

    $scriptError

  If the script succeeded, the sitemap can be found here:
  $store_into

<o2 ApplicationFrameFooter statusBar>
  <o2 addCell>Current path:</o2:addCell>
</o2:ApplicationFrameFooter>

<o2 footer />


text:
import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';

import { FinishComponent }  from './finish.component';

@NgModule({
    imports: [
        BrowserModule,
        RouterModule],
    declarations: [FinishComponent],
    exports: [FinishComponent],
})
export class FinishModule { }


text:
namespace Daishi.Microservices.Components.Serialisation {
    public class NumericJsonProperty : JsonProperty {
        public override string FormatValue() {
            return Value.ToString();
        }
    }
}


text:
package phoenix_test

import (
	"crypto/tls"
	"io/ioutil"
	"net/http"
	"testing"

	phoenix "."
)

var okHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte("ok"))
})

func simpleTLSRunFunc(runtime phoenix.Runtime) error {
	runtime.DefaultHTTPSHandler(okHandler)
	return runtime.Start()
}

func Test_Server_DefaultTLSServer_IsConnectableAfterStartup(t *testing.T) {
	// NOTE(lcooper): simply making requests to localhost is far easier
	// than generating a cert with an IP SAN. If this changes, feel free
	// to use 127.0.0.1 instead.
	baseURL := "localhost:62001"
	server := phoenix.NewServer("integration-test", "unreleased").
		OverrideOption("https", "listen", baseURL).
		OverrideOption("https", "certificate", "testdata/server.crt").
		OverrideOption("https", "key", "testdata/key.pem")
	withTestServer(t, server, simpleTLSRunFunc, func() {
		client := &http.Client{
			Transport: &http.Transport{
				TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
			},
		}

		resp, err := client.Get("https://" + baseURL + "/")
		if err != nil {
			t.Errorf("unexpected error making HTTP request: %v", err)
		}

		data, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			t.Errorf("unexpected error reading response body: %v", err)
		}

		if string(data) != "ok" {
			t.Errorf("Expected data to be 'ok', but was '%s'", data)
		}
	})
}


text:
require 'test_helper'

class Api::V1::CntHelperTest < ActionView::TestCase
end


text:
package se.rj.govie.search.repository;

import org.testng.Assert;
import org.testng.annotations.Test;
import se.rj.govie.model.Movie;
import se.rj.govie.request.SearchMovieRequest;
import se.rj.govie.search.repository.tmdb.TMDBMovieRepository;

import java.util.List;

public class TMDBMovieRepositoryTest {

    @Test
    public void given_when_then() throws Exception {
        List<Movie> movies = new TMDBMovieRepository().searchInCinemas(new SearchMovieRequest("hei", "hopp"));
        Assert.assertFalse(movies.isEmpty());
    }
}


text:
using System.Net.Http;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNetCore.Server.IntegrationTesting;

internal sealed class LoggingHandler : DelegatingHandler
{
    private readonly ILogger _logger;

    public LoggingHandler(ILoggerFactory loggerFactory, HttpMessageHandler innerHandler) : base(innerHandler)
    {
        _logger = loggerFactory.CreateLogger<HttpClient>();
    }

    protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
        _logger.LogDebug("Sending {method} {url}", request.Method, request.RequestUri);
        try
        {
            var response = await base.SendAsync(request, cancellationToken);
            _logger.LogDebug("Received {statusCode} {reasonPhrase} {url}", response.StatusCode, response.ReasonPhrase, request.RequestUri);
            return response;
        }
        catch (Exception ex)
        {
            _logger.LogError(0, ex, "Exception while sending '{method} {url}' : {exception}", request.Method, request.RequestUri, ex);
            throw;
        }
    }
}


text:
#ifndef SQLPP_POSTGRESQL_H
#define SQLPP_POSTGRESQL_H

#include <sqlpp11/postgresql/connection.h>
#include <sqlpp11/postgresql/result.h>

#endif