text:
struct ReceivedDataStats {
  int32_t frameNumber = 0;
  int32_t numberOfFrames = 2;
  int64_t totalBytesReceived = 0;
  int32_t numberOfMessagesReceived = 0;
  int numberOfFramesReceived = 0; // to check no messages lost
  uint64_t previousMessageID = std::numeric_limits<uint64_t>::max();
};

class NexusSubscriber {
public:
  NexusSubscriber(std::shared_ptr<EventSubscriber> subscriber,
                  const std::string &brokerAddress,
                  const std::string &streamName, const bool quietMode,
                  const std::string &filename);

  void listen();
  void decodeMessage(std::shared_ptr<EventData> eventData,
                     const std::string &rawbuf,
                     std::shared_ptr<ReceivedDataStats> receivedDataStats);

private:
  std::shared_ptr<EventSubscriber> m_subscriber;
  std::shared_ptr<NexusFileWriter> m_filewriter;
  bool m_quietMode = false;
  bool m_running = false;
  std::unordered_map<uint64_t, std::string> m_futureMessages;

  void processMessage(std::shared_ptr<EventData> receivedData,
                      const std::string &message,
                      std::shared_ptr<ReceivedDataStats> receivedDataStats);
  void reportProgress(const float progress);
};

#endif // ISIS_NEXUS_STREAMER_NEXUSSUBSCRIBER_H


text:
namespace Tests.Actions.MagicItemGeneration
{
    using Xunit;
    using SilverNeedle.Actions.MagicItemGeneration;
    using SilverNeedle.Equipment;
    using SilverNeedle.Spells;
    using SilverNeedle.Serialization;

    public class PotionCreatorTests : RequiresDataFiles
    {
        [Theory]
        [InlineData(1, 5000)]
        [InlineData(2, 30000)]
        [InlineData(3, 75000)]
        public void SelectAPotionFromAListOfSpellsAndChargesProperly(int level, int value)
        {
            var spellList = SpellList.CreateForTesting("cleric");
            spellList.Add(level, "Cure Light Wounds");
            var cureSpell = new Spell("Cure Light Wounds", "healing");
            var spellLists = EntityGateway<SpellList>.LoadWithSingleItem(spellList);
            var spells = EntityGateway<Spell>.LoadWithSingleItem(cureSpell);

            var potionCreator = new PotionCreator(spellLists, spells);
            var potion = potionCreator.Process();

            Assert.Equal(cureSpell, potion.Spell);
            Assert.Equal(value, potion.Value);
        }

        [Theory]
        [Repeat(100)]
        public void MaxSpellLevelIsLevel3()
        {
            var spellList = SpellList.CreateForTesting("cleric");
            spellList.Add(1, "Cure Light Wounds");
            spellList.Add(4, "Cure Serious Wounds");
            var cureSpell = new Spell("Cure Light Wounds", "healing");
            var cureSeriousSpell = new Spell("Cure Serious Wounds", "healing");
            var spellLists = EntityGateway<SpellList>.LoadWithSingleItem(spellList);
            var spells = EntityGateway<Spell>.LoadFromList(new Spell[] { cureSpell, cureSeriousSpell });

            var potionCreator = new PotionCreator(spellLists, spells);
            var potion = potionCreator.Process();

            //Always equals cureSpell
            Assert.Equal(cureSpell, potion.Spell);
        }

    }
}

redpajama_set_name: RedPajamaGithub


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

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>C-Index</title>
<meta name="date" content="2015-01-22">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

B C D F G H I L M N O Q R S U V

C

callback(HttpServletRequest, HttpServletResponse) - Method in class com.share.mod.pay.ums.UMSHandler

com.share.mod.pay.ums.inter - package com.share.mod.pay.ums.inter

create(HttpServletRequest, HttpServletResponse) - Method in class com.share.mod.pay.ums.UMSHandler

createMerOrderId(HttpServletRequest) - Method in interface com.share.mod.pay.ums.inter.ICreate

订单号,商户根据自己的规则生成, 最长32位

creatOrderUrl - Static variable in class com.share.mod.pay.ums.UMSConfig

B C D F G H I L M N O Q R S U V

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
using System;

namespace ClosedXML.Excel
{
    public enum XLSheetViewOptions { Normal, PageBreakPreview, PageLayout }

    public interface IXLSheetView
    {
        /// <summary>
        /// Gets or sets the column after which the horizontal split should take place.
        /// </summary>
        Int32 SplitColumn { get; set; }

        /// <summary>
        /// Gets or sets the row after which the vertical split should take place.
        /// </summary>
        Int32 SplitRow { get; set; }

        /// <summary>
        /// Gets or sets the location of the top left visible cell
        /// </summary>
        /// <value>
        /// The scroll position's top left cell.
        /// </value>
        IXLAddress TopLeftCellAddress { get; set; }

        XLSheetViewOptions View { get; set; }

        IXLWorksheet Worksheet { get; }

        /// <summary>
        /// Window zoom magnification for current view representing percent values. Horizontal and vertical scale together.
        /// </summary>
        /// <remarks>Representing percent values ranging from 10 to 400.</remarks>
        Int32 ZoomScale { get; set; }

        /// <summary>
        /// Zoom magnification to use when in normal view. Horizontal and vertical scale together
        /// </summary>
        /// <remarks>Representing percent values ranging from 10 to 400.</remarks>
        Int32 ZoomScaleNormal { get; set; }

        /// <summary>
        /// Zoom magnification to use when in page layout view. Horizontal and vertical scale together.
        /// </summary>
        /// <remarks>Representing percent values ranging from 10 to 400.</remarks>
        Int32 ZoomScalePageLayoutView { get; set; }

        /// <summary>
        /// Zoom magnification to use when in page break preview. Horizontal and vertical scale together.
        /// </summary>
        /// <remarks>Representing percent values ranging from 10 to 400.</remarks>
        Int32 ZoomScaleSheetLayoutView { get; set; }

        /// <summary>
        /// Freezes the specified rows and columns.
        /// </summary>
        /// <param name="rows">The rows to freeze.</param>
        /// <param name="columns">The columns to freeze.</param>
        void Freeze(Int32 rows, Int32 columns);

        /// <summary>
        /// Freezes the left X columns.
        /// </summary>
        /// <param name="columns">The columns to freeze.</param>
        void FreezeColumns(Int32 columns);

        //Boolean FreezePanes { get; set; }
        /// <summary>
        /// Freezes the top X rows.
        /// </summary>
        /// <param name="rows">The rows to freeze.</param>
        void FreezeRows(Int32 rows);

        IXLSheetView SetView(XLSheetViewOptions value);
    }
}


text:
var content = portal.content;
var pageRegions = portal.pageRegions;
var site = portal.siteContent;
var contents = system.contentService.getChildContent(site.path);
var editMode = portal.request.mode == 'edit';

var params = {
	context: portal,
	pageRegions: pageRegions,
	mainRegion: pageRegions.getRegion("main"),
	contents: contents,
	editable: editMode,
	banner: false,
    site: site,
    content: content,
    logoUrl: getLogoUrl()
};

var body = system.thymeleaf.render('view/page.html', params);

portal.response.contentType = 'text/html';
portal.response.body = body;

function getLogoUrl() {
    var logoContent;
    var logo = site.contentData.getProperty('logo');
    if (logo) {
        logoContent = system.contentService.getContentById(logo.getString());
    }

    if (logoContent) {
        return portal.url.createImageByIdUrl(logoContent.id).filter("scaleblock(115,26)");
    } else {
        return portal.url.createResourceUrl('images/logo.png');
    }
}


text:
abstract Sampler

#
# the expected interface of a sampler is:
#
# numparams(s::Sampler)
#		- the number parameters (including those of any samplers this sampler modifies)
# setparams!(s::Sampler, params::Vector{Real})
#		- updates the parameters of the sampler (if the sampler modifies another, this sets the parameter of both)
#		- if parameters pass checks on their number and ranges (e.g. using the checkparamranges function below), then
#		  the values should be accommodated in a sensible way even if they break other constraints (a warning may
#         still be raised, though); this is to facilate the use of search on the parameters
# paramranges(s::Sampler)
#		- returns an array specifying the valid ranges for each parameter of the sampler (if the sampler modifies others,
#         returns the parameter ranges of the modified sampler as well)
#		- the number and range of the parameter are assumed to remain constant even if the params are changed
# getparams(s::Sampler)
#		- returns the current parameters (currently used only to default parameters of a modifying sampler)
# sample(s::Sampler, support, cc::ChoiceContext)
#		- sample a Gödel number from the sampler
#		- samplers need not honour the support constraints; they are provided only to samplers that do take this into account
# estimateparams!(s::Sampler, traces)
#		- estiamte the parameters of the sampler from the passed traces
#
#
# note also that for consistency, samplers allow parameters to be specified in their constructor, but if
# the parameter array is empty, sensible defaults are set instead - however, this is not required
#

# it is assumed that the parameters ranges and number remains constant after construction, and so, these methods
# are provided for convenience:

numparams(s::Sampler) = length(paramranges(s))

# called from setparams to validate passed parameters
function checkparamranges(s::Sampler, params::Vector{Float64})
	pranges = paramranges(s)
	length(params) == length(pranges) || error("expected $(length(pranges)) parameters but got $(length(params))")
	for i in 1:length(pranges)
		prange = pranges[i]
		params[i] >= prange[1] || error("parameter $(i) must be >= $(prange[1]) but was $(params[i])")
		params[i] <= prange[2] || error("parameter $(i) must be <= $(prange[2]) but was $(params[i])")
	end
end

# identifies whether the sampler supports estimating the model, i.e. setting features other than the parameters, such
# as conditionality on other choice points or on the recursion depth (either of which may change the number of parameters)
supportsconditionalmodelestimation(s::Sampler) = method_exists(estimateconditionalmodel, (typeof(s), Any, Any, Any))

# supports pretty printing
function getsamplertypename(s::Sampler)
	samplertypename = "$(typeof(s))"
	if startswith(samplertypename, "DataGenerators.")
		samplertypename = samplertypename[length("DataGenerators.")+1:end]
	end
	samplertypename
end

include(joinpath("distribution_samplers", "distribution_sampler.jl"))
include(joinpath("modifying_samplers", "modifying_sampler.jl"))


text:
"""Tests for the Tuya config flow."""
from unittest.mock import Mock, patch

import pytest
from tuyaha.devices.climate import STEP_HALVES
from tuyaha.tuyaapi import TuyaAPIException, TuyaNetException

from homeassistant import config_entries, data_entry_flow
from homeassistant.components.tuya.config_flow import (
    CONF_LIST_DEVICES,
    ERROR_DEV_MULTI_TYPE,
    ERROR_DEV_NOT_CONFIG,
    ERROR_DEV_NOT_FOUND,
    RESULT_AUTH_FAILED,
    RESULT_CONN_ERROR,
    RESULT_SINGLE_INSTANCE,
)
from homeassistant.components.tuya.const import (
    CONF_BRIGHTNESS_RANGE_MODE,
    CONF_COUNTRYCODE,
    CONF_CURR_TEMP_DIVIDER,
    CONF_DISCOVERY_INTERVAL,
    CONF_MAX_KELVIN,
    CONF_MAX_TEMP,
    CONF_MIN_KELVIN,
    CONF_MIN_TEMP,
    CONF_QUERY_DEVICE,
    CONF_QUERY_INTERVAL,
    CONF_SET_TEMP_DIVIDED,
    CONF_SUPPORT_COLOR,
    CONF_TEMP_DIVIDER,
    CONF_TEMP_STEP_OVERRIDE,
    CONF_TUYA_MAX_COLTEMP,
    DOMAIN,
    TUYA_DATA,
)
from homeassistant.const import (
    CONF_PASSWORD,
    CONF_PLATFORM,
    CONF_UNIT_OF_MEASUREMENT,
    CONF_USERNAME,
    TEMP_CELSIUS,
)

from .common import CLIMATE_ID, LIGHT_ID, LIGHT_ID_FAKE1, LIGHT_ID_FAKE2, MockTuya

from tests.common import MockConfigEntry

USERNAME = "myUsername"
PASSWORD = "myPassword"
COUNTRY_CODE = "1"
TUYA_PLATFORM = "tuya"

TUYA_USER_DATA = {
    CONF_USERNAME: USERNAME,
    CONF_PASSWORD: PASSWORD,
    CONF_COUNTRYCODE: COUNTRY_CODE,
    CONF_PLATFORM: TUYA_PLATFORM,
}

@pytest.fixture(name="tuya")
def tuya_fixture() -> Mock:
    """Patch libraries."""
    with patch("homeassistant.components.tuya.config_flow.TuyaApi") as tuya:
        yield tuya

@pytest.fixture(name="tuya_setup", autouse=True)
def tuya_setup_fixture():
    """Mock tuya entry setup."""
    with patch("homeassistant.components.tuya.async_setup_entry", return_value=True):
        yield

async def test_user(hass, tuya):
    """Test user config."""
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "user"

    result = await hass.config_entries.flow.async_configure(
        result["flow_id"], user_input=TUYA_USER_DATA
    )
    await hass.async_block_till_done()

    assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
    assert result["title"] == USERNAME
    assert result["data"][CONF_USERNAME] == USERNAME
    assert result["data"][CONF_PASSWORD] == PASSWORD
    assert result["data"][CONF_COUNTRYCODE] == COUNTRY_CODE
    assert result["data"][CONF_PLATFORM] == TUYA_PLATFORM
    assert not result["result"].unique_id

async def test_import(hass, tuya):
    """Test import step."""
    result = await hass.config_entries.flow.async_init(
        DOMAIN,
        context={"source": config_entries.SOURCE_IMPORT},
        data=TUYA_USER_DATA,
    )
    await hass.async_block_till_done()

    assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
    assert result["title"] == USERNAME
    assert result["data"][CONF_USERNAME] == USERNAME
    assert result["data"][CONF_PASSWORD] == PASSWORD
    assert result["data"][CONF_COUNTRYCODE] == COUNTRY_CODE
    assert result["data"][CONF_PLATFORM] == TUYA_PLATFORM
    assert not result["result"].unique_id

async def test_abort_if_already_setup(hass, tuya):
    """Test we abort if Tuya is already setup."""
    MockConfigEntry(domain=DOMAIN, data=TUYA_USER_DATA).add_to_hass(hass)

    # Should fail, config exist (import)
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}, data=TUYA_USER_DATA
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
    assert result["reason"] == RESULT_SINGLE_INSTANCE

    # Should fail, config exist (flow)
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=TUYA_USER_DATA
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
    assert result["reason"] == RESULT_SINGLE_INSTANCE

async def test_abort_on_invalid_credentials(hass, tuya):
    """Test when we have invalid credentials."""
    tuya().init.side_effect = TuyaAPIException("Boom")

    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}, data=TUYA_USER_DATA
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["errors"] == {"base": RESULT_AUTH_FAILED}

    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=TUYA_USER_DATA
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
    assert result["reason"] == RESULT_AUTH_FAILED

async def test_abort_on_connection_error(hass, tuya):
    """Test when we have a network error."""
    tuya().init.side_effect = TuyaNetException("Boom")

    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}, data=TUYA_USER_DATA
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
    assert result["reason"] == RESULT_CONN_ERROR

    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=TUYA_USER_DATA
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
    assert result["reason"] == RESULT_CONN_ERROR

async def test_options_flow(hass):
    """Test config flow options."""
    config_entry = MockConfigEntry(
        domain=DOMAIN,
        data=TUYA_USER_DATA,
    )
    config_entry.add_to_hass(hass)

    # Set up the integration to make sure the config flow module is loaded.
    assert await hass.config_entries.async_setup(config_entry.entry_id)
    await hass.async_block_till_done()

    # Unload the integration to prepare for the test.
    with patch("homeassistant.components.tuya.async_unload_entry", return_value=True):
        assert await hass.config_entries.async_unload(config_entry.entry_id)
        await hass.async_block_till_done()

    # Test check for integration not loaded
    result = await hass.config_entries.options.async_init(config_entry.entry_id)
    assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
    assert result["reason"] == RESULT_CONN_ERROR

    # Load integration and enter options
    await hass.config_entries.async_setup(config_entry.entry_id)
    await hass.async_block_till_done()
    hass.data[DOMAIN] = {TUYA_DATA: MockTuya()}
    result = await hass.config_entries.options.async_init(config_entry.entry_id)

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "init"

    # Test dev not found error
    result = await hass.config_entries.options.async_configure(
        result["flow_id"],
        user_input={CONF_LIST_DEVICES: [f"light-{LIGHT_ID_FAKE1}"]},
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "init"
    assert result["errors"] == {"base": ERROR_DEV_NOT_FOUND}

    # Test dev type error
    result = await hass.config_entries.options.async_configure(
        result["flow_id"],
        user_input={CONF_LIST_DEVICES: [f"light-{LIGHT_ID_FAKE2}"]},
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "init"
    assert result["errors"] == {"base": ERROR_DEV_NOT_CONFIG}

    # Test multi dev error
    result = await hass.config_entries.options.async_configure(
        result["flow_id"],
        user_input={CONF_LIST_DEVICES: [f"climate-{CLIMATE_ID}", f"light-{LIGHT_ID}"]},
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "init"
    assert result["errors"] == {"base": ERROR_DEV_MULTI_TYPE}

    # Test climate options form
    result = await hass.config_entries.options.async_configure(
        result["flow_id"], user_input={CONF_LIST_DEVICES: [f"climate-{CLIMATE_ID}"]}
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "device"

    result = await hass.config_entries.options.async_configure(
        result["flow_id"],
        user_input={
            CONF_UNIT_OF_MEASUREMENT: TEMP_CELSIUS,
            CONF_TEMP_DIVIDER: 10,
            CONF_CURR_TEMP_DIVIDER: 5,
            CONF_SET_TEMP_DIVIDED: False,
            CONF_TEMP_STEP_OVERRIDE: STEP_HALVES,
            CONF_MIN_TEMP: 12,
            CONF_MAX_TEMP: 22,
        },
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "init"

    # Test light options form
    result = await hass.config_entries.options.async_configure(
        result["flow_id"], user_input={CONF_LIST_DEVICES: [f"light-{LIGHT_ID}"]}
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "device"

    result = await hass.config_entries.options.async_configure(
        result["flow_id"],
        user_input={
            CONF_SUPPORT_COLOR: True,
            CONF_BRIGHTNESS_RANGE_MODE: 1,
            CONF_MIN_KELVIN: 4000,
            CONF_MAX_KELVIN: 5000,
            CONF_TUYA_MAX_COLTEMP: 12000,
        },
    )

    assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
    assert result["step_id"] == "init"

    # Test common options
    result = await hass.config_entries.options.async_configure(
        result["flow_id"],
        user_input={
            CONF_DISCOVERY_INTERVAL: 100,
            CONF_QUERY_INTERVAL: 50,
            CONF_QUERY_DEVICE: LIGHT_ID,
        },
    )

    # Verify results
    assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY

    climate_options = config_entry.options[CLIMATE_ID]
    assert climate_options[CONF_UNIT_OF_MEASUREMENT] == TEMP_CELSIUS
    assert climate_options[CONF_TEMP_DIVIDER] == 10
    assert climate_options[CONF_CURR_TEMP_DIVIDER] == 5
    assert climate_options[CONF_SET_TEMP_DIVIDED] is False
    assert climate_options[CONF_TEMP_STEP_OVERRIDE] == STEP_HALVES
    assert climate_options[CONF_MIN_TEMP] == 12
    assert climate_options[CONF_MAX_TEMP] == 22

    light_options = config_entry.options[LIGHT_ID]
    assert light_options[CONF_SUPPORT_COLOR] is True
    assert light_options[CONF_BRIGHTNESS_RANGE_MODE] == 1
    assert light_options[CONF_MIN_KELVIN] == 4000
    assert light_options[CONF_MAX_KELVIN] == 5000
    assert light_options[CONF_TUYA_MAX_COLTEMP] == 12000

    assert config_entry.options[CONF_DISCOVERY_INTERVAL] == 100
    assert config_entry.options[CONF_QUERY_INTERVAL] == 50
    assert config_entry.options[CONF_QUERY_DEVICE] == LIGHT_ID


text:
package com.jvm_bloggers.core.social.twitter;

import com.jvm_bloggers.core.blogpost_redirect.LinkGenerator;
import com.jvm_bloggers.entities.blog.Blog;
import com.jvm_bloggers.entities.blog_post.BlogPost;
import com.jvm_bloggers.entities.newsletter_issue.NewsletterIssue;

import io.vavr.collection.List;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;
import org.stringtemplate.v4.ST;

import java.util.Objects;

import static lombok.AccessLevel.PACKAGE;

@Component
@Slf4j
@RequiredArgsConstructor(access = PACKAGE)
class TweetContentGenerator {

    private static final String MESSAGE_TEMPLATE =
        "Nowy numer #<number> już online - <link> z postami między innymi <personal1>"
            + "<if(company && personal2)>, <company> i <personal2>"
            + "<elseif(company)> i <company>"
            + "<elseif(personal2)> i <personal2><endif> #java #jvm";

    private final LinkGenerator linkGenerator;

    public String generateTweetContent(NewsletterIssue issue) {
        final List<String> personals =
            List.ofAll(issue.getBlogPosts())
                .map(BlogPost::getBlog)
                .filter(Blog::isPersonal)
                .map(Blog::getTwitter)
                .filter(Objects::nonNull)
                .distinct()
                .shuffle()
                .take(2)
                .padTo(2, null);

        final String company =
            List.ofAll(issue.getBlogPosts())
                .map(BlogPost::getBlog)
                .filter(Blog::isCompany)
                .map(Blog::getTwitter)
                .filter(Objects::nonNull)
                .shuffle()
                .getOrElse((String) null);

        final String issueLink = linkGenerator.generateIssueLink(issue.getIssueNumber());

        final ST template = new ST(MESSAGE_TEMPLATE);
        template.add("number", issue.getIssueNumber());
        template.add("link", issueLink);
        template.add("personal1", personals.head());
        template.add("personal2", personals.last());
        template.add("company", company);
        return template.render();
    }
}


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

<title>KeepAliveInputStream (Apache Ant API)</title>
<meta name="date" content="2016-04-09">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.tools.ant.util

Class KeepAliveInputStream

java.lang.Object

java.io.InputStream

java.io.FilterInputStream

org.apache.tools.ant.util.KeepAliveInputStream

All Implemented Interfaces:

java.io.Closeable, java.lang.AutoCloseable

public class KeepAliveInputStream
extends java.io.FilterInputStream

Class that can be used to wrap <tt>System.in</tt>
 without getting anxious about any client closing the stream.

 In code-language it means that it is not necessary to do:

 if (out != System.in) {
   in.close();
 }

Since:

Ant 1.6

Field Summary

Fields inherited from class java.io.FilterInputStream

in

Constructor Summary

Constructors

Constructor and Description

KeepAliveInputStream(java.io.InputStream in)

Constructor of KeepAliveInputStream.

Method Summary

Methods

Modifier and Type
Method and Description

void
close()

This method does nothing.

static java.io.InputStream
wrapSystemIn()

Convenience factory method that returns a non-closing
 InputStream around System.in.

Methods inherited from class java.io.FilterInputStream

available, mark, markSupported, read, read, read, reset, skip

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

KeepAliveInputStream

public KeepAliveInputStream(java.io.InputStream in)

Constructor of KeepAliveInputStream.

Parameters:

in - an InputStream value, it should be standard input.

Method Detail

close

public void close()
           throws java.io.IOException

This method does nothing.

Specified by:

close in interface java.io.Closeable

Specified by:

close in interface java.lang.AutoCloseable

Overrides:

close in class java.io.FilterInputStream

Throws:

java.io.IOException - as we are overriding FilterInputStream.

wrapSystemIn

public static java.io.InputStream wrapSystemIn()

Convenience factory method that returns a non-closing
 InputStream around System.in.

Since:

Ant 1.8.0

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.github.hermanzdosilovic.primeartist (Prime Artist documentation)</title>
<meta name="date" content="2014-12-16">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

com.github.hermanzdosilovic.primeartist

Classes

Artist

Canvas

ColorView

PrimeArtist


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 104: 186 (2008)

#### Original name
Melanelixia subvillosella H.Y. Wang & J.C. Wei

### Remarks
null


text:
/*************************************************************************/
/*  godot_webxr.h                                                        */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef GODOT_WEBXR_H
#define GODOT_WEBXR_H

#ifdef __cplusplus
extern "C" {
#endif

#include "stddef.h"

typedef void (*GodotWebXRSupportedCallback)(char *p_session_mode, int p_supported);
typedef void (*GodotWebXRStartedCallback)(char *p_reference_space_type);
typedef void (*GodotWebXREndedCallback)();
typedef void (*GodotWebXRFailedCallback)(char *p_message);
typedef void (*GodotWebXRControllerCallback)();
typedef void (*GodotWebXRInputEventCallback)(char *p_signal_name, int p_controller_id);
typedef void (*GodotWebXRSimpleEventCallback)(char *p_signal_name);

extern int godot_webxr_is_supported();
extern void godot_webxr_is_session_supported(const char *p_session_mode, GodotWebXRSupportedCallback p_callback);

extern void godot_webxr_initialize(
		const char *p_session_mode,
		const char *p_required_features,
		const char *p_optional_features,
		const char *p_requested_reference_space_types,
		GodotWebXRStartedCallback p_on_session_started,
		GodotWebXREndedCallback p_on_session_ended,
		GodotWebXRFailedCallback p_on_session_failed,
		GodotWebXRControllerCallback p_on_controller_changed,
		GodotWebXRInputEventCallback p_on_input_event,
		GodotWebXRSimpleEventCallback p_on_simple_event);
extern void godot_webxr_uninitialize();

extern int godot_webxr_get_view_count();
extern int *godot_webxr_get_render_target_size();
extern float *godot_webxr_get_transform_for_eye(int p_eye);
extern float *godot_webxr_get_projection_for_eye(int p_eye);
extern int godot_webxr_get_external_texture_for_eye(int p_eye);
extern void godot_webxr_commit_for_eye(int p_eye);

extern void godot_webxr_sample_controller_data();
extern int godot_webxr_get_controller_count();
extern int godot_webxr_is_controller_connected(int p_controller);
extern float *godot_webxr_get_controller_transform(int p_controller);
extern int *godot_webxr_get_controller_buttons(int p_controller);
extern int *godot_webxr_get_controller_axes(int p_controller);

extern char *godot_webxr_get_visibility_state();
extern int *godot_webxr_get_bounds_geometry();

#ifdef __cplusplus
}
#endif

#endif /* GODOT_WEBXR_H */


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.sql.gen;

import com.facebook.presto.byteCode.Block;
import com.facebook.presto.byteCode.ByteCodeNode;
import com.facebook.presto.byteCode.ClassDefinition;
import com.facebook.presto.byteCode.Scope;
import com.facebook.presto.byteCode.DynamicClassLoader;
import com.facebook.presto.byteCode.FieldDefinition;
import com.facebook.presto.byteCode.MethodDefinition;
import com.facebook.presto.byteCode.OpCode;
import com.facebook.presto.byteCode.Parameter;
import com.facebook.presto.byteCode.Variable;
import com.facebook.presto.byteCode.control.IfStatement;
import com.facebook.presto.byteCode.expression.ByteCodeExpression;
import com.facebook.presto.byteCode.instruction.LabelNode;
import com.facebook.presto.operator.InMemoryJoinHash;
import com.facebook.presto.operator.LookupSource;
import com.facebook.presto.operator.PagesHashStrategy;
import com.facebook.presto.spi.PageBuilder;
import com.facebook.presto.spi.block.BlockBuilder;
import com.facebook.presto.spi.type.BigintType;
import com.facebook.presto.spi.type.Type;
import com.google.common.base.Throwables;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.ExecutionError;
import com.google.common.util.concurrent.UncheckedExecutionException;
import it.unimi.dsi.fastutil.longs.LongArrayList;

import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ExecutionException;

import static com.facebook.presto.byteCode.Access.FINAL;
import static com.facebook.presto.byteCode.Access.PRIVATE;
import static com.facebook.presto.byteCode.Access.PUBLIC;
import static com.facebook.presto.byteCode.Access.a;
import static com.facebook.presto.byteCode.Parameter.arg;
import static com.facebook.presto.byteCode.ParameterizedType.type;
import static com.facebook.presto.byteCode.expression.ByteCodeExpressions.constantInt;
import static com.facebook.presto.byteCode.expression.ByteCodeExpressions.constantNull;
import static com.facebook.presto.byteCode.expression.ByteCodeExpressions.notEqual;
import static com.facebook.presto.sql.gen.CompilerUtils.defineClass;
import static com.facebook.presto.sql.gen.CompilerUtils.makeClassName;
import static com.facebook.presto.sql.gen.SqlTypeByteCodeExpression.constantType;
import static com.google.common.base.Preconditions.checkNotNull;

public class JoinCompiler
{
    private final LoadingCache<CacheKey, LookupSourceFactory> lookupSourceFactories = CacheBuilder.newBuilder().maximumSize(1000).build(
            new CacheLoader<CacheKey, LookupSourceFactory>()
            {
                @Override
                public LookupSourceFactory load(CacheKey key)
                        throws Exception
                {
                    return internalCompileLookupSourceFactory(key.getTypes(), key.getJoinChannels());
                }
            });

    private final LoadingCache<CacheKey, Class<? extends PagesHashStrategy>> hashStrategies = CacheBuilder.newBuilder().maximumSize(1000).build(
            new CacheLoader<CacheKey, Class<? extends PagesHashStrategy>>() {
                @Override
                public Class<? extends PagesHashStrategy> load(CacheKey key)
                        throws Exception
                {
                    return internalCompileHashStrategy(key.getTypes(), key.getJoinChannels());
                }
            });

    public LookupSourceFactory compileLookupSourceFactory(List<? extends Type> types, List<Integer> joinChannels)
    {
        try {
            return lookupSourceFactories.get(new CacheKey(types, joinChannels));
        }
        catch (ExecutionException | UncheckedExecutionException | ExecutionError e) {
            throw Throwables.propagate(e.getCause());
        }
    }

    public PagesHashStrategyFactory compilePagesHashStrategyFactory(List<Type> types, List<Integer> joinChannels)
    {
        checkNotNull(types, "types is null");
        checkNotNull(joinChannels, "joinChannels is null");

        try {
            return new PagesHashStrategyFactory(hashStrategies.get(new CacheKey(types, joinChannels)));
        }
        catch (ExecutionException | UncheckedExecutionException | ExecutionError e) {
            throw Throwables.propagate(e.getCause());
        }
    }

    private LookupSourceFactory internalCompileLookupSourceFactory(List<Type> types, List<Integer> joinChannels)
    {
        Class<? extends PagesHashStrategy> pagesHashStrategyClass = internalCompileHashStrategy(types, joinChannels);

        Class<? extends LookupSource> lookupSourceClass = IsolatedClass.isolateClass(
                new DynamicClassLoader(getClass().getClassLoader()),
                LookupSource.class,
                InMemoryJoinHash.class);

        return new LookupSourceFactory(lookupSourceClass, new PagesHashStrategyFactory(pagesHashStrategyClass));
    }

    private Class<? extends PagesHashStrategy> internalCompileHashStrategy(List<Type> types, List<Integer> joinChannels)
    {
        CallSiteBinder callSiteBinder = new CallSiteBinder();

        ClassDefinition classDefinition = new ClassDefinition(
                a(PUBLIC, FINAL),
                makeClassName("PagesHashStrategy"),
                type(Object.class),
                type(PagesHashStrategy.class));

        List<FieldDefinition> channelFields = new ArrayList<>();
        for (int i = 0; i < types.size(); i++) {
            FieldDefinition channelField = classDefinition.declareField(a(PRIVATE, FINAL), "channel_" + i, type(List.class, com.facebook.presto.spi.block.Block.class));
            channelFields.add(channelField);
        }
        List<Type> joinChannelTypes = new ArrayList<>();
        List<FieldDefinition> joinChannelFields = new ArrayList<>();
        for (int i = 0; i < joinChannels.size(); i++) {
            joinChannelTypes.add(types.get(joinChannels.get(i)));
            FieldDefinition channelField = classDefinition.declareField(a(PRIVATE, FINAL), "joinChannel_" + i, type(List.class, com.facebook.presto.spi.block.Block.class));
            joinChannelFields.add(channelField);
        }
        FieldDefinition hashChannelField = classDefinition.declareField(a(PRIVATE, FINAL), "hashChannel", type(List.class, com.facebook.presto.spi.block.Block.class));

        generateConstructor(classDefinition, joinChannels, channelFields, joinChannelFields, hashChannelField);
        generateGetChannelCountMethod(classDefinition, channelFields);
        generateAppendToMethod(classDefinition, callSiteBinder, types, channelFields);
        generateHashPositionMethod(classDefinition, callSiteBinder, joinChannelTypes, joinChannelFields, hashChannelField);
        generateHashRowMethod(classDefinition, callSiteBinder, joinChannelTypes);
        generateRowEqualsRowMethod(classDefinition, callSiteBinder, joinChannelTypes);
        generatePositionEqualsRowMethod(classDefinition, callSiteBinder, joinChannelTypes, joinChannelFields);
        generatePositionEqualsPositionMethod(classDefinition, callSiteBinder, joinChannelTypes, joinChannelFields);

        return defineClass(classDefinition, PagesHashStrategy.class, callSiteBinder.getBindings(), getClass().getClassLoader());
    }

    private void generateConstructor(ClassDefinition classDefinition,
            List<Integer> joinChannels,
            List<FieldDefinition> channelFields,
            List<FieldDefinition> joinChannelFields,
            FieldDefinition hashChannelField)
    {
        Parameter channels = arg("channels", type(List.class, type(List.class, com.facebook.presto.spi.block.Block.class)));
        Parameter hashChannel = arg("hashChannel", type(Optional.class, Integer.class));
        MethodDefinition constructorDefinition = classDefinition.declareConstructor(a(PUBLIC), channels, hashChannel);

        Variable thisVariable = constructorDefinition.getThis();

        Block constructor = constructorDefinition
                .getBody()
                .comment("super();")
                .append(thisVariable)
                .invokeConstructor(Object.class);

        constructor.comment("Set channel fields");

        for (int index = 0; index < channelFields.size(); index++) {
            ByteCodeExpression channel = channels.invoke("get", Object.class, constantInt(index))
                    .cast(type(List.class, com.facebook.presto.spi.block.Block.class));

            constructor.append(thisVariable.setField(channelFields.get(index), channel));
        }

        constructor.comment("Set join channel fields");
        for (int index = 0; index < joinChannelFields.size(); index++) {
            ByteCodeExpression joinChannel = channels.invoke("get", Object.class, constantInt(joinChannels.get(index)))
                    .cast(type(List.class, com.facebook.presto.spi.block.Block.class));

            constructor.append(thisVariable.setField(joinChannelFields.get(index), joinChannel));
        }

        constructor.comment("Set hashChannel");
        constructor.append(new IfStatement()
                .condition(hashChannel.invoke("isPresent", boolean.class))
                .ifTrue(thisVariable.setField(
                        hashChannelField,
                        channels.invoke("get", Object.class, hashChannel.invoke("get", Object.class).cast(Integer.class).cast(int.class))))
                .ifFalse(thisVariable.setField(
                        hashChannelField,
                        constantNull(hashChannelField.getType()))));
        constructor.ret();
    }

    private void generateGetChannelCountMethod(ClassDefinition classDefinition, List<FieldDefinition> channelFields)
    {
        classDefinition.declareMethod(
                a(PUBLIC),
                "getChannelCount",
                type(int.class))
                .getBody()
                .push(channelFields.size())
                .retInt();
    }

    private void generateAppendToMethod(ClassDefinition classDefinition, CallSiteBinder callSiteBinder, List<Type> types, List<FieldDefinition> channelFields)
    {
        Parameter blockIndex = arg("blockIndex", int.class);
        Parameter blockPosition = arg("blockPosition", int.class);
        Parameter pageBuilder = arg("pageBuilder", PageBuilder.class);
        Parameter outputChannelOffset = arg("outputChannelOffset", int.class);
        MethodDefinition method = classDefinition.declareMethod(a(PUBLIC), "appendTo", type(void.class), blockIndex, blockPosition, pageBuilder, outputChannelOffset);

        Variable thisVariable = method.getThis();
        Block appendToBody = method.getBody();

        for (int index = 0; index < channelFields.size(); index++) {
            Type type = types.get(index);
            ByteCodeExpression typeExpression = constantType(callSiteBinder, type);

            ByteCodeExpression block = thisVariable
                    .getField(channelFields.get(index))
                    .invoke("get", Object.class, blockIndex)
                    .cast(com.facebook.presto.spi.block.Block.class);

            appendToBody
                    .comment("%s.appendTo(channel_%s.get(blockIndex), blockPosition, pageBuilder.getBlockBuilder(outputChannelOffset + %s));", type.getClass(), index, index)
                    .append(typeExpression)
                    .append(block)
                    .append(blockPosition)
                    .append(pageBuilder)
                    .append(outputChannelOffset)
                    .push(index)
                    .append(OpCode.IADD)
                    .invokeVirtual(PageBuilder.class, "getBlockBuilder", BlockBuilder.class, int.class)
                    .invokeInterface(Type.class, "appendTo", void.class, com.facebook.presto.spi.block.Block.class, int.class, BlockBuilder.class);
        }
        appendToBody.ret();
    }

    private void generateHashPositionMethod(ClassDefinition classDefinition, CallSiteBinder callSiteBinder, List<Type> joinChannelTypes, List<FieldDefinition> joinChannelFields, FieldDefinition hashChannelField)
    {
        Parameter blockIndex = arg("blockIndex", int.class);
        Parameter blockPosition = arg("blockPosition", int.class);
        MethodDefinition hashPositionMethod = classDefinition.declareMethod(
                a(PUBLIC),
                "hashPosition",
                type(int.class),
                blockIndex,
                blockPosition);

        Variable thisVariable = hashPositionMethod.getThis();
        ByteCodeExpression hashChannel = thisVariable.getField(hashChannelField);
        ByteCodeExpression bigintType = constantType(callSiteBinder, BigintType.BIGINT);

        IfStatement ifStatement = new IfStatement();
        ifStatement.condition(notEqual(hashChannel, constantNull(hashChannelField.getType())));
        ifStatement.ifTrue(
                bigintType.invoke(
                        "getLong",
                        long.class,
                        hashChannel.invoke("get", Object.class, blockIndex).cast(com.facebook.presto.spi.block.Block.class),
                        blockPosition)
                        .cast(int.class)
                        .ret()
        );

        hashPositionMethod
                .getBody()
                .append(ifStatement);

        Variable resultVariable = hashPositionMethod.getScope().declareVariable(int.class, "result");
        hashPositionMethod.getBody().push(0).putVariable(resultVariable);

        for (int index = 0; index < joinChannelTypes.size(); index++) {
            ByteCodeExpression type = constantType(callSiteBinder, joinChannelTypes.get(index));

            ByteCodeExpression block = hashPositionMethod
                    .getThis()
                    .getField(joinChannelFields.get(index))
                    .invoke("get", Object.class, blockIndex)
                    .cast(com.facebook.presto.spi.block.Block.class);

            hashPositionMethod
                    .getBody()
                    .getVariable(resultVariable)
                    .push(31)
                    .append(OpCode.IMUL)
                    .append(typeHashCode(type, block, blockPosition))
                    .append(OpCode.IADD)
                    .putVariable(resultVariable);
        }

        hashPositionMethod
                .getBody()
                .getVariable(resultVariable)
                .retInt();
    }

    private void generateHashRowMethod(ClassDefinition classDefinition, CallSiteBinder callSiteBinder, List<Type> joinChannelTypes)
    {
        Parameter position = arg("position", int.class);
        Parameter blocks = arg("blocks", com.facebook.presto.spi.block.Block[].class);
        MethodDefinition hashPositionMethod = classDefinition.declareMethod(a(PUBLIC), "hashRow", type(int.class), position, blocks);

        Variable resultVariable = hashPositionMethod.getScope().declareVariable(int.class, "result");
        hashPositionMethod.getBody().push(0).putVariable(resultVariable);

        for (int index = 0; index < joinChannelTypes.size(); index++) {
            ByteCodeExpression type = constantType(callSiteBinder, joinChannelTypes.get(index));

            // todo is the case needed
            ByteCodeExpression block = blocks.getElement(index).cast(com.facebook.presto.spi.block.Block.class);

            hashPositionMethod
                    .getBody()
                    .getVariable(resultVariable)
                    .push(31)
                    .append(OpCode.IMUL)
                    .append(typeHashCode(type, block, position))
                    .append(OpCode.IADD)
                    .putVariable(resultVariable);
        }

        hashPositionMethod
                .getBody()
                .getVariable(resultVariable)
                .retInt();
    }

    private static ByteCodeNode typeHashCode(ByteCodeExpression type, ByteCodeExpression blockRef, ByteCodeExpression blockPosition)
    {
        return new IfStatement()
            .condition(blockRef.invoke("isNull", boolean.class, blockPosition))
            .ifTrue(constantInt(0))
            .ifFalse(type.invoke("hash", int.class, blockRef, blockPosition));
    }

    private void generateRowEqualsRowMethod(
            ClassDefinition classDefinition,
            CallSiteBinder callSiteBinder,
            List<Type> joinChannelTypes)
    {
        MethodDefinition hashPositionMethod = classDefinition.declareMethod(
                a(PUBLIC),
                "rowEqualsRow",
                type(boolean.class),
                arg("leftPosition", int.class),
                arg("leftBlocks", com.facebook.presto.spi.block.Block[].class),
                arg("rightPosition", int.class),
                arg("rightBlocks", com.facebook.presto.spi.block.Block[].class));

        Scope compilerContext = hashPositionMethod.getScope();
        for (int index = 0; index < joinChannelTypes.size(); index++) {
            ByteCodeExpression type = constantType(callSiteBinder, joinChannelTypes.get(index));

            ByteCodeExpression leftBlock = compilerContext
                    .getVariable("leftBlocks")
                    .getElement(index);

            ByteCodeExpression rightBlock = compilerContext
                    .getVariable("rightBlocks")
                    .getElement(index);

            LabelNode checkNextField = new LabelNode("checkNextField");
            hashPositionMethod
                    .getBody()
                    .append(typeEquals(
                            type,
                            leftBlock,
                            compilerContext.getVariable("leftPosition"),
                            rightBlock,
                            compilerContext.getVariable("rightPosition")))
                    .ifTrueGoto(checkNextField)
                    .push(false)
                    .retBoolean()
                    .visitLabel(checkNextField);
        }

        hashPositionMethod
                .getBody()
                .push(true)
                .retInt();
    }

    private void generatePositionEqualsRowMethod(
            ClassDefinition classDefinition,
            CallSiteBinder callSiteBinder,
            List<Type> joinChannelTypes,
            List<FieldDefinition> joinChannelFields)
    {
        Parameter leftBlockIndex = arg("leftBlockIndex", int.class);
        Parameter leftBlockPosition = arg("leftBlockPosition", int.class);
        Parameter rightPosition = arg("rightPosition", int.class);
        Parameter rightBlocks = arg("rightBlocks", com.facebook.presto.spi.block.Block[].class);
        MethodDefinition hashPositionMethod = classDefinition.declareMethod(
                a(PUBLIC),
                "positionEqualsRow",
                type(boolean.class),
                leftBlockIndex,
                leftBlockPosition,
                rightPosition,
                rightBlocks);

        Variable thisVariable = hashPositionMethod.getThis();

        for (int index = 0; index < joinChannelTypes.size(); index++) {
            ByteCodeExpression type = constantType(callSiteBinder, joinChannelTypes.get(index));

            ByteCodeExpression leftBlock = thisVariable
                    .getField(joinChannelFields.get(index))
                    .invoke("get", Object.class, leftBlockIndex)
                    .cast(com.facebook.presto.spi.block.Block.class);

            ByteCodeExpression rightBlock = rightBlocks.getElement(index);

            LabelNode checkNextField = new LabelNode("checkNextField");
            hashPositionMethod
                    .getBody()
                    .append(typeEquals(type, leftBlock, leftBlockPosition, rightBlock, rightPosition))
                    .ifTrueGoto(checkNextField)
                    .push(false)
                    .retBoolean()
                    .visitLabel(checkNextField);
        }

        hashPositionMethod
                .getBody()
                .push(true)
                .retInt();
    }

    private void generatePositionEqualsPositionMethod(
            ClassDefinition classDefinition,
            CallSiteBinder callSiteBinder,
            List<Type> joinChannelTypes,
            List<FieldDefinition> joinChannelFields)
    {
        Parameter leftBlockIndex = arg("leftBlockIndex", int.class);
        Parameter leftBlockPosition = arg("leftBlockPosition", int.class);
        Parameter rightBlockIndex = arg("rightBlockIndex", int.class);
        Parameter rightBlockPosition = arg("rightBlockPosition", int.class);
        MethodDefinition hashPositionMethod = classDefinition.declareMethod(
                a(PUBLIC),
                "positionEqualsPosition",
                type(boolean.class),
                leftBlockIndex,
                leftBlockPosition,
                rightBlockIndex,
                rightBlockPosition);

        Variable thisVariable = hashPositionMethod.getThis();
        for (int index = 0; index < joinChannelTypes.size(); index++) {
            ByteCodeExpression type = constantType(callSiteBinder, joinChannelTypes.get(index));

            ByteCodeExpression leftBlock = thisVariable
                    .getField(joinChannelFields.get(index))
                    .invoke("get", Object.class, leftBlockIndex)
                    .cast(com.facebook.presto.spi.block.Block.class);

            ByteCodeExpression rightBlock = thisVariable
                    .getField(joinChannelFields.get(index))
                    .invoke("get", Object.class, rightBlockIndex)
                    .cast(com.facebook.presto.spi.block.Block.class);

            LabelNode checkNextField = new LabelNode("checkNextField");
            hashPositionMethod
                    .getBody()
                    .append(typeEquals(type, leftBlock, leftBlockPosition, rightBlock, rightBlockPosition))
                    .ifTrueGoto(checkNextField)
                    .push(false)
                    .retBoolean()
                    .visitLabel(checkNextField);
        }

        hashPositionMethod
                .getBody()
                .push(true)
                .retInt();
    }

    private static ByteCodeNode typeEquals(
            ByteCodeExpression type,
            ByteCodeExpression leftBlock,
            ByteCodeExpression leftBlockPosition,
            ByteCodeExpression rightBlock,
            ByteCodeExpression rightBlockPosition)
    {
        IfStatement ifStatement = new IfStatement();
        ifStatement.condition()
                .append(leftBlock.invoke("isNull", boolean.class, leftBlockPosition))
                .append(rightBlock.invoke("isNull", boolean.class, rightBlockPosition))
                .append(OpCode.IOR);

        ifStatement.ifTrue()
                .append(leftBlock.invoke("isNull", boolean.class, leftBlockPosition))
                .append(rightBlock.invoke("isNull", boolean.class, rightBlockPosition))
                .append(OpCode.IAND);

        ifStatement.ifFalse().append(type.invoke("equalTo", boolean.class, leftBlock, leftBlockPosition, rightBlock, rightBlockPosition));

        return ifStatement;
    }

    public static class LookupSourceFactory
    {
        private final Constructor<? extends LookupSource> constructor;
        private final PagesHashStrategyFactory pagesHashStrategyFactory;

        public LookupSourceFactory(Class<? extends LookupSource> lookupSourceClass, PagesHashStrategyFactory pagesHashStrategyFactory)
        {
            this.pagesHashStrategyFactory = pagesHashStrategyFactory;
            try {
                constructor = lookupSourceClass.getConstructor(LongArrayList.class, List.class, PagesHashStrategy.class);
            }
            catch (NoSuchMethodException e) {
                throw Throwables.propagate(e);
            }
        }

        public LookupSource createLookupSource(LongArrayList addresses, List<Type> types, List<List<com.facebook.presto.spi.block.Block>> channels, Optional<Integer> hashChannel)
        {
            PagesHashStrategy pagesHashStrategy = pagesHashStrategyFactory.createPagesHashStrategy(channels, hashChannel);
            try {
                return constructor.newInstance(addresses, types, pagesHashStrategy);
            }
            catch (Exception e) {
                throw Throwables.propagate(e);
            }
        }
    }

    public static class PagesHashStrategyFactory
    {
        private final Constructor<? extends PagesHashStrategy> constructor;

        public PagesHashStrategyFactory(Class<? extends PagesHashStrategy> pagesHashStrategyClass)
        {
            try {
                constructor = pagesHashStrategyClass.getConstructor(List.class, Optional.class);
            }
            catch (NoSuchMethodException e) {
                throw Throwables.propagate(e);
            }
        }

        public PagesHashStrategy createPagesHashStrategy(List<? extends List<com.facebook.presto.spi.block.Block>> channels, Optional<Integer> hashChannel)
        {
            try {
                return constructor.newInstance(channels, hashChannel);
            }
            catch (Exception e) {
                throw Throwables.propagate(e);
            }
        }
    }

    private static final class CacheKey
    {
        private final List<Type> types;
        private final List<Integer> joinChannels;

        private CacheKey(List<? extends Type> types, List<Integer> joinChannels)
        {
            this.types = ImmutableList.copyOf(checkNotNull(types, "types is null"));
            this.joinChannels = ImmutableList.copyOf(checkNotNull(joinChannels, "joinChannels is null"));
        }

        private List<Type> getTypes()
        {
            return types;
        }

        private List<Integer> getJoinChannels()
        {
            return joinChannels;
        }

        @Override
        public int hashCode()
        {
            return Objects.hash(types, joinChannels);
        }

        @Override
        public boolean equals(Object obj)
        {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof CacheKey)) {
                return false;
            }
            CacheKey other = (CacheKey) obj;
            return Objects.equals(this.types, other.types) &&
                    Objects.equals(this.joinChannels, other.joinChannels);
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
AASP Contributions Series (Dallas) 39: 259 (2000)

#### Original name
Ramasricellites Kalgutkar & Janson.

### Remarks
null


text:
using System.Web.Mvc;
using System.Web.Routing;

namespace GE.WebUI
{
    public class RouteConfig
    {
        private static readonly string[] _defNamespace = { "GE.WebUI.Controllers" };

        public static void PreRouteAction(RouteCollection routes)
        {
            routes.IgnoreRoute("Articles/Details/{id}");
            routes.IgnoreRoute("News/Details/{id}");

            #region aphorisms

            routes.MapRoute(
                name: null,
                url: "AuthorAphorisms/{titleUrl}",
                defaults: new { controller = "AuthorAphorisms", action = "Details", area = "" },
                namespaces: _defNamespace
            );

            routes.MapRoute(
                name: null,
                url: "Aphorisms",
                defaults: new { controller = "Aphorisms", action = "List", categoryId = (string)null, page = 1, area = "" },
                namespaces: _defNamespace,
                constraints: new { action = "^List" }
            );

            routes.MapRoute(
                name: null,
                url: "Aphorisms/Page{page}",
                defaults: new { controller = "Aphorisms", action = "List", categoryId = (string)null, page = 1, area = "" },
                namespaces: _defNamespace,
                constraints: new { action = "^List" }
            );

            routes.MapRoute(
                name: null,
                url: "Aphorisms/{categoryId}",
                defaults: new { controller = "Aphorisms", action = "List", page = 1, area = "" },
                namespaces: _defNamespace,
                constraints: new { action = "^List" }
            );

            routes.MapRoute(
                name: null,
                url: "Aphorisms/{categoryId}/page{page}",
                defaults: new { controller = "Aphorisms", action = "List", page = 1, area = "" },
                namespaces: _defNamespace,
                constraints: new { action = "^List" }
            );

            routes.MapRoute(
                name: null,
                url: "Aphorisms/{categoryId}/{titleUrl}",
                defaults: new { controller = "Aphorisms", action = "Details", area = "" },
                namespaces: _defNamespace,
                constraints: new { action = "^Details" }
            );
            #endregion

            #region infographics
            routes.MapRoute(name: null, url: "Infographics/{id}", defaults: new { controller = "Infographics", action = "Details" }, namespaces: _defNamespace);
            #endregion

            #region games
            routes.MapRoute(
                name: null,
                url: "Games/{titleUrl}",
                defaults: new { controller = "Games", action = "Details", area = "" },
                namespaces: _defNamespace
            );
            #endregion

            #region rss
            routes.MapRoute(name: null, url: "Rss", defaults: new { controller = "Rss", action = "List" }, namespaces: _defNamespace);
            #endregion

            #region site test
            routes.MapRoute(
                name: null,
                url: "sitetests",
                defaults: new { controller = "SiteTests", action = "List", page = 1, area = "" },
                namespaces: _defNamespace,
                constraints: new { httpMethod = new HttpMethodConstraint("get") }
            );

            routes.MapRoute(
                name: null,
                url: "sitetests/page{page}",
                defaults: new { controller = "SiteTests", action = "List", page = 1, area = "" },
                namespaces: _defNamespace,
                constraints: new { httpMethod = new HttpMethodConstraint("get") }
            );

            routes.MapRoute(
                name: null,
                url: "sitetests/{titleUrl}",
                defaults: new { controller = "SiteTests", action = "Details", area = "" },
                namespaces: _defNamespace,
                constraints: new { httpMethod = new HttpMethodConstraint("get") }
            );
            #endregion

            #region youtube videos
            routes.MapRoute(name: null, url: "YoutubeVideos", defaults: new { controller = "YoutubeVideos", action = "List", amount = 9, cat=20, area = "" }, namespaces: _defNamespace);
            routes.MapRoute(name: null, url: "YoutubeVideos/Archive", defaults: new { controller = "YoutubeVideos", action = "Archive", area = "" }, namespaces: _defNamespace);
            routes.MapRoute(name: null, url: "YoutubeVideos/GetJson", defaults: new { controller = "YoutubeVideos", action = "GetJson", area = "" }, namespaces: _defNamespace);
            routes.MapRoute(name: null, url: "YoutubeVideos/{videoId}", defaults: new { controller = "YoutubeVideos", action = "Details", area = "" }, namespaces: _defNamespace);
            #endregion
        }

        public static void PostRouteAction(RouteCollection routes)
        {
            routes.MapRoute(
                        name: null,
                        url: "{controller}/AddLike/{mid}/{ld}",
                        defaults: new { controller = "Articles", action = "AddLike", area = "" },
                        namespaces: _defNamespace,
                        constraints: new { httpMethod = new HttpMethodConstraint("post") }
                    );

            #region articles
            routes.MapRoute(
                name: null,
                url: "articles/bydatematerial",
                defaults: new { controller = "articles", action = "bydatematerial", area = "" },
                namespaces: _defNamespace
            );

            routes.MapRoute(
                name: null,
                url: "articles/preview",
                defaults: new { controller = "articles", action = "preview", area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "articles",
                defaults: new { controller = "articles", action = "List", gameTitle = (string)null, page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "articles/page{page}",
                defaults: new { controller = "articles", action = "List", gameTitle = (string)null, page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "articles/{gameTitle}",
                defaults: new { controller = "articles", action = "List", page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "articles/{gameTitle}/page{page}",
                defaults: new { controller = "articles", action = "List", page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "articles/{year}/{month}/{day}/{titleUrl}",
                defaults: new { controller = "articles", action = "details", area = "" },
                constraints: new { year = @"\d{4}" },
                namespaces: _defNamespace
            );
            #endregion

            #region banners
            routes.MapRoute(
                name: null,
                url: "Banners/Click/{bannerId}",
                defaults: new { controller = "Banners", action = "Click", area = "" },
                namespaces: _defNamespace
            );
            #endregion

            #region employees
            routes.MapRoute(
                name: null,
                url: "employees",
                defaults: new { controller = "employees", action = "List", area = "" },
                namespaces: _defNamespace
            );
            #endregion

            #region news
            routes.IgnoreRoute("news/details/{id}");

            routes.MapRoute(
                name: null,
                url: "news/bydatematerial",
                defaults: new { controller = "news", action = "bydatematerial", area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "news",
                defaults: new { controller = "news", action = "List", gameTitle = (string)null, page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "news/page{page}",
                defaults: new { controller = "news", action = "List", gameTitle = (string)null, page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "news/{gameTitle}",
                defaults: new { controller = "news", action = "List", page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "news/{gameTitle}/page{page}",
                defaults: new { controller = "news", action = "List", page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "news/{year}/{month}/{day}/{titleUrl}",
                defaults: new { controller = "news", action = "details", area = "" },
                constraints: new { year = @"\d{4}" },
                namespaces: _defNamespace
            );
            #endregion

            #region humor
            routes.MapRoute(
                name: null,
                url: "humor",
                defaults: new { controller = "Humor", action = "List", page = 1, area = "" },
                namespaces: _defNamespace
            );
            routes.MapRoute(
                name: null,
                url: "humor/page{page}",
                defaults: new { controller = "Humor", action = "List", page = 1, area = "" },
                namespaces: _defNamespace
            );

            routes.MapRoute(
                name: null,
                url: "humor/{year}/{month}/{day}/{titleUrl}",
                defaults: new { controller = "Humor", action = "Details", area = "" },
                constraints: new { year = @"\d{4}" },
                namespaces: _defNamespace
            );
            #endregion

            routes.MapRoute(
                name: null,
                url: "Home/{gameTitle}",
                defaults: new { controller = "Home", action = "Index", gameTitle = UrlParameter.Optional, area = "" },
                namespaces: _defNamespace
            );
        }
    }
}


text:
package org.jboss.hal.testsuite.test.configuration.undertow.servlet.container;

import java.io.IOException;

import org.apache.commons.lang3.RandomStringUtils;
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.graphene.page.Page;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.hal.resources.Ids;
import org.jboss.hal.testsuite.Console;
import org.jboss.hal.testsuite.CrudOperations;
import org.jboss.hal.testsuite.Random;
import org.jboss.hal.testsuite.creaper.ManagementClientProvider;
import org.jboss.hal.testsuite.fixtures.undertow.UndertowFixtures;
import org.jboss.hal.testsuite.page.configuration.UndertowServletContainerPage;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.extras.creaper.core.online.OnlineManagementClient;
import org.wildfly.extras.creaper.core.online.operations.Address;
import org.wildfly.extras.creaper.core.online.operations.OperationException;
import org.wildfly.extras.creaper.core.online.operations.Operations;

import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;

@RunWith(Arquillian.class)
public class CrawlerTest {

    @Inject
    private Console console;

    @Inject
    private CrudOperations crudOperations;

    @Page
    private UndertowServletContainerPage page;

    private static final OnlineManagementClient client = ManagementClientProvider.createOnlineManagementClient();

    private static final Operations operations = new Operations(client);

    private static final String SERVLET_CONTAINER_EDIT =
        "servlet-container-to-be-edited-" + RandomStringUtils.randomAlphanumeric(7);

    private static final String SERVLET_CONTAINER_CRAWLER_CREATE =
        "servlet-container-without-crawler-" + RandomStringUtils.randomAlphanumeric(7);

    private static final String SERVLET_CONTAINER_CRAWLER_REMOVE =
        "servlet-container-with-crawler-" + RandomStringUtils.randomAlphanumeric(7);

    private static final Address SERVLET_CONTAINER_EDIT_CRAWLER_ADDRESS = crawlerAddress(SERVLET_CONTAINER_EDIT);

    private static Address crawlerAddress(String servletContainer) {
        return UndertowFixtures.servletContainerAddress(servletContainer).and("setting", "crawler-session-management");
    }

    @BeforeClass
    public static void setUp() throws IOException {
        operations.add(UndertowFixtures.servletContainerAddress(SERVLET_CONTAINER_EDIT));
        operations.add(SERVLET_CONTAINER_EDIT_CRAWLER_ADDRESS);
        operations.add(UndertowFixtures.servletContainerAddress(SERVLET_CONTAINER_CRAWLER_CREATE));
        operations.add(UndertowFixtures.servletContainerAddress(SERVLET_CONTAINER_CRAWLER_REMOVE));
        operations.add(crawlerAddress(SERVLET_CONTAINER_CRAWLER_REMOVE));
    }

    @AfterClass
    public static void tearDown() throws IOException, OperationException {
        operations.removeIfExists(UndertowFixtures.servletContainerAddress(SERVLET_CONTAINER_EDIT));
        operations.removeIfExists(UndertowFixtures.servletContainerAddress(SERVLET_CONTAINER_CRAWLER_CREATE));
        operations.removeIfExists(UndertowFixtures.servletContainerAddress(SERVLET_CONTAINER_CRAWLER_REMOVE));
    }

    @Test
    public void create() throws Exception {
        navigateToCrawlerForm(SERVLET_CONTAINER_CRAWLER_CREATE);
        crudOperations.createSingleton(crawlerAddress(SERVLET_CONTAINER_CRAWLER_CREATE), page.getCrawlerForm());
    }

    private void navigateToCrawlerForm(String servletContainerName) {
        page.navigateAgain(NAME, servletContainerName);
        // necessary to call 2 times as the first navigation doesn't open the view with the correct name parameter
        page.navigateAgain(NAME, servletContainerName);
        console.verticalNavigation()
            .selectPrimary(Ids.build(Ids.UNDERTOW_SERVLET_CONTAINER_CRAWLER, "item"));
    }

    @Test
    public void remove() throws Exception {
        navigateToCrawlerForm(SERVLET_CONTAINER_CRAWLER_REMOVE);
        crudOperations.deleteSingleton(crawlerAddress(SERVLET_CONTAINER_CRAWLER_REMOVE), page.getCrawlerForm());
    }

    @Test
    public void editSessionTimeout() throws Exception {
        navigateToCrawlerForm(SERVLET_CONTAINER_EDIT);
        crudOperations.update(SERVLET_CONTAINER_EDIT_CRAWLER_ADDRESS, page.getCrawlerForm(), "session-timeout", Random.number());
    }

    @Test
    public void editUserAgents() throws Exception {
        navigateToCrawlerForm(SERVLET_CONTAINER_EDIT);
        crudOperations.update(SERVLET_CONTAINER_EDIT_CRAWLER_ADDRESS, page.getCrawlerForm(), "user-agents");
    }

}


text:
using System;
using System.Runtime.InteropServices;

namespace LibuvSharp
{
	public class UVDirectoryEntity
	{
		unsafe internal UVDirectoryEntity(uv_dirent_t entity)
		{
			Name = new string(entity.name);
			Type = entity.type;
		}

		public string Name { get; set; }
		public UVDirectoryEntityType Type { get; set; }
	}
}


text:
Thalassemia Interpreter

A Thalassemia interpretation software built on a robust rules. Thalassemia Interpreter made it easy for doctors,medical technologists or any members to process
                and interprete their personality trait from Hemoglobin typing profile. It can also help couples to predict the risk and prevent the inherited babies.

                 Sign In

© Copyright 2014-2015, Biostatistics and Bioinformatics lab., Genome Tecnhology Research Unit, BIOTEC, NSTDA, Thailand


text:
NM := $(CROSS_COMPILE)nm -B
READELF := $(CROSS_COMPILE)readelf

export AWK

CHECKFLAGS	+= -m64 -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__

OBJCOPYFLAGS	:= --strip-all
LDFLAGS_vmlinux	:= -static
LDFLAGS_MODULE	+= -T $(srctree)/arch/ia64/module.lds
AFLAGS_KERNEL	:= -mconstant-gp
EXTRA		:=

cflags-y	:= -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
		   -falign-functions=32 -frename-registers -fno-optimize-sibling-calls
CFLAGS_KERNEL	:= -mconstant-gp

GAS_STATUS	= $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)")
CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)")

ifeq ($(GAS_STATUS),buggy)
$(error Sorry, you need a newer version of the assember, one that is built from	\
	a source-tree that post-dates 18-Dec-2002.  You can find a pre-compiled	\
	static binary of such an assembler at:					\
										\
		ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
endif

ifeq ($(call cc-version),0304)
	cflags-$(CONFIG_ITANIUM)	+= -mtune=merced
	cflags-$(CONFIG_MCKINLEY)	+= -mtune=mckinley
endif

CFLAGS += $(cflags-y)
head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o

libs-y				+= arch/ia64/lib/
core-y				+= arch/ia64/kernel/ arch/ia64/mm/
core-$(CONFIG_IA32_SUPPORT)	+= arch/ia64/ia32/
core-$(CONFIG_IA64_DIG) 	+= arch/ia64/dig/
core-$(CONFIG_IA64_GENERIC) 	+= arch/ia64/dig/
core-$(CONFIG_IA64_HP_ZX1)	+= arch/ia64/dig/
core-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/dig/
core-$(CONFIG_IA64_SGI_SN2)	+= arch/ia64/sn/

drivers-$(CONFIG_PCI)		+= arch/ia64/pci/
drivers-$(CONFIG_IA64_HP_SIM)	+= arch/ia64/hp/sim/
drivers-$(CONFIG_IA64_HP_ZX1)	+= arch/ia64/hp/common/ arch/ia64/hp/zx1/
drivers-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/hp/common/ arch/ia64/hp/zx1/
drivers-$(CONFIG_IA64_GENERIC)	+= arch/ia64/hp/common/ arch/ia64/hp/zx1/ arch/ia64/hp/sim/ arch/ia64/sn/
drivers-$(CONFIG_OPROFILE)	+= arch/ia64/oprofile/

boot := arch/ia64/hp/sim/boot

.PHONY: boot compressed check

all: compressed unwcheck

compressed: vmlinux.gz

vmlinux.gz: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $@

unwcheck: vmlinux
	-$(Q)READELF=$(READELF) $(srctree)/arch/ia64/scripts/unwcheck.py $<

archclean:
	$(Q)$(MAKE) $(clean)=$(boot)

CLEAN_FILES += vmlinux.gz bootloader

boot:	lib/lib.a vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $@

install: vmlinux.gz
	sh $(srctree)/arch/ia64/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"

define archhelp
  echo '* compressed	- Build compressed kernel image'
  echo '  install	- Install compressed kernel image'
  echo '  boot		- Build vmlinux and bootloader for Ski simulator'
  echo '* unwcheck	- Check vmlinux for invalid unwind info'
endef


text:
""" Energy Normalization with SAPM Unit Tests. """

import unittest

import pandas as pd
import numpy as np
import pvlib

from rdtools.normalization import normalize_with_sapm
from rdtools.normalization import sapm_dc_power

class SapmNormalizationTestCase(unittest.TestCase):
    ''' Unit tests for energy normalization module. '''

    def setUp(self):
        # define module constants and parameters
        module = {}
        module['A0'] = 0.0315
        module['A1'] = 0.05975
        module['A2'] = -0.01067
        module['A3'] = 0.0008
        module['A4'] = -2.24e-5
        module['B0'] = 1
        module['B1'] = -0.002438
        module['B2'] = 0.00031
        module['B3'] = -1.246e-5
        module['B4'] = 2.11e-7
        module['B5'] = -1.36e-9
        module['FD'] = 1
        module_parameters = {
            'pdc0': 2.1,
            'gamma_pdc': -0.0045
            }

        # define location
        test_location = pvlib.location\
            .Location(latitude=37.88447702, longitude=-122.2652549)

        self.pvsystem = pvlib.pvsystem\
            .LocalizedPVSystem(location=test_location,
                               surface_tilt=20,
                               surface_azimuth=180,
                               module=module,
                               module_parameters=module_parameters,
                               racking_model='insulated_back_polymerback',
                               modules_per_string=6)

        # define dummy energy data
        energy_freq = 'MS'
        energy_periods = 12
        energy_index = pd.date_range(start='2012-01-01',
                                     periods=energy_periods,
                                     freq=energy_freq)

        dummy_energy = np.repeat(a=100, repeats=energy_periods)
        self.energy = pd.Series(dummy_energy, index=energy_index)
        self.energy_periods = 12

        # define dummy meteorological data
        irrad_columns = ['DNI', 'GHI', 'DHI', 'Temperature', 'Wind Speed']
        irrad_freq = 'D'
        irrad_periods = 31 * energy_periods
        irrad_index = pd.date_range(start='2012-01-01',
                                    periods=irrad_periods,
                                    freq=irrad_freq)
        irrad_index = pd.date_range(start='2012-01-01',
                                    periods=irrad_periods,
                                    freq=irrad_freq)
        self.irrad = pd.DataFrame([[100, 45, 30, 25, 10]],
                                  index=irrad_index,
                                  columns=irrad_columns)

    def tearDown(self):
        pass

    def test_sapm_dc_power(self):
        ''' Test SAPM DC power. '''

        dc_power, poa = sapm_dc_power(self.pvsystem, self.irrad)
        self.assertEqual(self.irrad.index.freq, dc_power.index.freq)
        self.assertEqual(len(self.irrad), len(dc_power))

    def test_normalization_with_sapm(self):
        ''' Test SAPM normalization. '''

        sapm_kws = {
            'pvlib_pvsystem': self.pvsystem,
            'met_data': self.irrad,
        }

        corr_energy, insol = normalize_with_sapm(self.energy, sapm_kws)

        # Test output is same frequency and length as energy
        self.assertEqual(corr_energy.index.freq, self.energy.index.freq)
        self.assertEqual(len(corr_energy), len(self.energy))

        # TODO, test for:
        #     incorrect data format
        #     incomplete data
        #     missing pvsystem metadata
        #     missing measured irradiance data
        #     met_data freq > energy freq, issue/warining?

if __name__ == '__main__':
    unittest.main()


text:
SkeeBall app;
SkeeBall& gApp(app);

#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
#include <windows.h>

HINSTANCE g_hInstance;
HWND g_hwnd;
int _stdcall wWinMain(HINSTANCE hIntance, HINSTANCE hPrevInstance,
                      LPWSTR args, int argc)
{
    g_hInstance = hIntance;
#else
int main(int argc, char* args[])
{
#endif
    // ICE system initialization
    icSysTimeInit();
    icRandAutoSeed();

    ICRESULT ICE_STATUS = IC_OK;

    // Initialize the app
    if (ICEFAIL(app.Init(argc, (char**)args)))
    {
#ifdef WIN32
        MessageBoxA(NULL, "SkeeBall can't start", "Error", 0);
#elif defined (__APPLE__)
#endif
        return -1;
    }

    // Message loop
#ifdef WIN32
    MSG msg;
    ZeroMemory(&msg,sizeof(MSG));
    while (msg.message != WM_QUIT && ICE_STATUS >= IC_OK)
    {
        if (::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
        {
            ::TranslateMessage(&msg);
            ::DispatchMessage(&msg);
        }
#else
    volatile bool running = true;
    while (running)
    {
#ifdef __APPLE__
        EventRecord eventStruct;
        if (WaitNextEvent(everyEvent,&eventStruct,1,NULL))
        {
            if (eventStruct.what == kEventWindowClosed)
                running = false;
            if (eventStruct.what == kEventWindowClickCloseRgn)
                running = false;
        }
#endif
#endif

        ICE_STATUS = app.Update();
        ICE_STATUS |= app.Render();
    }

    icPrintf("Main loop exited with status: %s", icGetStr(ICE_STATUS));

    return ICE_STATUS;
};


text:
![Deploy to production](https://github.com/Majavapaja/Majavashakki/workflows/Deploy%20to%20production/badge.svg)
![Code style](https://img.shields.io/badge/code%20style-none-brightgreen)

# Majavashakki
The amazing Node.js sequel to the fantastic MaJAVAshakki (for Java). With this new version we are planning to add several new bugs and more unreadable code!

## Browser compatibility

Majavashakki doesn't guarantee support for any specific browser. Chrome and Firefox may work.

## Business hours
Mon-Fri 17-18

Sat 15-16

Sun Closed

### Install Node

The officially supported version is 14.16.1

### Install MongoDB using Vagrant ###

1. Install Virtual Box and Vagrant
2. Run `vagrant up` inside `local-services` directory

### [MongoDB with Docker Compose](/local-services/docker)

### Install local MongoDB as windows service ###
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#get-mongodb-community-edition

1. Created folders:

C:\MongoData
C:\MongoData\db
C:\MongoData\log

2. Created yaml configuration file:

C:\MongoData\mongod.cfg
content => (
systemLog:
 destination: file
 path: C:\MongoData\log\mongod.log
storage:
 dbPath: C:\MongoData\db
 )

 3. Run from administrator cmd (from mongo installation bin folder or if env var exists)

 mongod.exe --config "C:\MongoData\mongod.cfg" --install

## Environment variables
### Required
MajavashakkiSessionSecret

### Optional
MajavashakkiMongoConnectionString

MajavaMongoPassword

MajavashakkiFbClientId

MajavashakkiFbSecret


text:
<?php

namespace Zimbra\Struct;

/**
 * AttributeSelector interface
 *
 * @package   Zimbra
 * @category  Struct
 * @author    Nguyen Van Nguyen - nguyennv1981@gmail.com
 * @copyright Copyright © 2013 by Nguyen Van Nguyen.
 */
interface AttributeSelector
{
    /**
     * Gets attributes
     *
     * @return string
     */
    function getAttrs();

    /**
     * Add an attribute
     *
     * @param  string $attr
     * @return self
     */
    function addAttr($attr);

    /**
     * Gets attributes
     *
     * @param  array $attrs
     * @return self
     */
    function setAttrs(array $attrs);
}


text:
package v1beta1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"

	"github.com/google/knative-gcp/pkg/apis/events"
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: events.GroupName, Version: "v1beta1"}

// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
	return SchemeGroupVersion.WithKind(kind).GroupKind()
}

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
	return SchemeGroupVersion.WithResource(resource).GroupResource()
}

var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)

// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&CloudAuditLogsSource{},
		&CloudAuditLogsSourceList{},
		&CloudStorageSource{},
		&CloudStorageSourceList{},
		&CloudSchedulerSource{},
		&CloudSchedulerSourceList{},
		&CloudPubSubSource{},
		&CloudPubSubSourceList{},
		&CloudBuildSource{},
		&CloudBuildSourceList{},
	)
	metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
	return nil
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
 Copyright 2021 Google LLC

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<FlowCallout async="false" continueOnError="false" enabled="true" name="Shared-Flow-Callout">
    <DisplayName>Shared Flow Callout</DisplayName>
    <FaultRules/>
    <Properties/>
    <SharedFlowBundle>VehicleInsurance-AccountManagement-SouthboundApiMock-SharedFlowBundle</SharedFlowBundle>
</FlowCallout>


text:
<!DOCTYPE html>

    <title></title>

    <button id="loadBtn">Load</button>

        Loading...


text: FROM docker.elastic.co/logstash/logstash:7.3.1


text:
import { Middleware, Dispatch } from "redux";
import { EnhancedActionDefinition } from '../types';

const promiseMiddleware: Middleware = <S>(): (next: Dispatch<S>) => Dispatch<S> => (
  (next: Dispatch<S>) => <Dispatch<S>>(
    (action: EnhancedActionDefinition) => {
      if (!action.promise || !(action.promise instanceof Promise)) {
        next(action);
        return action;
      }
      next(action);
      action.promise.then(payload => {
        next({
          type: action.dispatcher.success,
          payload,
          meta: { request: action.payload }
        });
      }).catch(e => next({
        type: action.dispatcher.error,
        payload: e,
        meta: { request: action.payload }
      }));
      return action;
    }
  )
);

export default promiseMiddleware;


text:
from __future__ import print_function

from bokeh.util.browser import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
    GMapPlot, Range1d, ColumnDataSource, PanTool, WheelZoomTool, BoxSelectTool, GMapOptions)
from bokeh.resources import INLINE

x_range = Range1d()
y_range = Range1d()

# JSON style string taken from: https://snazzymaps.com/style/1/pale-dawn
map_options = GMapOptions(lat=30.2861, lng=-97.7394, map_type="roadmap", zoom=13, styles="""
[{"featureType":"administrative","elementType":"all","stylers":[{"visibility":"on"},{"lightness":33}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2e5d4"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#c5dac6"}]},{"featureType":"poi.park","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":20}]},{"featureType":"road","elementType":"all","stylers":[{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#c5c6c6"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#e4d7c6"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#fbfaf7"}]},{"featureType":"water","elementType":"all","stylers":[{"visibility":"on"},{"color":"#acbcc9"}]}]
""")

# Google Maps now requires an API key. You can find out how to get one here:
# https://developers.google.com/maps/documentation/javascript/get-api-key
API_KEY = "XXXXXXXXXXX"

plot = GMapPlot(
    x_range=x_range, y_range=y_range,
    map_options=map_options,
    api_key=API_KEY,
)
plot.title.text = "Austin"

source = ColumnDataSource(
    data=dict(
        lat=[30.2861, 30.2855, 30.2869],
        lon=[-97.7394, -97.7390, -97.7405],
        fill=['orange', 'blue', 'green']
    )
)

circle = Circle(x="lon", y="lat", size=15, fill_color="fill", line_color="black")
plot.add_glyph(source, circle)

pan = PanTool()
wheel_zoom = WheelZoomTool()
box_select = BoxSelectTool()

plot.add_tools(pan, wheel_zoom, box_select)

doc = Document()
doc.add_root(plot)

if __name__ == "__main__":
    doc.validate()
    filename = "maps.html"
    with open(filename, "w") as f:
        f.write(file_html(doc, INLINE, "Google Maps Example"))
    print("Wrote %s" % filename)
    view(filename)