text:
package.path = '../NFDataCfg/ScriptModule/?.lua;../NFDataCfg/ScriptModule/json/?.lua;../NFDataCfg/ScriptModule/cfg/?.lua;../NFDataCfg/ScriptModule/game/scenario/?.lua;../NFDataCfg/ScriptModule/game/?.lua;../NFDataCfg/ScriptModule/world/?.lua;../NFDataCfg/ScriptModule/proxy/?.lua;../NFDataCfg/ScriptModule/master/?.lua;../NFDataCfg/ScriptModule/login/?.lua;'

require("NFScriptEnum");

script_module = nil;
function init_script_system(xLuaScriptModule)
	script_module = xLuaScriptModule;

	script_module:log_info("Hello Lua, init script_module, " .. tostring(script_module));

	local app_id = script_module:app_id();
	local app_type = script_module:app_type();

	if NF_SERVER_TYPES.NF_ST_GAME == app_type then
		script_module:log_info("Hello Lua, NF_ST_GAME");
		require("./game/game_script_list");
	elseif NF_SERVER_TYPES.NF_ST_WORLD == app_type then
		script_module:log_info("Hello Lua, NF_ST_WORLD");
		require("./world/world_script_list");
	elseif NF_SERVER_TYPES.NF_ST_PROXY == app_type then
		script_module:log_info("Hello Lua, NF_ST_PROXY");
		require("./proxy/proxy_script_list");
	elseif NF_SERVER_TYPES.NF_ST_LOGIN == app_type then
		script_module:log_info("Hello Lua, NF_ST_LOGIN");
		require("./login/login_script_list");
	elseif NF_SERVER_TYPES.NF_ST_MASTER == app_type then
		script_module:log_info("Hello Lua, NF_ST_MASTER");
		require("./master/master_script_list");
	else
	end

end

function load_script_file(fileList, isReload)

	for i=1, #(fileList) do
		if package.loaded[fileList[i].tblName] then
			package.loaded[fileList[i].tblName] = nil
		end

		script_module:log_info("start to load " .. fileList[i].tblName);

		local oldTbl =_G[fileList[i].tblName];
		local object = require(fileList[i].tblName);
		if true == object then
			local newTbl =_G[fileList[i].tblName];
			register_module(newTbl, fileList[i].tblName, isReload);
			fileList[i].tbl = newTbl

			if oldTbl ~= nil then
				script_module:log_info("reload_script_file " .. fileList[i].tblName .. " succeed");
			end
		else
			script_module:log_info("load_script_file " .. fileList[i].tblName .. " failed");
		end
	end

	if true == isReload then
		for i=1, #(fileList) do
			fileList[i].tbl:awake()
		end
		for i=1, #(fileList) do
			fileList[i].tbl:init()
		end
		for i=1, #(fileList) do
			fileList[i].tbl:after_init()
		end

	end
end

function register_module(tbl, name, isReload)
	script_module:log_info("try to register module " .. name);
	script_module:register_module(name, tbl);
	if ScriptList then
		local isFind = false
		for i=1, #(ScriptList) do
			if ScriptList[i].tblName == name then
				ScriptList[i].tbl = tbl;
				isFind = true
				script_module:log_info("register module " .. name .. " succeed");
			end
		end
		if not isFind then
			table.insert(ScriptList,{tblName = name, tbl = tbl})
		end
		if true == isReload then
			for i=1, #(ScriptList) do
				if  ScriptList[i].tbl ~= nil then
					ScriptList[i].tbl:reload();
				end
			end
		end
	end
end

function find_module(name)
	if ScriptList then
		for i=1, #(ScriptList) do
			if ScriptList[i].tblName == name then
				return ScriptList[i].tbl;
			end
		end
	end
end
---------------------------------------------
function module_awake(...)
	script_module:log_info("lua module awake");
	if ScriptList then
		for i=1, #(ScriptList) do
			ScriptList[i].tbl:awake(...);
		end
	end
end

function module_init(...)
	script_module:log_info("lua module init");
	if ScriptList then
		for i=1, #(ScriptList) do
			ScriptList[i].tbl:init(...);
		end
	end
end

function module_after_init(...)
	script_module:log_info("lua module after init");
	if ScriptList then
		for i=1, #(ScriptList) do
			ScriptList[i].tbl:after_init(...);
		end
	end
end

function module_ready_execute(...)
	script_module:log_info("lua module execute");
	if ScriptList then
		for i=1, #(ScriptList) do
		ScriptList[i].tbl:ready_execute(...);
		end
	end
end

function module_before_shut(...)
	script_module:log_info("lua module before shut");
	if ScriptList then
		for i=1, #(ScriptList) do
			ScriptList[i].tbl:before_shut(...);
		end
	end
end

function module_shut(...)
	script_module:log_info("lua module shut");
	if ScriptList then
		for i=1, #(ScriptList) do
			ScriptList[i].tbl:shut(...);
		end
	end
end

function print_table(table)
	if table == nil then
		print("the table is nil");
		print(debug.traceback())
		return;
	end

	local key = ""
	level =  1
	local indent = ""
	for i = 1, level do
	indent = indent.."  "
	end

	if key ~= "" then
	print(indent..key.." ".."=".." ".."{")
	else
	print(indent .. "{")
	end

	key = ""
	for k,v in pairs(table) do
	if type(v) == "table" then
		key = k
		print(indent .. key .. " =")
		print_table(v, level + 1)
	else
		local content = string.format("%s%s = %s", indent .. "  ",tostring(k), tostring(v))
		print(content..";")
		end
	end
	print(indent .. "}")

end
----------------------------------------------


text:
template<class T>
class WinRtRendererMain {
public:
	template<typename... RendererArgs>
	WinRtRendererMain(Windows::UI::Xaml::Controls::SwapChainPanel ^panel,
		RendererArgs&& ...args)
		: renderer(std::forward<RendererArgs>(args)...),
		dxDev(renderer.GetDxDev()),
		output(dxDev, panel),
		renderThread([=]() { this->Render(); }),
		inputThread([=]() { this->Input(panel); })
	{
		auto window = Windows::UI::Xaml::Window::Current->CoreWindow;
		auto displayInformation = Windows::Graphics::Display::DisplayInformation::GetForCurrentView();

		window->VisibilityChanged += H::System::MakeTypedEventHandler(
			[=](Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::VisibilityChangedEventArgs ^args)
		{
			int stop = 324;
		});

		displayInformation->DpiChanged += H::System::MakeTypedEventHandler(
			[=](Windows::Graphics::Display::DisplayInformation ^sender, Platform::Object ^args)
		{
			int stop = 324;
		});

		displayInformation->OrientationChanged += H::System::MakeTypedEventHandler(
			[=](Windows::Graphics::Display::DisplayInformation ^sender, Platform::Object ^args)
		{
			int stop = 324;
		});

		displayInformation->DisplayContentsInvalidated += H::System::MakeTypedEventHandler(
			[=](Windows::Graphics::Display::DisplayInformation ^sender, Platform::Object ^args)
		{
			int stop = 324;
		});

		panel->CompositionScaleChanged += H::System::MakeTypedEventHandler(
			[=](Windows::UI::Xaml::Controls::SwapChainPanel ^sender, Platform::Object ^args)
		{
			int stop = 324;
		});

		panel->SizeChanged += ref new Windows::UI::Xaml::SizeChangedEventHandler(
			[=](Platform::Object ^sender, Windows::UI::Xaml::SizeChangedEventArgs ^args)
		{
			int stop = 324;
		});
	}

	~WinRtRendererMain() {
		if (this->renderThread.joinable()) {
			this->renderThread.join();
		}

		if (this->inputThread.joinable()) {
			this->inputThread.join();
		}
	}

private:
	T renderer;
	raw_ptr<DxDevice> dxDev;
	SwapChainPanelOutput output;

	Windows::UI::Core::CoreIndependentInputSource ^coreInput;

	std::thread renderThread;
	std::thread inputThread;

	void Render() {
		while (true) {
			{
				auto rtView = this->output.GetRtView();
				ID3D11RenderTargetView *const targets[1] = { this->output.GetRtView() };
				auto ctx = this->dxDev->GetContext();

				ctx->D3D()->OMSetRenderTargets(1, targets, nullptr);

				ctx->D3D()->ClearRenderTargetView(this->output.GetRtView(), DirectX::Colors::CornflowerBlue);
			}

			this->output.Present();
		}
	}

	void Input(Windows::UI::Xaml::Controls::SwapChainPanel ^panel) {
		this->coreInput = panel->CreateCoreIndependentInputSource(
			Windows::UI::Core::CoreInputDeviceTypes::Mouse |
			Windows::UI::Core::CoreInputDeviceTypes::Touch |
			Windows::UI::Core::CoreInputDeviceTypes::Pen);

		this->coreInput->PointerPressed += H::System::MakeTypedEventHandler(
			[=](Platform::Object ^sender, Windows::UI::Core::PointerEventArgs ^args) { this->OnPointerPressed(sender, args); });
		this->coreInput->PointerMoved += H::System::MakeTypedEventHandler(
			[=](Platform::Object ^sender, Windows::UI::Core::PointerEventArgs ^args) { this->OnPointerMoved(sender, args); });
		this->coreInput->PointerReleased += H::System::MakeTypedEventHandler(
			[=](Platform::Object ^sender, Windows::UI::Core::PointerEventArgs ^args) { this->OnPointerReleased(sender, args); });

		this->coreInput->Dispatcher->ProcessEvents(Windows::UI::Core::CoreProcessEventsOption::ProcessUntilQuit);
	}

	void OnPointerPressed(Platform::Object ^sender, Windows::UI::Core::PointerEventArgs ^args) {

	}

	void OnPointerMoved(Platform::Object ^sender, Windows::UI::Core::PointerEventArgs ^args) {

	}

	void OnPointerReleased(Platform::Object ^sender, Windows::UI::Core::PointerEventArgs ^args) {

	}
};

redpajama_set_name: RedPajamaGithub


text:
package com.bumptech.glide.request.transition;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import com.bumptech.glide.load.DataSource;

/**
 * A factory class that produces a new {@link Transition} that varies depending on whether or not
 * the drawable was loaded from the memory cache and whether or not the drawable is the first image
 * to be put on the target.
 *
 *
 Resources are usually loaded from the memory cache just before the user can see the view, for
 * example when the user changes screens or scrolls back and forth in a list. In those cases the
 * user typically does not expect to see a transition. As a result, when the resource is loaded from
 * the memory cache this factory produces an {@link NoTransition}.
 */
public class DrawableCrossFadeFactory implements TransitionFactory<Drawable> {
  private final ViewAnimationFactory<Drawable> viewAnimationFactory;
  private final int duration;
  private final boolean isCrossFadeEnabled;
  private DrawableCrossFadeTransition firstResourceTransition;
  private DrawableCrossFadeTransition secondResourceTransition;

  protected DrawableCrossFadeFactory(ViewAnimationFactory<Drawable> viewAnimationFactory,
      int duration, boolean isCrossFadeEnabled) {
    this.viewAnimationFactory = viewAnimationFactory;
    this.duration = duration;
    this.isCrossFadeEnabled = isCrossFadeEnabled;
  }

  @Override
  public Transition<Drawable> build(DataSource dataSource, boolean isFirstResource) {
    if (dataSource == DataSource.MEMORY_CACHE) {
      return NoTransition.get();
    } else if (isFirstResource) {
      return getFirstResourceTransition(dataSource);
    } else {
      return getSecondResourceTransition(dataSource);
    }
  }

  private Transition<Drawable> getFirstResourceTransition(DataSource dataSource) {
      if (firstResourceTransition == null) {
        firstResourceTransition = buildTransition(dataSource, true /*isFirstResource*/);
      }
      return firstResourceTransition;
  }

  private Transition<Drawable> getSecondResourceTransition(DataSource dataSource) {
      if (secondResourceTransition == null) {
        secondResourceTransition = buildTransition(dataSource, false /*isFirstResource*/);
      }
      return secondResourceTransition;
  }

  private DrawableCrossFadeTransition buildTransition(DataSource dataSource,
      boolean isFirstResource) {
    Transition<Drawable> defaultAnimation =
        viewAnimationFactory.build(dataSource, isFirstResource);
    return new DrawableCrossFadeTransition(defaultAnimation, duration, isCrossFadeEnabled);
  }

  private static final class DefaultViewTransitionAnimationFactory implements
      ViewTransition.ViewTransitionAnimationFactory {

    private final int durationMillis;

    DefaultViewTransitionAnimationFactory(int durationMillis) {
      this.durationMillis = durationMillis;
    }

    @Override
    public Animation build(Context context) {
      AlphaAnimation animation = new AlphaAnimation(0f, 1f);
      animation.setDuration(durationMillis);
      return animation;
    }
  }

  /**
   * A Builder for {@link DrawableCrossFadeFactory}.
   */
  public static class Builder {
    private static final int DEFAULT_DURATION_MS = 300;
    private int durationMillis;
    private ViewAnimationFactory<Drawable> factory;
    private boolean isCrossFadeEnabled;

    public Builder() {
      this(DEFAULT_DURATION_MS);
    }

    /**
     * @param durationMillis The duration of both the default animation when no previous Drawable
     *     is present and the cross fade animation when a previous Drawable is present. This value
     *     will not be used by the default animation if {@link #setDefaultAnimationId(int)},
     *     {@link #setDefaultAnimation(Animation)}, or
     *     {@link #setDefaultAnimationFactory(ViewAnimationFactory)} is called.
     */
    public Builder(int durationMillis) {
      this.durationMillis = durationMillis;
      factory = new ViewAnimationFactory<>(
          new DefaultViewTransitionAnimationFactory(durationMillis));
    }

    /**
     * Enables or disables animating the alpha of the {@link Drawable} the cross fade will animate
     * from.
     *
     *
Defaults to {@code false}.
     *
     * @param isCrossFadeEnabled If {@code true} the previous {@link Drawable}'s alpha will be
     *     animated from 100 to 0 while the new {@link Drawable}'s alpha is
     *     animated from 0 to 100. Otherwise the previous {@link Drawable}'s
     *     alpha will remain at 100 throughout the animation. See
     *     {@link android.graphics.drawable.TransitionDrawable#setCrossFadeEnabled(boolean)}
     */
    public Builder setCrossFadeEnabled(boolean isCrossFadeEnabled) {
      this.isCrossFadeEnabled = isCrossFadeEnabled;
      return this;
    }

    /**
     * Sets the resource id of the {@link Animation} to use when no previous {@link Drawable} is
     * available to animate from.
     *
     *
Defaults to a simple fade in.
     */
    public Builder setDefaultAnimationId(int animationId) {
      return setDefaultAnimationFactory(new ViewAnimationFactory<Drawable>(animationId));
    }

    /**
     * Sets the {@link Animation} to use when no previous {@link Drawable} is available to animate
     * from.
     *
     *
It is not safe to use the same {@link Animation} object for multiple animations
     * simultaneously. Always pass in a new instance to this method.
     */
    public Builder setDefaultAnimation(Animation animation) {
      return setDefaultAnimationFactory(new ViewAnimationFactory<Drawable>(animation));
    }

    /**
     * Sets the {@link ViewAnimationFactory} to use to generate animations to animate when no
     * previous {@link Drawable} is available to animate from.
     */
    public Builder setDefaultAnimationFactory(ViewAnimationFactory<Drawable> factory) {
      this.factory = factory;
      return this;
    }

    public DrawableCrossFadeFactory build() {
      return new DrawableCrossFadeFactory(factory, durationMillis, isCrossFadeEnabled);
    }
  }
}


text:
package org.apache.causeway.extensions.executionoutbox.applib.integtest.model;

import javax.inject.Named;

import org.apache.causeway.applib.annotation.Action;
import org.apache.causeway.applib.annotation.DomainObject;
import org.apache.causeway.applib.annotation.Editing;
import org.apache.causeway.applib.annotation.Nature;
import org.apache.causeway.applib.annotation.Property;
import org.apache.causeway.applib.annotation.Publishing;

@Named("executionoutbox.test.Counter")
@DomainObject(nature = Nature.ENTITY)
public abstract class Counter implements Comparable<Counter> {

    @Property(
            editing = Editing.ENABLED,
            executionPublishing = Publishing.ENABLED
    )
    public abstract Long getNum();
    public abstract void setNum(Long num);

    @Property(
            editing = Editing.ENABLED,
            executionPublishing = Publishing.DISABLED)
    public abstract Long getNum2();
    public abstract void setNum2(Long num2);

    public abstract String getName();
    public abstract void setName(String name);

    @Action(executionPublishing = Publishing.ENABLED)
    public Counter bumpUsingDeclaredAction() {
        return doBump();
    }

    @Action(executionPublishing = Publishing.DISABLED)
    public Counter bumpUsingDeclaredActionWithExecutionPublishingDisabled() {
        return doBump();
    }

    Counter doBump() {
        if (getNum() == null) {
            setNum(1L);
        } else {
            setNum(getNum() + 1);
        }
        return this;
    }

    @Override
    public int compareTo(final Counter o) {
        return this.getName().compareTo(o.getName());
    }
}


text:
require 'rails_helper'

RSpec.describe Person, :type => :model do
  it "is valid with a name" do
    person = Person.new(
      name: "Andrew"
    )
    expect(person).to be_valid
  end

  it "is invalid without a name" do
    person = Person.new()
    expect(person).to_not be_valid
  end
end


text:
'use strict';

module.exports = {
    set: function (v) {
        this.setProperty('marker-start', v);
    },
    get: function () {
        return this.getPropertyValue('marker-start');
    },
    enumerable: true
};


text:
package com.introductory_exercises;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Created by pprado on 4/23/15.
 */
public class FizzBuzzTest {

    FizzBuzz fizzBuzz;

    @Before
    public void setUp() {
        fizzBuzz = new FizzBuzz();
    }

    @Test
    public void testDivisibleByThree() throws Exception {
        assertTrue(fizzBuzz.divisibleByThree(27));
    }

    @Test
    public void testDivisibleByFive() throws Exception {
        assertTrue(fizzBuzz.divisibleByFive(25));
    }
}


text:
using System;
using System.Diagnostics;
using System.IO.Pipelines;
using System.Runtime.CompilerServices;
using Leto.Internal;

namespace Leto.Alerts
{
    public class AlertException : Exception
    {
        public AlertException(AlertLevel alertLevel, AlertDescription description, string message) : base(message)
        {
            Level = alertLevel;
            Description = description;
        }

        public AlertException(ReadableBuffer buffer)
            :this(buffer.ToSpan())
        {

        }

        public AlertException(Span<byte> alertSpan)
        {
            var reader = new BigEndianAdvancingSpan(alertSpan);
            Level = reader.Read<AlertLevel>();
            Description = reader.Read<AlertDescription>();
            ReceivedFromPeer = true;
        }

        public AlertLevel Level { get; }
        public AlertDescription Description { get; }
        public bool ReceivedFromPeer { get; }
        public override string Message => $"A {Level} {Description} {base.Message}";

        public override string ToString() => Message;

        [MethodImpl(MethodImplOptions.NoInlining)]
        [DebuggerHidden()]
        public static void ThrowAlert(AlertLevel alertLevel, AlertDescription description, string message) =>
            throw new AlertException(alertLevel, description, message);
        public static void ThrowFailedHandshake(string message) =>
            ThrowAlert(AlertLevel.Fatal, AlertDescription.handshake_failure, message);
        public static void ThrowUnexpectedMessage(RecordLayer.RecordType recordType) =>
            ThrowAlert(AlertLevel.Fatal, AlertDescription.unexpected_message, $"Unexpected message of type {recordType}");
        public static void ThrowUnexpectedMessage(Handshake.HandshakeType handshakeType) =>
            ThrowAlert(AlertLevel.Fatal, AlertDescription.unexpected_message, $"Unexpected message of type {handshakeType}");
        public static void ThrowInvalidLength(int expected, int actual) =>
            ThrowAlert(AlertLevel.Fatal, AlertDescription.decode_error, $"Invalid vector length expected {expected} actual {actual}");
        public static void ThrowDecode(string message) =>
            ThrowAlert(AlertLevel.Fatal, AlertDescription.decode_error, message);
        public static void ThrowApplicationProtocol(byte[] protocol) =>
            ThrowAlert(AlertLevel.Fatal, AlertDescription.no_application_protocol, $"Invalid protocol detected {BitConverter.ToString(protocol)}");
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Rysslands, Finlands ochden Scand. Halföns Hattssvampar 2: 162 (1879)

#### Original name
Hypochnus olivaceus Fr., 1818

### Remarks
null


text:
class Gazebo9 < Formula
  desc "Gazebo robot simulator"
  homepage "https://gazebosim.org"
  url "https://osrf-distributions.s3.amazonaws.com/gazebo/releases/gazebo-9.19.0.tar.bz2"
  sha256 "1f3ca430824b120ae0c7c4c0037a1a56e7b6bf6c50731b148b5c75bfc46d7fe7"
  license "Apache-2.0"
  revision 10

  head "https://github.com/osrf/gazebo.git", branch: "gazebo9"

  bottle do
    root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
    sha256 big_sur:  "11d7fac9d0f3a0dcec73901385cf8560eaec174c62767b083dc8799b242afb3d"
    sha256 catalina: "3a00685078a8aa129fc69116f761da99808a97cfe3cbab6bf9eda4c8013f3700"
  end

  depends_on "cmake" => :build
  depends_on "pkg-config" => :build

  depends_on "boost"
  depends_on "bullet"
  depends_on "cmake@3.21.4"
  depends_on "dartsim"
  depends_on "doxygen"
  depends_on "ffmpeg"
  depends_on "freeimage"
  depends_on "graphviz"
  depends_on "gts"
  depends_on "ignition-fuel-tools1"
  depends_on "ignition-math4"
  depends_on "ignition-msgs1"
  depends_on "ignition-transport4"
  depends_on "libtar"
  depends_on macos: :mojave # ogre1.9 missing in highsierra
  depends_on "ogre1.9"
  depends_on "ossp-uuid" => :linked
  depends_on "protobuf"
  depends_on "protobuf-c"
  depends_on "qt@5"
  depends_on "qwt-qt5"
  depends_on "sdformat6"
  depends_on "simbody"
  depends_on "tbb@2020_u3"
  depends_on "tinyxml"
  depends_on "tinyxml2"
  depends_on "zeromq" => :linked

  # depends on "gdal" => :optional
  # depends on "player" => :optional

  conflicts_with "gazebo7", because: "differing version of the same formula"
  conflicts_with "gazebo11", because: "differing version of the same formula"

  patch do
    # Fix build when homebrew python is installed
    # keep this patch
    url "https://gist.githubusercontent.com/scpeters/9199370/raw/afe595587e38737c537124a3652db99de026c272/brew_python_fix.patch"
    sha256 "c4774f64c490fa03236564312bd24a8630963762e25d98d072e747f0412df18e"
  end

  patch do
    # Fix for compatibility with qwt 6.2
    url "https://github.com/osrf/gazebo/commit/9e7e9bfbace6e0cc3f06842bb1efd47eb0632b36.patch?full_index=1"
    sha256 "625d7f990629e431ef160ac771b632f9007b72d0608e7bccd4a7e0987417a347"
  end

  def install
    cmake_args = std_cmake_args
    cmake_args << "-DQWT_WIN_INCLUDE_DIR=#{Formula["qwt-qt5"].opt_lib}/qwt.framework/Headers"
    cmake_args << "-DQWT_WIN_LIBRARY_DIR=#{Formula["qwt-qt5"].opt_lib}/qwt.framework"
    cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}"

    mkdir "build" do
      system "cmake", "..", *cmake_args
      system "make", "install"
    end
  end

  test do
    # Test is broken. See https://github.com/osrf/homebrew-simulation/issues/1003
    # this used to show boost linking errors, but not anymore
    # system "#{bin}/gz", "sdf"

    # running this sample code seg-faults from boost filesystem
    # if a bottle rebuild is needed
    (testpath/"test.cpp").write <<-EOS
      #include <gazebo/gazebo.hh>
      int main() {
        gazebo::common::copyDir(".", "./tmp");
        return 0;
      }
    EOS
    (testpath/"CMakeLists.txt").write <<-EOS
      cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
      find_package(gazebo QUIET REQUIRED)
      add_executable(test_cmake test.cpp)
      include_directories(${GAZEBO_INCLUDE_DIRS})
      target_link_libraries(test_cmake ${GAZEBO_LIBRARIES})
    EOS
    # system "pkg-config", "--cflags", "gazebo"
    # cflags = `pkg-config --cflags gazebo`.split
    # libs = `pkg-config --libs gazebo`.split
    # boost libs not properly generated in pkg-config file
    # disable test for now
    # see https://github.com/osrf/homebrew-simulation/issues/850
    # system ENV.cc, "test.cpp",
    #                *cflags,
    #                "-L#{lib}",
    #                *libs,
    #                "-lc++",
    #                "-o", "test"
    # system "./test"
    ENV.append_path "CPATH", Formula["tbb@2020_u3"].opt_include
    mkdir "build" do
      system "cmake", ".."
      system "make"
      # Test is broken. See https://github.com/osrf/homebrew-simulation/issues/1003
      # system "./test_cmake"
    end
    # check for Xcode frameworks in bottle
    cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
    system cmd_not_grep_xcode
  end
end


text:
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;

using LExpression = System.Linq.Expressions.Expression;

namespace Pidgin;

public static partial class Parser<TToken>
{
    /// <summary>
    /// Creates a parser that parses and returns a literal sequence of tokens.
    /// </summary>
    /// <param name="tokens">A sequence of tokens.</param>
    /// <returns>A parser that parses a literal sequence of tokens.</returns>
    public static Parser<TToken, TToken[]> Sequence(params TToken[] tokens)
    {
        if (tokens == null)
        {
            throw new ArgumentNullException(nameof(tokens));
        }

        return Sequence<TToken[]>(tokens);
    }

    /// <summary>
    /// Creates a parser that parses and returns a literal sequence of tokens.
    /// The input enumerable is enumerated and copied to a list.
    /// </summary>
    /// <typeparam name="TEnumerable">The type of tokens to parse.</typeparam>
    /// <param name="tokens">A sequence of tokens.</param>
    /// <returns>A parser that parses a literal sequence of tokens.</returns>
    public static Parser<TToken, TEnumerable> Sequence<TEnumerable>(TEnumerable tokens)
        where TEnumerable : IEnumerable<TToken>
    {
        if (tokens == null)
        {
            throw new ArgumentNullException(nameof(tokens));
        }

        return SequenceTokenParser<TToken, TEnumerable>.Create(tokens);
    }

    /// <summary>
    /// Creates a parser that applies a sequence of parsers and collects the results.
    /// This parser fails if any of its constituent parsers fail.
    /// </summary>
    /// <typeparam name="T">The return type of the parsers.</typeparam>
    /// <param name="parsers">A sequence of parsers.</param>
    /// <returns>A parser that applies a sequence of parsers and collects the results.</returns>
    public static Parser<TToken, IEnumerable<T>> Sequence<T>(params Parser<TToken, T>[] parsers)
    {
        return Sequence(parsers.AsEnumerable());
    }

    /// <summary>
    /// Creates a parser that applies a sequence of parsers and collects the results.
    /// This parser fails if any of its constituent parsers fail.
    /// </summary>
    /// <typeparam name="T">The return type of the parsers.</typeparam>
    /// <param name="parsers">A sequence of parsers.</param>
    /// <returns>A parser that applies a sequence of parsers and collects the results.</returns>
    public static Parser<TToken, IEnumerable<T>> Sequence<T>(IEnumerable<Parser<TToken, T>> parsers)
    {
        if (parsers == null)
        {
            throw new ArgumentNullException(nameof(parsers));
        }

        var parsersArray = parsers.ToArray();
        if (parsersArray.Length == 1)
        {
            return parsersArray[0].Select(x => new[] { x }.AsEnumerable());
        }

        return new SequenceParser<TToken, T>(parsersArray);
    }
}

[SuppressMessage(
    "StyleCop.CSharp.MaintainabilityRules",
    "SA1402:FileMayOnlyContainASingleType",
    Justification = "This class belongs next to the accompanying API method"
)]
internal sealed class SequenceParser<TToken, T> : Parser<TToken, IEnumerable<T>>
{
    private readonly Parser<TToken, T>[] _parsers;

    public SequenceParser(Parser<TToken, T>[] parsers)
    {
        _parsers = parsers;
    }

    public sealed override bool TryParse(ref ParseState<TToken> state, ref PooledList<Expected<TToken>> expecteds, [MaybeNullWhen(false)] out IEnumerable<T> result)
    {
        var ts = new T[_parsers.Length];

        for (var i = 0; i < _parsers.Length; i++)
        {
            var p = _parsers[i];

            var success = p.TryParse(ref state, ref expecteds, out ts[i]!);

            if (!success)
            {
                result = null;
                return false;
            }
        }

        result = ts;
        return true;
    }
}

[SuppressMessage(
    "StyleCop.CSharp.MaintainabilityRules",
    "SA1402:FileMayOnlyContainASingleType",
    Justification = "This class belongs next to the accompanying API method"
)]
internal static class SequenceTokenParser<TToken, TEnumerable>
    where TEnumerable : IEnumerable<TToken>
{
    private static readonly Func<TEnumerable, Parser<TToken, TEnumerable>>? _createParser = GetCreateParser();

    public static Parser<TToken, TEnumerable> Create(TEnumerable tokens)
    {
        if (_createParser != null)
        {
            return _createParser(tokens);
        }

        return new SequenceTokenParserSlow<TToken, TEnumerable>(tokens);
    }

    private static Func<TEnumerable, Parser<TToken, TEnumerable>>? GetCreateParser()
    {
        var ttoken = typeof(TToken).GetTypeInfo();
        var equatable = typeof(IEquatable<TToken>).GetTypeInfo();

        if (!ttoken.IsValueType || !equatable.IsAssignableFrom(ttoken))
        {
            return null;
        }

        var ctor = typeof(SequenceTokenParserFast<,>)
            .MakeGenericType(typeof(TToken), typeof(TEnumerable))
            .GetTypeInfo()
            .DeclaredConstructors
            .Single();
        var param = LExpression.Parameter(typeof(TEnumerable));
        var create = LExpression.New(ctor, param);
        return LExpression.Lambda<Func<TEnumerable, Parser<TToken, TEnumerable>>>(create, param).Compile();
    }
}

[SuppressMessage(
    "StyleCop.CSharp.MaintainabilityRules",
    "SA1402:FileMayOnlyContainASingleType",
    Justification = "This class belongs next to the accompanying API method"
)]
internal sealed class SequenceTokenParserFast<TToken, TEnumerable> : Parser<TToken, TEnumerable>
    where TToken : struct, IEquatable<TToken>
    where TEnumerable : IEnumerable<TToken>
{
    private readonly TEnumerable _value;
    private readonly ImmutableArray<TToken> _valueTokens;

    public SequenceTokenParserFast(TEnumerable value)
    {
        _value = value;
        _valueTokens = value.ToImmutableArray();
    }

    public sealed override bool TryParse(ref ParseState<TToken> state, ref PooledList<Expected<TToken>> expecteds, [MaybeNullWhen(false)] out TEnumerable result)
    {
        var span = state.LookAhead(_valueTokens.Length);  // span.Length <= _valueTokens.Length

        var errorPos = -1;
        for (var i = 0; i < span.Length; i++)
        {
            if (!span[i].Equals(_valueTokens[i]))
            {
                errorPos = i;
                break;
            }
        }

        if (errorPos != -1)
        {
            // strings didn't match
            state.Advance(errorPos);
            state.SetError(
                Maybe.Just(span[errorPos]),
                false,
                state.Location,
                null
            );
            expecteds.Add(new Expected<TToken>(_valueTokens));
            result = default;
            return false;
        }

        if (span.Length < _valueTokens.Length)
        {
            // strings matched but reached EOF
            state.Advance(span.Length);
            state.SetError(
                Maybe.Nothing<TToken>(),
                true,
                state.Location,
                null
            );
            expecteds.Add(new Expected<TToken>(_valueTokens));
            result = default;
            return false;
        }

        // OK
        state.Advance(_valueTokens.Length);
        result = _value;
        return true;
    }
}

[SuppressMessage(
    "StyleCop.CSharp.MaintainabilityRules",
    "SA1402:FileMayOnlyContainASingleType",
    Justification = "This class belongs next to the accompanying API method"
)]
internal sealed class SequenceTokenParserSlow<TToken, TEnumerable> : Parser<TToken, TEnumerable>
    where TEnumerable : IEnumerable<TToken>
{
    private readonly TEnumerable _value;
    private readonly ImmutableArray<TToken> _valueTokens;

    public SequenceTokenParserSlow(TEnumerable value)
    {
        _value = value;
        _valueTokens = value.ToImmutableArray();
    }

    public sealed override bool TryParse(ref ParseState<TToken> state, ref PooledList<Expected<TToken>> expecteds, [MaybeNullWhen(false)] out TEnumerable result)
    {
        var span = state.LookAhead(_valueTokens.Length);  // span.Length <= _valueTokens.Length

        var errorPos = -1;
        for (var i = 0; i < span.Length; i++)
        {
            if (!EqualityComparer<TToken>.Default.Equals(span[i], _valueTokens[i]))
            {
                errorPos = i;
                break;
            }
        }

        if (errorPos != -1)
        {
            // strings didn't match
            state.Advance(errorPos);
            state.SetError(Maybe.Just(span[errorPos]), false, state.Location, null);
            expecteds.Add(new Expected<TToken>(_valueTokens));
            result = default;
            return false;
        }

        if (span.Length < _valueTokens.Length)
        {
            // strings matched but reached EOF
            state.Advance(span.Length);
            state.SetError(Maybe.Nothing<TToken>(), true, state.Location, null);
            expecteds.Add(new Expected<TToken>(_valueTokens));
            result = default;
            return false;
        }

        // OK
        state.Advance(_valueTokens.Length);
        result = _value;
        return true;
    }
}


text:
<?php

abstract class Plugin extends Context
{
	private $itemId = 0;

	function __construct($args = array())
	{
		parent::__construct();

		if ($args)
		{
			foreach ($args as $arg => $value)
			{
				if (method_exists($this, 'set' . $arg))
				{
					$this->{'set' . $arg}($value);
				}
			}
		}

		return $this;
	}

	public function setItem($itemId)
	{
		$this->itemId = $itemId;
	}

	public function getItem()
	{
		return $this->itemId;
	}

	abstract public function display();

	public function __toString()
	{
		return $this->display();
	}
}
?>


text:
class Settings < Settingslogic
  # used in conjonction with figaro
  source "#{Rails.root}/config/settings.yml"
  namespace Rails.env
end


text:
import os

from scripts.test import shared
from . import utils

class FeatureValidationTest(utils.BinaryenTestCase):
    def check_feature(self, module, error, flag, const_flags=[]):
        p = shared.run_process(shared.WASM_OPT +
                               ['--mvp-features', '--print', '-o', os.devnull] +
                               const_flags,
                               input=module, check=False, capture_output=True)
        self.assertIn(error, p.stderr)
        self.assertIn('Fatal: error validating input', p.stderr)
        self.assertNotEqual(p.returncode, 0)
        p = shared.run_process(
            shared.WASM_OPT + ['--mvp-features', '--print', '-o', os.devnull] +
            const_flags + [flag],
            input=module,
            check=False,
            capture_output=True)
        self.assertEqual(p.returncode, 0)

    def check_simd(self, module, error):
        self.check_feature(module, error, '--enable-simd')

    def check_sign_ext(self, module, error):
        self.check_feature(module, error, '--enable-sign-ext')

    def check_bulk_mem(self, module, error):
        self.check_feature(module, error, '--enable-bulk-memory')

    def check_exception_handling(self, module, error):
        self.check_feature(module, error, '--enable-exception-handling')

    def check_tail_call(self, module, error):
        self.check_feature(module, error, '--enable-tail-call')

    def check_reference_types(self, module, error):
        self.check_feature(module, error, '--enable-reference-types')

    def check_multivalue(self, module, error):
        self.check_feature(module, error, '--enable-multivalue')

    def check_multivalue_exception_handling(self, module, error):
        self.check_feature(module, error, '--enable-multivalue',
                           ['--enable-exception-handling'])

    def check_gc(self, module, error):
        # GC implies reference types
        self.check_feature(module, error, '--enable-gc',
                           ['--enable-reference-types'])

    def test_v128_signature(self):
        module = '''
        (module
         (func $foo (param $0 v128) (result v128)
            (local.get $0)
         )
        )
        '''
        self.check_simd(module, 'all used types should be allowed')

    def test_v128_global(self):
        module = '''
        (module
         (global $foo (mut v128) (v128.const i32x4 0 0 0 0))
        )
        '''
        self.check_simd(module, 'all used types should be allowed')

    def test_v128_local(self):
        module = '''
        (module
         (func $foo
            (local v128)
         )
        )
        '''
        self.check_simd(module, 'all used types should be allowed')

    def test_simd_const(self):
        module = '''
        (module
         (func $foo
            (drop (v128.const i32x4 0 0 0 0))
         )
        )
        '''
        self.check_simd(module, 'all used features should be allowed')

    def test_simd_load(self):
        module = '''
        (module
         (memory 1 1)
         (func $foo
            (drop (v128.load (i32.const 0)))
         )
        )
        '''
        self.check_simd(module, 'SIMD operations require SIMD [--enable-simd]')

    def test_simd_splat(self):
        module = '''
        (module
         (func $foo
            (drop (i32x4.splat (i32.const 0)))
         )
        )
        '''
        self.check_simd(module, 'all used features should be allowed')

    def test_sign_ext(self):
        module = '''
        (module
         (func $foo
            (drop (i32.extend8_s (i32.const 7)))
         )
        )
        '''
        self.check_sign_ext(module, 'all used features should be allowed')

    def test_bulk_mem_inst(self):
        module = '''
        (module
         (memory 1 1)
         (func $foo
            (memory.copy (i32.const 0) (i32.const 8) (i32.const 8))
         )
        )
        '''
        self.check_bulk_mem(module,
                            'Bulk memory operations require bulk memory [--enable-bulk-memory]')

    def test_bulk_mem_segment(self):
        module = '''
        (module
         (memory 256 256)
         (data "42")
        )
        '''
        self.check_bulk_mem(module, 'nonzero segment flags require bulk memory [--enable-bulk-memory]')

    def test_tail_call(self):
        module = '''
        (module
         (func $bar)
         (func $foo
            (return_call $bar)
         )
        )
        '''
        self.check_tail_call(module, 'return_call* requires tail calls [--enable-tail-call]')

    def test_tail_call_indirect(self):
        module = '''
        (module
         (type $T (func))
         (table $0 1 1 funcref)
         (func $foo
            (return_call_indirect (type $T)
             (i32.const 0)
            )
         )
        )
        '''
        self.check_tail_call(module, 'return_call* requires tail calls [--enable-tail-call]')

    def test_reference_types_externref(self):
        module = '''
        (module
         (import "env" "test1" (func $test1 (param externref) (result externref)))
         (import "env" "test2" (global $test2 externref))
         (export "test1" (func $test1 (param externref) (result externref)))
         (export "test2" (global $test2))
         (func $externref_test (param $0 externref) (result externref)
          (return
           (call $test1
            (local.get $0)
           )
          )
         )
        )
        '''
        self.check_reference_types(module, 'all used types should be allowed')

    def test_tag(self):
        module = '''
        (module
         (tag $e (param i32))
         (func $foo
            (throw $e (i32.const 0))
         )
        )
        '''
        self.check_exception_handling(module, 'Tags require exception-handling [--enable-exception-handling]')

    def test_multivalue_import(self):
        module = '''
        (module
         (import "env" "foo" (func $foo (result i32 i64)))
        )
        '''
        self.check_multivalue(module, 'Imported multivalue function requires multivalue [--enable-multivalue]')

    def test_multivalue_function(self):
        module = '''
        (module
         (func $foo (result i32 i64)
          (tuple.make
           (i32.const 42)
           (i64.const 42)
          )
         )
        )
        '''
        self.check_multivalue(module, 'Multivalue function results ' +
                              '(multivalue is not enabled)')

    def test_multivalue_tag(self):
        module = '''
        (module
         (tag $foo (param i32 i64))
        )
        '''
        self.check_multivalue_exception_handling(module, 'Multivalue tag type requires multivalue [--enable-multivalue]')

    def test_multivalue_block(self):
        module = '''
        (module
         (func $foo
          (drop
           (block (result i32 i64)
            (tuple.make
             (i32.const 42)
             (i64.const 42)
            )
           )
          )
         )
        )
        '''
        self.check_multivalue(module, 'Multivalue block type require multivalue [--enable-multivalue]')

    def test_i31_global(self):
        module = '''
        (module
         (global $foo (ref null i31) (ref.null i31))
        )
        '''
        self.check_gc(module, 'all used types should be allowed')

    def test_i31_local(self):
        module = '''
        (module
         (func $foo
          (local $0 (ref null i31))
         )
        )
        '''
        self.check_gc(module, 'all used types should be allowed')

    def test_eqref_global(self):
        module = '''
        (module
         (global $foo eqref (ref.null eq))
        )
        '''
        self.check_gc(module, 'all used types should be allowed')

    def test_eqref_local(self):
        module = '''
        (module
         (func $foo
          (local $0 eqref)
         )
        )
        '''
        self.check_gc(module, 'all used types should be allowed')

class TargetFeaturesSectionTest(utils.BinaryenTestCase):
    def test_atomics(self):
        filename = 'atomics_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['threads'])
        self.assertIn('i32.atomic.rmw.add', self.disassemble(filename))

    def test_bulk_memory(self):
        filename = 'bulkmem_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['bulk-memory'])
        self.assertIn('memory.copy', self.disassemble(filename))

    def test_nontrapping_fptoint(self):
        filename = 'truncsat_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['nontrapping-float-to-int'])
        self.assertIn('i32.trunc_sat_f32_u', self.disassemble(filename))

    def test_mutable_globals(self):
        filename = 'mutable_globals_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['mutable-globals'])
        self.assertIn('(import "env" "global-mut" (global $gimport$0 (mut i32)))',
                      self.disassemble(filename))

    def test_sign_ext(self):
        filename = 'signext_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['sign-ext'])
        self.assertIn('i32.extend8_s', self.disassemble(filename))

    def test_simd(self):
        filename = 'simd_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['simd'])
        self.assertIn('i32x4.splat', self.disassemble(filename))

    def test_tailcall(self):
        filename = 'tail_call_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['tail-call'])
        self.assertIn('return_call', self.disassemble(filename))

    def test_reference_types(self):
        filename = 'reference_types_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['reference-types'])
        self.assertIn('anyref', self.disassemble(filename))

    def test_exception_handling(self):
        filename = 'exception_handling_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['exception-handling'])
        self.assertIn('throw', self.disassemble(filename))

    def test_gc(self):
        filename = 'gc_target_feature.wasm'
        self.roundtrip(filename)
        self.check_features(filename, ['reference-types', 'gc'])
        disassembly = self.disassemble(filename)
        self.assertIn('externref', disassembly)
        self.assertIn('eqref', disassembly)

    def test_superset(self):
        # It is ok to enable additional features past what is in the section.
        shared.run_process(
            shared.WASM_OPT + ['--print', '--detect-features', '-mvp',
                               '--enable-simd', '--enable-sign-ext',
                               self.input_path('signext_target_feature.wasm')])

    def test_superset_even_without_detect_features(self):
        # It is ok to enable additional features past what is in the section,
        # even without passing --detect-features (which is now a no-op).
        path = self.input_path('signext_target_feature.wasm')
        shared.run_process(
            shared.WASM_OPT + ['--print', '--enable-simd', '-o', os.devnull,
                               path])

    def test_superset_with_detect_features(self):
        path = self.input_path('signext_target_feature.wasm')
        shared.run_process(
            shared.WASM_OPT + ['--print', '--detect-features',
                               '--enable-simd', '-o', os.devnull, path])

    def test_explicit_detect_features(self):
        self.check_features('signext_target_feature.wasm', ['simd', 'sign-ext'],
                            opts=['-mvp', '--detect-features', '--enable-simd'])

    def test_emit_all_features(self):
        p = shared.run_process(shared.WASM_OPT +
                               ['--emit-target-features', '-all', '-o', '-'],
                               input="(module)", check=False,
                               capture_output=True, decode_output=False)
        self.assertEqual(p.returncode, 0)
        p2 = shared.run_process(shared.WASM_OPT +
                                ['--print-features', '-o', os.devnull],
                                input=p.stdout, check=False,
                                capture_output=True)
        self.assertEqual(p2.returncode, 0)
        self.assertEqual([
            '--enable-threads',
            '--enable-mutable-globals',
            '--enable-nontrapping-float-to-int',
            '--enable-simd',
            '--enable-bulk-memory',
            '--enable-sign-ext',
            '--enable-exception-handling',
            '--enable-tail-call',
            '--enable-reference-types',
            '--enable-multivalue',
            '--enable-gc',
            '--enable-memory64',
            '--enable-relaxed-simd',
            '--enable-extended-const',
            '--enable-strings',
            '--enable-multi-memories',
        ], p2.stdout.splitlines())


text:
package com.bxf.hradmin.common.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * NonTransactional
 *
 * @since 2016-05-07
 * @author Bo-Xuan Fan
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface NonTransactional {

}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using QMunicate.Core.Logger;

namespace QMunicate.Core.Navigation
{
    public class NavigationService : INavigationService
    {
        public event NavigatedEventHandler Navigated;
        public event NavigatingCancelEventHandler Navigating;
        public event NavigationFailedEventHandler NavigationFailed;
        public event NavigationStoppedEventHandler NavigationStopped;

        private Frame frame;
        private PageResolver pageResolver;
        private INavigationAware previousPage;

        public void Initialize(Frame frame, PageResolver pageResolver)
        {
            if (frame == null)
            {
                throw new ArgumentNullException("frame null");
            }

            this.pageResolver = pageResolver;
            this.frame = frame;
            this.frame.Navigated += OnNavigated;
            this.frame.Navigating += OnNavigating;
            this.frame.NavigationFailed += OnNavigationFailed;
            this.frame.NavigationStopped += OnNavigationStopped;
            Debug.WriteLine("Frame initialized");
        }

        private async void OnNavigationStopped(object sender, NavigationEventArgs e)
        {
            await QmunicateLoggerHolder.Log(QmunicateLogLevel.Debug, "OnNavigationStopped. SourcePageType=" + e.SourcePageType + " Mode=" + e.NavigationMode);
            var handler = NavigationStopped;
            if (handler != null)
            {
                handler.Invoke(sender, e);
            }
        }

        private async void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            await QmunicateLoggerHolder.Log(QmunicateLogLevel.Debug, "OnNavigationFailed. SourcePageType=" + e.SourcePageType + "\n Exception=" + e.Exception);
            var handler = NavigationFailed;
            if (handler != null)
            {
                handler.Invoke(sender, e);
            }
        }

        private async void OnNavigating(object sender, NavigatingCancelEventArgs e)
        {
            await QmunicateLoggerHolder.Log(QmunicateLogLevel.Debug, "OnNavigating. SourcePageType=" + e.SourcePageType + " Mode=" + e.NavigationMode);
            var handler = Navigating;
            if (handler != null)
            {
                handler.Invoke(sender, e);
            }

            //if (!e.Cancel)
            //{
            //    switch (e.NavigationMode)
            //    {
            //        case NavigationMode.Back:
            //            NavigatedFrom(e);
            //            break;
            //        case NavigationMode.Forward:
            //            break;
            //        case NavigationMode.New:
            //            NavigatedFrom(e);
            //            break;
            //        case NavigationMode.Refresh:
            //            break;
            //    }
            //}
        }

        private async void OnNavigated(object sender, NavigationEventArgs e)
        {
            await QmunicateLoggerHolder.Log(QmunicateLogLevel.Debug, "OnNavigated. SourcePageType=" + e.SourcePageType + " Mode=" + e.NavigationMode);
            var handler = Navigated;
            if (handler != null)
            {
                handler.Invoke(sender, e);
            }

            switch (e.NavigationMode)
            {
                case NavigationMode.Back:
                    NavigatedTo(e);
                    break;
                case NavigationMode.Forward:
                    break;
                case NavigationMode.New:
                    NavigatedTo(e);
                    break;
                case NavigationMode.Refresh:
                    break;
            }
        }

        public bool Navigate(String pageKey)
        {
            var page = this.pageResolver.GetPageByKey(pageKey);
            return this.frame.Navigate(page);
        }

        public bool Navigate(String pageKey, object parameter)
        {
            var page = this.pageResolver.GetPageByKey(pageKey);
            return this.frame.Navigate(page, parameter);
        }

        public void GoBack()
        {
            this.frame.GoBack();
        }

        public bool CanGoBack
        {
            get
            {
                return this.frame.CanGoBack;
            }
        }

        public IList<PageStackEntry> BackStack
        {
            get { return frame.BackStack; }
        }

        public int BackStackDepth
        {
            get { return frame.BackStackDepth; }
        }

        /// <summary>
        /// Called when the implementer is being navigated away from.
        /// </summary>
        /// <param name="args">Provides data for navigation methods and event handlers that cannot cancel the navigation request.</param>
        private void NavigatedFrom(NavigatingCancelEventArgs args)
        {
            //var navigationAware = GetNavigationAware(frame.Content);
            //if (navigationAware == null) return;
            //navigationAware.OnNavigatedFrom(args);
        }

        /// <summary>
        /// Called when the implementer has been navigated to.
        /// </summary>
        /// <param name="args">Provides data for navigation methods and event handlers that cannot cancel the navigation request.</param>
        private void NavigatedTo(NavigationEventArgs args)
        {
            if(previousPage != null)
                previousPage.OnNavigatedFrom(args);

            previousPage = GetNavigationAware(args.Content);
            if (previousPage == null) return;
            previousPage.OnNavigatedTo(args);
        }

        private static INavigationAware GetNavigationAware(Object content)
        {
            if (content == null) return null;
            var frameworkElement = content as FrameworkElement;
            if (frameworkElement == null) return null;
            return frameworkElement.DataContext as INavigationAware;
        }
    }
}


text:
require 'spec_helper'

feature 'Transfer Making Prints', transfer_making_print: true, js: true do

  context 'as an admin' do

    include_context 'logged_in_as_admin'
    let(:machine) { create(:machine) }

    scenario 'I can create an order with a transfer_making print' do
      create_order(
          name: 'Test Order',
          jobs: [
              {
                  imprints: [
                      {
                          name: 'Test Job',
                          description: 'Test Desc',
                          machine: machine.name,
                          type: 'Transfer Making Print',
                          estimated_time: 3,
                          machine_print_count: 100
                      }
                  ]
              }
          ]
      )
      expect(page).to have_content('Order was successfully created')
      expect(page).to have_css('dd', text: 'Transfer making print')
    end

    context 'given an order with an imprint that is a transfer_making print', print: true  do
      given(:order) { create(:order, jobs: [ create(:job_with_transfer_making_print) ]) }
      given(:imprint) { order.jobs.first.imprints.first }

      scenario 'I can transition a print state to completion', story_909: true  do
        visit order_path(order)
        within("#imprint-#{imprint.id}") do
          click_link 'Show Full Details'
        end
        sleep 1
        success_transition :approve
        success_transition :preproduction_complete
        success_transition :final_test_print_printed
        success_transition :start_printing
        success_transition :completed

        within('.train-category-success') do
          expect(page).to have_content('No actions available')
        end

        expect(imprint.reload.complete?).to be_truthy
      end

      context 'that requires manager signoff' do

        let(:manager) { create(:admin) }

        before(:each) do
          imprint.update_attribute(:require_manager_signoff, true)
          imprint.update_column(:state, :pending_final_test_print)
        end

        scenario 'I can transition a print state to completion', story_909: true do
          visit order_path(order)
          within("#imprint-#{imprint.id}") do
            click_link 'Show Full Details'
          end
          sleep(1)

          success_transition :final_test_print_printed
          select_from_select2 manager.full_name
          success_transition :production_manager_approved
          success_transition :start_printing
          success_transition :completed

          within('.train-category-success') do
            expect(page).to have_content('No actions available')
          end

          expect(imprint.reload.complete?).to be_truthy
          expect(imprint.reload.completed_at).not_to be_nil
        end
      end
    end
  end
end


text:
class PagesController < ApplicationController

  def preview
    @page = Page.new(slide_params[:pages_attributes].values.first)
    render layout: false
  end

end


text:
//= require_self
//= require spree/backend/handlebar_extensions
//= require spree/backend/variant_autocomplete
//= require spree/backend/taxon_autocomplete
//= require spree/backend/option_type_autocomplete
//= require spree/backend/user_picker
//= require spree/backend/product_picker
//= require spree/backend/option_value_picker
//= require spree/backend/taxons

/**
This is a collection of javascript functions and whatnot
under the spree namespace that do stuff we find helpful.
Hopefully, this will evolve into a propper class.
**/

jQuery(function($) {

  // Add some tips
  $('.with-tip').tooltip();

  $('.js-show-index-filters').click(function(){
    $(".filter-well").slideToggle();
    $(this).parents(".filter-wrap").toggleClass("collapsed");
    $("span.icon", $(this)).toggleClass("icon-chevron-down");
  });

  $(".js-collapse-sidebar").click(function(){
    $(".main-right-sidebar").toggleClass("collapsed");
    $("section.content").toggleClass("sidebar-collapsed");
    $("span.icon", $(this)).toggleClass("icon-chevron-right");
    $("span.icon", $(this)).toggleClass("icon-chevron-left");
  });

  $('#main-sidebar').find('[data-toggle="collapse"]').on('click', function()
    {
      if($(this).find('.icon-chevron-left').length == 1){
        $(this).find('.icon-chevron-left').removeClass('icon-chevron-left').addClass('icon-chevron-down');
      }
      else {
        $(this).find('.icon-chevron-down').removeClass('icon-chevron-down').addClass('icon-chevron-left');
      }
    }
  )

  // Sidebar nav toggle functionality
  var sidebar_toggle = $('#sidebar-toggle');

  sidebar_toggle.on('click', function(){
    var wrapper = $('#wrapper');
    var main    = $('#main-part');

    if(wrapper.hasClass('sidebar-minimized')){
      wrapper.removeClass('sidebar-minimized');
      main
        .removeClass('col-sm-12 col-md-12 sidebar-collapsed')
        .addClass('col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2');
      $.cookie('sidebar-minimized', 'false', { path: '/admin' });
    }
    else {
      wrapper.addClass('sidebar-minimized');
      main
        .removeClass('col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2')
        .addClass('col-sm-12 col-md-12 sidebar-collapsed');
      $.cookie('sidebar-minimized', 'true', { path: '/admin' });
    }
  });

  $('.sidebar-menu-item').mouseover(function(){
    if($('#wrapper').hasClass('sidebar-minimized')){
      $(this).addClass('menu-active');
      $(this).find('ul.nav').addClass('submenu-active');
    }
  });
  $('.sidebar-menu-item').mouseout(function(){
    if($('#wrapper').hasClass('sidebar-minimized')){
      $(this).removeClass('menu-active');
      $(this).find('ul.nav').removeClass('submenu-active');
    }
  });

  // TODO: remove this js temp behaviour and fix this decent
  // Temp quick search
  // When there was a search term, copy it
  $(".js-quick-search").val($(".js-quick-search-target").val());
  // Catch the quick search form submit and submit the real form
  $("#quick-search").submit(function(){
    $(".js-quick-search-target").val($(".js-quick-search").val());
    $("#table-filter form").submit();
    return false;
  });

  // Main menu active item submenu show
  var active_item = $('#sidebar').find('.selected');
  active_item.parent().addClass('in');
  active_item.parent().prev()
    .find('.icon-chevron-left')
    .removeClass('icon-chevron-left')
    .addClass('icon-chevron-down');

  // Replace ▼ and ▲ in sort_link with nicer icons
  $(".sort_link").each(function(){
    // Remove the   in the text
    var sort_link_text = $(this).text().replace('\xA0', '');

    if(sort_link_text.indexOf("▼") >= 0){
      $(this).text(sort_link_text.replace("▼",""));
      $(this).append('');
    } else if(sort_link_text.indexOf("▲") >= 0){
      $(this).text(sort_link_text.replace("▲",""));
      $(this).append('');
    }
  });

  // Clickable ransack filters
  $(".js-add-filter").click(function() {
    var ransack_field = $(this).data("ransack-field");
    var ransack_value = $(this).data("ransack-value");

    $("#" + ransack_field).val(ransack_value);
    $("#table-filter form").submit();
  });

  $(document).on("click", ".js-delete-filter", function() {
    var ransack_field = $(this).parents(".js-filter").data("ransack-field");

    $("#" + ransack_field).val('');
    $("#table-filter form").submit();
  });

  $(".js-filterable").each(function() {
    var $this = $(this);

    if ($this.val()) {
      var ransack_value, filter;
      var ransack_field = $this.attr("id");
      var label = $('label[for="' + ransack_field + '"]');

      if ($this.is("select")) {
        ransack_value = $this.find('option:selected').text();
      } else {
        ransack_value = $this.val();
      }

      label = label.text() + ': ' + ransack_value;
      filter = '' + label + '';

      $(".js-filters").append(filter).show();
    }
  });

  // Enable sidebar toggle
  $("[data-toggle='offcanvas']").click(function(e) {
    e.preventDefault();

    // If window is small enough, enable sidebar push menu
    if ($(window).width() <= 992) {
      $('.row-offcanvas').toggleClass('active');
      $('.left-side').removeClass("collapse-left");
      $(".right-side").removeClass("strech");
      $('.row-offcanvas').toggleClass("relative");
    } else {
      // Else, enable content streching
      $('.left-side').toggleClass("collapse-left");
      $(".right-side").toggleClass("strech");
    }
  });

  // Make flash messages dissapear
  setTimeout('$(".alert-auto-dissapear").slideUp()', 5000);

});

$.fn.visible = function(cond) { this[cond ? 'show' : 'hide' ]() };

show_flash = function(type, message) {
  var flash_div = $('.flash.' + type);
  if (flash_div.length == 0) {
    flash_div = $('
');
    $('#content').prepend(flash_div);
  }
  flash_div.html(message).show().delay(10000).slideUp();
}

// Apply to individual radio button that makes another element visible when checked
$.fn.radioControlsVisibilityOfElement = function(dependentElementSelector){
  if(!this.get(0)){ return  }
  showValue = this.get(0).value;
  radioGroup = $("input[name='" + this.get(0).name + "']");
  radioGroup.each(function(){
    $(this).click(function(){
      $(dependentElementSelector).visible(this.checked && this.value == showValue)
    });
    if(this.checked){ this.click() }
  });
}

handle_date_picker_fields = function(){
  $('.datepicker').datepicker({
    dateFormat: Spree.translations.date_picker,
    dayNames: Spree.translations.abbr_day_names,
    dayNamesMin: Spree.translations.abbr_day_names,
    firstDay: Spree.translations.first_day,
    monthNames: Spree.translations.month_names,
    prevText: Spree.translations.previous,
    nextText: Spree.translations.next,
    showOn: "focus"
  });

  // Correctly display range dates
  $('.date-range-filter .datepicker-from').datepicker('option', 'onSelect', function(selectedDate) {
    $(".date-range-filter .datepicker-to" ).datepicker( "option", "minDate", selectedDate );
  });
  $('.date-range-filter .datepicker-to').datepicker('option', 'onSelect', function(selectedDate) {
    $(".date-range-filter .datepicker-from" ).datepicker( "option", "maxDate", selectedDate );
  });
}

$(document).ready(function(){
  handle_date_picker_fields();
  $(".observe_field").on('change', function() {
    target = $(this).data("update");
    $(target).hide();
    $.ajax({ dataType: 'html',
             url: $(this).data("base-url")+encodeURIComponent($(this).val()),
             type: 'get',
             success: function(data){
               $(target).html(data);
               $(target).show();
             }
    });
  });

  var uniqueId = 1;
  $('.spree_add_fields').click(function() {
    var target = $(this).data("target");
    var new_table_row = $(target + ' tr:visible:last').clone();
    var new_id = new Date().getTime() + (uniqueId++);
    new_table_row.find("input, select").each(function () {
      var el = $(this);
      el.val("");
      el.prop("id", el.prop("id").replace(/\d+/, new_id))
      el.prop("name", el.prop("name").replace(/\d+/, new_id))
    })
    // When cloning a new row, set the href of all icons to be an empty "#"
    // This is so that clicking on them does not perform the actions for the
    // duplicated row
    new_table_row.find("a").each(function () {
      var el = $(this);
      el.prop('href', '#');
    })
    $(target).prepend(new_table_row);
  })

  $('body').on('click', '.delete-resource', function() {
    var el = $(this);
    if (confirm(el.data("confirm"))) {
      $.ajax({
        type: 'POST',
        url: $(this).prop("href"),
        data: {
          _method: 'delete',
          authenticity_token: AUTH_TOKEN
        },
        dataType: 'script',
        success: function(response) {
          el.parents("tr").fadeOut('hide', function() {
            $(this).remove();
          });
        },
        error: function(response, textStatus, errorThrown) {
          show_flash('error', response.responseText);
        }
      });
    }
    return false;
  });

  $('body').on('click', 'a.spree_remove_fields', function() {
    el = $(this);
    el.prev("input[type=hidden]").val("1");
    el.closest(".fields").hide();
    if (el.prop("href").substr(-1) == '#') {
      el.parents("tr").fadeOut('hide');
    }else if (el.prop("href")) {
      $.ajax({
        type: 'POST',
        url: el.prop("href"),
        data: {
          _method: 'delete',
          authenticity_token: AUTH_TOKEN
        },
        success: function(response) {
          el.parents("tr").fadeOut('hide');
        },
        error: function(response, textStatus, errorThrown) {
          show_flash('error', response.responseText);
        }

      })
    }
    return false;
  });

  $('body').on('click', '.select_properties_from_prototype', function(){
    $("#busy_indicator").show();
    var clicked_link = $(this);
    $.ajax({ dataType: 'script', url: clicked_link.prop("href"), type: 'get',
        success: function(data){
          clicked_link.parent("td").parent("tr").hide();
          $("#busy_indicator").hide();
        }
    });
    return false;
  });

  // Fix sortable helper
  var fixHelper = function(e, ui) {
      ui.children().each(function() {
          $(this).width($(this).width());
      });
      return ui;
  };

  $('table.sortable').ready(function(){
    var td_count = $(this).find('tbody tr:first-child td').length
    $('table.sortable tbody').sortable(
      {
        handle: '.handle',
        helper: fixHelper,
        placeholder: 'ui-sortable-placeholder',
        update: function(event, ui) {
          $("#progress").show();
          positions = {};
          $.each($('table.sortable tbody tr'), function(position, obj){
            reg = /spree_(\w+_?)+_(\d+)/;
            parts = reg.exec($(obj).prop('id'));
            if (parts) {
              positions['positions['+parts[2]+']'] = position;
            }
          });
          $.ajax({
            type: 'POST',
            dataType: 'script',
            url: $(ui.item).closest("table.sortable").data("sortable-link"),
            data: positions,
            success: function(data){ $("#progress").hide(); }
          });
        },
        start: function (event, ui) {
          // Set correct height for placehoder (from dragged tr)
          ui.placeholder.height(ui.item.height())
          // Fix placeholder content to make it correct width
          ui.placeholder.html("		")
        },
        stop: function (event, ui) {
          // Fix odd/even classes after reorder
          $("table.sortable tr:even").removeClass("odd even").addClass("even");
          $("table.sortable tr:odd").removeClass("odd even").addClass("odd");
        }

      });
  });

  $('a.dismiss').click(function() {
    $(this).parent().fadeOut();
  });

  window.Spree.advanceOrder = function() {
      $.ajax({
          type: "PUT",
          async: false,
          data: {
            token: Spree.api_key
          },
          url: Spree.url(Spree.routes.checkouts_api + "/" + order_number + "/advance")
      }).done(function() {
          window.location.reload();
      });
  }
});


text:
$(function () {

    if (typeof tags === 'undefined') {
        tags = []
    }
    $("#myTags").tagit({
        availableTags: tags,
        beforeTagAdded: function (event, ui) {
            var tagLabel = ui.tagLabel;
            if (tags.indexOf(tagLabel) > -1) {
                var form = $("form#new_order");
                if (tagLabel.includes('(group)'))
                    form.append($("<input name='groups[]' type='hidden' value='" + tagLabel.slice(0, tagLabel.indexOf('(')).trim() + "'>"))
                else
                    form.append($("<input name='users[]' type='hidden' value='" + ui.tagLabel + "'>"))
                $("#tag_err").html("")

            } else {
                $("#tag_err").html(ui.tagLabel + " isn't in your frindes or groups")
                $("#myTags").tagit("removeTagByLabel", ui.tagLabel);
            }
        }
    });

    $('#res_tab a').click(function (e) {
        e.preventDefault()
        $(this).tab('show')
    })
////////////////////////////////////////////////////////////////////
    var i = 0;
    var total = 0;
    var basket = $('.basket');
    var table = $("#order_tabel");

    //The function that is triggered once delete button is pressed
    $(".basket").delegate('a.delete', "click", function () {
        var $li = $(this).closest("li");
        data_id = $li.data('id');
        changeBtn(false, data_id);
        $li.remove();
        calcPrice();
        return false
    });
    table.delegate('button', 'click', function () {
        var $el = $(this);
        var row = $el.parents('tr');
        if (changeBtn($el)) {
            addBasket(basket, row)
        } else {
            basket.find('li[data-id=' + row.data('id') + ']').remove();
            calcPrice();
        }

    })
    basket.delegate('input.count', 'change  ', function () {
        calcPrice();
    })

    function calcPrice() {
        total =0;
        basket.find('ul li').each(function (k, val) {
            var item_price = $(val).find('span.price').text();
            var item_amount = $(val).find('input.count').val();
            total += parseFloat(item_amount) * parseFloat(item_price);
            console.log(item_price);
            console.log(item_amount);

        })
        $('#total_price').text(total);
    }

    function addBasket(basket, $ele) {
        var data_id = $ele.data('id');
        var price = $ele.data('price');
        var data_name = $ele.data('name');
        console.log(price);
        basket.find("ul").append('
'
            + '' + data_name + ''
            + '' + price + ''
            + '<input name="order_items[' + data_id + ']" class="count" value="1" type="text">'
            + '✕');
        i++;
        calcPrice();

    }

    function changeBtn($el, data_id) {
        if ($el == false) {
            $el = table.find('tr[data-id=' + data_id + ']').find('button')
        }
        if ($el.text().trim() == "order") {
            $el.find('span').text(" remove");
            $el.addClass("btn-danger");
            $el.removeClass("btn-default");
            return true;
        } else {
            $el.find('span').text(" order");
            $el.removeClass("btn-danger");
            $el.addClass("btn-default");
            return false;
        }
    }
});


text:
<!DOCTYPE html>

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>class TestPortspec - RDoc Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

    Home
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Defined In

test/portspec_test.rb

Parent

Test::Unit::TestCase

Methods

#setup

#teardown

#test_fail

Pages

LICENSE

README

USAGE

VERSION

created.rid

firescan.gemspec

Class and Module Index

Example

Firebind

Firebind::Client

Firebind::Portspec

Firebind::Scan

Firebind::ScanError

Firebind::ScanState

Firebind::SimpleProtocol

Firebind::TcpTransport

Firebind::Transport

Firebind::UdpTransport

Runner

TestPortspec

Tools

class TestPortspec

Public Instance Methods

          setup()

          click to toggle source

Called before every test method runs. Can be used to set up fixture
information.

# File test/portspec_test.rb, line 9
def setup
  # Do nothing
end

          teardown()

          click to toggle source

Called after every test method runs. Can be used to tear down fixture
information.

# File test/portspec_test.rb, line 16
def teardown
  # Do nothing
end

          test_fail()

          click to toggle source

Fake test

# File test/portspec_test.rb, line 21
def test_fail

  #fail('Not implemented')
end

[Validate]

Generated by RDoc 4.0.1.

Generated with the Darkfish Rdoc Generator 3.


text:
//
//  UIScrollView+MJRefreshGif.h
//  YuWa
//
//  Created by 黄佳峰 on 2016/10/31.
//  Copyright © 2016年 Shanghai DuRui Information Technology Company. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MJRefresh.h"

@interface UIScrollView (MJRefreshGif)
/**
 下拉刷新

 */
//+(MJRefreshGifHeader*)scrollRefreshGifHeaderwithRefreshBlock:(MJRefreshComponentRefreshingBlock)refreshBlock;
//
//+(void)setHeaderGIF:(MJRefreshGifHeader*)header WithImageName:(NSString*)imageName withImageCount:(NSInteger)imageCount withPullWay:(MJRefreshState)Brefresh;
//
//
///**
// 上拉刷新
// */
//+(MJRefreshAutoGifFooter*)scrollRefreshGifFooterWithRefreshBlock:(MJRefreshComponentRefreshingBlock)refreshBlock;
//+(void)setFooterGIF:(MJRefreshAutoGifFooter*)footer WithImageName:(NSString*)imageName withImageCount:(NSInteger)imageCount withPullWay:(MJRefreshState)Brefresh;

@end


text:
package org.olat.presentation.notification;

import java.util.Date;

import org.olat.presentation.framework.core.UserRequest;
import org.olat.presentation.framework.core.components.form.flexible.FormItemContainer;
import org.olat.presentation.framework.core.components.form.flexible.elements.DateChooser;
import org.olat.presentation.framework.core.components.form.flexible.impl.FormBasicController;
import org.olat.presentation.framework.core.components.form.flexible.impl.FormEvent;
import org.olat.presentation.framework.core.control.Controller;
import org.olat.presentation.framework.core.control.WindowControl;

/**
 * Initial Date: 15.03.2012 <br>
 *
 * @author Branislav Balaz
 */
public class NotificationDateChooserController extends FormBasicController {

    private DateChooser dateFromChooser;
    private final String label;

    public NotificationDateChooserController(final UserRequest ureq, final WindowControl wControl, final Date initDate, final String label) {
        super(ureq, wControl);
        this.label = label;
        initForm(ureq);
    }

    @Override
    protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
        dateFromChooser = uifactory.addDateChooser(label, "", formLayout);
        dateFromChooser.setDate(new Date());
        dateFromChooser.addActionListener(this, FormEvent.ONCHANGE);
    }

    @Override
    protected void formOK(UserRequest ureq) {
        // TODO Auto-generated method stub

    }

    @Override
    protected void doDispose() {
        // TODO Auto-generated method stub

    }

}


text:
/*jslint browser: true */
/*global tabOverride */

(function (tabOverride, document) {
    'use strict';

    // get references to the elements on the page
    var textarea = document.getElementById('txt'),
        checkboxEnableTabOverride = document.getElementById('tab_override_enabled'),
        inputTabSize = document.getElementById('tab_override_tab_size'),
        checkboxAutoIndent = document.getElementById('tab_override_auto_indent'),
        checkboxAltKeys = document.getElementById('tab_override_alt_keys'),

        // use cmd key on Mac and ctrl key everywhere else
        modKeys = [/mac/i.test(navigator.platform) ? 'meta' : 'ctrl'];

    // enable/disable Tab Override when the checkbox value changes
    checkboxEnableTabOverride.onchange = function () {
        tabOverride.set(textarea, this.checked);
    };
    // initialize Tab Override last

    // update the tab size setting when the number changes
    inputTabSize.onchange = function () {
        var value = this.value,
            tabSize;

        tabOverride.tabSize(parseInt(value, 10));
        tabSize = tabOverride.tabSize();

        // don't display a non-accepted value
        if (value && value !== tabSize.toString()) {
            this.value = tabSize || '';
        }
    };
    inputTabSize.onchange(); // initialize

    // toggle auto indent when the checkbox value changes
    checkboxAutoIndent.onchange = function () {
        tabOverride.autoIndent(this.checked);
    };
    checkboxAutoIndent.onchange(); // initialize

    // toggle custom key combinations
    checkboxAltKeys.onchange = function () {
        if (this.checked) {
            tabOverride.tabKey(221, modKeys).untabKey(219, modKeys);
        } else {
            tabOverride.tabKey(9).untabKey(9, ['shift']);
        }
    };
    checkboxAltKeys.onchange(); // initialize

    // initialize Tab Override
    checkboxEnableTabOverride.onchange();
}(tabOverride, document));


text:
// This file is part of the dune-gdt project:
//   https://github.com/dune-community/dune-gdt
// Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
//      or  GPL-2.0+ (http://opensource.org/licenses/gpl-license)
//          with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
//   Felix Schindler (2013 - 2018)
//   Kirsten Weber   (2013)
//   René Fritze     (2014, 2016, 2018)
//   René Milk       (2017)
//   Tobias Leibner  (2014, 2016 - 2018)

#warning This header is deprecated, use and include <dune/gdt/local/integrands/laplace.hh> instead!

#ifndef DUNE_GDT_LOCAL_INTEGRANDS_ELLIPTIC_HH
#  define DUNE_GDT_LOCAL_INTEGRANDS_ELLIPTIC_HH

#  include <dune/xt/common/memory.hh>
#  include <dune/xt/la/container/eye-matrix.hh>
#  include <dune/xt/functions/base/function-as-grid-function.hh>
#  include <dune/xt/functions/constant.hh>
#  include <dune/xt/functions/interfaces/grid-function.hh>

#  include "interfaces.hh"

namespace Dune {
namespace GDT {

/**
 * This class is deprecated, use LocalLaplaceIntegrand instead (10.08.2019)!
 * Given an inducing scalar function lambda and an inducing matrix-valued function kappa, computes
 * `lambda(x) * {[kappa(x) \nabla phi(x)] * \nabla psi(x)}` for all combinations of phi in the ansatz basis and psi in
 * the test basis.
 * If phi and psi are vector-valued, \nabla phi is the jacobian matrix and we are actually computing
 * `lambda(x) * {[kappa(x) (\nabla phi(x))^T] : (\nabla psi(x))^T}`, where ':' denotes the matrix scalar product.
 */
template <class E, size_t r = 1, class F = double>
class [[deprecated("Use LocalLaplaceIntegrand instead (10.08.2019)!")]] LocalEllipticIntegrand
  : public LocalBinaryElementIntegrandInterface<E, r, 1, F, F, r, 1, F>
{
  using BaseType = LocalBinaryElementIntegrandInterface<E, r, 1, F, F, r, 1, F>;
  using ThisType = LocalEllipticIntegrand;

public:
  using BaseType::d;
  using typename BaseType::DomainType;
  using typename BaseType::ElementType;
  using typename BaseType::LocalAnsatzBasisType;
  using typename BaseType::LocalTestBasisType;

  using DiffusionFactorType = XT::Functions::GridFunctionInterface<E, 1, 1, F>;
  using DiffusionTensorType = XT::Functions::GridFunctionInterface<E, d, d, F>;

  LocalEllipticIntegrand(const F& diffusion_factor = F(1),
                         const XT::Common::FieldMatrix<F, d, d>& diffusion_tensor =
                             XT::LA::eye_matrix<FieldMatrix<F, d, d>>(d, d))
    : BaseType()
    , diffusion_factor_(new XT::Functions::FunctionAsGridFunctionWrapper<E, 1, 1, F>(
          new XT::Functions::ConstantFunction<d, 1, 1, F>(diffusion_factor)))
    , diffusion_tensor_(new XT::Functions::FunctionAsGridFunctionWrapper<E, d, d, F>(
          new XT::Functions::ConstantFunction<d, d, d, F>(diffusion_tensor)))
    , local_diffusion_factor_(diffusion_factor_.access().local_function())
    , local_diffusion_tensor_(diffusion_tensor_.access().local_function())
  {}

  LocalEllipticIntegrand(const XT::Functions::FunctionInterface<d, 1, 1, F>& diffusion_factor,
                         const XT::Functions::FunctionInterface<d, d, d, F>& diffusion_tensor)
    : BaseType(diffusion_factor.parameter_type() + diffusion_tensor.parameter_type())
    , diffusion_factor_(new XT::Functions::FunctionAsGridFunctionWrapper<E, 1, 1, F>(diffusion_factor))
    , diffusion_tensor_(new XT::Functions::FunctionAsGridFunctionWrapper<E, d, d, F>(diffusion_tensor))
    , local_diffusion_factor_(diffusion_factor_.access().local_function())
    , local_diffusion_tensor_(diffusion_tensor_.access().local_function())
  {}

  LocalEllipticIntegrand(const DiffusionFactorType& diffusion_factor, const DiffusionTensorType& diffusion_tensor)
    : BaseType(diffusion_factor.parameter_type() + diffusion_tensor.parameter_type())
    , diffusion_factor_(diffusion_factor)
    , diffusion_tensor_(diffusion_tensor)
    , local_diffusion_factor_(diffusion_factor_.access().local_function())
    , local_diffusion_tensor_(diffusion_tensor_.access().local_function())
  {}

  LocalEllipticIntegrand(const ThisType& other)
    : BaseType(other)
    , diffusion_factor_(other.diffusion_factor_)
    , diffusion_tensor_(other.diffusion_tensor_)
    , local_diffusion_factor_(diffusion_factor_.access().local_function())
    , local_diffusion_tensor_(diffusion_tensor_.access().local_function())
  {}

  LocalEllipticIntegrand(ThisType && source) = default;

  std::unique_ptr<BaseType> copy_as_binary_element_integrand() const override final
  {
    return std::make_unique<ThisType>(*this);
  }

protected:
  void post_bind(const ElementType& ele) override
  {
#  ifndef NDEBUG
    if (!ele.geometry().affine())
      std::cerr << "Warning: integration order has to be increased for non-affine geometries!" << std::endl;
#  endif
    local_diffusion_factor_->bind(ele);
    local_diffusion_tensor_->bind(ele);
  }

public:
  int order(const LocalTestBasisType& test_basis,
            const LocalAnsatzBasisType& ansatz_basis,
            const XT::Common::Parameter& param = {}) const override final
  {
    return local_diffusion_factor_->order(param) + local_diffusion_tensor_->order(param) + test_basis.order(param)
           + ansatz_basis.order(param);
  }

  void evaluate(const LocalTestBasisType& test_basis,
                const LocalAnsatzBasisType& ansatz_basis,
                const DomainType& point_in_reference_element,
                DynamicMatrix<F>& result,
                const XT::Common::Parameter& param = {}) const override final
  {
    // prepare storage
    const size_t rows = test_basis.size(param);
    const size_t cols = ansatz_basis.size(param);
    if (result.rows() < rows || result.cols() < cols)
      result.resize(rows, cols);
    result *= 0;
    // evaluate
    test_basis.jacobians(point_in_reference_element, test_basis_grads_, param);
    ansatz_basis.jacobians(point_in_reference_element, ansatz_basis_grads_, param);
    const auto diffusion = local_diffusion_tensor_->evaluate(point_in_reference_element, param)
                           * local_diffusion_factor_->evaluate(point_in_reference_element, param)[0];
    // compute elliptic evaluation
    for (size_t ii = 0; ii < rows; ++ii)
      for (size_t jj = 0; jj < cols; ++jj)
        for (size_t rr = 0; rr < r; ++rr)
          result[ii][jj] += (diffusion * ansatz_basis_grads_[jj][rr]) * test_basis_grads_[ii][rr];
  } // ... evaluate(...)

private:
  const XT::Common::ConstStorageProvider<DiffusionFactorType> diffusion_factor_;
  const XT::Common::ConstStorageProvider<DiffusionTensorType> diffusion_tensor_;
  std::unique_ptr<typename DiffusionFactorType::LocalFunctionType> local_diffusion_factor_;
  std::unique_ptr<typename DiffusionTensorType::LocalFunctionType> local_diffusion_tensor_;
  mutable std::vector<typename LocalTestBasisType::DerivativeRangeType> test_basis_grads_;
  mutable std::vector<typename LocalAnsatzBasisType::DerivativeRangeType> ansatz_basis_grads_;
}; // class LocalEllipticIntegrand

} // namespace GDT
} // namespace Dune

#endif // DUNE_GDT_LOCAL_INTEGRANDS_ELLIPTIC_HH


text:
/**
 * Created by alecgorge on 4/8/15.
 */
///<reference path="../../typings/tsd.d.ts" />

import mysql = require('mysql2');
import Promise = require('bluebird');

var log = require('../logging/Logger').defaultLogger();
var c : mysql.IConnection = null;

if(!process.env.DATABASE_URL) {
    log.error("process.env.DATABASE_URL doesn't exist!");
}
else {
    var dsn:string = process.env.DATABASE_URL;

    c = mysql.createConnection(dsn);
    c.connect(function (err) {
        if (err) {
            log.error("Error connecting to %s: %s", dsn, err);
        }
        else {
            log.info("DB connected!");
        }
    });

    //c.config.namedPlaceholders = true;
}

export var db = c;


text:
* Updated minimum Ruby version to 2.6 ([#18443](https://github.com/googleapis/google-cloud-ruby/issues/18443))
#### Bug Fixes

* Fixed a crash when making certain long-running-operations status calls ([#18441](https://github.com/googleapis/google-cloud-ruby/issues/18441))

### 0.3.6 / 2022-01-11

#### Bug Fixes

* Honor quota project in auxiliary operations clients

#### Documentation

* Fix titles of documentation pages
* Remove some broken images and fix outdated content in authentication documentation

### 0.3.5 / 2021-11-08

#### Documentation

* Added simple code snippets to RPC method documentation

### 0.3.4 / 2021-10-28

#### Documentation

* Improved formatting of some of the reference docs

### 0.3.3 / 2021-08-11

#### Bug Fixes

* Honor client-level timeout configuration

### 0.3.2 / 2021-07-12

#### Documentation

* Clarify some language around authentication configuration

### 0.3.1 / 2021-06-17

#### Bug Fixes

* Support future 1.x versions of gapic-common

### 0.3.0 / 2021-03-08

#### Features

* Drop support for Ruby 2.4 and add support for Ruby 3.0

### 0.2.0 / 2021-02-03

#### Features

* Use self-signed JWT credentials when possible

### 0.1.1 / 2021-01-19

#### Documentation

* Timeout config description correctly gives the units as seconds.

### 0.1.0 / 2020-10-16

Initial release.


text:
(function(window, undefined){
  window.getComputedStylePropertyValue = function(el,cssProperty){
    el = el.domNode || el;
    if(!window.getComputedStyle){
      if(document.defaultView && document.defaultView.getComputedStyle){
        return document.defaultView.getComputedStyle.getPropertyValue(cssProperty);
      } else {
        var camelCasedCssProperty = getCamelCasedCssProperty(cssProperty);
        if(el.currentStyle){
          return el.currentStyle[camelCasedCssProperty];
        } else {
          return el.style[camelCasedCssProperty];
        }
      }
    } else{
      return window.getComputedStyle(el).getPropertyValue(cssProperty);
    }
  }

  function getCamelCasedCssProperty(cssProperty){
    return cssProperty.replace(/-([a-z])/g, function (g) { return g.charAt(1).toUpperCase() });
  }

})(this);

// Register SVG elements with IE so they can be styled
(function() {
  var svgElements = 'circle ellipse line polygon polyline rect g svg image path text'.split(' ');

  for (var i=0; i< svgElements.length; i++) {
    document.createElement(svgElements[i]);
  }
})();

function appendRaphael(parent) {
  var paper =  Raphael(parent, 0, 0),
      svg = document.createElement('svg');

  // Create the DOM node representing the SVG docuemnt
  // This will enable us to pull in styles from the stylesheets using
  // node.currentStyle
  svg.style.display = 'none';
  parent.appendChild(svg);

  return new R2D3Element(paper, svg);
}


text:
import { TestBed, inject } from '@angular/core/testing';

import { AlphabetService } from './alphabet.service';

describe('AlphabetService', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [AlphabetService]
    });
  });

  it('should be created', inject([AlphabetService], (service: AlphabetService) => {
    expect(service).toBeTruthy();
  }));
});