text:
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">

    <display-name>${project.artifactId} ${project.version}</display-name>

    <servlet>
        <servlet-name>Wms</servlet-name>
        <servlet-class>com.github.davidmoten.grumpy.wms.app.WmsServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>Wms</servlet-name>
        <url-pattern>/wms</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>Map</servlet-name>
        <jsp-file>/map.jsp</jsp-file>
    </servlet>

<servlet-mapping>
        <servlet-name>Map</servlet-name>
        <url-pattern>/map</url-pattern>
    </servlet-mapping>

</web-app>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Ideagen Website Snippets</title>

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

    <link href="ideagen/css/slick.css" rel="stylesheet">
    <link href="ideagen/css/slick-theme.css" rel="stylesheet">

    <link href="ideagen/css/styles.css" rel="stylesheet">

    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Lato:400,700,300' rel='stylesheet' type='text/css'>

          21st Century Auditing Needs to Embrace Technology

          Leveraging the Third Line of Defense for internal audit execution
        </dliiv>

          10 Essentials of Internal Audit

          Internal audit needs to have a broad view of risks

          Ideagen PLC to participate in Healthcare Strategy Forum

          Ideagen's Gael Ltd work with leading university to find the next generation of developers

Slide #1 with some content.

Slide #2 with some content.

Slide #3 with some content.

redpajama_set_name: RedPajamaGithub


text:
layout: default
---

{% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
  {% include page__hero.html %}
{% elsif page.header.video.id and page.header.video.provider %}
  {% include page__hero_video.html %}
{% endif %}

{% if page.url != "/" and site.breadcrumbs %}
  {% unless paginator %}
    {% include breadcrumbs.html %}
  {% endunless %}
{% endif %}

  {% include sidebar.html %}

    {% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
    {% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
    {% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date: "%B %d, %Y" }}">{% endif %}
    {% if page.modified %}<meta itemprop="dateModified" content="{{ page.modified | date: "%B %d, %Y" }}">{% endif %}

      {% unless page.header.overlay_color or page.header.overlay_image %}

          {% if page.title %}
{{ page.title | markdownify | remove: "
" | remove: "
" }}
{% endif %}
          {% if page.read_time %}

 {% include read-time.html %}

          {% endif %}

      {% endunless %}

        {{ content }}
        {% if page.link %}
{{ site.data.ui-text[site.locale].ext_link_label | default: "Direct Link" }}
{% endif %}

        {% if site.data.ui-text[site.locale].meta_label %}

{{ site.data.ui-text[site.locale].meta_label }}

        {% endif %}
        {% include page__taxonomy.html %}
        {% if page.modified %}

 {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }} <time datetime="{{ page.modified | date: "%Y-%m-%d" }}">{{ page.modified | date: "%B %d, %Y" }}</time>

        {% elsif page.date %}

 {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }} <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time>

        {% endif %}

      {% if page.share %}{% include social-share.html %}{% endif %}

      {% include post_pagination.html %}

    {% if site.comments.provider and page.comments %}
      {% include comments.html %}
    {% endif %}

  {% comment %}{% endcomment %}
  {% if page.id and page.related and site.related_posts.size > 0 %}

{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}

        {% for post in site.related_posts limit:4 %}
          {% include archive-single.html type="grid" %}
        {% endfor %}

  {% endif %}


text:
package org.insightech.er.editor.view.action.dbexport;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.widgets.Event;
import org.insightech.er.ERDiagramActivator;
import org.insightech.er.ResourceString;
import org.insightech.er.editor.ERDiagramEditor;
import org.insightech.er.editor.controller.command.settings.ChangeSettingsCommand;
import org.insightech.er.editor.model.ERDiagram;
import org.insightech.er.editor.view.action.AbstractBaseAction;
import org.insightech.er.editor.view.dialog.dbexport.AbstractExportDialog;

public abstract class AbstractExportWithDialogAction extends AbstractBaseAction {

	public AbstractExportWithDialogAction(String id, String titleResource,
			String imageKey, ERDiagramEditor editor) {
		super(id, ResourceString.getResourceString(titleResource), editor);
		this.setImageDescriptor(ERDiagramActivator.getImageDescriptor(imageKey));
	}

	@Override
	public void execute(Event event) {
		ERDiagram diagram = this.getDiagram();

		AbstractExportDialog dialog = this.getExportDialog();
		dialog.init(diagram);

		if (dialog.open() == IDialogConstants.OK_ID) {
			ChangeSettingsCommand command = new ChangeSettingsCommand(diagram,
					dialog.getSettings(), false);
			this.execute(command);
		}
	}

	protected abstract AbstractExportDialog getExportDialog();

}


text:
FROM alpine:latest

LABEL version="0.0.1"
LABEL maintainer="David Adi Nugroho <davidadi216@gmail.com>"

RUN apk add bash
RUN apk add curl
RUN apk add netcat-openbsd

COPY entrypoint.sh /usr/local/bin/entrypoint

RUN chmod +x /usr/local/bin/entrypoint

ENTRYPOINT ["/usr/local/bin/entrypoint"]


text:
module Atlas
  class ApplicationController < ActionController::Base
  end
end


text:
//
// ReversibleActionCommand.cs
//
// Author:
//       Ehouarn Perret <ehouarn.perret@outlook.com>
//
// Copyright (c) Ehouarn Perret
//
// 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.
using System;

namespace EhouarnPerret.CSharp.Utilities.Core.Patterns.Design.Command
{
    public class ReversibleActionCommand : ReversibleCommand
    {
        public ReversibleActionCommand(Action execute, Action unexecute)
        {
            _execute = ExceptionHelpers.ThrowIfNull(execute, nameof(execute));
            _unexecute = ExceptionHelpers.ThrowIfNull(unexecute, nameof(unexecute));
        }

        private readonly Action _execute;
        private readonly Action _unexecute;

        public override void Execute()
        {
            _execute();
        }

        public override void Unexecute()
        {
            _unexecute();
        }
    }

}


text:
package com.hitsoysauce.generic;

import java.util.ArrayList;
import java.util.List;

public class TestGeneric {
	public static void main(String[] args) {

        List<? super Car> cars = new ArrayList<Car>();

        cars.add(new Buick());
        cars.add(new Mazada());
        cars.add(new Car());

	}
}


text:
require File.dirname(__FILE__) + '/spec_helper'

describe MetaTags do
  before :each do
    @view = ActionView::Base.new
  end

  describe 'loading' do
    it 'should be mixed into ActionView::Base' do
      ActionView::Base.included_modules.should include(MetaTags)
    end

    it 'should respond to "title" helper' do
      @view.should respond_to(:title)
    end

    it 'should respond to "description" helper' do
      @view.should respond_to(:description)
    end

    it 'should respond to "keywords" helper' do
      @view.should respond_to(:keywords)
    end

    it 'should respond to "set_meta_tags" helper' do
      @view.should respond_to(:set_meta_tags)
    end

    it 'should respond to "display_meta_tags" helper' do
      @view.should respond_to(:display_meta_tags)
    end
  end

  describe 'returning values' do
    it 'should return title' do
      @view.title('someTitle').should == 'someTitle'
    end

    it 'should return headline if specified' do
      @view.title('someTitle', 'someHeadline').should == 'someHeadline'
    end

    it 'should return description' do
      @view.description('someDescription').should == 'someDescription'
    end

    it 'should return keywords' do
      @view.description('someKeywords').should == 'someKeywords'
    end
  end

  describe 'displaying title' do
    it 'should use website name if title is empty' do
      @view.display_meta_tags(:site => 'someSite').should == '<title>someSite</title>'
    end

    it 'should display title when "title" used' do
      @view.title('someTitle')
      @view.display_meta_tags(:site => 'someSite').should == '<title>someSite | someTitle</title>'
    end

    it 'should display title when "set_meta_tags" used' do
      @view.set_meta_tags(:title => 'someTitle')
      @view.display_meta_tags(:site => 'someSite').should == '<title>someSite | someTitle</title>'
    end

    it 'should display custom title if given' do
      @view.title('someTitle')
      @view.display_meta_tags(:site => 'someSite', :title => 'defaultTitle').should == '<title>someSite | someTitle</title>'
    end

    it 'should use website before page by default' do
      @view.display_meta_tags(:site => 'someSite', :title => 'someTitle').should == '<title>someSite | someTitle</title>'
    end

    it 'should only use markup in titles in the view' do
      @view.title('someTitle').should == 'someTitle'
      @view.display_meta_tags(:site => 'someSite').should == '<title>someSite | someTitle</title>'
    end

    it 'should use page before website if :reverse' do
      @view.display_meta_tags(:site => 'someSite', :title => 'someTitle', :reverse => true).should == '<title>someTitle | someSite</title>'
    end

    it 'should be lowercase if :lowercase' do
      @view.display_meta_tags(:site => 'someSite', :title => 'someTitle', :lowercase => true).should == '<title>someSite | sometitle</title>'
    end

    it 'should use custom separator if :separator' do
      @view.title('someTitle')
      @view.display_meta_tags(:site => 'someSite', :separator => '-').should == '<title>someSite - someTitle</title>'
      @view.display_meta_tags(:site => 'someSite', :separator => ':').should == '<title>someSite : someTitle</title>'
      @view.display_meta_tags(:site => 'someSite', :separator => '—').should == '<title>someSite — someTitle</title>'
    end

    it 'should use custom prefix and suffix if available' do
      @view.display_meta_tags(:site => 'someSite', :title => 'someTitle', :prefix => ' -', :suffix => '- ').should == '<title>someSite -|- someTitle</title>'
    end

    it 'should collapse prefix if false' do
      @view.display_meta_tags(:site => 'someSite', :title => 'someTitle', :prefix => false).should == '<title>someSite| someTitle</title>'
    end

    it 'should collapse suffix if false' do
      @view.display_meta_tags(:site => 'someSite', :title => 'someTitle', :suffix => false).should == '<title>someSite |someTitle</title>'
    end

    it 'should use all custom options if available' do
      @view.display_meta_tags(:site => 'someSite',
                              :title => 'someTitle',
                              :prefix => ' -',
                              :suffix => '+ ',
                              :separator => ':',
                              :lowercase => true,
                              :reverse => true).should == '<title>sometitle -:+ someSite</title>'
    end

    it 'shold allow Arrays in title' do
      @view.display_meta_tags(:site => 'someSite', :title => ['someTitle', 'anotherTitle']).should == '<title>someSite | someTitle | anotherTitle</title>'
    end

    it 'shold build title in reverse order if :reverse' do
      @view.display_meta_tags(:site => 'someSite',
                              :title => ['someTitle', 'anotherTitle'],
                              :prefix => ' -',
                              :suffix => '+ ',
                              :separator => ':',
                              :reverse => true).should == '<title>anotherTitle -:+ someTitle -:+ someSite</title>'
    end
  end

  describe 'displaying description' do
    it 'should display description when "description" used' do
      @view.description('someDescription')
      @view.display_meta_tags(:site => 'someSite').should include('<meta content="someDescription" name="description" />')
    end

    it 'should display description when "set_meta_tags" used' do
      @view.set_meta_tags(:description => 'someDescription')
      @view.display_meta_tags(:site => 'someSite').should include('<meta content="someDescription" name="description" />')
    end

    it 'should display default description' do
      @view.display_meta_tags(:site => 'someSite', :description => 'someDescription').should include('<meta content="someDescription" name="description" />')
    end

    it 'should use custom description if given' do
      @view.description('someDescription')
      @view.display_meta_tags(:site => 'someSite', :description => 'defaultDescription').should include('<meta content="someDescription" name="description" />')
    end

    it 'should strip multiple spaces' do
      @view.display_meta_tags(:site => 'someSite', :description => "some \n\r\t description").should include('<meta content="some description" name="description" />')
    end

    it 'should strip HTML' do
      @view.display_meta_tags(:site => 'someSite', :description => "
some description
").should include('<meta content="some description" name="description" />')
    end
  end

  describe 'displaying keywords' do
    it 'should display keywords when "keywords" used' do
      @view.keywords('some-keywords')
      @view.display_meta_tags(:site => 'someSite').should include('<meta content="some-keywords" name="keywords" />')
    end

    it 'should display keywords when "set_meta_tags" used' do
      @view.set_meta_tags(:keywords => 'some-keywords')
      @view.display_meta_tags(:site => 'someSite').should include('<meta content="some-keywords" name="keywords" />')
    end

    it 'should display default keywords' do
      @view.display_meta_tags(:site => 'someSite', :keywords => 'some-keywords').should include('<meta content="some-keywords" name="keywords" />')
    end

    it 'should use custom keywords if given' do
      @view.keywords('some-keywords')
      @view.display_meta_tags(:site => 'someSite', :keywords => 'default_keywords').should include('<meta content="some-keywords" name="keywords" />')
    end

    it 'should lowercase keywords' do
      @view.display_meta_tags(:site => 'someSite', :keywords => 'someKeywords').should include('<meta content="somekeywords" name="keywords" />')
    end

    it 'should join keywords from Array' do
      @view.display_meta_tags(:site => 'someSite', :keywords => %w(keyword1 keyword2)).should include('<meta content="keyword1, keyword2" name="keywords" />')
    end

    it 'should join keywords from nested Arrays' do
      @view.display_meta_tags(:site => 'someSite', :keywords => [%w(keyword1 keyword2), 'keyword3']).should include('<meta content="keyword1, keyword2, keyword3" name="keywords" />')
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/stanford2.iml" filepath="$PROJECT_DIR$/.idea/stanford2.iml" />
    </modules>
  </component>
</project>


text:
package com.amazonaws.services.amplifyuibuilder.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;

import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.amplifyuibuilder.model.*;
import com.amazonaws.transform.Marshaller;

import com.amazonaws.protocol.*;
import com.amazonaws.protocol.Protocol;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * CreateThemeRequest Marshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class CreateThemeRequestProtocolMarshaller implements Marshaller<Request<CreateThemeRequest>, CreateThemeRequest> {

    private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON)
            .requestUri("/app/{appId}/environment/{environmentName}/themes").httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(true)
            .hasPayloadMembers(true).serviceName("AWSAmplifyUIBuilder").build();

    private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory;

    public CreateThemeRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) {
        this.protocolFactory = protocolFactory;
    }

    public Request<CreateThemeRequest> marshall(CreateThemeRequest createThemeRequest) {

        if (createThemeRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            final ProtocolRequestMarshaller<CreateThemeRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
                    createThemeRequest);

            protocolMarshaller.startMarshalling();
            CreateThemeRequestMarshaller.getInstance().marshall(createThemeRequest, protocolMarshaller);
            return protocolMarshaller.finishMarshalling();
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
import * as ChildProcess from 'child_process'

export function openKactus(url: string = '') {
  const env = { ...process.env }
  // NB: We're gonna launch Kactus and we definitely don't want to carry over
  // `ELECTRON_RUN_AS_NODE`. This seems to only happen on Windows.
  delete env['ELECTRON_RUN_AS_NODE']

  url = 'x-kactus-client://' + url

  return ChildProcess.spawn('open', [url], { env })
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/util
           http://www.springframework.org/schema/util/spring-util-3.0.xsd">

    <bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="ignoreUnresolvablePlaceholders" value="false" />
      <property name="location" value="stand-alone-demo.properties"/>
    </bean>

</beans>


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace WIQuest.Web.Data
{
    public class TrainingSession
    {
        public TrainingSession()
        {
            Exercises = new HashSet<TrainingExercise>();
        }

        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid Id { get; set; }

        public string Name { get; set; }

        public string Description { get; set; }

        public TrainingBenchmark Benchmark { get; set; }

        public virtual TrainingPlan TrainingPlan { get; set; }

        public virtual ICollection<TrainingExercise> Exercises { get; set; }

    }
}


text:
var resets = [// minimal top-level reset
'html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}', 'body{margin:0;}', // minimal form pseudo-element reset
'button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}', 'input::-webkit-search-cancel-button,input::-webkit-search-decoration,' + 'input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}'];
export default resets;


text:
package com.udacity.gradle.builditbigger;

import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.udacity.gradle.builditbigger.androidLibrary.JokeActivity;

/**
 * A placeholder fragment containing a simple view.
 */
public class MainActivityFragment extends Fragment implements JokeListener {

    private InterstitialAd mInterstitialAd;
    private String joke;
    private AsyncTask<Context, Void, String> task;

    public MainActivityFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_main, container, false);

        mInterstitialAd = new InterstitialAd(getActivity());
        mInterstitialAd.setAdUnitId("ca-app-pub-3940256099942544/1033173712");
        mInterstitialAd.setAdListener(new AdListener() {
            @Override
            public void onAdClosed() {
                requestNewInterstitial();
                showJoke(joke);
            }
        });
        requestNewInterstitial();

        AdView mAdView = (AdView) root.findViewById(R.id.adView);
        // Create an ad request. Check logcat output for the hashed device ID to
        // get test ads on a physical device. e.g.
        // "Use AdRequest.Builder.addTestDevice("ABCDEF012345") to get test ads on this device."
        AdRequest adRequest = new AdRequest.Builder()
                .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                .build();
        mAdView.loadAd(adRequest);

        Button jokeButton = (Button) root.findViewById(R.id.tellAJokeButton);
        jokeButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                task = new EndpointsAsyncTask(MainActivityFragment.this).execute();
            }
        });
        return root;
    }

    private void showJoke(String joke) {
        Intent intent = new Intent(getActivity(), JokeActivity.class);
        intent.putExtra("joke", joke);
        startActivity(intent);
    }

    private void requestNewInterstitial() {
        AdRequest adRequest = new AdRequest.Builder()
                .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                .build();

        mInterstitialAd.loadAd(adRequest);
    }

    @Override
    public void onJokeReceived(String joke) {
        this.joke = joke;
        if (mInterstitialAd.isLoaded()) {
            mInterstitialAd.show();
        }
    }

    /**
     * Called when the fragment is no longer in use.  This is called
     * after {@link #onStop()} and before {@link #onDetach()}.
     */
    @Override
    public void onDestroy() {
        if (task != null) {
            task.cancel(true);
        }
        super.onDestroy();
    }
}


text:
function New-Guid {
    [System.Guid]::NewGuid().ToString("d").Substring(0, 6).Replace("-", "")
}


text:
module AtypesHelper
end


text:
namespace hotels::haversack::internal::types {
namespace {

struct A {};
struct B {};
struct C {};
constexpr Type<A> a{};
constexpr Type<B> b{};
constexpr Type<C> c{};
template <typename...>
struct Types;

static_assert(type_c<A> == Type<A>());
static_assert(type_c<int> == Type(1));

static_assert(AsTuple(Type<Types<A, B, C>>()) == MakeBasicTuple(a, b, c));

static_assert(FromTuple<Types>(MakeBasicTuple(a, b, c)) ==
              Type<Types<A, B, C>>());

struct Foo {
  int i;
};
static_assert(IsValidExpr(
    Type<Foo>(),
    [](auto t) -> decltype(std::declval<typename decltype(t)::type>().i) {}));
static_assert(!IsValidExpr(
    Type<Foo>(),
    [](auto t) -> decltype(std::declval<typename decltype(t)::type>().missing) {
    }));

static_assert(ValidExprOr(
                  Foo{.i = 5},
                  [](const auto& t) -> decltype(t.i) { return t.i; }, 0) == 5);
static_assert(ValidExprOr(
                  Foo{.i = 5},
                  [](const auto& t) -> decltype(t.missing) {
                    return t.missing;
                  },
                  0) == 0);

static_assert(MetaValueFunction<std::is_same>()(a, a));
static_assert(MetaTypeFunction<std::remove_pointer>()(type_c<A*>) == a);

static_assert(size(type_c<BasicTuple<A, B, C>>) == 3);

TEST(MetaValueFunctionTest, IsConst) {
  const auto& func = MetaValueFunction<std::is_same, A>();
  EXPECT_TRUE(func(type_c<A>));
  EXPECT_FALSE(func(type_c<B>));
}

TEST(MetaTypeFunctionTest, IsConst) {
  const auto& func = MetaTypeFunction<std::remove_const>();
  EXPECT_EQ(func(type_c<const A>), a);
  EXPECT_EQ(func(a), a);
}

}  // namespace
}  // namespace hotels::haversack::internal::types


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */

/**
 * Contains the Calendar_Factory class
 *
 * PHP versions 4 and 5
 *
 * LICENSE: Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @category  Date and Time
 * @package   Calendar
 * @author    Harry Fuecks <hfuecks@phppatterns.com>
 * @author    Lorenzo Alberton <l.alberton@quipo.it>
 * @copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
 * @version   CVS: $Id: Factory.php 246404 2007-11-18 21:46:43Z quipo $
 * @link      http://pear.php.net/package/Calendar
 */

/**
 * Allows Calendar include path to be redefined
 * @ignore
 */
if (!defined('CALENDAR_ROOT')) {
    define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}

/**
 * Load Calendar base class
 */
require_once CALENDAR_ROOT.'Calendar.php';

/**
 * Contains a factory method to return a Singleton instance of a class
 * implementing the Calendar_Engine_Interface.

 * For Month objects, to control type of month returned, use CALENDAR_MONTH_STATE
 * constact e.g.;
 *
 * require_once 'Calendar/Factory.php';
 * define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); // Use Calendar_Month_Weekdays
 * // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS); // Use Calendar_Month_Weeks
 * // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH); // Use Calendar_Month
 *
 * It defaults to building Calendar_Month objects.

 * Use the constract CALENDAR_FIRST_DAY_OF_WEEK to control the first day of the week
 * for Month or Week objects (e.g. 0 = Sunday, 6 = Saturday)
 *
 * @category  Date and Time
 * @package   Calendar
 * @author    Harry Fuecks <hfuecks@phppatterns.com>
 * @author    Lorenzo Alberton <l.alberton@quipo.it>
 * @copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
 * @link      http://pear.php.net/package/Calendar
 * @access protected
 */
class Calendar_Factory
{
    /**
     * Creates a calendar object given the type and units
     *
     * @param string $type class of calendar object to create
     * @param int    $y    year
     * @param int    $m    month
     * @param int    $d    day
     * @param int    $h    hour
     * @param int    $i    minute
     * @param int    $s    second
     *
     * @return object subclass of Calendar
     * @access public
     * @static
     */
    function create($type, $y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
    {
        $firstDay = defined('CALENDAR_FIRST_DAY_OF_WEEK') ? CALENDAR_FIRST_DAY_OF_WEEK : 1;
        switch ($type) {
        case 'Day':
            include_once CALENDAR_ROOT.'Day.php';
            return new Calendar_Day($y, $m, $d);
        case 'Month':
            // Set default state for which month type to build
            if (!defined('CALENDAR_MONTH_STATE')) {
                define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH);
            }
            switch (CALENDAR_MONTH_STATE) {
            case CALENDAR_USE_MONTH_WEEKDAYS:
                include_once CALENDAR_ROOT.'Month/Weekdays.php';
                $class = 'Calendar_Month_Weekdays';
                break;
            case CALENDAR_USE_MONTH_WEEKS:
                include_once CALENDAR_ROOT.'Month/Weeks.php';
                $class = 'Calendar_Month_Weeks';
                break;
            case CALENDAR_USE_MONTH:
            default:
                include_once CALENDAR_ROOT.'Month.php';
                $class = 'Calendar_Month';
                break;
            }
            return new $class($y, $m, $firstDay);
        case 'Week':
            include_once CALENDAR_ROOT.'Week.php';
            return new Calendar_Week($y, $m, $d, $firstDay);
        case 'Hour':
            include_once CALENDAR_ROOT.'Hour.php';
            return new Calendar_Hour($y, $m, $d, $h);
        case 'Minute':
            include_once CALENDAR_ROOT.'Minute.php';
            return new Calendar_Minute($y, $m, $d, $h, $i);
        case 'Second':
            include_once CALENDAR_ROOT.'Second.php';
            return new Calendar_Second($y, $m, $d, $h, $i, $s);
        case 'Year':
            include_once CALENDAR_ROOT.'Year.php';
            return new Calendar_Year($y);
        default:
            include_once 'PEAR.php';
            PEAR::raiseError('Calendar_Factory::create() unrecognised type: '.$type,
                null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Factory::create()');
            return false;
        }
    }

    /**
     * Creates an instance of a calendar object, given a type and timestamp
     *
     * @param string $type  type of object to create
     * @param mixed  $stamp timestamp (depending on Calendar engine being used)
     *
     * @return object subclass of Calendar
     * @access public
     * @static
     */
    function & createByTimestamp($type, $stamp)
    {
        $cE  = & Calendar_Engine_Factory::getEngine();
        $y   = $cE->stampToYear($stamp);
        $m   = $cE->stampToMonth($stamp);
        $d   = $cE->stampToDay($stamp);
        $h   = $cE->stampToHour($stamp);
        $i   = $cE->stampToMinute($stamp);
        $s   = $cE->stampToSecond($stamp);
        $cal = Calendar_Factory::create($type, $y, $m, $d, $h, $i, $s);
        return $cal;
    }
}
?>


text:
package main

import (
	"bytes"
	"crypto/tls"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/fclairamb/ftpserver/server"
	"log"
	"os"
	"path/filepath"
	"strings"
	"time"
)

type S3Driver struct {
	s3Session *session.Session
	s3Client  *s3.S3
	maxKeys   int64
}

func (d *S3Driver) WelcomeUser(cc server.ClientContext) (string, error) {
	cc.SetDebug(true)
	return "Welcome to the FTP server for S3", nil
}

func (d *S3Driver) AuthUser(cc server.ClientContext, user, pass string) (server.ClientHandlingDriver, error) {

	if user != FTP_USER {
		log.Println("username does not match expected user", user)
		return nil, fmt.Errorf("incorrect username: %s", user)
	}

	if pass != FTP_PASSWD {
		log.Println("incorrect password")
		return nil, errors.New("incorrect password")
	}

	_, err := session.NewSession()
	if err != nil {
		log.Println("error creating S3 session (check AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars on server):", err)
		return nil, err
	}

	return d, nil
}

func (d *S3Driver) GetTLSConfig() (*tls.Config, error) {
	return nil, errors.New("TLS not implemented")
}

func (d *S3Driver) ChangeDirectory(cc server.ClientContext, directory string) error {
	// Query S3 to see if the directory exists.  We return an error if we cannot list it.

	var err error

	// root dir is special case, always exists in a bucket
	if directory == "/" {
		return nil
	}

	var prefix string
	if prefix, err = getS3Key(directory + "/"); err != nil {
		return err
	}

	delimiter := "/"
	params := &s3.ListObjectsV2Input{
		Bucket:    &S3_BUCKET_NAME,
		Prefix:    &prefix,
		Delimiter: &delimiter, // limits the search to directories (they have a trailing slash)
	}

	var resp *s3.ListObjectsV2Output
	if resp, err = d.s3Client.ListObjectsV2(params); err != nil {
		return stripNewlines(err)
	}

	// prefix of "" is a special case, the root directory of a bucket which can have zero objects
	if prefix == "" {
		return nil
	}

	if *resp.KeyCount == 0 {
		return errors.New("No such directory: " + directory)
	}

	return nil
}

func (d *S3Driver) MakeDirectory(cc server.ClientContext, directory string) error {

	var err error
	var dirname string
	if dirname, err = getS3Key(directory + "/"); err != nil {
		return err
	}

	if dirname == "" {
		return fmt.Errorf("Cannot mkdir on: %s", directory)
	}

	var parentExists bool
	if parentExists, err = d.parentExists(dirname + "../"); err != nil {
		return err
	}

	if !parentExists {
		return fmt.Errorf("Directory has non-existent parent directory: %s", directory)
	}

	params := &s3.PutObjectInput{
		Bucket: &S3_BUCKET_NAME,
		Key:    &dirname,
		Body:   bytes.NewReader([]byte("")),
	}

	if _, err = d.s3Client.PutObject(params); err != nil {
		return stripNewlines(err)
	}

	return nil
}

// AWS errors may include newlines that interfere with FTP commands so strip them out
func stripNewlines(err error) error {
	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			strippedMessage := strings.Replace(awsErr.Message(), "\n", "", -1)
			return awserr.New(awsErr.Code(), strippedMessage, awsErr.OrigErr())
		} else {
			return err
		}
	}

	return nil
}

func (d *S3Driver) ListFiles(cc server.ClientContext) ([]os.FileInfo, error) {

	var err error
	var prefix string
	if prefix, err = getS3Key(cc.Path()); err != nil {
		return nil, err
	}

	// all dirs in S3 apart from root dir should end with /. Non standard between ftp clients.
	if len(prefix) > 0 && !strings.HasSuffix(prefix, "/") {
		prefix += "/"
	}

	delimiter := "/" // delimiter keeps the listing from being recursive
	params := &s3.ListObjectsV2Input{
		Bucket:    &S3_BUCKET_NAME,
		Prefix:    &prefix,
		Delimiter: &delimiter,
		MaxKeys:   &d.maxKeys,
	}

	var resp *s3.ListObjectsV2Output
	if resp, err = d.s3Client.ListObjectsV2(params); err != nil {
		return nil, stripNewlines(err)
	}

	files := []os.FileInfo{}

	// directories other than CWD
	for _, dir := range resp.CommonPrefixes {
		var dirInfo os.FileInfo

		if dirInfo, err = d.GetFileInfo(cc, filepath.Join("/", *dir.Prefix)+"/"); err != nil {
			return nil, err
		}

		files = append(files, dirInfo)
	}

	// files and CWD
	for _, f := range resp.Contents {

		// don't list CWD in the list of files
		if *f.Key == prefix {
			continue
		}

		var fi os.FileInfo
		if fi, err = d.getFakeFileInfo(*f.Key, *f.Size, *f.LastModified); err != nil {
			return nil, err
		}
		files = append(files, fi)
	}

	return files, nil
}

func (d *S3Driver) UserLeft(cc server.ClientContext) {
}

func (d *S3Driver) OpenFile(cc server.ClientContext, path string, flag int) (server.FileStream, error) {
	// our implementation uses an interface that mimics a file but uploads/downloads to S3
	var err error
	var s3file *S3VirtualFile
	var s3key string
	var parentExists bool

	if parentExists, err = d.parentExists(path); err != nil {
		return nil, err
	}

	if !parentExists {
		return nil, fmt.Errorf("Path has non-existent parent directory: %s", path)
	}

	if s3key, err = getS3Key(path); err != nil {
		return nil, err
	}

	if s3file, err = NewS3VirtualFile(s3key, flag, d.s3Session, d.s3Client); err != nil {
		return nil, err
	}

	return s3file, nil
}

func (d *S3Driver) getObjectInfo(key string) (*s3.GetObjectOutput, error) {
	params := &s3.GetObjectInput{
		Bucket: &S3_BUCKET_NAME,
		Key:    &key,
	}

	req, resp := d.s3Client.GetObjectRequest(params)

	if err := req.Send(); err != nil {
		return nil, stripNewlines(err)
	}

	return resp, nil
}

func (d *S3Driver) GetFileInfo(cc server.ClientContext, path string) (os.FileInfo, error) {

	var err error
	relPath := path
	if relPath, err = getS3Key(path); err != nil {
		return nil, err
	}

	var resp *s3.GetObjectOutput
	// check for directories (trailing slashes) if we can't find the file
	if resp, err = d.getObjectInfo(relPath); err != nil {

		if resp, err = d.getObjectInfo(relPath + "/"); err != nil {
			return nil, err
		} else {
			relPath += "/"
		}
	}

	// resp itself, resp.ContentLength and resp.LastModified are sometimes nil (!) so check for this state.  Aws!
	if resp == nil {
		return nil, fmt.Errorf("Error getting file info for key: %s", relPath)
	}

	var objectSize int64
	if resp.ContentLength != nil {
		objectSize = *resp.ContentLength

		if strings.HasSuffix(relPath, "/") {
			// the size of a directory, just faking it.
			objectSize = 4096
		}
	}

	var modTime time.Time
	if resp.LastModified != nil {
		modTime = *resp.LastModified
	}

	var f os.FileInfo
	if f, err = d.getFakeFileInfo(relPath, objectSize, modTime); err != nil {
		return nil, err
	}

	return f, nil
}

func (d *S3Driver) CanAllocate(cc server.ClientContext, size int) (bool, error) {
	return true, nil
}

func (d *S3Driver) ChmodFile(cc server.ClientContext, path string, mode os.FileMode) error {
	return errors.New("ChmodFile not implemented")
}

func (d *S3Driver) DeleteFile(cc server.ClientContext, path string) error {
	// list objects matching the path, then use DeleteObjects on all of them.  Needed because you must delete all
	// child key/objects belonging to a directory key before deleting that key

	var err error
	var relPath string
	if relPath, err = getS3Key(path); err != nil {
		return err
	}

	var isDir bool
	if isDir, err = d.isS3Dir(relPath); err != nil {
		return err
	}

	if isDir && !strings.HasSuffix(relPath, "/") {
		relPath += "/"
	}

	listParams := &s3.ListObjectsV2Input{
		Bucket:  &S3_BUCKET_NAME,
		Prefix:  &relPath,
		MaxKeys: &d.maxKeys,
		//Delimiter: &delimiter, // empty delim makes this recursive
	}

	var resp *s3.ListObjectsV2Output
	if resp, err = d.s3Client.ListObjectsV2(listParams); err != nil {
		return stripNewlines(err)
	}

	var delObjects []*s3.ObjectIdentifier
	for _, f := range resp.Contents {
		delObjects = append(delObjects, &s3.ObjectIdentifier{Key: f.Key})
	}

	if len(delObjects) == 0 {
		return fmt.Errorf("No such file or directory: %s [S3 key: %s]", path, relPath)
	}

	delParams := &s3.DeleteObjectsInput{
		Bucket: &S3_BUCKET_NAME,
		Delete: &s3.Delete{Objects: delObjects},
	}

	if _, err = d.s3Client.DeleteObjects(delParams); err != nil {
		return stripNewlines(err)
	}

	return nil
}

// returns true or false depending on if the path exists as a file (no trailing slash) or a directory (trailing slash)
// in S3.
func (d *S3Driver) isS3Dir(path string) (bool, error) {
	var err error
	var s3Path string
	if s3Path, err = getS3Key(path); err != nil {
		return false, err
	}

	_, err = d.getObjectInfo(s3Path + "/")
	if err == nil {
		return true, nil
	}

	_, err = d.getObjectInfo(s3Path)
	if err == nil {
		return false, nil
	}

	return false, fmt.Errorf("No such file or directory: %s", path)
}

func (d *S3Driver) RenameFile(cc server.ClientContext, from, to string) error {
	// S3 doesn't have rename (or move).  We're copying all objects that match the input file or directory key
	// to the new key name

	var err error
	var relFrom, relTo string

	if relFrom, err = getS3Key(from); err != nil {
		return err
	}

	if relTo, err = getS3Key(to); err != nil {
		return err
	}

	// sanity checks
	if relFrom == "" || relTo == "" {
		return errors.New("Cannot rename to or from the root directory")
	}

	var isDir bool
	if isDir, err = d.isS3Dir(relFrom); err != nil {
		return err
	}

	if isDir {

		// if source is a dir then so is dest
		if !strings.HasSuffix(relFrom, "/") {
			relFrom += "/"
		}

		if !strings.HasSuffix(relTo, "/") {
			relTo += "/"
		}
	}

	// check for missing parent directories in destination
	var parentDir string
	if parentDir, err = getS3Key(filepath.Dir(to)); err != nil {
		return err
	}

	if _, err = d.getObjectInfo(parentDir + "/"); err != nil && len(parentDir) > 0 {
		return fmt.Errorf("Parent directory of destination does not exist: %s. err: %s", parentDir, err)
	}

	listParams := &s3.ListObjectsV2Input{
		Bucket:  &S3_BUCKET_NAME,
		Prefix:  &relFrom,
		MaxKeys: &d.maxKeys,
	}

	var resp *s3.ListObjectsV2Output
	if resp, err = d.s3Client.ListObjectsV2(listParams); err != nil {
		return stripNewlines(err)
	}

	var srcObjects []*s3.ObjectIdentifier
	for _, f := range resp.Contents {
		srcObjects = append(srcObjects, &s3.ObjectIdentifier{Key: f.Key})
	}

	// copy all destinations objects from source to dest (already ordered from top level directory key)
	for _, objId := range srcObjects {

		toPath := strings.Replace(*objId.Key, relFrom, relTo, 1)
		copySrc := S3_BUCKET_NAME + "/" + *objId.Key
		copyParams := &s3.CopyObjectInput{
			Bucket:     &S3_BUCKET_NAME,
			Key:        &toPath,
			CopySource: &copySrc,
		}

		if _, err = d.s3Client.CopyObject(copyParams); err != nil {
			return stripNewlines(err)
		}
	}

	// delete original file (or nested directory of matching keys).  Faster than looping over them.
	delParams := &s3.DeleteObjectsInput{
		Bucket: &S3_BUCKET_NAME,
		Delete: &s3.Delete{Objects: srcObjects},
	}

	if len(srcObjects) == 0 {
		return fmt.Errorf("Unable to remove old file: %s [S3 key: %s]", from, relFrom)
	}

	if _, err = d.s3Client.DeleteObjects(delParams); err != nil {
		return stripNewlines(err)
	}

	return nil
}

func (d *S3Driver) GetSettings() *server.Settings {
	config := server.Settings{
		Host:           "0.0.0.0",
		Port:           FTP_PORT,
		MaxConnections: 300,
	}
	return &config
}

// Return a fakeInfo struct that satisfies the os.FileInfo interface, emulating a file from an S3 object
func (d *S3Driver) getFakeFileInfo(name string, size int64, modTime time.Time) (os.FileInfo, error) {

	isDir := strings.HasSuffix(name, "/")

	mode := os.FileMode(0666)
	if isDir {
		mode = mode | os.ModeDir
	}

	f := fakeInfo{
		name:    filepath.Base(name),
		size:    size,
		mode:    mode,
		modTime: modTime,
		isDir:   isDir,
	}

	return f, nil
}

// check that any parent directories (S3 keys) exist in path.  S3 misbehaves when a child has missing parent directories.
func (d *S3Driver) parentExists(path string) (bool, error) {
	var err error
	var dir string

	if dir, err = getS3Key(filepath.Dir(path)); err != nil {
		return false, err
	}

	if len(dir) > 0 && dir != "." && dir != "/" {
		var isDir bool
		// ignore errors (eg: no directory)
		if isDir, _ = d.isS3Dir(dir); err != nil {
			return false, nil
		}

		return isDir, nil
	}

	return true, nil
}

func NewS3Driver(s3Session *session.Session, s3Client *s3.S3) (*S3Driver, error) {

	driver := &S3Driver{
		maxKeys:   10000,
		s3Client:  s3Client,
		s3Session: s3Session,
	}

	return driver, nil
}

// cleans the input path and queries S3 to see if it's a directory or file key.  Will return an error if it cannot find
// either a file or directory key (with a trailing slash)
func getS3Key(path string) (string, error) {
	var err error
	s3Key := path

	// join paths and keep relative to root dir.
	if strings.HasPrefix(s3Key, "/") {
		if s3Key, err = filepath.Rel("/", path); err != nil {
			return "", err
		}
	}

	// "/" relative to "/" is "." but in S3 this should be ""
	if s3Key == "." {
		s3Key = ""
	}

	// directories in S3 must always have a trailing slash (filepath.Rel removes this)
	if strings.HasSuffix(path, "/") && len(s3Key) > 0 && !strings.HasSuffix(s3Key, "/") {
		s3Key += "/"
	}

	return s3Key, nil
}


text:
/*global QUnit*/

sap.ui.define([
	"sap/ui/core/Configuration",
	"sap/ui/test/opaQunit",
	"./pages/Welcome",
	"./pages/Product",
	"./pages/Home",
	"./pages/Category"
], function (Configuration, opaTest) {
	"use strict";

	var sDefaultLanguage = Configuration.getLanguage();

	QUnit.module("Phone navigation", {
		before : function () {
			Configuration.setLanguage("en-US");
		},
		after : function () {
			Configuration.setLanguage(sDefaultLanguage);
		}
	});

	opaTest("Should navigate to a product detail page by pressing the product link of the first product tile", function (Given, When, Then) {
		// Arrangements
		Given.iStartMyApp();
		//Actions
		When.onTheWelcomePage.iPressTheProductLink();
		// Assertions
		Then.onTheProduct.iShouldSeeTheProductPage();
	});

	opaTest("Should press back button and navigate to welcome view", function (Given, When, Then) {
		// Actions
		When.onTheProduct.iPressTheBackButtonInProduct();
		// Assertions
		Then.onTheWelcomePage.iShouldSeeTheWelcomePage();
	});

	opaTest("The category view should open by pressing the menu button", function (Given, When, Then) {
		//Actions
		When.onTheWelcomePage.iPressTheMenuButton();
		// Assertions
		Then.onHome.iShouldSeeTheCategoryList();
	});

	opaTest("Should see the product list", function (Given, When, Then) {
		// Actions
		When.onHome.iPressOnTheFlatScreensCategory();
		// Assertions
		Then.onTheCategory.iShouldBeTakenToTheFlatScreensCategory().
		and.iShouldSeeTheProductList().
		and.iShouldSeeSomeEntriesInTheProductList();
		// Cleanup
		Then.iTeardownMyApp();
	});
});


text:
package org.mtransit.android.commons.provider;

import android.annotation.SuppressLint;
import android.content.Context;
import android.database.Cursor;

import androidx.annotation.NonNull;

import org.json.JSONArray;
import org.json.JSONObject;
import org.mtransit.android.commons.FileUtils;
import org.mtransit.android.commons.MTLog;
import org.mtransit.android.commons.NetworkUtils;
import org.mtransit.android.commons.PreferenceUtils;
import org.mtransit.android.commons.R;
import org.mtransit.android.commons.StringUtils;
import org.mtransit.android.commons.TimeUtils;
import org.mtransit.android.commons.data.AvailabilityPercent;
import org.mtransit.android.commons.data.BikeStationAvailabilityPercent;
import org.mtransit.android.commons.data.DefaultPOI;
import org.mtransit.android.commons.data.POI;
import org.mtransit.android.commons.data.POIStatus;

import java.net.HttpURLConnection;
import java.net.SocketException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
import java.util.HashSet;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLHandshakeException;

@SuppressLint("Registered")
public class JCDecauxBikeStationProvider extends BikeStationProvider {

	private static final String TAG = JCDecauxBikeStationProvider.class.getSimpleName();

	@NonNull
	@Override
	public String getLogTag() {
		return TAG;
	}

	/**
	 * Override if multiple {@link JCDecauxBikeStationProvider} implementations in same app.
	 */
	private static final String PREF_KEY_LAST_UPDATE_MS = BikeStationDbHelper.PREF_KEY_LAST_UPDATE_MS;

	private static String jcdecauxApiKey = null;

	/**
	 * Override if multiple {@link BikeStationProvider} implementations in same app.
	 */
	public static String getJCDECAUX_API_KEY(Context context) {
		if (jcdecauxApiKey == null) {
			jcdecauxApiKey = context.getResources().getString(R.string.jcdecaux_api_key);
		}
		return jcdecauxApiKey;
	}

	@Override
	public void updateBikeStationDataIfRequired() {
		long lastUpdateInMs = getLastUpdateInMs(); // POI
		long nowInMs = TimeUtils.currentTimeMillis();
		if (lastUpdateInMs + getPOIMaxValidityInMs() < nowInMs) {
			deleteAllBikeStationData();
			updateAllDataFromWWW(lastUpdateInMs);
			return;
		}
		if (lastUpdateInMs + getPOIValidityInMs() < nowInMs) {
			updateAllDataFromWWW(lastUpdateInMs);
		}
	}

	@Override
	public long getLastUpdateInMs() { // POI & Status
		return PreferenceUtils.getPrefLcl(getContext(), PREF_KEY_LAST_UPDATE_MS, 0L);
	}

	public void setLastUpdateInMs(long newLastUpdateInMs) { // POI & Status
		PreferenceUtils.savePrefLcl(getContext(), PREF_KEY_LAST_UPDATE_MS, newLastUpdateInMs, true); // sync
	}

	@Override
	public Cursor getPOIBikeStations(POIProviderContract.Filter poiFilter) {
		updateBikeStationDataIfRequired();
		return getPOIFromDB(poiFilter);
	}

	@Override
	public void updateBikeStationStatusDataIfRequired(@NonNull StatusProviderContract.Filter statusFilter) {
		long lastUpdateInMs = getLastUpdateInMs(); // STATUS
		long nowInMs = TimeUtils.currentTimeMillis();
		if (lastUpdateInMs + getStatusMaxValidityInMs() < nowInMs) {
			deleteAllBikeStationStatusData();
			updateAllDataFromWWW(lastUpdateInMs);
			return;
		}
		if (lastUpdateInMs + getStatusValidityInMs(statusFilter.isInFocusOrDefault()) < nowInMs) {
			updateAllDataFromWWW(lastUpdateInMs);
		}
	}

	@Override
	public POIStatus getNewBikeStationStatus(@NonNull AvailabilityPercent.AvailabilityPercentStatusFilter statusFilter) {
		updateBikeStationStatusDataIfRequired(statusFilter);
		return getCachedStatus(statusFilter);
	}

	private synchronized void updateAllDataFromWWW(long oldLastUpdatedInMs) {
		if (getLastUpdateInMs() > oldLastUpdatedInMs) { // POI & STATUS
			return; // too late, another thread already updated
		}
		loadDataFromWWW(0); // 0 = 1st try
	}

	private static final int MAX_RETRY = 1;

	private static final String AND = "&";
	private static final String QUESTION_MARK = "?";
	private static final String EQ = "=";

	private static final String API_KEY_URL_PARAM = "apiKey";
	private static final String STATION_STATUS_CLOSED = "CLOSED";

	private static final String JSON_LAST_UPDATE = "last_update";
	private static final String JSON_AVAILABLE_BIKE_STANDS = "available_bike_stands";
	private static final String JSON_AVAILABLE_BIKES = "available_bikes";
	private static final String JSON_STATUS = "status";
	private static final String JSON_POSITION = "position";
	private static final String JSON_POSITION_LNG = "lng";
	private static final String JSON_POSITION_LAT = "lat";
	private static final String JSON_NAME = "name";
	private static final String JSON_NUMBER = "number";

	private HashSet<DefaultPOI> loadDataFromWWW(int tried) {
		try {
			final Context context = getContext();
			if (context == null) {
				return null;
			}
			String urlString = getDATA_URL(context);
			StringBuilder urlSb = new StringBuilder(urlString);
			urlSb.append(urlString.contains(QUESTION_MARK) ? AND : QUESTION_MARK).append(API_KEY_URL_PARAM).append(EQ)
					.append(getJCDECAUX_API_KEY(context));
			URL url = new URL(urlSb.toString());
			URLConnection urlc = url.openConnection();
			NetworkUtils.setupUrlConnection(urlc);
			HttpsURLConnection httpsUrlConnection = (HttpsURLConnection) urlc;
			switch (httpsUrlConnection.getResponseCode()) {
			case HttpURLConnection.HTTP_OK:
				long newLastUpdateInMs = TimeUtils.currentTimeMillis();
				String jsonString = FileUtils.getString(urlc.getInputStream());
				HashSet<DefaultPOI> newBikeStations = new HashSet<>();
				HashSet<POIStatus> newBikeStationStatus = new HashSet<>();
				String authority = getAUTHORITY(context);
				int dataSourceTypeId = getAGENCY_TYPE_ID(context);
				long poiMaxValidityInMs = getPOIMaxValidityInMs();
				long statusMaxValidityInMs = getStatusMaxValidityInMs();
				int value1Color = getValue1Color(context);
				int value1ColorBg = getValue1ColorBg(context);
				int value2Color = getValue2Color(context);
				int value2ColorBg = getValue2ColorBg(context);
				JSONArray json = new JSONArray(jsonString);
				for (int l = 0; l < json.length(); l++) {
					JSONObject jStation = json.getJSONObject(l);
					try {
						long lastUpdateInMs = jStation.getLong(JSON_LAST_UPDATE);
						if (lastUpdateInMs + poiMaxValidityInMs < newLastUpdateInMs) {
							continue; // skip
						}
						DefaultPOI newBikeStation = new DefaultPOI(authority, dataSourceTypeId, POI.ITEM_VIEW_TYPE_BASIC_POI,
								POI.ITEM_STATUS_TYPE_AVAILABILITY_PERCENT, POI.ITEM_ACTION_TYPE_FAVORITABLE);
						newBikeStation.setId(jStation.getInt(JSON_NUMBER));
						newBikeStation.setName(cleanJCDecauxBikeStationName(jStation.getString(JSON_NAME)));
						JSONObject jStationPosition = jStation.getJSONObject(JSON_POSITION);
						newBikeStation.setLat(jStationPosition.getDouble(JSON_POSITION_LAT));
						newBikeStation.setLng(jStationPosition.getDouble(JSON_POSITION_LNG));
						newBikeStations.add(newBikeStation);
						BikeStationAvailabilityPercent newStatus = new BikeStationAvailabilityPercent(
								newBikeStation.getUUID(),
								newLastUpdateInMs, statusMaxValidityInMs, newLastUpdateInMs,
								value1Color, value1ColorBg,
								value2Color, value2ColorBg);
						newStatus.setStatusClosed(STATION_STATUS_CLOSED.equalsIgnoreCase(jStation.getString(JSON_STATUS)));
						newStatus.setValue1(jStation.getInt(JSON_AVAILABLE_BIKES)); // bikes
						newStatus.setValue2(jStation.getInt(JSON_AVAILABLE_BIKE_STANDS)); // docks
						newBikeStationStatus.add(newStatus);
					} catch (Exception e) {
						MTLog.w(this, e, "Error while parsing stations JSON '%s'!", jStation);
					}
				}
				deleteAllBikeStationData();
				POIProvider.insertDefaultPOIs(this, newBikeStations);
				deleteAllBikeStationStatusData();
				StatusProvider.cacheAllStatusesBulkLockDB(this, newBikeStationStatus);
				setLastUpdateInMs(newLastUpdateInMs); // POI & STATUS
				return newBikeStations;
			default:
				MTLog.w(this, "ERROR: HTTP URL-Connection Response Code %s (Message: %s)", httpsUrlConnection.getResponseCode(),
						httpsUrlConnection.getResponseMessage());
				if (tried < MAX_RETRY) {
					return loadDataFromWWW(++tried);
				} else {
					return null;
				}
			}
		} catch (SSLHandshakeException sslhe) {
			MTLog.w(this, sslhe, "SSL error!");
			if (tried < MAX_RETRY) {
				return loadDataFromWWW(++tried);
			} else {
				return null;
			}
		} catch (UnknownHostException uhe) {
			if (MTLog.isLoggable(android.util.Log.DEBUG)) {
				MTLog.w(this, uhe, "No Internet Connection!");
			} else {
				MTLog.w(this, "No Internet Connection!");
			}
			return null;
		} catch (SocketException se) {
			MTLog.w(TAG, se, "No Internet Connection!");
			return null;
		} catch (Exception e) {
			MTLog.e(TAG, e, "INTERNAL ERROR: Unknown Exception");
			if (tried < MAX_RETRY) {
				return loadDataFromWWW(++tried);
			} else {
				return null;
			}
		}
	}

	@NonNull
	private String cleanJCDecauxBikeStationName(String name) {
		if (name == null || name.length() == 0) {
			return StringUtils.EMPTY;
		}
		name = name.substring(8);
		return cleanBikeStationName(name);
	}
}


text:
# HybriCache
HybriCache is a hybrid cache solution based on EhCache and Redis. HybriCache is almost as fast as EhCache and utilization of Redis makes HybriCache a Cluster friendly. HybriCache is ideal solution if you're switching over to a clustered environment on AWS and need a fast caching library. If your application is already configured for EhCache – that's even easier, HybriCache uses existing EhCache configuration, just add HybriCache jar to the classpath, replace EhCacheManager with HybriCacheManager in a spring context and set Elasticache server's Host and Port to the HybriCacheManager instance. And that is all.

## Table of Content
* [What is wrong with AWS Elasticache?](#whats_wrong_elasticache)
* [Why HybriCache is faster than AWS Elasticache Redis?](#hybricache_faster)
* [HybriCache Cache Type](#hybricache_type)
* [Getting Started](#getting_started)
  * [Download HybriCache Jar](#download_jar)
  * [Download dependencies](#download_other_jar)
  * [Include Jars](#include_jar)
  * [Configure Caches](#configure_caches)
  * [Declare Cache Manager](#declare_cache_manager)
  * [Set Environment Properties](#env_properties)

## What is wrong with AWS Elasticache?
AWS Elasticache Redis is a non-sql in-memory database and:

1.	Network Latency. Redis is being accessed over TCP/IP protocol and often located on a separate server instance.

2.	Every time you put/get an object to or from Redis it takes some time to serialize/deserialize object's instance.

So if your application makes a couple of dozens cache hits per server response – you'd probably be better off with just AWS Elasticache alone.

But if a number of cache hits is around of few hundreds or even thousands - you will face a performance decrease and longer page load time. This is especially noticeable when comparing a pure EhCache caching with a pure AWS Elasticache caching. We tested some pages within one of our applications with 3000 cache hits per page load on AWS Beanstalk instance for just EhCahce and just Elasticache Redis:

1.	EhCache showed an average page load time of 1+ seconds.

2.	AWS Elasticache Redis was 8-9 seconds.

Things did not get much better after upgrading to the top-end memory optimized Elasticache instance type with high network performance – page load goes to 5-6 seconds which is still not acceptable for a production site.

HybriCache source code contains 2 performance tests where we check execution time of 3000 GET Object calls in 2 modes:

1.	Local (only EhCache is enabled). Result: Execution took 37 milliseconds

2.	Remote (only Redis cache is enabled). Result: Execution took 576 milliseconds.

As you can see - EhCache is almost 15 times faster than Redis caching.
(Some other tests you can find online show 10 times difference)

So, what is wrong with AWS Elasticache?  - Network Latency + Time needed for object Serialization, along with single-threaded nature of Redis.

[Top](#top)

## Why HybriCache is faster than AWS Elasticache Redis?
HybriCache  is NOT a replacement for AWS Elasticache nor EhCache. HybriCache utilizes a hybrid cache model when both EhCache and Redis work together caching objects:

1.	Caching Locally (EhCache) on a webserver instance for faster access.

2.	Caching Remotely on AWS Elasticache (Redis) for clustering support.

Cached Objects are replicated using Revisions:

*	If a Local Cache Revision matches a Remote Cache Revision – Cached Object is extracted from a fast Local Cache (EhCache).

*	Otherwise Cached Object is taken from a Remote Cache (Redis) and HybriCache updates Local Cache.

"Key Trust Period" is another mechanism that makes HybriCache even faster. "Key Trust Period" is a time period in milliseconds in which HybriCache can trust the Local Cache Revision. This is useful when objects are rarely changed in Cache but might be extracted from HybriCache more than once during one page load. Setting "Key Trust Period" can prevent redundant calls to Redis to verify the Remote Cache Revision - our tests shows that even such a simple call "GET Integer Key from Redis" made 3000 times dramatically affects performance. "Key Trust Period" defaults to 1000 milliseconds and can be overridden for each Cache Database.

[Top](#top)

## HybriCache Cache Types
Each Cache Database can be set to one of 3 Cash Strategies(Types) supported by HybriCache:

1. HYBRID - default cache type utilizing hybrid caching model (see above).
2. LOCAL - caches objects ONLY on local EhCache instance running on a webserver (one of instances in a cluster). No cache replication is supported by this type of cache. A fastest type of cache. Useful for caches when synchronization with a cluster is not critical but speed is important, e.g. caching of Merged CSS and JS resources.
3. REMOTE - caches objects ONLY on remote AWS Elasticache Redis instance. Clustering is supported. Slowest cache type. Used for object caches when speed is not critical but the latest cache revision is highly important, e.g. caching of User's Session metadata.

[Top](#top)

## Getting Started

1. Download the latest [hybricache.jar]( https://github.com/batir-akhmerov/hybricache/raw/master/hybricache/target/hybricache-0.0.1.jar)

2. Download other dependencies jars (if your application does not use them yet). A full list of dependencies is in [pom.xml](https://raw.githubusercontent.com/batir-akhmerov/hybricache/master/hybricache/pom.xml)

3. Include jars into a .classpath file:

   ```
   <classpathentry kind="lib" path="hybricache.jar"/>
   <!-- include all other dependencies jars if needed -->
   ```

4. Configure Caches. If your application already uses EhCache then by default no additional configuration is needed. HybriCache will configure itself for all EhCache Caches set in ehcache.xml. Here is a sample ehcache.xml:

   ```
      <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="ehcache.xsd"
	updateCheck="true"
	monitoring="autodetect"
	dynamicConfig="true">

	<cache name="mergedCssJsCache" ...>
		...
	</cache>

	<cache name="userSessionCache" ...>
		...
	</cache>

	<cache name="daoBeanCache" ...>
		...
	</cache>

      </ehcache>
   ```

   All 3 caches above will be configured with HybriCache defaults: HYBRID type and 1000 milliseconds Key Trust Period.

   To declare custom HybriCache configuration for certain/all pre-configured EhCaches – provide HybriCache configuration via hybriCacheConfigurationList list in spring-context.xml or ApplicationConfiguration class:

   ```
  @Configuration
  public class AppContextConfiguration  {
	@Bean
	public List<HybriCacheConfiguration> hybriCacheConfigurationList() {
		List<HybriCacheConfiguration> list = new ArrayList<>();
		list.add( new HybriCacheConfiguration(
				"mergedCssJsCache",
				CacheType.LOCAL,
				0
			)
		);
		list.add( new HybriCacheConfiguration(
				"userSessionCache",
				CacheType.REMOTE,
				0
			)
		);
		return list;
	}
}
```
   Here mergedCssJsCache is configured as a LOCAL cache and userSessionCache as REMOTE.
   Cache daoBeanCache will be a HYBRID cache by default.

5. Declare default application cacheManager. If ehCacheManager was a default manager - rename it since it's needed for HybriCache, otherwise declare ehCahceManager too:

   ```
@Configuration
public class AppContextConfiguration {

	@Inject protected Environment env;

	@Bean
	public HybriCacheManager cacheManager() {
		String host = this.env.getProperty("remote.cache.server.host");
		String port = this.env.getProperty("remote.cache.server.port");
		Integer intPort = null;
		if (port != null) {
			intPort = Integer.parseInt(port);
		}
		HybriCacheManager cacheManager =  new HybriCacheManager( new EhCacheCacheManager(ehCacheCacheManager().getObject()), host,  intPort);
		cacheManager.setHybriCacheConfigurationList(hybriCacheConfigurationList());
		return cacheManager;
	}

	@Bean
	public EhCacheManagerFactoryBean ehCacheCacheManager() {
		EhCacheManagerFactoryBean cmfb = new EhCacheManagerFactoryBean();
		cmfb.setConfigLocation(new ClassPathResource("ehcache.xml"));
		cmfb.setShared(true);
		return cmfb;
	}

  @Bean
	public List<HybriCacheConfiguration> hybriCacheConfigurationList() {
		...
	}
}

   ```

6. Add AWS Elasticache Redis host name and port into environment properties.

   ```
   remote.cache.server.host=https://[url.to elasticache.redis.instance].amazonaws.com
   remote.cache.server.port=6379
   ```

[Top](#top)


text:
<?php

$lang = array(

//----------------------------
// Modules
//----------------------------

'module_name' =>
'Module Name',

'module_description' =>
'Description',

'data_will_be_lost' =>
'All data associated with this module will be permanently deleted!',

'module_access' =>
'Edit Module',

'module_no_access' =>
'You are not allowed to access any modules',

'delete_module' =>
'De-install Module',

'delete_module_confirm' =>
'Are you sure you want to remove the following module:',

'module_backend' =>
'User CP',

'module_version' =>
'Version',

'module_status' =>
'Status',

'module_action' =>
'Action',

'not_installed' =>
'Not Installed',

'installed' =>
'Installed',

'install' =>
'Install',

'update_modules' =>
'Run Module Updates',

'updated' =>
'Updated',

'updated_to_version' =>
'updated to version',

'all_modules_up_to_date' =>
'All modules are up to date.',

'deinstall' =>
'Remove',

'module_can_not_be_found' =>
'Unable to locate the files needed to install this module',

'module_has_been_installed' =>
'Module installed:',

'module_has_been_removed' =>
'Module removed:',

'requested_module_not_installed' =>
'The requested module is not installed:',

'requested_page_not_found' =>
'The requested module page could not be found.',

''=>''
);

/* End of file modules_lang.php */
/* Location: ./system/expressionengine/language/english/modules_lang.php */


text:
NFS server/client Role
=======================

Install NFS server/client. This role has been specifically developed to be used in the INDIGO project.

Role Variables
--------------

The variables that can be passed to this role and a brief description about them are as follows.

```yaml
# NFS install mode: server or client
nfs_mode: server

# Line to add to the /etc/exports file
nfs_exports:
  - path: "/home"
    export: "vnode*.localdomain(fsid=0,rw,async,no_root_squash,no_subtree_check,insecure)"

# Line to add to the /etc/fstab file
nfs_client_imports:
  - local: "/home"
    remote: "/home"
    server_host: "{{hostvars['server']['ansible_default_ipv4']}}"
```

NFS client imports can also define the following variables:
  * `state`: see: http://docs.ansible.com/ansible/mount_module.html for more information.
  * `opts`: see https://wiki.debian.org/fr/fstab for more information.
  * `dump`: see https://wiki.debian.org/fr/fstab for more information.
  * `passno`: see https://wiki.debian.org/fr/fstab for more information.

Example Playbook
----------------

This an example of how to install a Torque/PBS cluster:
```yaml
    - hosts: server
      roles:
      - { role: 'indigo-dc.nfs', nfs_mode: 'server', nfs_exports: [{path: "/home", export: "vnode*.localdomain(fsid=0,rw,async,no_root_squash,no_subtree_check,insecure)"}] }

    - hosts: client
      roles:
      - { role: 'indigo-dc.nfs', nfs_mode: 'client', nfs_client_imports: [{ local: "/home", remote: "/home", server_host: "{{hostvars['server']['ansible_default_ipv4']}}" }] }
```

License
-------

Apache Licence v2 [1]

[1] http://www.apache.org/licenses/LICENSE-2.0


text:
const clientPromise = import('ifrau/client/slim.js').then((ifrau) => {
	return ifrau.SlimClient;
});

export default clientPromise;


text:
package com.theagilemonkeys.meets;

import com.octo.android.robospice.persistence.DurationInMillis;
import com.theagilemonkeys.meets.models.base.MeetsListener;

import org.jdeferred.Deferred;
import org.jdeferred.DonePipe;
import org.jdeferred.FailPipe;
import org.jdeferred.Promise;
import org.jdeferred.impl.DeferredObject;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ApiMethodModelHelper<MODEL> implements ApiMethodModelHelperInterface<MODEL> {
    static MeetsListener globalListener = new MeetsListener.Empty();

    boolean ignoreGlobalListener = false;
    protected transient Map<MeetsListener<MODEL>, Boolean> listenersWithKeepInfo = new ConcurrentHashMap<MeetsListener<MODEL>, Boolean>();
    protected transient Deferred masterPromise = new DeferredObject().resolve(this);
    private boolean serially = false;
    private Boolean forceNextCacheEnable = null;
    private boolean modelCacheEnable = true;
    private MODEL model;

    public ApiMethodModelHelper(MODEL model){
        this.model = model;
    }

    public Promise pushMethod(final ApiMethod method){
        return pushMethod(method, new DelayedParams() {
            @Override public Map<String, Object> buildParams() { return null; }
            @Override public List<String> buildUrlExtraSegments() { return null; }
        });
    }

    public Promise pushMethod(final ApiMethod method, final DelayedParams params) {
        // With this clear all references to previous onDone, onFail and onAlways callbacks, avoiding possible
        // memory leaks
        if (! masterPromise.isPending()) {
            masterPromise = new DeferredObject().resolve(model);
        }

        if ( ! modelCacheEnable ) {
            method.setCacheDuration(DurationInMillis.ALWAYS_EXPIRED);
        }

        if ( forceNextCacheEnable != null ) {
            method.setCacheDuration(forceNextCacheEnable ? ApiMethod.globalCacheDuration.get() : DurationInMillis.ALWAYS_EXPIRED);
            forceNextCacheEnable = null;
        }

        if ( serially ){
            // This is not the best way to implement the "nextWaitForPrevious" functionality.
            // All the operations called between the call to "nextWaitForPrevious" and the result
            // of the first operation will be executed serially.
            // The correct behaviour should be that all of them were executed in parallel after
            // the finish of the first one
            return pushPipe(new DonePipe() {
                                @Override
                                public Deferred pipeDone(Object result) {
                                    serially = false;
                                    return method.run(params.buildParams(), params.buildUrlExtraSegments());
                                }
                            }, new FailPipe() {
                                @Override
                                public Deferred pipeFail(Object o) {
                                    serially = false;
                                    return new DeferredObject().reject(o);
                                }
                            });
        }
        else{
            return pushDeferred(method.run(params.buildParams(), params.buildUrlExtraSegments()));
        }
    }

    public Promise pushDeferred(final Deferred deferred){
        masterPromise = (Deferred) masterPromise.then(new DonePipe() {
            @Override
            public Deferred pipeDone(Object result) {
                return deferred;
            }
        }, new FailPipe() {
            @Override
            public Deferred pipeFail(Object result) {
                return new DeferredObject().reject(result);
            }
        });

        return masterPromise;
    }

    public Promise pushPipe(DonePipe donePipe, FailPipe failPipe){
        masterPromise = (Deferred) masterPromise.then(donePipe,failPipe);
        return masterPromise;
    }

    @Override
    public void ignoreGlobalListener() {
        ignoreGlobalListener = true;
    }

    @Override
    public MODEL await(MeetsListener<MODEL> listener) {
        await(listener, false);
        return model;
    }

    @Override
    public MODEL await(MeetsListener<MODEL> listener, boolean keepListening) {
        if ( ! masterPromise.isPending() ){
            Exception e = new Exception("Last operation failed");
            //Generify this to avoid duplicate code here and inside triggerListeners
            if ( masterPromise.isResolved() ) listener.onDone(model);
            else if (masterPromise.isRejected()) listener.onFail(model, e);
            listener.onAlways(model, e);
            // Avoid register the listener if user don't want to keep it
            if (! keepListening ) return model;
        }

        listenersWithKeepInfo.put(listener, keepListening);
        return model;
    }

    @Override
    public MODEL noLongerWait(MeetsListener<MODEL> listener) {
        listenersWithKeepInfo.remove(listener);
        return model;
    }

    @Override
    public MODEL allNoLongerWait() {
        listenersWithKeepInfo.clear();
        return model;
    }

    //////// Methods called after fetched ///////

    public void triggerListeners() {
        triggerListeners(null);
    }

    public void triggerListeners(Exception e) {
        if (masterPromise.isPending()) return;
        Iterator<Map.Entry<MeetsListener<MODEL>, Boolean>> entries = listenersWithKeepInfo.entrySet().iterator();
        while (entries.hasNext()) {
            Map.Entry<MeetsListener<MODEL>, Boolean> entry = entries.next();
            MeetsListener<MODEL> listener = entry.getKey();
            Boolean keepListening = entry.getValue();

            if (! keepListening ) entries.remove(); // Remove the last value returned by next()

            if ( e == null ) listener.onDone(model);
            else listener.onFail(model, e);
            listener.onAlways(model, e);
        }

        // Call global listener
        if (! ignoreGlobalListener ) {
            if (e == null) globalListener.onDone(null);
            else globalListener.onFail(null, e);
            globalListener.onAlways(null, e);
        }
        ignoreGlobalListener = false;

    }

    public Map<MeetsListener<MODEL>, Boolean> getListenersWithKeepInfo() {
        return listenersWithKeepInfo;
    }

    @Override
    public MODEL nextWaitForPrevious() {
        serially = true;
        return model;
    }

    /**
     * Force to enable or disable cache during the next operations, bypassing model cache. After that,
     * the cache will return to its previous state (see {@link #setModelCache(boolean)} for details}
     * @return This model
     */
    public MODEL forceNextCacheToBe(boolean enable) {
        forceNextCacheEnable = enable;
        return model;
    }

    /**
     * Disable or enable the cache for all operations in this model. Note that when model cache is enabled,
     * the configuration for it will be taken from ApiMethod, so if cache is disabled in ApiMethod, this
     * functions does nothing.
     * By default is enabled
     * @param enable Whether to enable or disable cache
     * @return This object
     */
    public MODEL setModelCache(boolean enable) {
        modelCacheEnable = enable;
        return model;
    }

    public static abstract class DelayedParams {
        public Map<String, Object> buildParams() {
            return null;
        }
        public List<String> buildUrlExtraSegments() {
            return null;
        }
    }
}


text:
// The MIT License (MIT)
//
// Copyright (c) 2014 Team Owesome (http://owesome.ch)
//
// 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.

var STRIDE = Float32Array.BYTES_PER_ELEMENT * 6;
var TEX_COORD_OFFSET = Float32Array.BYTES_PER_ELEMENT * 2;
var COLOR_OFFSET = Float32Array.BYTES_PER_ELEMENT * 4;
var MAX_BATCH_SIZE = 2000;

var DEFAULT_WIDTH = 500;
var DEFAULT_HEIGHT = 500;

var drawBatchPool = [];

/**
 * @constructor
 */
var DrawBatch = function()
{
    this.size = 0;
    this.texture = null;

    this.vertexBufferArray = new Float32Array(MAX_BATCH_SIZE * 24);
};

DrawBatch.prototype.dispose = function()
{
    this.size = 0;
    this.texture = null;

    drawBatchPool.push(this);
};

DrawBatch.create = function(renderer)
{
    var drawBatch = drawBatchPool.pop();

    if (!drawBatch)
    {
        drawBatch = new DrawBatch();
    }

    return drawBatch;
};

/**
 * @constructor
 */
var WebGlRenderer = function(width, height)
{
    width = width || DEFAULT_WIDTH;
    height = height || DEFAULT_HEIGHT;

    this.domElement = document.createElement('canvas');

    var options = { preserveDrawingBuffer: true };

    var gl = this.domElement.getContext('webgl', options) ||
             this.domElement.getContext('experimental-webgl', options);

    gl.clearColor(0.0, 0.0, 0.0, 1.0);

    this.drawBatches = [];

    this.renderSession = [];
    this.textureCache = new ow.TextureCache(gl);

    var vertexShader = gl.createShader(gl.VERTEX_SHADER);
    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);

    gl.shaderSource(vertexShader, ow.SPRITE_VERT_SHADER_SRC);
    gl.compileShader(vertexShader);

    gl.shaderSource(fragmentShader, ow.SPRITE_FRAG_SHADER_SRC);
    gl.compileShader(fragmentShader);

    var program = gl.createProgram();

    gl.attachShader(program, vertexShader);
    gl.attachShader(program, fragmentShader);

    gl.linkProgram(program);
    gl.useProgram(program);

    gl.deleteShader(vertexShader);
    gl.deleteShader(fragmentShader);

    this._positionLocation = gl.getAttribLocation(program, 'aPosition');
    this._texCoordLocation = gl.getAttribLocation(program, 'aTexCoord');
    this._colorLocation =    gl.getAttribLocation(program, 'aColor');

    this._matrixLocation =   gl.getUniformLocation(program, 'uProjectionMatrix');
    this._textureLocation =  gl.getUniformLocation(program, 'uTexture');

    this._indexBuffer = gl.createBuffer();
    this._vertexBuffer = gl.createBuffer();

    var indexBufferArray = new Uint16Array(MAX_BATCH_SIZE * 6);

    for (var i = 0; i < indexBufferArray.length; ++i)
    {
        var arrayIndexOffset = i * 6;
        var indexOffset = i * 4;

        indexBufferArray[arrayIndexOffset + 0] = indexOffset + 0;
        indexBufferArray[arrayIndexOffset + 1] = indexOffset + 1;
        indexBufferArray[arrayIndexOffset + 2] = indexOffset + 2;

        indexBufferArray[arrayIndexOffset + 3] = indexOffset + 2;
        indexBufferArray[arrayIndexOffset + 4] = indexOffset + 3;
        indexBufferArray[arrayIndexOffset + 5] = indexOffset + 0;
    }

    gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(MAX_BATCH_SIZE * 24), gl.DYNAMIC_DRAW);

    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexBufferArray, gl.STATIC_DRAW);

    gl.enableVertexAttribArray(this._positionLocation);
    gl.vertexAttribPointer(this._positionLocation, 2, gl.FLOAT, false, STRIDE, 0);

    gl.enableVertexAttribArray(this._texCoordLocation);
    gl.vertexAttribPointer(this._texCoordLocation, 2, gl.FLOAT, false, STRIDE, TEX_COORD_OFFSET);

    gl.enableVertexAttribArray(this._colorLocation);
    gl.vertexAttribPointer(this._colorLocation, 2, gl.FLOAT, false, STRIDE, COLOR_OFFSET);

    gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
    gl.enable(gl.BLEND);

    this.gl = gl;
    this.setSize(width, height);
};

WebGlRenderer.prototype = Object.create(Renderer.prototype);
WebGlRenderer.prototype.constructor = WebGlRenderer;

WebGlRenderer.prototype.drawTexture = function(texture, textureRect, transformMatrix, alpha, color)
{
    var textureId = texture.getId();
    var drawBatches = this.drawBatches;
    var drawBatchesLength = drawBatches.length;

    var drawBatch = drawBatches[textureId];

    if (!drawBatch)
    {
        drawBatch = DrawBatch.create();

        drawBatch.texture = texture;
        drawBatches[textureId] = drawBatch;
    }

    var vertexBufferArray = drawBatch.vertexBufferArray;

    var size = drawBatch.size;

    var indexOffset = size * 24;

    var x = textureRect.x;
    var y = textureRect.y;

    var width = textureRect.width;
    var height = textureRect.height;

    var top = y / texture.height;
    var left = x / texture.width;

    var right = (x + width) / texture.width;
    var bottom = (y + height) / texture.height;

    vertexBufferArray[indexOffset + 0] = /*(transformMatrix.a * 0) + (transformMatrix.b * 0) + */transformMatrix.tx;
    vertexBufferArray[indexOffset + 1] = /*(transformMatrix.c * 0) + (transformMatrix.d * 0) + */transformMatrix.ty;

    vertexBufferArray[indexOffset + 2] = left;
    vertexBufferArray[indexOffset + 3] = top;

    vertexBufferArray[indexOffset + 4] = alpha;
    vertexBufferArray[indexOffset + 5] = color;

    vertexBufferArray[indexOffset + 6] = transformMatrix.a * width/* + (transformMatrix.b * 0)*/ + transformMatrix.tx;
    vertexBufferArray[indexOffset + 7] = transformMatrix.c * width/* + (transformMatrix.d * 0)*/ + transformMatrix.ty;

    vertexBufferArray[indexOffset + 8] = right;
    vertexBufferArray[indexOffset + 9] = top;

    vertexBufferArray[indexOffset + 10] = alpha;
    vertexBufferArray[indexOffset + 11] = color;

    vertexBufferArray[indexOffset + 12] = transformMatrix.a * width + transformMatrix.b * height + transformMatrix.tx;
    vertexBufferArray[indexOffset + 13] = transformMatrix.c * width + transformMatrix.d * height + transformMatrix.ty;

    vertexBufferArray[indexOffset + 14] = right;
    vertexBufferArray[indexOffset + 15] = bottom;

    vertexBufferArray[indexOffset + 16] = alpha;
    vertexBufferArray[indexOffset + 17] = color;

    vertexBufferArray[indexOffset + 18] = /*(transformMatrix.a * 0) + */transformMatrix.b * height + transformMatrix.tx;
    vertexBufferArray[indexOffset + 19] = /*(transformMatrix.c * 0) + */transformMatrix.d * height + transformMatrix.ty;

    vertexBufferArray[indexOffset + 20] = left;
    vertexBufferArray[indexOffset + 21] = bottom;

    vertexBufferArray[indexOffset + 22] = alpha;
    vertexBufferArray[indexOffset + 23] = color;

    ++drawBatch.size;

    if (drawBatch.size >= MAX_BATCH_SIZE)
    {
        this._flushBatch(drawBatch);
        drawBatch.size = 0;
    }
};

WebGlRenderer.prototype.render = function(drawable)
{
    drawable.draw(this);

    var id;
    var gl = this.gl;

    var drawIndex = 0;
    var session = null;

    var i = 0;
    var texture = null;

    var drawBatches = this.drawBatches;
    var drawBatchesLength = drawBatches.length;

    var drawBatch = null;

    for (id in drawBatches)
    {
        drawBatch = drawBatches[id];

        this._flushBatch(drawBatch);

        drawBatch.dispose();
    }

    // Reset array
    drawBatches.length = 0;
};

WebGlRenderer.prototype._flushBatch = function(drawBatch)
{
    var gl = this.gl;

    var vertexBufferArray = drawBatch.vertexBufferArray;

    var texture = drawBatch.texture;
    var glTexture = this.textureCache.getGlTexture(texture);

    if (glTexture)
    {
        gl.activeTexture(gl.TEXTURE0);
        gl.bindTexture(gl.TEXTURE_2D, glTexture);
        gl.uniform1i(this._textureLocation, 0);
    }

    gl.bufferSubData(gl.ARRAY_BUFFER, 0, vertexBufferArray.subarray(0, drawBatch.size * 24));
    gl.drawElements(gl.TRIANGLES, 6 * drawBatch.size, gl.UNSIGNED_SHORT, 0);
}

WebGlRenderer.prototype.setSize = function(width, height)
{
    var gl = this.gl;

    this.width = Number(width);
    this.height = Number(height);

    this.domElement.width = this.width;
    this.domElement.height = this.height;

    gl.uniformMatrix4fv(this._matrixLocation, false,
    [
        2 / this.width, 0,                0, 0,
        0,              -2 / this.height, 0, 0,
        0,              0,                0, 0,
        -1,             1,                0, 1,
    ]);

    gl.viewport(0, 0, this.width, this.height);
};

WebGlRenderer.prototype.clear = function()
{
    var gl = this.gl;

    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
};

ow.WebGlRenderer = WebGlRenderer;


text:
<?php

/**
 * Reduces network flooding when sending large amounts of mail.
 * @package Swift
 * @subpackage Plugins
 * @author Chris Corbyn
 */
class Swift_Plugins_BandwidthMonitorPlugin
  implements Swift_Events_SendListener, Swift_Events_CommandListener,
  Swift_Events_ResponseListener, Swift_InputByteStream
{

  /**
   * The outgoing traffic counter.
   * @var int
   * @access private
   */
  private $_out = 0;

  /**
   * The incoming traffic counter.
   * @var int
   * @access private
   */
  private $_in = 0;

  /** Bound byte streams */
  private $_mirrors = array();

  /**
   * Not used.
   */
  public function beforeSendPerformed(Swift_Events_SendEvent $evt)
  {
  }

  /**
   * Invoked immediately after the Message is sent.
   * @param Swift_Events_SendEvent $evt
   */
  public function sendPerformed(Swift_Events_SendEvent $evt)
  {
    $message = $evt->getMessage();
    $message->toByteStream($this);
  }

  /**
   * Invoked immediately following a command being sent.
   * @param Swift_Events_ResponseEvent $evt
   */
  public function commandSent(Swift_Events_CommandEvent $evt)
  {
    $command = $evt->getCommand();
    $this->_out += strlen($command);
  }

  /**
   * Invoked immediately following a response coming back.
   * @param Swift_Events_ResponseEvent $evt
   */
  public function responseReceived(Swift_Events_ResponseEvent $evt)
  {
    $response = $evt->getResponse();
    $this->_in += strlen($response);
  }

  /**
   * Called when a message is sent so that the outgoing counter can be increased.
   * @param string $bytes
   */
  public function write($bytes)
  {
    $this->_out += strlen($bytes);
    foreach ($this->_mirrors as $stream)
    {
      $stream->write($bytes);
    }
  }

  /**
   * Not used.
   */
  public function commit()
  {
  }

  /**
   * Attach $is to this stream.
   * The stream acts as an observer, receiving all data that is written.
   * All {@link write()} and {@link flushBuffers()} operations will be mirrored.
   *
   * @param Swift_InputByteStream $is
   */
  public function bind(Swift_InputByteStream $is)
  {
    $this->_mirrors[] = $is;
  }

  /**
   * Remove an already bound stream.
   * If $is is not bound, no errors will be raised.
   * If the stream currently has any buffered data it will be written to $is
   * before unbinding occurs.
   *
   * @param Swift_InputByteStream $is
   */
  public function unbind(Swift_InputByteStream $is)
  {
    foreach ($this->_mirrors as $k => $stream)
    {
      if ($is === $stream)
      {
        unset($this->_mirrors[$k]);
      }
    }
  }

  /**
   * Not used.
   */
  public function flushBuffers()
  {
    foreach ($this->_mirrors as $stream)
    {
      $stream->flushBuffers();
    }
  }

  /**
   * Get the total number of bytes sent to the server.
   * @return int
   */
  public function getBytesOut()
  {
    return $this->_out;
  }

  /**
   * Get the total number of bytes received from the server.
   * @return int
   */
  public function getBytesIn()
  {
    return $this->_in;
  }

  /**
   * Reset the internal counters to zero.
   */
  public function reset()
  {
    $this->_out = 0;
    $this->_in = 0;
  }

}


text:
2021-02-22: Development Meeting
===============================

Kacper, Mike H, Tommy, Tim

Agenda
------
* Updates
* Auto generated versions
    * Create new version on _every_ export/publish or only when one is missing

Updates
-------

* Kacper
    * Merged all the things! (version restore, partial support for versions in export/publish)
    * Reviewing Tommy's work.

* Craig
    * PR review/testing

* Tommy
    * Exporting & Publishing Versions work
        * Addressing Kacper's feedback about version requirements in the Manifest
        * Fixed up gwvolman tests
        * Will write wt_versioning tests after agenda discussion
        * Followed by girder_wt tests
    * Other general DataONE related testing
        * Found that analyzing published Tales is restrictive in the search for Tales in the system (many Tales weren't found)
        * Expect to see PR for that fix soon
    * SDTL stuff
        * George confirmed ~5 or so commands look good in linked data form
        * The different parsers produce slightly different JSON output (my converter parses that JSON) so some things broke. George has a work around, low priority but done before prov week
    * End of lifetime
        * My WT time has been ramping down, ends this week
        * I still have some recorded run work to do, so I'll be spending a little time this week looking at geist and a PoC of instering the provone output into resource maps

* Tim
    * Cleaned up Blazegraph CLI and got it closer to feature complete, help, etc.
    * Still need to add a --wait flag to the status command, for waiting until Blazegraph is up and running.

* Mike H
    *


text:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="TotemWeb" default="make" basedir=".">
    <description>
        TotemWeb build script
    </description>

    <!-- These properties should be overriden by the commandline -->
    <property name="default" value="" />

    <target name="make">
        <!-- Build the folder structure -->
        <mkdir dir="${default}builds" />
        <mkdir dir="${default}builds/TotemWeb" />
        <mkdir dir="${default}builds/TotemWeb/production/" />
        <mkdir dir="${default}builds/TotemWeb/production/Application/" />
        <mkdir dir="${default}builds/TotemWeb/production/Application/Controllers/" />
        <mkdir dir="${default}builds/TotemWeb/production/Application/DomainObjects/" />
        <mkdir dir="${default}builds/TotemWeb/production/Application/Lib/" />
        <mkdir dir="${default}builds/TotemWeb/production/Application/Models/" />
        <mkdir dir="${default}builds/TotemWeb/production/Application/Views" />
        <mkdir dir="${default}builds/TotemWeb/production/Cache/" />
        <mkdir dir="${default}builds/TotemWeb/production/Configuration/" />
        <mkdir dir="${default}builds/TotemWeb/production/Log/" />
        <copy file="src/build.xml" tofile="${default}builds/TotemWeb/build.xml" />

        <copy todir="${default}builds/TotemWeb/development/">
            <fileset dir="${default}builds/TotemWeb/production/" />
        </copy>

        <!-- Default production site -->
        <copy file="src/TotemAppPro.php" tofile="${default}builds/TotemWeb/production/Application/TotemApp.php" />
        <copy file="src/DefaultMessage.html" tofile="${default}builds/TotemWeb/production/Application/Views/DefaultMessage.html" />

        <!-- Default development Site -->
        <copy file="src/TotemAppDev.php" tofile="${default}builds/TotemWeb/development/Application/TotemApp.php" />

        <mkdir dir="${default}builds/TotemWeb/totem/" />
        <mkdir dir="${default}builds/TotemWeb/totem/webroot/" />
        <copy file="src/webroot/.htaccess" tofile="${default}builds/TotemWeb/totem/webroot/.htaccess" />
        <copy file="src/webroot/index.php" tofile="${default}builds/TotemWeb/totem/webroot/index.php" />
        <mkdir dir="${default}builds/TotemWeb/totem/webroot/assets/" />
        <mkdir dir="${default}builds/TotemWeb/totem/webroot/assets/css/" />
        <mkdir dir="${default}builds/TotemWeb/totem/webroot/assets/docs/" />
        <mkdir dir="${default}builds/TotemWeb/totem/webroot/assets/js/" />

        <ant antfile="src/lib/core_build.xml" inheritAll="none" />
        <move file="src/lib/Totem.Core.phar" tofile="${default}builds/TotemWeb/totem/Totem.Core.phar" />

        <copy file="LICENSE" tofile="${default}builds/TotemWeb/LICENSE" />

        <mkdir dir="${default}builds/TotemWeb/docs" />
        <copy file="SampleApacheConfig.conf" tofile="${default}builds/TotemWeb/docs/SampleApacheConfig.conf" />

        <tar basedir="${default}builds/TotemWeb/" destfile="${default}builds/TotemWeb.tar.gz" compression="gzip" />
    </target>

    <target name="clean">
        <delete file="composer.lock" />
        <delete dir="${default}builds/Respect" />
        <delete dir="${default}builds/TotemWeb" />
        <delete file="{$default}builds/TotemWeb.tar.gz" />
    </target>
</project>