text:
require 'spec_helper'

describe Saml::Elements::AudienceRestriction do

  let(:audience_restriction) { build(:audience_restriction) }

  describe "Optional fields" do
    [:audiences].each do |field|
      it "should have the #{field} field" do
        expect(audience_restriction).to respond_to(field)
      end

      it "should allow #{field} to blank" do
        audience_restriction.send("#{field}=", nil)
        expect(audience_restriction).to be_valid
        audience_restriction.send("#{field}=", "")
        expect(audience_restriction).to be_valid
      end
    end
  end

  describe '#audience' do
    context 'when there are audiences' do
      before { allow(audience_restriction).to receive(:audiences).and_return [ build(:audience, value: 'AuthorityProvider'), build(:audience, value: 'ServiceProvider') ] }

      it 'returns the first audience' do
        expect(audience_restriction.audience).to eq 'AuthorityProvider'
      end
    end

    context 'when there is only one audience' do
      before { allow(audience_restriction).to receive(:audiences).and_return [ build(:audience, value: 'ServiceProvider') ] }

      it 'returns the audience' do
        expect(audience_restriction.audience).to eq 'ServiceProvider'
      end
    end

    context 'when there are no audiences' do
      before { audience_restriction.audiences = nil }

      it 'returns nil' do
        expect(audience_restriction.audience).to be_nil
      end
    end
  end

  describe '#audience=' do
    let(:audience_restriction_xml) { File.read(File.join('spec','fixtures','artifact_response.xml')) }
    let(:audience_restriction) { Saml::Elements::AudienceRestriction.parse(audience_restriction_xml, single: true) }

    it 'replaces the audience elements with the given element' do
      aggregate_failures do
        expect(audience_restriction.audiences.count).to eq 2
        expect(audience_restriction.audiences).to contain_exactly an_instance_of(Saml::Elements::Audience), an_instance_of(Saml::Elements::Audience)
        expect(audience_restriction.audiences.map(&:value)).to match_array ['ServiceProvider', 'AuthorityProvider']

        audience_restriction.audience = 'IdentityProvider'
        expect(audience_restriction.audiences.count).to eq 1
        expect(audience_restriction.audiences).to contain_exactly an_instance_of(Saml::Elements::Audience)
        expect(audience_restriction.audiences.map(&:value)).to match_array ['IdentityProvider']
      end
    end
  end

  describe "#parse" do
    let(:audience_restriction_xml) { File.read(File.join('spec','fixtures','artifact_response.xml')) }
    let(:audience_restriction) { Saml::Elements::AudienceRestriction.parse(audience_restriction_xml, single: true) }

    it "should create an AudienceRestriction" do
      expect(audience_restriction).to be_a(Saml::Elements::AudienceRestriction)
    end

    it 'parses all the Audience elements' do
      expect(audience_restriction.audiences.count).to eq 2
    end

    it 'has the correct Audience values' do
      expect(audience_restriction.audiences.map(&:value)).to match_array ['ServiceProvider', 'AuthorityProvider']
    end
  end
end


text:
import {
  createMuiTheme,
  CssBaseline,
  MuiThemeProvider
} from "@material-ui/core";
import green from "@material-ui/core/colors/green";
import * as React from "react";
import * as ReactDOM from "react-dom";
import { theme as themeVars } from "../constants/theme";
import Popup from "./Popup";

const theme = createMuiTheme({
  typography: themeVars.typography,
  palette: {
    primary: { main: themeVars.colors.primary },
    secondary: green
  }
});

chrome.tabs.query({ active: true, currentWindow: true }, tab => {
  ReactDOM.render(
    <MuiThemeProvider theme={theme}>
      <>
        <CssBaseline />
        <Popup />
      </>
    </MuiThemeProvider>,
    document.getElementById("popup")
  );
});

redpajama_set_name: RedPajamaGithub


text:
@interface BulbRecorder (Private)

- (void)addSignalsRecord:(NSString *)record;
- (void)addSignalsRegisterRecord:(Bulb *)bulb signals:(NSArray<BulbSignal *> *)signals;
- (void)addSignalFireRecord:(Bulb *)bulb signal:(BulbSignal *)signal;

@end


text:
#ifndef _EVENTS_H_
#define _EVENTS_H_

#include <X11/Xlib.h>
#include "SDL.h"

#define SEND_EVENT_CODE 1
#define INTERNAL_EVENT_CODE 2

#define HAS_EVENT_MASK(window, mask) ((GET_WINDOW_STRUCT(window)->eventMask & mask) == mask)

int initEventPipe(Display* display);
unsigned int convertModifierState(Uint16 mod);
Bool postEvent(Display* display, Window eventWindow, unsigned int eventId, ...);
void postExposeEvent(Display* display, Window window, const SDL_Rect* damagedAreaList, size_t numAreas);

#endif /* _EVENTS_H_ */


text:
package org.apache.hadoop.hive.ql.udf;

import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
import org.apache.hive.common.util.HiveVersionInfo;

/**
 * UDFVersion
 */
@Description(name = "version",
    value="_FUNC_() - Returns the Hive build version string - includes base " +
          "version and revision.")
public class UDFVersion extends UDF {
  private static final String versionInfo = String.format("%s r%s",
      HiveVersionInfo.getVersion(), HiveVersionInfo.getRevision());

  public Text evaluate() {
	  return new Text(versionInfo);
  }
}


text:
>Note: Before getting started with the samples, go through the [prerequisites](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/resourcemanager/Azure.ResourceManager#prerequisites).

Namespaces for this example:
```C# Snippet:Manage_Instances_Namespaces
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.DeviceUpdate;
using Azure.ResourceManager.DeviceUpdate.Models;
```

When you first create your ARM client, choose the subscription you're going to work in. You can use the `GetDefaultSubscription`/`GetDefaultSubscriptionAsync` methods to return the default subscription configured for your user:

```C# Snippet:Readme_DefaultSubscription
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
```

This is a scoped operations object, and any operations you perform will be done under that subscription. From this object, you have access to all children via collection objects. Or you can access individual children by ID.

```C# Snippet:Readme_GetResourceGroupCollection
ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
// With the collection, we can create a new resource group with a specific name
string rgName = "myRgName";
AzureLocation location = AzureLocation.WestUS2;
ArmOperation<ResourceGroupResource> lro = await rgCollection.CreateOrUpdateAsync(WaitUntil.Completed, rgName, new ResourceGroupData(location));
ResourceGroupResource resourceGroup = lro.Value;
```

Now that we have the resource group created, we can manage the instances inside this resource group.

***Create an instance***

```C# Snippet:Managing_Instances_CreateAnInstance
// Create a new account
string accountName = "myAccount";
DeviceUpdateAccountData input1 = new DeviceUpdateAccountData(AzureLocation.WestUS2);
ArmOperation<DeviceUpdateAccountResource> lro1 = await resourceGroup.GetDeviceUpdateAccounts().CreateOrUpdateAsync(WaitUntil.Completed, accountName, input1);
DeviceUpdateAccountResource account = lro1.Value;
// Get the instance collection from the specific account and create an instance
string instanceName = "myInstance";
DeviceUpdateInstanceData input2 = new DeviceUpdateInstanceData(AzureLocation.WestUS2);
input2.IotHubs.Add(new IotHubSettings("/subscriptions/.../resourceGroups/.../providers/Microsoft.Devices/IotHubs/..."));
ArmOperation<DeviceUpdateInstanceResource> lro2 = await account.GetDeviceUpdateInstances().CreateOrUpdateAsync(WaitUntil.Completed, instanceName, input2);
DeviceUpdateInstanceResource instance = lro2.Value;
```

***List all instances***

```C# Snippet:Managing_Instances_ListAllInstances
// First we need to get the instance collection from the specific account
DeviceUpdateAccountResource account = await resourceGroup.GetDeviceUpdateAccounts().GetAsync("myAccount");
DeviceUpdateInstanceCollection instanceCollection = account.GetDeviceUpdateInstances();
// With GetAllAsync(), we can get a list of the instances in the collection
AsyncPageable<DeviceUpdateInstanceResource> response = instanceCollection.GetAllAsync();
await foreach (DeviceUpdateInstanceResource instance in response)
{
    Console.WriteLine(instance.Data.Name);
}
```

***Update an instance***

```C# Snippet:Managing_Instances_UpdateAnInstance
// First we need to get the instance collection from the specific account
DeviceUpdateAccountResource account = await resourceGroup.GetDeviceUpdateAccounts().GetAsync("myAccount");
DeviceUpdateInstanceCollection instanceCollection = account.GetDeviceUpdateInstances();
// Now we can get the instance with GetAsync()
DeviceUpdateInstanceResource instance = await instanceCollection.GetAsync("myInstance");
// With AddTagAsync(), we can add tag to the instance
instance = await instance.AddTagAsync("newTag", "newValue");
```

***Delete an instance***

```C# Snippet:Managing_Instances_DeleteAnInstance
// First we need to get the instance collection from the specific account
DeviceUpdateAccountResource account = await resourceGroup.GetDeviceUpdateAccounts().GetAsync("myAccount");
DeviceUpdateInstanceCollection instanceCollection = account.GetDeviceUpdateInstances();
// Now we can get the instance with GetAsync()
DeviceUpdateInstanceResource instance = await instanceCollection.GetAsync("myInstance");
// With DeleteAsync(), we can delete the instance
await instance.DeleteAsync(WaitUntil.Completed);
```


text:
		<link rel="stylesheet" type="text/css" href="css/button.css">
		<link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
		<link rel="stylesheet" type="text/css" href="css/menu.css">
		<link rel="stylesheet" type="text/css" href="css/home.css">

		<title>The Share Game</title>

Home

Leaderboard

Stocks

Contact Us

The Share Game

Loading leaderboard...


text:
*:focus {
    outline: none;
}

/* Process Menu Left List */
#leftMenu {
    margin-top: 15px;
}
.listMenu .md-no-style {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 400;
    text-transform: none;
}
.listMenu .md-no-style md-icon {
    margin-right: 32px;
    margin-left: 0;
}
/* END : Process Menu Left List */
.inputdemoErrors .inputErrorsApp {
    min-height: 48px; }

.center {
    margin-left: auto;
    margin-right: auto;
    width: 50%;
}

.isLock {
    color: gray;
    background: #eeeeee;
}

.ListFanPage td{
    padding: 5px;
}
.ListFanPage .link {
    cursor: pointer;
}
.ListFanPage .link:hover {
    background-color: #FFFFB0;
}


text:
package com.datumbox.framework.core.machinelearning.clustering;

import com.datumbox.framework.common.Configuration;
import com.datumbox.framework.core.common.dataobjects.DataframeMatrix;
import com.datumbox.framework.core.common.dataobjects.Record;
import com.datumbox.framework.common.storage.interfaces.StorageEngine;
import com.datumbox.framework.core.machinelearning.common.abstracts.AbstractTrainer;
import com.datumbox.framework.core.machinelearning.common.abstracts.algorithms.AbstractDPMM;
import com.datumbox.framework.core.machinelearning.common.abstracts.modelers.AbstractClusterer;
import com.datumbox.framework.core.statistics.distributions.ContinuousDistributions;
import org.apache.commons.math3.linear.OpenMapRealVector;
import org.apache.commons.math3.linear.RealVector;

import java.util.Map;

/**
 * The MultinomialDPMM implements Dirichlet Process Mixture Models with Multinomial
 * and Dirichlet priors.
 *
 * References:
 * http://blog.datumbox.com/overview-of-cluster-analysis-and-dirichlet-process-mixture-models/
 * http://blog.datumbox.com/clustering-documents-and-gaussian-data-with-dirichlet-process-mixture-models/
 * http://web.science.mq.edu.au/~mjohnson/papers/Johnson11MLSS-talk-extras.pdf
 * https://web.archive.org/web/20100119210345/http://cog.brown.edu/~mj/classes/cg168/slides/ChineseRestaurants.pdf
 *
 * @author Vasilis Vryniotis <bbriniotis@datumbox.com>
 */
public class MultinomialDPMM extends AbstractDPMM<MultinomialDPMM.Cluster, MultinomialDPMM.ModelParameters, MultinomialDPMM.TrainingParameters> {

    /**
     * The AbstractCluster class of the MultinomialDPMM model.
     */
    public static class Cluster extends AbstractDPMM.AbstractCluster {
        private static final long serialVersionUID = 2L;

        //hyper parameters
        private final double alphaWords; //effectively we set alphaWords = 50. The alphaWords controls the amount of words in each cluster. In most notes it is notated as alpha.

        //cluster parameters
        private RealVector wordCounts;

        private Double wordcounts_plusalpha; //internal cached value of WordCountsPlusAlpha

        /**
         * @param clusterId
         * @param dimensions
         * @param alphaWords
         * @see AbstractClusterer.AbstractCluster#AbstractCluster(java.lang.Integer)
         */
        protected Cluster(Integer clusterId, int dimensions, double alphaWords) {
            super(clusterId);

            this.alphaWords = alphaWords;

            wordCounts = new OpenMapRealVector(dimensions);
            wordcounts_plusalpha = estimateWordCountsPlusAlpha();
        }

        /** {@inheritDoc} */
        @Override
        protected double posteriorLogPdf(Record r) {
            RealVector x_mu = DataframeMatrix.parseRecord(r, featureIds);

            RealVector wordCountsPlusAlpha = wordCounts.mapAdd(alphaWords);

            double logPdf = C(wordCountsPlusAlpha.add(x_mu))-wordcounts_plusalpha;
            return logPdf;
        }

        /** {@inheritDoc} */
        @Override
        protected Map<Object, Integer> getFeatureIds() {
            return featureIds;
        }

        /** {@inheritDoc} */
        @Override
        protected void setFeatureIds(Map<Object, Integer> featureIds) {
            this.featureIds = featureIds;
        }

        /** {@inheritDoc} */
        @Override
        protected void add(Record r) {
            RealVector rv = DataframeMatrix.parseRecord(r, featureIds);

            //update cluster clusterParameters
            if(size==0) {
                wordCounts=rv;
            }
            else {
                wordCounts=wordCounts.add(rv);
            }

            size++;

            updateClusterParameters();
        }

        /** {@inheritDoc} */
        @Override
        protected void remove(Record r) {
            size--;

            RealVector rv = DataframeMatrix.parseRecord(r, featureIds);

            //update cluster clusterParameters
            wordCounts=wordCounts.subtract(rv);

            updateClusterParameters();
        }

        /** {@inheritDoc} */
        @Override
        protected void updateClusterParameters() {
            wordcounts_plusalpha = estimateWordCountsPlusAlpha();
        }

        /** {@inheritDoc} */
        @Override
        protected void clear() {

        }

        /**
         * Estimates the WordCountsPlusAlpha which is stored internally in the
         * cluster for performance reasons.
         *
         * @return
         */
        private double estimateWordCountsPlusAlpha() {
            RealVector wordCountsPlusAlpha = wordCounts.mapAdd(alphaWords);
            return C(wordCountsPlusAlpha);
        }

        /**
         * Internal method that estimates the value of C(a).
         *
         * @param alphaVector   Vector with alpha values
         * @return              Returns the value of C(a)
         */
        private double C(RealVector alphaVector) {
            double Cvalue;
            double sumAi=0.0;
            double sumLogGammaAi=0.0;

            int aLength=alphaVector.getDimension();
            double tmp;
            for(int i=0;i<aLength;++i) {
                tmp=alphaVector.getEntry(i);
                sumAi+= tmp;
                sumLogGammaAi+=ContinuousDistributions.logGamma(tmp);
            }

            Cvalue = sumLogGammaAi-ContinuousDistributions.logGamma(sumAi);

            return Cvalue;
        }
    }

    /** {@inheritDoc} */
    public static class ModelParameters extends AbstractDPMM.AbstractModelParameters<MultinomialDPMM.Cluster> {
        private static final long serialVersionUID = 1L;

        /**
         * @param storageEngine
         * @see AbstractTrainer.AbstractModelParameters#AbstractModelParameters(StorageEngine)
         */
        protected ModelParameters(StorageEngine storageEngine) {
            super(storageEngine);
        }

    }

    /** {@inheritDoc} */
    public static class TrainingParameters extends AbstractDPMM.AbstractTrainingParameters {
        private static final long serialVersionUID = 1L;

        private double alphaWords = 50.0; //effectively we set alphaWords = 50. The alphaWords controls the amount of words in each cluster. In most notes it is notated as alpha.

        /**
         * Getter for the Alpha hyperparameter of the words.
         *
         * @return
         */
        public double getAlphaWords() {
            return alphaWords;
        }

        /**
         * Setter for the Alpha hyperparameter of the words.
         *
         * @param alphaWords
         */
        public void setAlphaWords(double alphaWords) {
            this.alphaWords = alphaWords;
        }

    }

    /**
     * @param trainingParameters
     * @param configuration
     * @see AbstractTrainer#AbstractTrainer(AbstractTrainer.AbstractTrainingParameters, Configuration)
     */
    protected MultinomialDPMM(TrainingParameters trainingParameters, Configuration configuration) {
        super(trainingParameters, configuration);
    }

    /**
     * @param storageName
     * @param configuration
     * @see AbstractTrainer#AbstractTrainer(String, Configuration)
     */
    protected MultinomialDPMM(String storageName, Configuration configuration) {
        super(storageName, configuration);
    }

    /** {@inheritDoc} */
    @Override
    protected Cluster createNewCluster(Integer clusterId) {
        ModelParameters modelParameters = knowledgeBase.getModelParameters();
        TrainingParameters trainingParameters = knowledgeBase.getTrainingParameters();
        Cluster c = new Cluster(clusterId, modelParameters.getD(), trainingParameters.getAlphaWords());
        c.setFeatureIds(modelParameters.getFeatureIds());

        return c;
    }

}


text:
//
// MainPage.xaml.h
// Declaration of the MainPage class.
//

#pragma once

#include "MainPage.g.h"
#include "Types.h"
#include "IAsyncThreadPage.h"

namespace SocketUdpUwp
{
	/// <summary>
	/// An empty page that can be used on its own or navigated to within a Frame.
	/// </summary>
    public ref class MainPage sealed : public IAsyncThreadPage
	{
	public:
        MainPage();

        virtual void NotifyFromAsyncThread(String^ message, NotifyType type);

        void Notify(String^ message, NotifyType type);

    private:
        // (row, col) position of MainPageGrid for (server or client) Control
        static constexpr int ROLE_POS_ROW = 2;
        static constexpr int ROLE_POS_COL = 0;

        // change role from server client (or vice versa)
        void Role_Changed(Object^ sender, RoutedEventArgs^ e);

        // (server or client) control position in MainPageGrid->Children
        int roleCtrlIndex_ = -1;
    };
}


text:
require 'ostruct'

module ResourceKit
  module Testing
    class ActionHandlerMatchers
      ResponseStub = Class.new(OpenStruct)

      attr_reader :action, :response_stub, :failure_message

      def initialize(action)
        @action = action
      end

      def with(options, &block)
        @response_stub = ResponseStub.new(options)
        @handled_block = block

        self
      end

      def matches?(subject, &block)
        @handled_block ||= block
        action = subject.resources.find_action(self.action)
        unless action
          @failure_message = "expected :#{self.action} to be handled by the class."
          return false
        end

        status_code = response_stub.status || 200
        unless action.handlers[status_code]
          @failure_message = "expected the #{status_code} status code to be handled by the class."
          return false
        end

        handled_response = action.handlers[status_code].call(response_stub)
        @handled_block.call(handled_response)

        true
      end
    end
  end
end


text:
local all = {}

local groups = require 'quiz.groups'

for _, group in ipairs(groups) do
    local tests = group[2]
    for _, test in ipairs(tests) do
        local name = test[1]
        local mod = test[2]
        all[name] = mod
    end
end

return all


text:
package org.jivesoftware.smackx.omemo.internal;

import org.jivesoftware.smack.packet.Message;

/**
 * Class that bundles a decrypted message together with the original message and some information about the encryption.
 *
 * @author Paul Schaub
 */
public class ClearTextMessage {
    private final String body;
    private final Message encryptedMessage;
    private final OmemoMessageInformation messageInformation;

    public ClearTextMessage(String message, Message original, OmemoMessageInformation messageInfo) {
        this.body = message;
        this.encryptedMessage = original;
        this.messageInformation = messageInfo;
    }

    /**
     * Return the body of the decrypted message.
     *
     * @return plaintext body
     */
    public String getBody() {
        return body;
    }

    /**
     * Return the original Message object.
     *
     * @return original message
     */
    public Message getOriginalMessage() {
        return encryptedMessage;
    }

    /**
     * Return the OmemoMessageInformation.
     *
     * @return omemoMessageInformation
     */
    public OmemoMessageInformation getMessageInformation() {
        return messageInformation;
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\widgets\DetailView;
use common\models\VesselType;
use common\models\Vessel;
use common\models\Ports;
use common\models\Services;
use common\models\Currency;
use common\models\Terminal;
use common\models\Debtor;
use common\models\InvoiceType;
use common\models\Contacts;
use common\models\Purpose;
use common\models\CloseEstimate;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model common\models\Appointment */

$this->title = $model->appointment_no;
$this->params['breadcrumbs'][] = ['label' => 'Appointments', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

                        –
                        +

                        ×

                <?= Html::a(' Manage Appointment', ['index'], ['class' => 'btn btn-warning  btn-icon btn-icon-standalone']) ?>
                <?= Html::a(' Disable', ['appointment/disable', 'id' => $model->id], ['class' => 'btn btn-warning  btn-icon btn-icon-standalone']) ?>

                            Appointment

                            Estimated Proforma

                            Port call Data

                            Close Estimate

                                <?php
//                                if($model->status == 1){
                                echo Html::a(' Update', ['appointment/update', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                                ?>

                                <?=
                                DetailView::widget([
                                    'model' => $model,
                                    'attributes' => [
                                        //'id',
                                        [
                                            'attribute' => 'vessel_type',
                                            'value' => call_user_func(function($model) {

                                                            return VesselType::findOne($model->vessel_type)->vessel_type;
                                                    }, $model),
                                        ],
                                        [
                                            'attribute' => 'vessel',
                                            'label' => call_user_func(function($model) {
                                                            return VesselType::findOne($model->vessel_type)->vessel_type;
                                                    }, $model),
                                            'value' => call_user_func(function($model) {
                                                            if ($model->vessel_type == 1) {
                                                                    return 'T - ' . Vessel::findOne($model->tug)->vessel_name . ' / B - ' . Vessel::findOne($model->barge)->vessel_name;
                                                            } else {
                                                                    return Vessel::findOne($model->vessel)->vessel_name;
                                                            }
                                                    }, $model),
                                        ],
                                        [
                                            'attribute' => 'port_of_call',
                                            'value' => call_user_func(function($model) {

                                                            return Ports::findOne($model->port_of_call)->port_name;
                                                    }, $model),
                                        ],
                                        [
                                            'attribute' => 'terminal',
                                            'value' => call_user_func(function($model) {

                                                            return Terminal::findOne($model->terminal)->terminal;
                                                    }, $model),
                                        ],
                                        'birth_no',
                                        'appointment_no',
                                        'no_of_principal',
                                        [
                                            'attribute' => 'principal',
                                            'value' => call_user_func(function ($data) {
                                                            $principle = explode(',', $data->principal);
                                                            $result = '';
                                                            foreach ($principle as $prncple) {
                                                                    $result .= $data->getDebtorName($prncple) . ', ';
                                                            }
                                                            return rtrim($result, ",");
                                                    }, $model),
                                        ],
                                        [
                                            'attribute' => 'nominator',
                                            'value' => call_user_func(function($model) {

                                                            return Contacts::findOne($model->nominator)->name;
                                                    }, $model),
                                        ],
                                        [
                                            'attribute' => 'charterer',
                                            'value' => call_user_func(function($model) {

                                                            return Contacts::findOne($model->charterer)->name;
                                                    }, $model),
                                        ],
                                        [
                                            'attribute' => 'shipper',
                                            'value' => call_user_func(function($model) {

                                                            return Contacts::findOne($model->shipper)->name;
                                                    }, $model),
                                        ],
                                        [
                                            'attribute' => 'purpose',
                                            'value' => call_user_func(function($model) {

                                                            return Purpose::findOne($model->purpose)->purpose;
                                                    }, $model),
                                        ],
                                        'cargo',
                                        'cargo_details',
                                        'quantity',
                                        'last_port',
                                        'next_port',
                                        'eta',
                                        'stage',
                                        [
                                            'label' => 'Status',
                                            'format' => 'raw',
                                            'value' => $model->status == 1 ? 'Enabled' : 'disabled',
                                        ],
                                    ],
                                ])
                                ?>

                                    <?php
                                    if (empty($estimates)) {
                                            echo Html::a(' Add EstimatedProforma', ['estimated-proforma/add', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                                    } else {
                                            echo Html::a(' Update EstimatedProforma', ['estimated-proforma/add', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                                    }
                                    ?>

                                    <?= Html::beginForm(['estimated-proforma/reports'], 'post', ['target' => 'print_popup', 'onSubmit' => "window.open('about:blank','print_popup','width=1200,height=800');"]) ?>

                                    <?php
                                    $arr = explode(',', $appointment->principal);
                                    if (count($arr) == 1) {
                                            ?>
                                            <input type="hidden" name="app_id" value="<?= $appointment->id ?>">
                                            <input type="hidden" name="principal" value="<?= $arr[0]; ?>">
                                            <?php
                                    } else {
                                            ?>

                                            <input type="hidden" name="app_id" value="<?= $appointment->id ?>">

                                            <select name = "principal" id = "" class="form-control">
                                                <option selected = "selected">Select Principal</option>
                                                <?php
                                                foreach ($arr as $key => $value) {
                                                        $data = Debtor::findOne(['id' => $value]);
                                                        ?>
                                                        <option value="<?= $value ?>"><?= $data->principal_name ?></option>
                                                <?php }
                                                ?>
                                            </select>

                                            <?php
                                    }
                                    ?>

                                    <?= Html::submitButton('Generate EPDA', ['class' => 'btn btn-secondary btn-icon btn-icon-standalone']) ?>

                                    <?= Html::endForm() ?>
                                    <?php
//                    echo Html::a('Generate Report', ['estimated-proforma/report', 'id' => $appointment->id], ['class' => 'btn btn-secondary btn-icon btn-icon-standalone']);
                                    ?>

                                            #
                                            SERVICES
                                            SUPPLIER

                                            RATE /QTY
                                            QTY
                                            ROE
                                            EPDA VALUE
                                            PRINCIPAL
                                            COMMENTS

                                        <?php
                                        $i = 0;
                                        foreach ($estimates as $estimate):
                                                $i++;
                                                ?>

                                                    <?= $i; ?>
                                                    <?= $estimate->service->service ?>
                                                    <?= $estimate->supplier0->name ?>

                                                    <?= $estimate->unit_rate; ?>
                                                    <?= $estimate->unit; ?>
                                                    <?= $estimate->roe; ?>
                                                    <?= $estimate->epda; ?>
                                                    <?= $estimate->principal0->principal_name; ?>
                                                    <?= $estimate->comments; ?>

                                                <?php
                                        endforeach;
                                        ?>

Uploaded Files: <?= Yii::$app->UploadFile->ListFile($appointment->id, Yii::$app->params['estimatePath']); ?>

                            <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2.css">
                            <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2-bootstrap.css">

                            <?php
                            if (empty($ports)) {
                                    echo Html::a(' Add PortCallData', ['port-call-data/update', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                            } else {
                                    echo Html::a(' Update PortCallData', ['port-call-data/update', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                            }
                            ?>

PortCallData

                                    <?php
                                    if (!empty($imigration)) {
                                            echo '
Imigration Clearence Details
';
                                            echo '
';
                                            echo $this->render('_imigration', [
                                                'model' => $imigration,
                                                'form' => $form,
                                            ]);
                                    }
                                    ?>

Port Call Details

                                        ETA  :
                                        <?= Yii::$app->SetValues->ChangeFormate($ports->eta) ?>
                                        <?= $newDate; ?>

                                        ETS  :
                                        <?= Yii::$app->SetValues->ChangeFormate($ports->ets) ?>
                                        <?= $newDate; ?>

                                        EOSP  :
                                        <?= Yii::$app->SetValues->ChangeFormate($ports->eosp) ?>
                                        <?= $$newDate; ?>

                                        ARRIVED ANCHORAGE  :
                                        <?= Yii::$app->SetValues->ChangeFormate($ports->arrived_anchorage) ?>
                                        <?= $newDate; ?>

                                        NOR TENDERED  :
                                        <?= Yii::$app->SetValues->ChangeFormate($ports->nor_tendered) ?>
                                        <?= $newDate; ?>

                                    <?php
                                    if ($appointment->port_of_call == 2 || $appointment->port_of_call == 3) {
                                            if ($appointment->purpose == 2 && $appointment->port_of_call == 2) {
                                                    //$var = "_form_rmc_tanker";
                                                    echo $this->render('_rmc_tanker', [
                                                        'model' => $ports,
                                                        'form' => $form,
                                                    ]);
                                            } else {
                                                    //$var = "_form_stevin_rocks";
                                                    echo $this->render('_stevin_rocks', [
                                                        'model' => $ports,
                                                        'form' => $form,
                                                    ]);
                                            }
                                    } else {
                                            //$var = "_form_common";
                                            echo $this->render('_common', [
                                                'model' => $ports,
                                                'form' => $form,
                                            ]);
                                    }
                                    ?>

                                        COMMENTS  :
                                        <?= $ports->comments; ?>

                                <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2.css">
                                <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2-bootstrap.css">

                            <?php
                            if (empty($drafts)) {
                                    echo Html::a(' Add PortCallDataDraft', ['port-call-data/update', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                            } else {
                                    echo Html::a(' Update PortCallDataDraft', ['port-call-data/update', 'id' => $drafts->appointment_id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                            }
                            ?>

PortCallDataDraft

                                        DATA ID  :
                                        <?= $drafts->data_id; ?>

                                        INITIAL SURVEY COMMENCED  :
                                        <?= Yii::$app->SetValues->ChangeFormate($drafts->intial_survey_commenced) ?>
                                        <?= $newDate; ?>

                                        INITIAL SURVEY COMPLETED  :
                                        <?= Yii::$app->SetValues->ChangeFormate($drafts->intial_survey_commenced) ?>
                                        <?= $newDate; ?>

                                        FINAL SURVEY COMMENCED  :
                                        <?= Yii::$app->SetValues->ChangeFormate($drafts->finial_survey_commenced) ?>
                                        <?= $newDate; ?>

                                        FINAL SURVEY COMPLETED  :
                                        <?= Yii::$app->SetValues->ChangeFormate($drafts->finial_survey_completed) ?>
                                        <?= $newDate; ?>

                                        FWD ARRIVAL QUANTITY  :
                                        <?= $drafts->fwd_arrival_quantity; ?>

                                        AFT ARRIVAL QUANTITY  :
                                        <?= $drafts->aft_arrival_quantity; ?>

                                        MEAN ARRIVAL QUANTITY  :
                                        <?= $drafts->mean_arrival_quantity; ?>

                                        FWD SAILING QUANTITY  :
                                        <?= $drafts->fwd_sailing_quantity; ?>

                                        AFT SAILING QUANTITY  :
                                        <?= $drafts->aft_sailing_quantity; ?>

                                        MEAN SAILING QUANTITY  :
                                        <?= $drafts->mean_sailing_quantity; ?>

                                        COMMENTS  :
                                        <?= $drafts->comments; ?>

                                <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2.css">
                                <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2-bootstrap.css">

                            <?php
                            if (empty($rob)) {
                                    echo Html::a(' Add PortCallDataRob', ['port-call-data/update', 'id' => $model->appointment_id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                            } else {
                                    echo Html::a(' Update PortCallDataRob', ['port-call-data/update', 'id' => $rob->appointment_id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                            }
                            ?>

PortCallDataRob

                                        FO ARRIVAL  :
                                        <?= $rob->fo_arrival_quantity; ?> <?php
                                        if ($rob->fo_arrival_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->fo_arrival_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        DO ARRIVAL  :
                                        <?= $rob->do_arrival_quantity; ?> <?php
                                        if ($rob->do_arrival_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->do_arrival_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        GO ARRIVAL :
                                        <?= $rob->go_arrival_quantity; ?> <?php
                                        if ($rob->go_arrival_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->go_arrival_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        LO ARRIVAL :
                                        <?= $rob->lo_arrival_quantity; ?> <?php
                                        if ($rob->lo_arrival_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->lo_arrival_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        FRESH WATER ARRIVAL :
                                        <?= $rob->fresh_water_arrival_quantity; ?> <?php
                                        if ($rob->fresh_water_arrival_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->fresh_water_arrival_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        FO SAILING :
                                        <?= $rob->do_sailing_quantity; ?> <?php
                                        if ($rob->fo_sailing_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->fo_sailing_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        DO SAILING :
                                        <?= $rob->do_sailing_quantity; ?> <?php
                                        if ($rob->do_sailing_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->do_sailing_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        GO SAILING :
                                        <?= $rob->go_sailing_quantity; ?> <?php
                                        if ($rob->go_sailing_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->go_sailing_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        LO SAILING :
                                        <?= $rob->lo_sailing_quantity; ?> <?php
                                        if ($rob->lo_sailing_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->lo_sailing_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        FRESH WATER SAILING  :
                                        <?= $rob->fresh_water_sailing_quantity; ?> <?php
                                        if ($rob->fresh_water_sailing_unit == 1) {
                                                echo 'Metric Ton';
                                        } elseif ($rob->fresh_water_sailing_unit == 2) {
                                                echo 'Litre';
                                        }
                                        ?>

                                        COMMENTS  :
                                        <?= $rob->comments; ?>

                                <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2.css">
                                <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2-bootstrap.css">

Uploaded Files: <?= Yii::$app->UploadFile->ListFile($appointment->id, Yii::$app->params['datPath']); ?>

                                    <?php
                                    if (empty($closeestimates)) {
                                            echo Html::a(' Add CloseEstimate', ['close-estimate/add', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                                    } else {
                                            echo Html::a(' Update CloseEstimate', ['close-estimate/add', 'id' => $model->id], ['class' => 'btn btn-blue btn-icon btn-icon-standalone btn-icon-standalone-right']);
                                    }
                                    ?>

                                    <?php
                                    $arr = CloseEstimate::find()->select('invoice_type')->distinct()->where(['apponitment_id' => $appointment->id])->all();
                                    foreach ($arr as $value) {
                                            if ($value->invoice_type != '') {
                                                    $invoice_type = $value->invoice_type;
                                            }
                                    }
                                    ?>
                                    <?= Html::beginForm(['close-estimate/report'], 'post', ['target' => 'print_popup', 'onSubmit' => "window.open('about:blank','print_popup','width=1200,height=600');"]) ?>
                                    <?php
                                    if (count($arr) == 1) {
                                            ?>
                                            <?php
                                            $arr = CloseEstimate::find()->select('invoice_type')->distinct()->where(['apponitment_id' => $appointment->id])->one();
                                            ?>
                                            <input type="hidden" name="app_id" value="<?= $appointment->id ?>">
                                            <?php //                                                ?>
                                            <input type="hidden" name="invoice_type" value="//<?php // $arr->invoice_type          ?>">
                                            <?php
                                            ?>

                                            <?php
                                    } else {
                                            ?>

                                            <input type="hidden" name="app_id" value="<?= $appointment->id ?>">

                                            <?php
                                    }
                                    ?>

                                        <select name = "invoice_type" id = "close-estimate-invoice" class="form-control">
                                            <option selected = "selected">Select Invoice Type</option>
                                            <option value="all">All</option>
                                            <?php
                                            foreach ($arr as $key => $value) {
                                                    if ($value->invoice_type != '') {
                                                            $data = InvoiceType::findOne(['id' => $value->invoice_type]);
                                                            ?>
                                                            <option value="<?= $value->invoice_type ?>"><?= $data->invoice_type ?></option>
                                                            <?php
                                                    }
                                            }
                                            ?>
                                        </select>

                                    <?php
                                    $principals = CloseEstimate::find()->select('principal')->distinct()->where(['apponitment_id' => $appointment->id])->all();
                                    if (count($principals) > 1) {
                                            ?>

                                                <select name = "fda" id = "fda" class="form-control">
                                                    <option value="" selected = "selected">Select Principal</option>
                                                    <?php
                                                    foreach ($principals as $princippp) {
                                                            if ($princippp->principal != '') {
                                                                    $data = Debtor::findOne(['id' => $princippp->principal]);
                                                                    ?>
                                                                    <option value="<?= $princippp->principal ?>"><?= $data->principal_name ?></option>
                                                                    <?php
                                                            }
                                                    }
                                                    ?>
                                                </select>

                                            <?php
                                    } else {
                                            foreach ($principals as $princippp) {
                                                    ?>
                                                    <input type="hidden" name="fda" value="<?= $princippp->principal ?>">

                                                    <?php
                                            }
                                    }
                                    ?>

                                        <?= Html::submitButton('Generate Final DA', ['class' => 'btn btn-secondary btn-icon btn-icon-standalone']) ?>
                                        <?= Html::endForm() ?>
                                        <?php ?>

                                            #
                                            SERVICES
                                            SUPPLIER
                                            RATE /QTY
                                            QTY
                                            ROE
                                            EPDA VALUE
                                            FDA VALUE
                                            PAYMENT TYPE
                                            TOTAL
                                            INVOICE TYPE
                                            PRINCIPAL
                                            COMMENTS

                                        <?php
                                        $i = 0;
                                        foreach ($closeestimates as $closeestimate):
                                                $i++;
                                                ?>

                                                    <?= $i; ?>
                                                    <?= $closeestimate->service->service ?>
                                                    <?= $closeestimate->supplier0->name ?>
                                                    <?= $closeestimate->unit_rate; ?>
                                                    <?= $closeestimate->unit; ?>
                                                    <?= $closeestimate->roe; ?>
                                                    <?= $closeestimate->epda; ?>
                                                    <?= $closeestimate->fda; ?>
                                                    <?= $closeestimate->payment_type; ?>
                                                    <?= $closeestimate->total; ?>
                                                    <?= $closeestimate->invoice->invoice_type ?>
                                                    <?= $closeestimate->principal0->principal_id; ?>
                                                    <?= $closeestimate->comments; ?>

                                                <?php
                                        endforeach;
                                        ?>

Uploaded Files: <?= Yii::$app->UploadFile->ListFile($appointment->id, Yii::$app->params['closePath']); ?>

                            <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2.css">
                            <link rel="stylesheet" href="<?= Yii::$app->homeUrl; ?>/js/select2/select2-bootstrap.css">

                    <?php
//                                 }
                    ?>


text:
#ifndef ITEMID_H
#define ITEMID_H

/*
 * An item pointer (also called line pointer) on a buffer page
 *
 * In some cases an item pointer is "in use" but does not have any associated
 * storage on the page.  By convention, lp_len == 0 in every item pointer
 * that does not have storage, independently of its lp_flags state.
 */
typedef struct ItemIdData
{
	unsigned	lp_off:15,		/* offset to tuple (from start of page) */
				lp_flags:2,		/* state of item pointer, see below */
				lp_len:15;		/* byte length of tuple */
} ItemIdData;

typedef ItemIdData *ItemId;

/*
 * lp_flags has these possible states.  An UNUSED line pointer is available
 * for immediate re-use, the other states are not.
 */
#define LP_UNUSED		0		/* unused (should always have lp_len=0) */
#define LP_NORMAL		1		/* used (should always have lp_len>0) */
#define LP_REDIRECT		2		/* HOT redirect (should have lp_len=0) */
#define LP_DEAD			3		/* dead, may or may not have storage */

/*
 * Item offsets and lengths are represented by these types when
 * they're not actually stored in an ItemIdData.
 */
typedef uint16 ItemOffset;
typedef uint16 ItemLength;

/* ----------------
 *		support macros
 * ----------------
 */

/*
 *		ItemIdGetLength
 */
#define ItemIdGetLength(itemId) \
   ((itemId)->lp_len)

/*
 *		ItemIdGetOffset
 */
#define ItemIdGetOffset(itemId) \
   ((itemId)->lp_off)

/*
 *		ItemIdGetFlags
 */
#define ItemIdGetFlags(itemId) \
   ((itemId)->lp_flags)

/*
 *		ItemIdGetRedirect
 * In a REDIRECT pointer, lp_off holds the link to the next item pointer
 */
#define ItemIdGetRedirect(itemId) \
   ((itemId)->lp_off)

/*
 * ItemIdIsValid
 *		True iff item identifier is valid.
 *		This is a pretty weak test, probably useful only in Asserts.
 */
#define ItemIdIsValid(itemId)	PointerIsValid(itemId)

/*
 * ItemIdIsUsed
 *		True iff item identifier is in use.
 */
#define ItemIdIsUsed(itemId) \
	((itemId)->lp_flags != LP_UNUSED)

/*
 * ItemIdIsNormal
 *		True iff item identifier is in state NORMAL.
 */
#define ItemIdIsNormal(itemId) \
	((itemId)->lp_flags == LP_NORMAL)

/*
 * ItemIdIsRedirected
 *		True iff item identifier is in state REDIRECT.
 */
#define ItemIdIsRedirected(itemId) \
	((itemId)->lp_flags == LP_REDIRECT)

/*
 * ItemIdIsDead
 *		True iff item identifier is in state DEAD.
 */
#define ItemIdIsDead(itemId) \
	((itemId)->lp_flags == LP_DEAD)

/*
 * ItemIdHasStorage
 *		True iff item identifier has associated storage.
 */
#define ItemIdHasStorage(itemId) \
	((itemId)->lp_len != 0)

/*
 * ItemIdSetUnused
 *		Set the item identifier to be UNUSED, with no storage.
 *		Beware of multiple evaluations of itemId!
 */
#define ItemIdSetUnused(itemId) \
( \
	(itemId)->lp_flags = LP_UNUSED, \
	(itemId)->lp_off = 0, \
	(itemId)->lp_len = 0 \
)

/*
 * ItemIdSetNormal
 *		Set the item identifier to be NORMAL, with the specified storage.
 *		Beware of multiple evaluations of itemId!
 */
#define ItemIdSetNormal(itemId, off, len) \
( \
	(itemId)->lp_flags = LP_NORMAL, \
	(itemId)->lp_off = (off), \
	(itemId)->lp_len = (len) \
)

/*
 * ItemIdSetRedirect
 *		Set the item identifier to be REDIRECT, with the specified link.
 *		Beware of multiple evaluations of itemId!
 */
#define ItemIdSetRedirect(itemId, link) \
( \
	(itemId)->lp_flags = LP_REDIRECT, \
	(itemId)->lp_off = (link), \
	(itemId)->lp_len = 0 \
)

/*
 * ItemIdSetDead
 *		Set the item identifier to be DEAD, with no storage.
 *		Beware of multiple evaluations of itemId!
 */
#define ItemIdSetDead(itemId) \
( \
	(itemId)->lp_flags = LP_DEAD, \
	(itemId)->lp_off = 0, \
	(itemId)->lp_len = 0 \
)

/*
 * ItemIdMarkDead
 *		Set the item identifier to be DEAD, keeping its existing storage.
 *
 * Note: in indexes, this is used as if it were a hint-bit mechanism;
 * we trust that multiple processors can do this in parallel and get
 * the same result.
 */
#define ItemIdMarkDead(itemId) \
( \
	(itemId)->lp_flags = LP_DEAD \
)

#endif							/* ITEMID_H */


text:
using System.Collections.Generic;

namespace GraphQL.Language.AST
{
    public class Directive : AbstractNode
    {
        public Directive(NameNode node)
        {
            NameNode = node;
        }

        public string Name => NameNode.Name;
        public NameNode NameNode { get; set; }

        public Arguments Arguments { get; set; }

        public override IEnumerable<INode> Children
        {
            get { yield return Arguments; }
        }

        public override string ToString()
        {
            return "Directive{{name='{0}',arguments={1}}}".ToFormat(Name, Arguments);
        }

        protected bool Equals(Directive other)
        {
            return string.Equals(Name, other.Name);
        }

        public override bool IsEqualTo(INode obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((Directive) obj);
        }
    }
}


text:
package shared

import (
	"fmt"
)

type SSHInfo struct {
	Host     string `json:"host,omitempty"`
	Port     string `json:"port,omitempty"`
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
	Key      string `json:"key,omitempty"`
}

func (info SSHInfo) String() string {
	return fmt.Sprintf("%s@%s:%s", info.User, info.Host, info.Port)
}


text:
package com.nokia.springboot.training.d05.s02.service;

import com.nokia.springboot.training.d05.s02.dto.ProductDTO;
import com.nokia.springboot.training.d05.s02.exceptions.NotFoundException;
import com.nokia.springboot.training.d05.s02.model.Product;
import com.nokia.springboot.training.d05.s02.repository.ProductRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;
import java.util.function.Function;

@Service
public class ProductService {

    private static final Logger LOGGER = LoggerFactory.getLogger(ProductService.class);

    private final ProductRepository productRepository;

    @Autowired
    public ProductService(final ProductRepository productRepository) {
        this.productRepository = productRepository;
    }

    public ProductDTO get(final int id) {
        LOGGER.info("Getting the product with the ID {}...", id);

        final Product product =
                Optional.ofNullable(productRepository.get(id))
                        .orElseThrow(() -> new NotFoundException("There is no product with the id " + id));

        return getProductConverter().apply(product);
    }

    public void removeProduct(final int id) {
        productRepository.remove(id);
    }

    private Function<Product, ProductDTO> getProductConverter() {
        return product -> new ProductDTO(product.getId(), product.getName());
    }
}


text:
package org.agorava.utils.solder.bean.generic;

import java.lang.annotation.Annotation;
import java.util.Set;

/**
 * Uniquely identifies a generic bean set
 *
 * @author Stuart Douglas
 * @author Ove Ranheim
 */
public class GenericIdentifier {

    private final Set<Annotation> qualifiers;
    private final Annotation configuration;

    @Override
    public String toString() {
        return "GenericIdentifier [configuration=" + configuration + ", qualifiers=" + qualifiers + "]";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((configuration == null) ? 0 : configuration.hashCode());
        result = prime * result + ((qualifiers == null) ? 0 : qualifiers.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        GenericIdentifier other = (GenericIdentifier) obj;
        if (configuration == null) {
            if (other.configuration != null)
                return false;
        } else if (!configuration.equals(other.configuration))
            return false;
        if (qualifiers == null) {
            if (other.qualifiers != null)
                return false;
        } else if (!qualifiers.equals(other.qualifiers))
            return false;
        return true;
    }

    public GenericIdentifier(Set<Annotation> qualifiers, Annotation configuration) {
        this.qualifiers = qualifiers;
        this.configuration = configuration;
    }

    public Set<Annotation> getQualifiers() {
        return qualifiers;
    }

    public Class<? extends Annotation> getAnnotationType() {
        return configuration.annotationType();
    }

    public Annotation getConfiguration() {
        return configuration;
    }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.obda.sql.benchmark</groupId>
  <artifactId>ontowisbench</artifactId>
  <version>1.0</version>
  <packaging>jar</packaging>

  <name>ontowisbench</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>


text:
public class LRUCache {
    public class cacheNode {
        int key;
        int val;
        cacheNode prev;
        cacheNode next;

        public cacheNode(int key, int val) {
            this.key = key;
            this.val = val;
        }
    }
    private Map <Integer, cacheNode> cache;
    private cacheNode head, tail; //dummy nodes
    private int capacity;

    public LRUCache(int capacity) {
        this.capacity = capacity;
        cache = new HashMap<> ();
        head = new cacheNode(0, 0);
        tail = new cacheNode(0, 0);
        head.next = tail;
        tail.prev = head;
    }

    public int get(int key) {
        cacheNode node = cache.get(key);
        if (node != null) {
            remove(node);
            addFirst(node);
            return node.val;
        }

        return -1;
    }

    public void set(int key, int value) {
        cacheNode node = cache.get(key);
        if (node != null) {
            node.val = value;
            remove(node);
            addFirst(node);
        } else {
            node = new cacheNode(key, value);
            if (cache.size() >= capacity) {
                cacheNode nodeToRemove = removeLast();
                if (nodeToRemove != null) {
                    cache.remove(nodeToRemove.key);
                }
            }
            cache.put(key, node);
            addFirst(node);
        }
    }

    private void remove(cacheNode node) {
        node.next.prev = node.prev;
        node.prev.next = node.next;
        node.next = node.prev = null;
    }

    private void addFirst(cacheNode node) {
        node.next = head.next;
        node.prev = head;
        node.next.prev = node;
        head.next = node;
    }

    private cacheNode removeLast() {
        if (tail.prev == head) {
            return null;
        }
        cacheNode node = tail.prev;
        tail.prev = node.prev;
        tail.prev.next = tail;

        return node;
    }
}


text:
/**
 * Configure QUnit
 */
QUnit.config({
  title: 'File System',
  requireExpects: false,
  hidepassed: false,
});
QUnit.urlParams({});
/**
 * Registers QUnit helpers globally
 * Imports the following functions:
 * ok, equal, notEqual, deepEqual, notDeepEqual, strictEqual,
 * notStrictEqual, throws, module, test, asyncTest, expect
 */
QUnit.helpers(this);

/**
 * HTML Test Report Generation Handler
 * @param {object} e The event parameter for a simple get trigger.
 */
function doGet(e) {
  QUnit.urlParams(e.parameter);
  QUnit.load(testFunctions);

  return QUnit.getHtml();
}

/**
 * Generates test report as PDF
 */
function generateTestReport() {
  var fileName = 'FileSystem - Report.pdf';
  FileMapper.clearAllMappingsInConfig();
  Workbook.setActiveWorkbookPath('c:\\user\\desktop');
  QUnit.load(testFunctions);
  // Run tests and generate html output
  var htmlOutput = QUnit.getHtml();
  htmlOutput.setWidth(1200);
  htmlOutput.setHeight(800);
  // Display test results
  SpreadsheetApp.getUi().showModalDialog(htmlOutput, fileName);
  // Save test results in Google Drive
  var blob = htmlOutput.getBlob();
  var pdf = blob.getAs('application/pdf');
  DriveApp.createFile(pdf).setName(fileName);
}

function testFunctions() {
  setupTestEnvironment();
  workbook_run_all_tests();
  file_io_run_all_tests();
  file_mapper_run_all_tests();
  directory_manager_run_all_tests();
  vba_file_run_all_tests();
  vba_folder_run_all_tests();
  file_system_run_all_tests();
  vba_textstream_run_all_tests();
}

function setupTestEnvironment() {
  var folder1 = 'c:\\user\\desktop\\folder1';
  var folder2 = 'c:\\user\\desktop\\folder2';
  deleteFolderIfExists(folder1);
  deleteFolderIfExists(folder2);
  var originalFolder1 = 'c:\\user\\desktop\\original\\folder1';
  var originalFolder2 = 'c:\\user\\desktop\\original\\folder2';
  FileMapper.copyFolder(originalFolder1, 'c:\\user\\desktop');
  FileMapper.copyFolder(originalFolder2, 'c:\\user\\desktop');
}

// Callback when module starts
QUnit.moduleStart(function(property) {
  spreadsheetLogger.logColumn++;  // New module, increase indentation
  spreadsheetLogger.log(property.name + ' - Test Module Start');
  SpreadsheetApp.flush();
});
// Callback when module is finished
QUnit.moduleDone(function(property) {
  spreadsheetLogger.log(property.name + ' - Test Module End');
  spreadsheetLogger.logColumn--;  // Module finished, decrease indentation
  SpreadsheetApp.flush();
});
// Callback when assertion is fired
QUnit.log(function(property) {
  var message = 'Assertion ' + property.message + ' ' + property.result;
  spreadsheetLogger.log(message, 2);
});
// Callback when test is finished
QUnit.testDone(function(property) {
  spreadsheetLogger.log('Test Done ' + property.name, 1);
  SpreadsheetApp.flush();
});

/**
 * Runs custom tests - Loads the selected tests into QUnit. Runs setup and
 * teardown functions as needed. Logs the output into the spreadsheet. Final
 * report is rendered as a Modal Dialog.
 * @param {object} selectedTests Selected tests metadata object
 */
function runCustomTests(selectedTests) {
  spreadsheetLogger.reset();
  var fileSystemTests = getFileSystemTests();
  // Function to load all selected tests
  function testFunctions() {
    loadSelectedTests(fileSystemTests, selectedTests, 'FileSystem');
  };
  QUnit.load(testFunctions);  // Load tests
  // Run tests and generate html output
  var htmlOutput = QUnit.getHtml();
  htmlOutput.setWidth(1200);
  htmlOutput.setHeight(800);
  // Display test results
  var fileName = 'FileSystem - Report';
  SpreadsheetApp.getUi().showModalDialog(htmlOutput, fileName);
}

/**
 * Helper function to recursively load selected tests
 * @param {object} fileSystemTests Filesystem Tests object
 * @param {object} selectedTests Selected tests metadata object
 * @param {string} name Name of current test module
 */
function loadSelectedTests(fileSystemTests, selectedTests, name) {
  // Run Setup if present
  if (fileSystemTests.setup) {
    spreadsheetLogger.log(name + ' - Setup', 1);
    SpreadsheetApp.flush();
    fileSystemTests.setup();
  }
  // Load selected tests
  for (test in selectedTests) {
    if (typeof (fileSystemTests.tests[test]) == 'function') {
      fileSystemTests.tests[test]();  // Load Test Function
    } else {
      // Load module test
      spreadsheetLogger.logColumn++;
      loadSelectedTests(fileSystemTests.tests[test], selectedTests[test], test);
      spreadsheetLogger.logColumn--;
    }
  }
  // Run Tear down if present
  if (fileSystemTests.teardown) {
    fileSystemTests.teardown();
  }
}

// State variable for current running test module
var currentRunningTestModule = null;

/**
 * Helper function to get fileSystems tests.
 * @return {object} File System Tests
 */
function getFileSystemTests() {
  var FileSystemTests = {
    setup: function() {
      FileMapper.clearAllMappingsInConfig();
      Workbook.setActiveWorkbookPath('c:\\user\\desktop');
    },
    tests: {
      'File Mapper': fileMapperTests,
      'File IO': fileIoTests,
      'Directory Manager': directoryManagerTests,
      'Workbook': workbookTests,
      'VBA File': vbaFileTests,
      'VBA Folder': vbaFolderTests,
      'File System': fileSystemApiTests,
      'Text Stream': vbaTextStreamTests,
      'File Handling': fileSystemHandlingTests,
    }
  };
  return FileSystemTests;
}


text:
require 'rails_helper'

describe MaterialPolicy do

  subject { MaterialCategoryPolicy }

  permissions :create?, :destroy? do
    before do
      @user = double User
      @course = double Course, admins: [@user]
      @material = double Material, course: @course
    end

    context "course member" do
      it "grants access" do
        expect(subject).to permit(@user, @material)
      end
    end

    context "not a course member" do
      it "denies access" do
        allow(@course).to receive(:admins).and_return([])
        expect(subject).not_to permit(@user, @material)
      end
    end
  end

end


text:
from couchdbkit import ResourceNotFound
from tastypie import fields as tp_f
from tastypie.resources import Resource
from corehq.apps.api.resources import HqBaseResource, CouchResourceMixin
from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.api.resources.meta import CustomResourceMeta
from corehq.apps.api.util import get_object_or_not_exist
from corehq.apps.fixtures.models import FixtureDataItem, FixtureDataType
from corehq.apps.users.models import Permissions

def convert_fdt(fdi):
    try:
        fdt = FixtureDataType.get(fdi.data_type_id)
        fdi.fixture_type = fdt.tag
        return fdi
    except ResourceNotFound:
        return fdi

class FixtureResource(CouchResourceMixin, HqBaseResource):
    type = "fixture"
    fields = tp_f.DictField(attribute='try_fields_without_attributes',
                            readonly=True, unique=True)
    # when null, that means the ref'd fixture type was not found
    fixture_type = tp_f.CharField(attribute='fixture_type', readonly=True,
                                  null=True)
    id = tp_f.CharField(attribute='_id', readonly=True, unique=True)

    def obj_get(self, bundle, **kwargs):
        return convert_fdt(get_object_or_not_exist(
            FixtureDataItem, kwargs['pk'], kwargs['domain']))

    def obj_get_list(self, bundle, **kwargs):
        domain = kwargs['domain']
        parent_id = bundle.request.GET.get("parent_id", None)
        parent_ref_name = bundle.request.GET.get("parent_ref_name", None)
        references = bundle.request.GET.get("references", None)
        child_type = bundle.request.GET.get("child_type", None)
        type_id = bundle.request.GET.get("fixture_type_id", None)
        type_tag = bundle.request.GET.get("fixture_type", None)

        if parent_id and parent_ref_name and child_type and references:
            parent_fdi = FixtureDataItem.get(parent_id)
            fdis = list(
                FixtureDataItem.by_field_value(
                    domain, child_type, parent_ref_name,
                    parent_fdi.fields_without_attributes[references])
            )
        elif type_id or type_tag:
            type_id = type_id or FixtureDataType.by_domain_tag(
                domain, type_tag).one()
            fdis = list(FixtureDataItem.by_data_type(domain, type_id))
        else:
            fdis = list(FixtureDataItem.by_domain(domain))

        return [convert_fdt(fdi) for fdi in fdis] or []

    class Meta(CustomResourceMeta):
        authentication = RequirePermissionAuthentication(Permissions.edit_apps)
        object_class = FixtureDataItem
        resource_name = 'fixture'
        limit = 0

class InternalFixtureResource(FixtureResource):

    # using the default resource dispatch function to bypass our authorization for internal use
    def dispatch(self, request_type, request, **kwargs):
        return Resource.dispatch(self, request_type, request, **kwargs)

    class Meta(CustomResourceMeta):
        authentication = RequirePermissionAuthentication(Permissions.edit_apps, allow_session_auth=True)
        object_class = FixtureDataItem
        resource_name = 'fixture_internal'
        limit = 0


text:
package uk.co.bluegecko.core.swing.table.rendering;

import java.awt.Component;

import javax.swing.AbstractButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

/**
 * Define alignment of components
 */
public enum Alignment
{

	LEFT( SwingConstants.LEFT ), LEADING( SwingConstants.LEADING ), CENTER( SwingConstants.CENTER ), RIGHT(
			SwingConstants.RIGHT ), TRAILING( SwingConstants.TRAILING );

	private final int alignment;

	private Alignment( final int alignment )
	{
		this.alignment = alignment;
	}

	/**
	 * Apply the alignment to a component
	 *
	 * @param c
	 *            the component
	 */
	public void apply( final Component c )
	{
		if ( c instanceof JLabel )
		{
			( ( JLabel ) c ).setHorizontalAlignment( alignment );
		}
		else if ( c instanceof JTextField )
		{
			( ( JTextField ) c ).setHorizontalAlignment( alignment );
		}
		else if ( c instanceof AbstractButton )
		{
			( ( AbstractButton ) c ).setHorizontalAlignment( alignment );
		}
		else if ( c instanceof JComponent )
		{
			final JComponent comp = ( JComponent ) c;
			switch ( alignment )
			{
				case SwingConstants.LEFT:
				case SwingConstants.LEADING:
					comp.setAlignmentY( Component.LEFT_ALIGNMENT );
					break;
				case SwingConstants.CENTER:
					comp.setAlignmentY( Component.CENTER_ALIGNMENT );
					break;
				case SwingConstants.RIGHT:
				case SwingConstants.TRAILING:
					comp.setAlignmentY( Component.RIGHT_ALIGNMENT );
					break;
				default:
					break;
			}
		}
	}

}


text:
namespace PixieBrowser
{
    partial class Login
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.pixivId = new System.Windows.Forms.TextBox();
            this.pixivPasswd = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.loginButton = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // pixivId
            //
            this.pixivId.Location = new System.Drawing.Point(57, 4);
            this.pixivId.Name = "pixivId";
            this.pixivId.Size = new System.Drawing.Size(100, 21);
            this.pixivId.TabIndex = 0;
            //
            // pixivPasswd
            //
            this.pixivPasswd.Location = new System.Drawing.Point(57, 31);
            this.pixivPasswd.Name = "pixivPasswd";
            this.pixivPasswd.PasswordChar = '~';
            this.pixivPasswd.Size = new System.Drawing.Size(100, 21);
            this.pixivPasswd.TabIndex = 1;
            this.pixivPasswd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Login_KeyDown);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(12, 7);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(16, 12);
            this.label1.TabIndex = 2;
            this.label1.Text = "ID";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(12, 34);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(37, 12);
            this.label2.TabIndex = 3;
            this.label2.Text = "Pswd";
            //
            // loginButton
            //
            this.loginButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.loginButton.Location = new System.Drawing.Point(175, 12);
            this.loginButton.Name = "loginButton";
            this.loginButton.Size = new System.Drawing.Size(75, 34);
            this.loginButton.TabIndex = 4;
            this.loginButton.Text = "Login";
            this.loginButton.UseVisualStyleBackColor = true;
            this.loginButton.Click += new System.EventHandler(this.Login_Click);
            this.loginButton.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Login_KeyDown);
            //
            // Login
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.loginButton;
            this.ClientSize = new System.Drawing.Size(262, 70);
            this.Controls.Add(this.loginButton);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.pixivPasswd);
            this.Controls.Add(this.pixivId);
            this.MaximizeBox = false;
            this.MaximumSize = new System.Drawing.Size(278, 108);
            this.MinimizeBox = false;
            this.MinimumSize = new System.Drawing.Size(278, 108);
            this.Name = "Login";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Login";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox pixivId;
        private System.Windows.Forms.TextBox pixivPasswd;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Button loginButton;
    }
}


text:
Vectorization is the process of converting an algorithm from operating on a single input value at a time
to operating on a set of input values([vector](./Vector.md)) at one time.

A vectorized routine is a routine that can perform operations on a set of input values,
transmitted as a [vector](./Vector.md). The vectorized routine should not lose the ability to process
scalar data.

### Automatic vectorization

Vectorization can be performed using the routine [vectorize](../tutorial/Vectorize.md).

The user object is passed to the `getFullName` routine, and its full name is returned as a string.
```js
// routine to vectorize
function getFullName( user )
{
  return `${user.firstName} ${user.lastName}`;
}

let user = { firstName : 'John', lastName : 'Smith', age : 30 }
let users =
[
  { firstName : 'John', lastName : 'Smith', age : 30 },
  { firstName : 'Samantha', lastName : 'Blum', age : 25 },
  { firstName : 'Edvard', lastName : 'Pitt', age : 33 }
];

console.log( getFullName( user ) );
// John Smith
console.log( getFullName( users ) );
// undefined undefined
```
After performing the automatic vectorization of the `getFullName` routine, it can also process the data vector.
```js
let _ = require( 'wTools' );

// routine to vectorize
function getFullName( user )
{
  return `${user.firstName} ${user.lastName}`;
}

// automatically vectorized routine by vectorize( func, n ),
// func - scalar routine, n - number of parameters for vectorized routine
let getFullName2 = _.vectorize( getFullName, 1 );

let user = { firstName : 'John', lastName : 'Smith', age : 30 }
let users =
[
  { firstName : 'John', lastName : 'Smith', age : 30 },
  { firstName : 'Samantha', lastName : 'Blum', age : 25 },
  { firstName : 'Edvard', lastName : 'Pitt', age : 33 }
];

console.log( getFullName2( user ) );
// John Smith
console.log( getFullName2( users ) );
// [ 'John Smith', 'Samantha Blum', 'Edward Pitt' ]
```

### Manual vectorization

Data operations can be complex and not be amenable to automatic vectorization or make it inappropriate.
In this case, you need to vectorize the routines manually.

For example, consider a routine that can actually be easily automatically vectorized, but it demonstrates well
manual vectorization idea.
```js
// routine to vectorize
function getFullName( user )
{
  return `${user.firstName} ${user.lastName}`;
}

let user = { firstName : 'John', lastName : 'Smith', age : 30 }
let users =
[
  { firstName : 'John', lastName : 'Smith', age : 30 },
  { firstName : 'Samantha', lastName : 'Blum', age : 25 },
  { firstName : 'Edvard', lastName : 'Pitt', age : 33 }
];

console.log( getFullName( user ) );
// John Smith
console.log( getFullName( users ) );
// undefined undefined

```
It is necessary to make it possible to process both one user object and an array of user objects.
To do this, we can change the operations on the input data as follows.
```js
let _ = require( 'wTools' );

// manually vectorized routine
function getFullName( user )
{
  if( _.arrayIs( user ) )
  {
    const fullNames = [];
    user.forEach( ( u ) => fullNames.push( `${u.firstName} ${u.lastName}` ) )
    return fullNames;
  }
  else
  {
    return `${user.firstName} ${user.lastName}`;
  }
}

let user = { firstName : 'John', lastName : 'Smith', age : 30 }
let users =
[
  { firstName : 'John', lastName : 'Smith', age : 30 },
  { firstName : 'Samantha', lastName : 'Blum', age : 25 },
  { firstName : 'Edvard', lastName : 'Pitt', age : 33 }
];

console.log( getFullName( user ) );
// John Smith
console.log( getFullName( users ) );
// [ 'John Smith', 'Samantha Blum', 'Edvard Pitt' ]
```

[Back to content](../README.md#Concepts)


text:
SYNONYM

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

#### Published in
Bull. Séanc. Soc. Sci. Nancy 11: 138 (1910)

#### Original name
Sporotrichum beurmannii Matr. & Ramond, 1905

### Remarks
null


text:
<?php

namespace Google\Service\BigtableAdmin;

class AutoscalingTargets extends \Google\Model
{
  /**
   * @var int
   */
  public $cpuUtilizationPercent;
  /**
   * @var int
   */
  public $storageUtilizationGibPerNode;

  /**
   * @param int
   */
  public function setCpuUtilizationPercent($cpuUtilizationPercent)
  {
    $this->cpuUtilizationPercent = $cpuUtilizationPercent;
  }
  /**
   * @return int
   */
  public function getCpuUtilizationPercent()
  {
    return $this->cpuUtilizationPercent;
  }
  /**
   * @param int
   */
  public function setStorageUtilizationGibPerNode($storageUtilizationGibPerNode)
  {
    $this->storageUtilizationGibPerNode = $storageUtilizationGibPerNode;
  }
  /**
   * @return int
   */
  public function getStorageUtilizationGibPerNode()
  {
    return $this->storageUtilizationGibPerNode;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AutoscalingTargets::class, 'Google_Service_BigtableAdmin_AutoscalingTargets');


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

<title>PresenceBuilder (Google App Engine Java API)</title>
<meta name="date" content="2013-11-14">
<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

com.google.appengine.api.xmpp

Class PresenceBuilder

java.lang.Object

com.google.appengine.api.xmpp.PresenceBuilder

public class PresenceBuilder
extends java.lang.Object

Builder used to generate Presence instances to represent
 incoming XMPP presence stanzas.

Constructor Summary

Constructors

Constructor and Description

PresenceBuilder()

Method Summary

Methods

Modifier and Type
Method and Description

Presence
build()

PresenceBuilder
withFromJid(JID fromJid)

PresenceBuilder
withPresenceShow(PresenceShow presenceShow)

PresenceBuilder
withPresenceType(PresenceType presenceType)

PresenceBuilder
withStatus(java.lang.String status)

PresenceBuilder
withToJid(JID toJid)

Methods inherited from class java.lang.Object

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

Constructor Detail

PresenceBuilder

public PresenceBuilder()

Method Detail

withPresenceType

public PresenceBuilder withPresenceType(PresenceType presenceType)

withPresenceShow

public PresenceBuilder withPresenceShow(PresenceShow presenceShow)

withStatus

public PresenceBuilder withStatus(java.lang.String status)

withFromJid

public PresenceBuilder withFromJid(JID fromJid)

withToJid

public PresenceBuilder withToJid(JID toJid)

build

public Presence build()

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