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

module Spec
  module Example
    describe 'ExampleGroupMethods' do
      with_sandboxed_options do
        attr_reader :example_group, :result, :reporter
        before(:each) do
          # See http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/525-arity-changed-on-partial-mocks#ticket-525-2
          method_with_three_args = lambda { |arg1, arg2, arg3| }
          options.formatters << mock("formatter", :null_object => true, :example_pending => method_with_three_args)
          options.backtrace_tweaker = mock("backtrace_tweaker", :null_object => true)
          @reporter = FakeReporter.new(@options)
          options.reporter = reporter
          @example_group = Class.new(ExampleGroupDouble) do
            describe("ExampleGroup")
            it "does nothing"
          end
        end

        after(:each) do
          ExampleGroupDouble.reset
        end

        ["describe","context"].each do |method|
          describe "##{method}" do
            describe "when creating an ExampleGroup" do
              before(:each) do
                @parent_example_group = Class.new(ExampleGroupDouble) do
                  example "first example" do; end
                end
                @child_example_group = @parent_example_group.__send__ method, "Child" do
                  example "second example" do; end
                end
              end

              it "should create a subclass of the ExampleGroup when passed a block" do
                @child_example_group.superclass.should == @parent_example_group
                options.example_groups.should include(@child_example_group)
              end

              it "should not inherit examples" do
                @child_example_group.should have(1).examples
              end

              it "records the spec path" do
                @child_example_group.location.should =~ /#{__FILE__}:#{__LINE__ - 15}/
              end
            end

            describe "when creating an example group with no description" do
              it "raises an ArgumentError" do
                lambda do
                  Class.new(ExampleGroupDouble).describe
                end.should raise_error(Spec::Example::NoDescriptionError, /No description supplied for example group declared on #{__FILE__}:#{__LINE__ - 1}/)
              end
            end

            describe "when creating a SharedExampleGroup" do
              before(:each) do
                @shared_example_group = @example_group.__send__ method, "A Shared ExampleGroup", :shared => true do; end
              end

              after(:each) do
                SharedExampleGroup.instance_eval{@shared_example_groups}.delete @shared_example_group
              end

              it "should create a SharedExampleGroup" do
                @shared_example_group.should_not be_nil
                SharedExampleGroup.find("A Shared ExampleGroup").should == @shared_example_group
              end
            end

          end
        end

        [:example, :specify, :it].each do |method|
          describe "##{method.to_s}" do
            it "should add an example" do
              lambda {
                @example_group.__send__(method, "")
              }.should change { @example_group.examples.length }.by(1)
            end

            describe "with no location supplied" do
              describe "creates an ExampleProxy" do
                before(:all) do
                  @example_group = Class.new(ExampleGroupDouble).describe("bar")
                  @example_proxy = @example_group.__send__(method, "foo", {:this => :that}) {}
                  @location = "#{__FILE__}:#{__LINE__ - 1}"
                end

                specify "with a description" do
                  @example_proxy.description.should == "foo"
                end

                specify "with options" do
                  @example_proxy.options.should == {:this => :that}
                end

                specify "with a default backtrace (DEPRECATED)" do
                  Spec.stub!(:deprecate)
                  @example_proxy.backtrace.should =~ /#{@location}/
                end

                specify "with a default location" do
                  @example_proxy.location.should =~ /#{@location}/
                end
              end
            end

            describe "with a location supplied" do
              describe "creates an ExampleProxy" do
                before(:all) do
                  @example_group = Class.new(ExampleGroupDouble).describe("bar")
                  @example_proxy = @example_group.__send__(method, "foo", {:this => :that}, "the location") {}
                end

                specify "with the supplied location as #backtrace (DEPRECATED)" do
                  Spec.stub!(:deprecate)
                  @example_proxy.backtrace.should == "the location"
                end

                specify "with the supplied location as #location" do
                  @example_proxy.location.should == "the location"
                end
              end
            end

          end
        end

        [:xexample, :xit, :xspecify].each do |method|
          describe "##{method.to_s}" do
            before(:each) do
              Kernel.stub!(:warn)
            end

            it "should NOT create an example" do
              lambda {
                @example_group.__send__(method,"")
              }.should_not change(@example_group.examples, :length)
            end

            it "should warn that the example is disabled" do
              Kernel.should_receive(:warn).with("Example disabled: foo")
              @example_group.__send__(method,"foo")
            end
          end
        end

        describe "#examples" do
          it "should have Examples" do
            example_group = Class.new(ExampleGroupDouble) do
              it "should exist" do; end
            end
            example_group.examples.length.should == 1
            example_group.examples.first.description.should == "should exist"
          end

          it "should not include methods that begin with test (only when TU interop is loaded)" do
            example_group = Class.new(ExampleGroupDouble) do
              def test_any_args(*args)
                true.should be_true
              end
              def test_something
                1.should == 1
              end
              def test
                raise "This is not a real test"
              end
              def testify
                raise "This is not a real test"
              end
              def should_something
                # forces the run
              end
            end

            example_group.examples.length.should == 1
            example_group.run(options).should be_true
          end

          it "should include methods that begin with should and has an arity of 0 in suite" do
            example_group = Class.new(ExampleGroupDouble) do
              def shouldCamelCase
                true.should be_true
              end
              def should_any_args(*args)
                true.should be_true
              end
              def should_something
                1.should == 1
              end
              def should_not_something
                1.should_not == 2
              end
              def should
                raise "This is not a real example"
              end
              def should_not
                raise "This is not a real example"
              end
            end
            example_group.should have(4).examples
            descriptions = example_group.examples.collect {|e| e.description}
            descriptions.should include(
              "shouldCamelCase",
              "should_any_args",
              "should_something",
              "should_not_something")
            descriptions.should_not include(
              "should",
              "should_not"
            )
          end

          it "should not include methods that begin with test_ and has an arity > 0 in suite" do
            example_group = Class.new(ExampleGroupDouble) do
              def test_invalid(foo)
                1.should == 1
              end
              def testInvalidCamelCase(foo)
                1.should == 1
              end
            end
            example_group.should have(:no).examples
          end

          it "should not include methods that begin with should_ and has an arity > 0 in suite" do
            example_group = Class.new(ExampleGroupDouble) do
              def should_invalid(foo)
                1.should == 2
              end
              def shouldInvalidCamelCase(foo)
                1.should == 3
              end
              def should_not_invalid(foo)
                1.should == 4
              end
              def should_valid
                1.should == 1
              end
            end
            example_group.should have(1).examples
            example_group.run(options).should be_true
          end

          it "should run should_methods" do
            example_group = Class.new(ExampleGroupDouble) do
              def should_valid
                1.should == 2
              end
            end
            example_group.should have(1).examples
            example_group.run(options).should be_false
          end
        end

        describe "#set_description" do
          attr_reader :example_group
          before do
            class << example_group
              public :set_description
            end
          end

          describe "given a String" do
            before(:each) do
              example_group.set_description("abc")
            end

            specify ".description should return the String passed into .set_description" do
              example_group.description.should == "abc"
            end

            specify ".described_type should provide nil as its type" do
              example_group.described_type.should be_nil
            end
          end

          describe "given a Class" do
            before(:each) do
              example_group.set_description(ExampleGroup)
            end

            specify ".description should return a String representation of that type (fully qualified) as its name" do
              example_group.description.should == "Spec::Example::ExampleGroup"
            end

            specify ".described_type should return the passed in type" do
              example_group.described_type.should == Spec::Example::ExampleGroup
            end
          end

          describe "given a String and a Class" do
            before(:each) do
              example_group.set_description("behaving", ExampleGroup)
            end

            specify ".description should return String then space then Type" do
              example_group.description.should == "behaving Spec::Example::ExampleGroup"
            end

            specify ".described_type should return the passed in type" do
              example_group.described_type.should == Spec::Example::ExampleGroup
            end
          end

          describe "given a Class and a String (starting with an alpha char)" do
            before(:each) do
              example_group.set_description(ExampleGroup, "behaving")
            end

            specify ".description should return the Type then space then String" do
              example_group.description.should == "Spec::Example::ExampleGroup behaving"
            end
          end

          describe "given a Class and a String (starting with a '.')" do
            before(:each) do
              example_group.set_description(ExampleGroup, ".behaving")
            end

            specify ".description should return the Type then String" do
              example_group.description.should == "Spec::Example::ExampleGroup.behaving"
            end
          end

          describe "#set_description(Class, String starting with #)" do
            before(:each) do
              example_group.set_description(ExampleGroup, "#behaving")
            end

            specify "should return the Class then String" do
              example_group.description.should == "Spec::Example::ExampleGroup#behaving"
            end
          end

          describe "#set_description(Class, String containing .)" do
            before(:each) do
              example_group.set_description(ExampleGroup, "calling a.b")
            end

            specify ".description should return the Type then space then String" do
              example_group.description.should == "Spec::Example::ExampleGroup calling a.b"
            end
          end

          describe "#set_description(Class, String containing #)" do
            before(:each) do
              example_group.set_description(ExampleGroup, "is #1")
            end

            specify ".description should return the Type then space then String" do
              example_group.description.should == "Spec::Example::ExampleGroup is #1"
            end
          end

          describe "#set_description(String, Type, String)" do
            before(:each) do
              example_group.set_description("A", Hash, "with one entry")
            end

            specify ".description should return the first String then space then Type then second String" do
              example_group.description.should == "A Hash with one entry"
            end
          end

          describe "#set_description(Hash representing options)" do
            before(:each) do
              example_group.set_description(:a => "b", :location => "blah")
            end

            it ".location should expand the passed in :location option passed into the constructor" do
              example_group.location.should == File.expand_path("blah")
            end

            it ".options should return all the options passed in" do
              example_group.options.should == {:a => "b", :location => "blah"}
            end

          end
        end

        describe "#description" do
          it "should return the same description instance for each call" do
            example_group.description.should eql(example_group.description)
          end

          it "should not add a space when description begins with #" do
            child_example_group = Class.new(example_group) do
              describe("#foobar", "Does something")
            end
            child_example_group.description.should == "ExampleGroup#foobar Does something"
          end

          it "should not add a space when description begins with ." do
            child_example_group = Class.new(example_group) do
              describe(".foobar", "Does something")
            end
            child_example_group.description.should == "ExampleGroup.foobar Does something"
          end

          it "should return the class name if nil" do
            example_group.set_description(nil)
            example_group.description.should =~ /Class:/
          end

          it "should return the class name if nil" do
            example_group.set_description("")
            example_group.description.should =~ /Class:/
          end

          it "is cached" do
            example_group.set_description("describe me")
            example_group.description.should be(example_group.description)
          end
        end

        describe "#description_parts" do
          it "should return an Array of the current class description args" do
            example_group.description_parts.should == [example_group.description]
          end

          it "should return an Array of the description args from each class in the hierarchy" do
            parent_example_group = Class.new(ExampleGroupDouble) do
              describe("Parent")
            end

            child_example_group = Class.new(parent_example_group)
            child_example_group.describe("Child", ExampleGroup)
            child_example_group.description.should_not be_empty

            grand_child_example_group = Class.new(child_example_group)
            grand_child_example_group.describe("GrandChild", ExampleGroup)
            grand_child_example_group.description.should_not be_empty

            grand_child_example_group.description_parts.should == [
              "Parent",
              "Child",
              Spec::Example::ExampleGroup,
              "GrandChild",
              Spec::Example::ExampleGroup
            ]
          end

          it "caches the description parts" do
            example_group.description_parts.should equal(example_group.description_parts)
          end
        end

        describe "#described_type" do
          it "should return passed in type" do
            child_example_group = Class.new(example_group) do
              describe Object
            end
            child_example_group.described_type.should == Object
          end

          it "should return #described_type of superclass when no passed in type" do
            parent_example_group = Class.new(ExampleGroupDouble) do
              describe Object, "#foobar"
            end
            child_example_group = Class.new(parent_example_group) do
              describe "not a type"
            end
            child_example_group.described_type.should == Object
          end

          it "is cached per example group" do
            klass = Class.new
            group = Class.new(ExampleGroupDouble) do
              describe(klass)
            end
            group.should_receive(:description_parts).once.and_return([klass])
            group.described_type
            group.described_type
          end
        end

        describe "#include" do
          it "should have accessible class methods from included module" do
            mod_method_called = false
            mod = Module.new do
              class_methods = Module.new do
                define_method :mod_method do
                  mod_method_called = true
                end
              end

              self.class.class_eval do
                define_method(:included) do |receiver|
                  receiver.extend class_methods
                end
              end
            end

            @example_group.__send__ :include, mod

            @example_group.mod_method
            mod_method_called.should be_true
          end
        end

        describe "#number_of_examples" do
          it "should count number of examples" do
            proc do
              @example_group.it("one") {}
              @example_group.it("two") {}
              @example_group.it("three") {}
              @example_group.it("four") {}
            end.should change {@example_group.number_of_examples}.by(4)
          end
        end

        describe "#class_eval" do
          it "should allow constants to be defined" do
            example_group = Class.new(ExampleGroupDouble) do
              FOO = 1
              it "should reference FOO" do
                FOO.should == 1
              end
            end
            success = example_group.run(options)
            success.should be_true
            Object.const_defined?(:FOO).should == false
          end
        end

        describe '#register' do
          after(:each) do
            Spec::Runner.options.remove_example_group example_group
          end
          it "should add ExampleGroup to set of ExampleGroups to be run" do
            Spec::Runner.options.add_example_group example_group
            options.example_groups.should include(example_group)
          end
        end

        describe '#remove_example_group' do
          before(:each) do
            Spec::Runner.options.add_example_group example_group
          end
          it "should remove ExampleGroup from set of ExampleGroups to be run" do
            Spec::Runner.options.remove_example_group example_group
            options.example_groups.should_not include(example_group)
          end
        end

        describe "#run" do
          describe "given an example group with at least one example" do
            it "should call add_example_group" do
              example_group = Class.new(ExampleGroupDouble) do
                example("anything") {}
              end
              reporter.should_receive(:add_example_group)
              example_group.run(options)
            end
          end

          describe "given an example group with no examples" do
            it "should NOT call add_example_group" do
              example_group = Class.new(ExampleGroupDouble) do end
              reporter.should_not_receive(:add_example_group)
              example_group.run(options)
            end
          end
        end

        describe "#matcher_class=" do
          it "should call new and matches? on the class used for matching examples" do
            example_group = Class.new(ExampleGroupDouble) do
              it "should do something" do end
              def self.specified_examples
                ["something"]
              end
              def self.to_s
                "TestMatcher"
              end
            end

            matcher = mock("matcher")
            matcher.should_receive(:matches?).with(["something"]).any_number_of_times

            matcher_class = Class.new
            matcher_class.should_receive(:new).with("TestMatcher", "should do something").and_return(matcher)

            begin
              ExampleGroupMethods.matcher_class = matcher_class

              example_group.run(options)
            ensure
              ExampleGroupMethods.matcher_class = ExampleMatcher
            end
          end
        end

        describe "#options" do
          it "should expose the options hash" do
            group = describe("group", :this => 'hash') {}
            group.options[:this].should == 'hash'
          end
        end

        describe "#before" do
          it "stores before(:each) blocks" do
            example_group = Class.new(ExampleGroupDouble) {}
            block = lambda {}
            example_group.before(:each, &block)
            example_group.before_each_parts.should include(block)
          end

          it "stores before(:all) blocks" do
            example_group = Class.new(ExampleGroupDouble) {}
            block = lambda {}
            example_group.before(:all, &block)
            example_group.before_all_parts.should include(block)
          end

          it "stores before(:suite) blocks" do
            example_group = Class.new(ExampleGroupDouble) {}
            parts = []
            ExampleGroupMethods.stub!(:before_suite_parts).and_return(parts)
            block = lambda {}
            example_group.before(:suite, &block)
            example_group.before_suite_parts.should include(block)
          end
        end

        describe "#after" do
          it "stores after(:each) blocks" do
            example_group = Class.new(ExampleGroupDouble) {}
            block = lambda {}
            example_group.after(:each, &block)
            example_group.after_each_parts.should include(block)
          end

          it "stores after(:all) blocks" do
            example_group = Class.new(ExampleGroupDouble) {}
            block = lambda {}
            example_group.after(:all, &block)
            example_group.after_all_parts.should include(block)
          end

          it "stores after(:suite) blocks" do
            example_group = Class.new(ExampleGroupDouble) {}
            parts = []
            ExampleGroupMethods.stub!(:after_suite_parts).and_return(parts)
            block = lambda {}
            example_group.after(:suite, &block)
            example_group.after_suite_parts.should include(block)
          end
        end

        describe "#run_before_all" do
          it "does not create an instance if before_all_parts are empty" do
            example_group = Class.new(ExampleGroupDouble) { example("one example") {} }
            example_group.should_not_receive(:new)
            example_group.__send__ :run_before_all, nil
          end
        end

        describe "#run_after_all" do
          it "does not create an instance if after_all_parts are empty" do
            example_group = Class.new(ExampleGroupDouble) { example("one example") {} }
            example_group.should_not_receive(:new)
            example_group.__send__ :run_after_all, true, {}, nil
          end
        end

        describe "#examples_to_run" do
          it "runs only the example identified by a line number" do
            example_group = Class.new(ExampleGroupDouble).describe("this") do
              it { 3.should == 3 }
              it "has another example which raises" do
                raise "this shouldn't have run"
              end
            end
            options.examples << :ignore
            options.line_number = __LINE__ - 6
            options.files << __FILE__
            example_group.run(options).should be_true
          end

          it "runs the example identified by a line number even if it's not the example line number" do
            example_group = Class.new(ExampleGroupDouble).describe("this") do

              it { raise "foo" }

            end
            options.examples << :ignore
            options.line_number = __LINE__ - 3
            options.files << __FILE__
            example_group.run(options).should be_false
          end

          it "runs all the examples in the group " do
            first_example_ran  = false
            second_example_ran = false
            example_group = Class.new(ExampleGroupDouble).describe("this") do

              it { first_example_ran  = true }
              it { second_example_ran = true }

            end
            options.line_number = __LINE__ - 6
            options.files << __FILE__
            options.examples << :ignore
            example_group.run(options)
            first_example_ran.should be_true
            second_example_ran.should be_true
          end

          it "doesn't run any examples in another group" do
            example_ran  = false
            example_group_1 = Class.new(ExampleGroupDouble).describe("this") do
              it "ignore" do
                example_ran = true
              end
            end
            example_group_2 = Class.new(ExampleGroupDouble).describe("that") do
            end
            options.examples << :ignore
            options.line_number = __LINE__ - 3
            options.files << __FILE__
            example_group_1.run(options)
            example_group_2.run(options)
            example_ran.should be_false
          end
        end

      end
    end
  end
end


text:
<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/nav_drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Main Content -->
    <com.andrewreitz.onthisday.ui.motar.core.MainView
        android:id="@+id/container"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"
        />

    <!-- Navigation Drawer -->
    <FrameLayout
        android:id="@+id/navigation_drawer"
        android:layout_width="@dimen/navigation_drawer_width"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        />

</android.support.v4.widget.DrawerLayout>

redpajama_set_name: RedPajamaGithub


text:
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shouldly.DifferenceHighlighting
{
    /// <summary>
    /// Highlights differences between IEnumerables of the same type,
    /// marking differences with asterisks
    /// </summary>
    internal class EnumerableDifferenceHighlighter : IDifferenceHighlighter
    {
        private const int MaxElementsToShow = 1000;
        private readonly ItemDifferenceHighlighter _itemDifferenceHighlighter;

        public EnumerableDifferenceHighlighter()
        {
            _itemDifferenceHighlighter = new ItemDifferenceHighlighter();
        }

        public bool CanProcess(IShouldlyAssertionContext context)
        {
            return context.Expected != null && context.Actual != null
                   && (context.Expected is IEnumerable)
                   && !(context.Expected is string)
                   && (context.Actual is IEnumerable)
                   && !(context.Actual is string);
        }

        public string HighlightDifferences(IShouldlyAssertionContext context)
        {
            var actual = context.Actual as IEnumerable;
            var expected = context.Expected as IEnumerable;
            if (CanProcess(context))
            {
                var actualList = actual.Cast<object>();
                var expectedList = expected.Cast<object>();

                var highestCount = actualList.Count() > expectedList.Count() ? actualList.Count() : expectedList.Count();

                return HighlightDifferencesBetweenLists(actualList, expectedList, highestCount);
            }

            return actual.ToStringAwesomely();
        }

        private string HighlightDifferencesBetweenLists(IEnumerable<object> actualList, IEnumerable<object> expectedList, int highestListCount)
        {
            var returnMessage = new StringBuilder("[");

            for (var listItem = 0; listItem < highestListCount; listItem++)
            {
                if (listItem >= MaxElementsToShow)
                {
                    returnMessage.Append("...");
                    break;
                }

                returnMessage.Append(GetComparedItemString(actualList, expectedList, listItem));

                if (listItem < highestListCount - 1)
                {
                    returnMessage.Append(", ");
                }
            }

            return returnMessage.Append("]").ToString();
        }

        private string GetComparedItemString(IEnumerable<object> actualList, IEnumerable<object> expectedList, int itemPosition)
        {
            if (expectedList.Count() <= itemPosition)
            {
                return _itemDifferenceHighlighter.HighlightItem(actualList.ElementAt(itemPosition).ToStringAwesomely());
            }

            if (actualList.Count() <= itemPosition)
            {
                return ItemDifferenceHighlighter.HighlightCharacter;
            }

            if (Is.Equal(actualList.ElementAt(itemPosition), expectedList.ElementAt(itemPosition)))
            {
                return actualList.ElementAt(itemPosition).ToStringAwesomely();
            }

            return _itemDifferenceHighlighter.HighlightItem(actualList.ElementAt(itemPosition).ToStringAwesomely());
        }
    }
}


text:
@extends('layouts/default')

{{-- Web site Title --}}
@section('title')
Account
@parent
@stop

{{-- page level styles --}}
@section('header_styles')
@stop

{{-- Content --}}
@section('content')

            @if (Session::has('error_message'))

{{ Session::get('error_message') }}

            @endif

            {{ Form::model($model, array('route' => array('accounts.update', $model->id), 'method' => 'put', 'class' => 'form-horizontal form-bordered')) }}

Account No
{{ Form::text('account_no', null, array('class' => 'form-control', 'readonly' => 'readonly')) }}

Name
{{ Form::text('name', null, array('class' => 'form-control', 'readonly' => 'readonly')) }}

Type
{{ Form::text('type', null, array('class' => 'form-control', 'readonly' => 'readonly')) }}

Parent Id
{{ Form::text('parent_id', null, array('class' => 'form-control', 'readonly' => 'readonly')) }}

Level
{{ Form::text('level', null, array('class' => 'form-control', 'readonly' => 'readonly')) }}

Is Parent
{{ Form::text('is_parent', null, array('class' => 'form-control', 'readonly' => 'readonly')) }}

Normal Balance
{{ Form::text('normal_balance', null, array('class' => 'form-control', 'readonly' => 'readonly')) }}

                             @lang('button.back')

            {{ Form::close() }}

@stop

{{-- page level scripts --}}
@section('footer_scripts')
@stop


text:
package org.apache.storm.utils;

/**
 * This interface is implemented by classes, instances of which can be passed into certain Util functions which test some collection for
 * elements matching the IPredicate. (IPredicate.test(...) == true)
 */
public interface IPredicate<T> {
    boolean test(T obj);
}


text:
const Gettext = imports.gettext;
const Gio = imports.gi.Gio;

const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;

/**
 * initTranslations:
 * @domain: (optional): the gettext domain to use
 *
 * Initialize Gettext to load translations from extensionsdir/locale.
 * If @domain is not provided, it will be taken from metadata['gettext-domain']
 */
function initTranslations(domain) {
	let extension = ExtensionUtils.getCurrentExtension();

	domain = domain || extension.metadata['gettext-domain'];

	// check if this extension was built with "make zip-file", and thus
	// has the locale files in a subfolder
	// otherwise assume that extension has been installed in the
	// same prefix as gnome-shell
	let localeDir = extension.dir.get_child('locale');
	if (localeDir.query_exists(null))
		Gettext.bindtextdomain(domain, localeDir.get_path());
	else
		Gettext.bindtextdomain(domain, Config.LOCALEDIR);
}

/**
 * getSettings:
 * @schema: (optional): the GSettings schema id
 *
 * Builds and return a GSettings schema for @schema, using schema files
 * in extensionsdir/schemas. If @schema is not provided, it is taken from
 * metadata['settings-schema'].
 */
function getSettings(schema) {
	let extension = ExtensionUtils.getCurrentExtension();

	schema = schema || extension.metadata['settings-schema'];

	const GioSSS = Gio.SettingsSchemaSource;

	// check if this extension was built with "make zip-file", and thus
	// has the schema files in a subfolder
	// otherwise assume that extension has been installed in the
	// same prefix as gnome-shell (and therefore schemas are available
	// in the standard folders)
	let schemaDir = extension.dir.get_child('schemas');
	let schemaSource;
	if (schemaDir.query_exists(null))
		schemaSource = GioSSS.new_from_directory(schemaDir.get_path(),
			GioSSS.get_default(),
			false);
	else
		schemaSource = GioSSS.get_default();

	let schemaObj = schemaSource.lookup(schema, true);
	if (!schemaObj)
		throw new Error('Schema ' + schema + ' could not be found for extension '
			+ extension.metadata.uuid + '. Please check your installation.');

	return new Gio.Settings({settings_schema: schemaObj});
}


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

<title>org.opencv.calib3d</title>
<meta name="date" content="2015-03-04">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

org.opencv.calib3d

Classes

Calib3d

StereoBM

StereoSGBM


text:
import { ATTRIBUTE } from 'config/types';
import runloop from 'src/global/runloop';
import Input from './Input';
import { isBindable } from '../binding/selectBinding';
import createItem from '../../createItem';
import Fragment from '../../../Fragment';

export default class Textarea extends Input {
  constructor(options) {
    const template = options.template;

    options.deferContent = true;

    super(options);

    // check for single interpolator binding
    if (!this.attributeByName.value) {
      if (template.f && isBindable({ template })) {
        (this.attributes || (this.attributes = [])).push(
          createItem({
            owner: this,
            template: { t: ATTRIBUTE, f: template.f, n: 'value' },
            up: this.up
          })
        );
      } else {
        this.fragment = new Fragment({
          owner: this,
          cssIds: null,
          template: template.f
        });
      }
    }
  }

  bubble() {
    if (!this.dirty) {
      this.dirty = true;

      if (this.rendered && !this.binding && this.fragment) {
        runloop.scheduleTask(() => {
          this.dirty = false;
          this.node.value = this.fragment.toString();
        });
      }

      this.up.bubble(); // default behaviour
    }
  }
}


text:
Acesso Rápido

Quero fazer um curso

Quero viajar

Quero comprar equipamentos

Principais Categorias

                            {{categoria.nome}}

{{subcategoria.nome}}

Fique por dentro

Receba diretamente em seu e-mail novidades e promoções.

Nome: <input type="text" name="nome" value=""/>

E-mail: <input type="text" name="nome" value=""/>

Enviar

                    <flex-slider slide="slide in slides"
                        animation="fade" slideshow="true" slideshow-speed="5000"
                        animation-speed="2000" control-nav="false" direction-nav="false">

                    </flex-slider>

Bermuda de Neoprene Mormaii Triathlon Cinza - Mormaii

                                Televendas

                                (11)
3978-6277

                                Preço

                                R${symbol_dollar} 209,00

                                ou 10x R${symbol_dollar} 20,90
sem acréscimo

                                IR À LOJA

                                COMPRAR AGORA

Competition 35mm Tamanho 6 Preto Preto - Nautika Cod: NA511A70QZLMOB

                                Preço

                                R${symbol_dollar} 807,20

                                ou 12x R${symbol_dollar} 67,27
sem acréscimo

                                IR À LOJA

Bermuda de Neoprene Mormaii Triathlon Cinza - Mormaii

                                Televendas

                                (11)
3978-6277

                                Preço

                                R${symbol_dollar} 209,00

                                ou 10x R${symbol_dollar} 20,90
sem acréscimo

                                IR À LOJA

                                COMPRAR AGORA

Paginas:

1

2

3

4

                <flex-slider slide="logo in logos"
                    animation="slide" slideshow="false" slideshow-speed="3000" animation-loop="false"
                    item-width="250" item-margin="0" control-nav="false" direction-nav="true"
                    prev-text="" next-text="">

                </flex-slider>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace loop_statements
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Ohjelma laskee kertoman. Anna luku, jonka kertoma lasketaan.");
            string userInput = Console.ReadLine();
            int number = int.Parse(userInput);
            int i = 0;
            int f = 1;

            if (number < 0)
            {
                Console.WriteLine("Vastaus: Määrittelemätön.");
            }
            else
            {
                do
                {
                    i = i + 1;
                    f = f * i;
                } while (i < number);

                Console.WriteLine($"\tSyötit: {number}\n\tVastaus: {f}");
            }
            Console.ReadKey();
        }
    }
}


text:
<?xml version="1.0" ?>
<!-- JSONTopicMap properties
	20140312 jp2: latest
	-->

<properties>

	<!--
		ShouldBootstrap:
			Yes = test for bootstrap the topic map
			No = do not test for bootstrap
		Only one config-props.xml file should say "Yes" in
			an installation; typically on the SolrAgentFramework that includes
			the MergeAgent. Other installations of SolrAgentFramework
			in the area or network should say "No".
			It is unlikely that there will be problems, the probability
			that two agents, while booting, will decide to begin the
			bootstrap process at the same time is not nil.
	 -->
	<parameter name="ShouldBootstrap" value="Yes" />

	<!-- MergeListener uses a ServerSocket which is blocking.
		If there are no listeners, it will block listening.
		Use 'No' if no listeners are engages, otherwise, 'Yes' -->
	<parameter name="MergeListenerPropagate" value="No" />

	<!--
		Allows for a plug-in dataprovider
		 -->
	<parameter name="DataProviderClass" value = "org.topicquests.topicmap.json.persist.JSONDocStoreTopicMapProvider" />

	<!--
		Allows for plugin IVirtualizer
		 -->
	<parameter name="VirtualizerClass" value = "org.topicquests.topicmap.json.merge.DefaultVirtualizer" />

	<!--
		The core TopicQuests topic map platform has an internal merge function which
		is plug-in swappable. "MergeImplementation" is the key to get the
		classpath (value) for that object
	 -->
	<parameter name="MergeImplementation" value="org.topicquests.solr.merge.MergeBean" />

	<!--
		AgentBehavior value is a string which determines certain behaviors.
		There are presently two types of behaviours:
			"harvest"  where the system stays tightly coupled with Solr update events
			"model" where the system watches other SolrAgentEnvironment instances
				for requests for models or results
		Behaviors are defined in IAgentFrameworkBehavior
			though it might be possible to make the behavior extensible such
			that new behaviors can be "plugged in" by way of the agents
			themselves.
	 -->
	<parameter name="AgentBehavior" value="harvest" />

	<!--
		AgentName gives this agent a unique identity when talking to
		SolrAgentCoordinator(s). The string can be anything, just so long as it is
		unique in a society of agents all polling the same blackboard.
	 -->
	<parameter name="AgentName" value="94026" />

	<!--
		This platform includes an instance of SemiSpace blackboard (tuplespace).
		It needs a unique name for its Tracer log
	 -->
	<parameter name="SemiSpaceName" value="SemiSpace94026" />

	<!-- number of nodes cached internally  -->
	<parameter name="MapCacheSize" value="1024" />

	<!--
		port for the TupleSpaceConnector
		used in AgentEnvironment
	 -->
	<parameter name="TuplespacePort" value="2930" /> <!-- CHANGE ME -->
	<!--
		server for the TupleSpaceConnector
		NOTE: if this system must listen to multiple instances of
		SolrAgentCoordinator, then there may be different instances
		of this parameter with slightly different name and value
		used in AgentEnvironment
	 -->
	<parameter name="TuplespaceServer" value="localhost" /> <!-- CHANGE ME -->

</properties>


text:
module Sinatra
  module Plugins
    module CAS
      OPTIONS = {
        :enabled         => true,
        :cas_server_url  => nil,
        :session_timeout => 14400
      }
    end
  end
end

module Sinatra
  module Plugins
    module CAS
      helpers do
        def login_required?
          return false if request.env['REQUEST_URI'] =~ /^\/extjs\/|^\/js\/|^\/css\//
          return false if request.env['PATH_INFO'] =~ /.css$|.jpg$|.png$|.gif$|.json$/
          return true
        end

        def get_serice_url
          surl = (request.env['rack.url_scheme'] + "://"+request.env['HTTP_HOST'] + request.env['REQUEST_URI'])
          surl = surl.gsub(/service=[^&]*[&]?/,'').gsub(/ticket=[^&]*[&]?/,'').gsub(/logout?/,'').gsub(/logout/,'')
          surl.gsub(/\?$/,'')
        end

        def logout_url
          client = CASClient::Client.new({:cas_base_url => Plugins::CAS::OPTIONS[:cas_server_url]})
          client.logout_url(get_serice_url,get_serice_url)
        end

        def logout
          session.delete :cas_username
          redirect logout_url
        end

        def login
          if ! login_required? && ! Plugins::CAS::OPTIONS[:enabled]
            return nil
          end
          client = CASClient::Client.new({:cas_base_url => Plugins::CAS::OPTIONS[:cas_server_url]})
          caslogin_url = client.add_service_to_login_url(get_serice_url)
          params = nested_params(request.params)
          if params[:ticket]
            if params[:ticket] =~ /^PT-/
              st = CASClient::ProxyTicket.new(params[:ticket], get_serice_url, params[:renew])
            else
              st = CASClient::ServiceTicket.new(params[:ticket], get_serice_url, params[:renew])
            end
            client.validate_service_ticket(st)
            if st.is_valid?
              yield st.response.user if block_given?
              params[:cas_username] = st.response.user
              session[:cas_username] = st.response.user
              session[:cas_last_valid_ticket] = Time.now.to_i
              redirect get_serice_url
            else
              redirect caslogin_url
            end
          else
            if session[:cas_username]
              session[:cas_last_valid_ticket] = Time.now.to_i unless session.has_key? :cas_last_valid_ticket
              time_ago = Time.now.to_i - session[:cas_last_valid_ticket]
              if time_ago > 14400
                session.delete :cas_username
                redirect caslogin_url
              else
                session[:created_at] = Time.now.to_i
                params.merge!(session)
              end
            else
              # go ahead and redirect to the cas
              redirect caslogin_url
            end
          end
          @cas_username = params[:cas_username]
        end
      end
    end
  end
end

Sinatra::Base.send(:include, Sinatra::Plugins::CAS)


text:
namespace Cosmos.IL2CPU.Plugs.Diagnostics {
	[Plug(Target = typeof(global::System.Diagnostics.Debugger))]
	public static class DebuggerImpl {
		public static void Break() {
            // leave empty, this is handled by a special case..
		}
	}
}


text:
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">

    <key>startbootstrap</key>

    <view>ClientWebsiteBundle:templates:startbootstrap</view>
    <controller>SuluWebsiteBundle:Default:index</controller>
    <cacheLifetime>2400</cacheLifetime>

    <meta>
        <title lang="de">Start Bootstrap Theme</title>
        <title lang="en">Start Bootstrap Theme</title>
    </meta>

    <properties>

            <properties>

                <property name="profile_image" type="media_selection" mandatory="true">
                    <meta>
                        <title lang="de">Titel</title>
                        <title lang="en">Profile Image</title>
                    </meta>
                    <params>
                        <param name="headline" value="true"/>
                    </params>

                    <tag name="sulu.search.field" role="image" index="false"/>
                </property>

                <property name="title" type="text_line" mandatory="true">
                    <meta>
                        <title lang="de">Titel</title>
                        <title lang="en">Title</title>
                    </meta>
                    <params>
                        <param name="headline" value="true"/>
                    </params>

                    <tag name="sulu.rlp.part"/>
                </property>

                <property name="skills" type="text_line" mandatory="true">
                    <meta>
                        <title lang="de">Titel</title>
                        <title lang="en">Skills</title>
                    </meta>
                    <params>
                        <param name="headline" value="true"/>
                    </params>

                    <tag name="sulu.rlp.part"/>
                </property>

                <property name="url" type="resource_locator" mandatory="true">
                    <meta>
                        <title lang="de">Adresse</title>
                        <title lang="en">Resourcelocator</title>
                    </meta>

                    <tag name="sulu.rlp"/>
                </property>
            </properties>

        <property name="portfolio_images" type="media_selection">
            <tag name="sulu.search.field" role="image" index="false"/>
            <meta>
                <title lang="de">Bilder</title>
                <title lang="en">Portfolio Images</title>
            </meta>
        </property>

            <meta>
                <title lang="de">Inhalt</title>
                <title lang="en">Content</title>

                <info_text lang="de">Bereich für den Inhalt</info_text>
                <info_text lang="en">Content Section</info_text>
            </meta>
            <properties>
                <property name="about" type="text_editor">
                    <meta>
                        <title lang="de">Artikel</title>
                        <title lang="en">About</title>
                    </meta>

                    <params>
                        <param name="link" value="true"/>
                        <param name="table" value="true"/>
                        <param name="height" value="100"/>
                        <param name="max_height" value="500"/>
                        <param name="paste_from_word" value="true"/>
                        <param name="extra_allowed_content"
                               value="img(*)[*]; span(*)[*]; div(*)[*]; iframe(*)[*]; script(*)[*]"/>
                    </params>
                </property>

                <block name="block"
                       default-type="editor"
                       minOccurs="2"
                       maxOccurs="10"
                       mandatory="true">
                    <meta>
                        <title lang="de">Block</title>
                        <title lang="en">Block</title>
                    </meta>
                    <types>
                        <type name="editor">
                            <meta>
                                <title lang="de">Texteditor</title>
                                <title lang="en">Text editor</title>
                            </meta>
                            <properties>
                                <property name="title" type="text_line" mandatory="true">
                                    <meta>
                                        <title lang="de">Titel</title>
                                        <title lang="en">Title</title>
                                    </meta>
                                </property>
                                <property name="article" type="text_editor" mandatory="true">
                                    <meta>
                                        <title lang="de">Artikel</title>
                                        <title lang="en">Article</title>
                                    </meta>
                                </property>
                            </properties>
                        </type>
                        <type name="images">
                            <meta>
                                <title lang="de">Bilder</title>
                                <title lang="en">Images</title>
                            </meta>
                            <properties>
                                <property name="title" type="text_line" mandatory="true">
                                    <meta>
                                        <title lang="de">Titel</title>
                                        <title lang="en">Title</title>
                                    </meta>
                                </property>
                                <property name="logos" type="media_selection">
                                    <meta>
                                        <title lang="de">Bilder</title>
                                        <title lang="en">Images</title>
                                    </meta>
                                </property>
                                <property name="article" type="text_editor" mandatory="true">
                                    <meta>
                                        <title lang="de">Artikel</title>
                                        <title lang="en">Article</title>
                                    </meta>
                                </property>
                            </properties>
                        </type>
                        <type name="textarea">
                            <meta>
                                <title lang="de">Texteingabe</title>
                                <title lang="en">Text area</title>
                            </meta>
                            <properties>
                                <property name="title" type="text_line" mandatory="true">
                                    <meta>
                                        <title lang="de">Titel</title>
                                        <title lang="en">Title</title>
                                    </meta>
                                </property>
                                <property name="article" type="text_area" mandatory="true">
                                    <meta>
                                        <title lang="de">Artikel</title>
                                        <title lang="en">Article</title>
                                    </meta>
                                </property>
                            </properties>
                        </type>
                        <type name="title_only">
                            <meta>
                                <title lang="de">Nur Titel</title>
                                <title lang="en">Title Only</title>
                            </meta>
                            <properties>
                                <property name="title" type="text_line" mandatory="true">
                                    <meta>
                                        <title lang="de">Titel</title>
                                        <title lang="en">Title</title>
                                    </meta>
                                </property>
                            </properties>
                        </type>
                    </types>
                </block>
            </properties>

        <property name="pages" type="smart_content">
            <meta>
                <title lang="en">Smart Content</title>
            </meta>

            <params>
                <param name="properties" type="collection">
                    <param name="title" value="title"/>
                    <param name="description" value="excerpt.description"/>
                </param>
                <param name="present_as" type="collection">
                    <param name="one">
                        <meta>
                            <title lang="en">One column</title>
                        </meta>
                    </param>
                    <param name="two">
                        <meta>
                            <title lang="en">Two column</title>
                        </meta>
                    </param>
                </param>
            </params>
        </property>

    </properties>
</template>


text:
import { createStore, combineReducers, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';

import * as reducers from '../reducer/index';

const store = createStore(
  combineReducers(reducers),
  applyMiddleware(thunk)
);

export default store;


text:
package com.webpagebytes.cms.engine;

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

import com.webpagebytes.cms.WPBFileInfo;
import com.webpagebytes.cms.WPBFilePath;

public class WPBDefaultCloudFileInfo implements WPBFileInfo {
	private WPBFilePath cloudFile;
	private String contentType;
	private Map<String, String> customProperties;
	private long size;
	private String md5;
	private long crc32;
	private long creationDate;

	public WPBDefaultCloudFileInfo(WPBFilePath cloudFile,
							String contentType,
							boolean fileExists,
							long size,
							String md5,
							long crc32,
							long creationDate) {
		this.cloudFile = cloudFile;
		this.contentType = contentType;
		this.size = size;
		this.crc32 = crc32;
		this.creationDate = creationDate;
		this.md5 = md5;
		customProperties = new HashMap<String, String>();
	}

	public WPBFilePath getFilePath() {
		return cloudFile;
	}

	public long getSize()
	{
		return size;
	}
	public String getContentType() {
		return contentType;
	}
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	public Map<String, String> getCustomProperties() {
		return customProperties;
	}
	public void setCustomProperties(Map<String, String> customProperties) {
		this.customProperties = customProperties;
	}
	public void setProperty(String name, String value)
	{
		customProperties.put(name, value);
	}
	public String getProperty(String name)
	{
		return customProperties.get(name);
	}

	public String getMd5() {
		return md5;
	}

	public long getCrc32() {
		return crc32;
	}

	public long getCreationDate() {
		return creationDate;
	}

}


text:
package scales.component

import org.scalajs.dom.{ Element, document }
import org.scalajs.dom.html.Div

import com.greencatsoft.greenlight.TestSuite

import scales.dom.Polyfill.CustomElements

object AttributeChangeAwareTest extends TestSuite {

  implicit val doc = document

  "AttributeChangeAware.onAttributeChange" should "be invoked when value of an attribute is changed" in {
    case class Change(name: String, oldValue: Any, newValue: Any, element: Element)

    var lastChange: Option[Change] = None

    @name("attribute-change-test-1")
    class HellaComponent extends Component[Div] with AttributeChangeAware[Div] {

      override def onAttributeChange(name: String, oldValue: Any, newValue: Any, element: Div) {
        super.onAttributeChange(name, oldValue, newValue, element)

        lastChange = Some(Change(name, oldValue, newValue, element))
      }
    }

    val component = ComponentRegistry.register[HellaComponent].apply()
    val element = component.element

    CustomElements.takeRecords()

    lastChange should be (empty)

    element.setAttribute("title", "Maxine")

    CustomElements.takeRecords()

    lastChange should not be (empty)

    lastChange foreach {
      case Change(name, _, newValue, elem) =>
        name should be ("title")
        newValue should be ("Maxine")
        elem should be (element)
    }

    element.setAttribute("title", "Max, never Maxine!")

    CustomElements.takeRecords()

    lastChange should not be (empty)

    lastChange foreach {
      case Change(name, oldValue, newValue, elem) =>
        name should be ("title")
        oldValue should be ("Maxine")
        newValue should be ("Max, never Maxine!")
        elem should be (element)
    }
  }
}


text:
package com.google.sps.data;
import java.util.ArrayList;
import java.util.List;

public class SearchInfo {
  private String searchId;
  private String textSearch;
  private String gcsUrl;
  private String imageUrl;
  private String userId;
  private String productCategory;

  public SearchInfo(String searchId, String textSearch, String gcsUrl,
                    String imageUrl, String userId, String productCategory) {
    this.searchId = searchId;
    this.textSearch = textSearch;
    this.gcsUrl = gcsUrl;
    this.imageUrl = imageUrl;
    this.userId = userId;
    this.productCategory = productCategory;
  }

  public String getSearchId() {
    return searchId;
  }

  public String getTextSearch() {
    return textSearch;
  }

  public String getGcsUrl() {
    return gcsUrl;
  }

  public String getImageUrl() {
    return imageUrl;
  }

  public String getUserId() {
    return userId;
  }

  public String getProductCategory() {
    return productCategory;
  }

}


text:
using Microsoft.EntityFrameworkCore;

namespace Workplace.Eureka.Services.Data
{
    public class SeranetDb : DbContext
    {
        public SeranetDb(DbContextOptions<SeranetDb> options) : base(options)
        {
        }
    }
}


text:
package lt.vilnius.tvarkau;

import android.app.ProgressDialog;
import android.content.ClipData;
import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Address;
import android.location.Geocoder;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.gms.location.places.Place;
import com.google.android.gms.location.places.ui.PlacePicker;
import com.google.android.gms.maps.model.LatLng;
import com.viewpagerindicator.CirclePageIndicator;

import org.greenrobot.eventbus.EventBus;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.ZoneOffset;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;
import javax.inject.Singleton;

import autodagger.AutoComponent;
import autodagger.AutoInjector;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import icepick.State;
import lt.vilnius.tvarkau.backend.ApiMethod;
import lt.vilnius.tvarkau.backend.ApiRequest;
import lt.vilnius.tvarkau.backend.ApiResponse;
import lt.vilnius.tvarkau.backend.GetNewProblemParams;
import lt.vilnius.tvarkau.backend.LegacyApiModule;
import lt.vilnius.tvarkau.backend.LegacyApiService;
import lt.vilnius.tvarkau.entity.Profile;
import lt.vilnius.tvarkau.events_listeners.NewProblemAddedEvent;
import lt.vilnius.tvarkau.utils.FormatUtils;
import lt.vilnius.tvarkau.utils.ImageUtils;
import lt.vilnius.tvarkau.utils.KeyboardUtils;
import lt.vilnius.tvarkau.utils.PermissionUtils;
import lt.vilnius.tvarkau.utils.SharedPrefsManager;
import lt.vilnius.tvarkau.views.adapters.ProblemImagesPagerAdapter;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

import static android.Manifest.permission.ACCESS_FINE_LOCATION;
import static android.Manifest.permission.CAMERA;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static lt.vilnius.tvarkau.ChooseReportTypeActivity.EXTRA_REPORT_TYPE;

@AutoComponent(modules = {LegacyApiModule.class, AppModule.class, SharedPreferencesModule.class})
@AutoInjector
@Singleton
public class NewProblemActivity extends BaseActivity {

    @Inject LegacyApiService legacyApiService;
    @Inject SharedPreferences myProblemsPreferences;

    private static final int REQUEST_IMAGE_CAPTURE = 1;
    private static final int GALLERY_REQUEST_CODE = 2;

    private static final int LOCATION_PERMISSION_REQUEST_CODE = 10;
    private static final int MAP_PERMISSION_REQUEST_CODE = 20;

    public static final int REQUEST_PLACE_PICKER = 11;
    public static final int REQUEST_PERSONAL_DATA = 12;
    public static final int REQUEST_CHOOSE_REPORT_TYPE = 13;

    public static final String[] MAP_PERMISSIONS = new String[]{ACCESS_FINE_LOCATION};
    private static final String[] LOCATION_PERMISSIONS = {WRITE_EXTERNAL_STORAGE, CAMERA, READ_EXTERNAL_STORAGE};

    public static final String PROBLEM_PREFERENCE_KEY = "problem";

    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.report_problem_location)
    EditText reportProblemLocation;
    @BindView(R.id.problem_images_view_pager)
    ViewPager problemImagesViewPager;
    @BindView(R.id.problem_images_view_pager_indicator)
    CirclePageIndicator problemImagesViewPagerIndicator;
    @BindView(R.id.report_problem_type)
    EditText reportProblemType;
    @BindView(R.id.report_problem_description)
    EditText reportProblemDescription;
    @BindView(R.id.report_problem_location_wrapper)
    TextInputLayout reportProblemLocationWrapper;
    @BindView(R.id.report_problem_description_wrapper)
    TextInputLayout reportProblemDescriptionWrapper;
    @BindView(R.id.report_problem_type_wrapper)
    TextInputLayout reportProblemTypeWrapper;
    @BindView(R.id.report_problem_take_photo)
    ImageView reportProblemTakePhoto;

    @State
    File lastPhotoFile;
    @State
    LatLng locationCords;
    @State
    ArrayList<Uri> imagesURIs;
    @State
    Profile profile;
    @State
    String reportType;
    @State
    String address;

    private String photoFileName;
    private SharedPrefsManager prefsManager;
    private String reporterName;
    private String reporterDateOfBirth;
    private String reporterEmail;
    private String reporterPhone;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_problem);

        ButterKnife.bind(this);

        DaggerNewProblemActivityComponent
            .builder()
            .appModule(new AppModule(this.getApplication()))
            .sharedPreferencesModule(new SharedPreferencesModule())
            .legacyApiModule(new LegacyApiModule())
            .build()
            .inject(this);

        prefsManager = SharedPrefsManager.getInstance(this);

        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_close);

        initProblemImagesPager();

        imagesURIs = new ArrayList<>();
    }

    private void initProblemImagesPager() {
        problemImagesViewPager.setAdapter(new ProblemImagesPagerAdapter(this, null));
        problemImagesViewPager.setOffscreenPageLimit(3);
        problemImagesViewPagerIndicator.setViewPager(problemImagesViewPager);
        problemImagesViewPagerIndicator.setVisibility(View.GONE);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                onBackPressed();
                return true;
            case R.id.action_send:
                sendProblem();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        getMenuInflater().inflate(R.menu.new_problem_toolbar_menu, menu);

        return true;
    }

    public void sendProblem() {
        if (validateProblemInputs()) {

            ProgressDialog progressDialog = createProgressDialog();
            progressDialog.setCancelable(false);
            progressDialog.show();

            Observable<String[]> photoObservable;

            if (imagesURIs != null) {
                photoObservable = Observable.from(imagesURIs)
                    .subscribeOn(Schedulers.io())
                    .observeOn(Schedulers.io())
                    .map(uri -> Uri.fromFile(new File(ImageUtils.getPhotoPathFromUri(this, uri))))
                    .map(ImageUtils::convertToBase64EncodedString)
                    .toList()
                    .map(encodedPhotos -> {
                        if (encodedPhotos.size() > 0) {
                            String[] encodedPhotosArray = new String[encodedPhotos.size()];
                            encodedPhotos.toArray(encodedPhotosArray);
                            return encodedPhotosArray;
                        } else {
                            return null;
                        }
                    });
            } else {
                photoObservable = Observable.just(null);
            }

            Action1<ApiResponse<Integer>> onSuccess = apiResponse -> {
                if (apiResponse.getResult() != null) {
                    String newProblemId = apiResponse.getResult().toString();
                    myProblemsPreferences
                        .edit()
                        .putString(PROBLEM_PREFERENCE_KEY + newProblemId, newProblemId)
                        .apply();
                    EventBus.getDefault().post(new NewProblemAddedEvent());
                    progressDialog.dismiss();
                    if (reportProblemDescription.hasFocus()) {
                        KeyboardUtils.closeSoftKeyboard(this, reportProblemDescription);
                    }
                    Toast.makeText(this, R.string.problem_successfully_sent, Toast.LENGTH_SHORT).show();
                    setResult(RESULT_OK);
                    finish();
                }
            };

            Action1<Throwable> onError = throwable -> {
                LogApp.logCrash(throwable);
                progressDialog.dismiss();
                Toast.makeText(getApplicationContext(), R.string.error_submitting_problem, Toast.LENGTH_SHORT).show();
            };

            if (prefsManager.isUserAnonymous()) {
                reporterName = null;
                reporterDateOfBirth = null;
                reporterEmail = null;
                reporterPhone = null;
            } else if (prefsManager.getUserProfile() != null) {
                reporterName = prefsManager.getUserProfile().getName();
                reporterDateOfBirth = FormatUtils.formatLocalDate(prefsManager.getUserProfile().getBirthday());
                reporterEmail = prefsManager.getUserProfile().getEmail();
                reporterPhone = prefsManager.getUserProfile().getMobilePhone();
            }

            photoObservable
                .subscribeOn(Schedulers.io())
                .flatMap(encodedPhotos ->
                    Observable.just(
                        new GetNewProblemParams.Builder()
                            .setSessionId(null)
                            .setDescription(reportProblemDescription.getText().toString())
                            .setType(reportType)
                            .setAddress(address)
                            .setLatitude(locationCords.latitude)
                            .setLongitude(locationCords.longitude)
                            .setPhoto(encodedPhotos)
                            .setEmail(reporterEmail)
                            .setPhone(reporterPhone)
                            .setNameOfReporter(reporterName)
                            .setDateOfBirth(reporterDateOfBirth)
                            .setMessageDescription(null)
                            .create())
                ).map(params -> new ApiRequest<>(ApiMethod.NEW_PROBLEM, params))
                .flatMap(request -> legacyApiService.postNewProblem(request))
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(
                    onSuccess,
                    onError
                );
        }
    }

    private ProgressDialog createProgressDialog() {
        ProgressDialog progressDialog = new ProgressDialog(this);
        progressDialog.setMessage(getString(R.string.sending_problem));
        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        return progressDialog;
    }

    private boolean validateProblemInputs() {
        boolean addressIsValid = false;
        boolean descriptionIsValid = false;
        boolean problemTypeIsValid = false;

        if (address != null) {
            addressIsValid = true;
            reportProblemDescriptionWrapper.setError(null);
        } else {
            reportProblemLocationWrapper.setError(getText(R.string.error_problem_location_is_empty));
        }

        if (reportProblemDescription.getText() != null && reportProblemDescription.getText().length() > 0) {
            descriptionIsValid = true;
        } else {
            reportProblemDescriptionWrapper.setError(getText(R.string.error_problem_description_is_empty));
        }

        if (reportProblemType.getText().length() > 0) {
            problemTypeIsValid = true;
        } else {
            reportProblemTypeWrapper.setError(getText(R.string.error_problem_type_is_empty));
        }

        return addressIsValid && descriptionIsValid && problemTypeIsValid;
    }

    private boolean validateContacts() {
        if (reportType.equals("Transporto priemonių stovėjimo tvarkos pažeidimai") && (prefsManager.isUserAnonymous())) {

            new AlertDialog.Builder(this, R.style.MyDialogTheme)
                .setTitle(getString(R.string.personal_data_disabled))
                .setMessage(getString(R.string.share_personal_data))
                .setPositiveButton(getString(R.string.add), (dialog, which) -> {
                    if (prefsManager.isUserDetailsSaved()) {
                        fillReportTypeField();
                        Toast.makeText(getApplicationContext(), R.string.personal_data_sharing_enabled, Toast.LENGTH_SHORT).show();
                        dialog.dismiss();
                    } else {
                        Intent intent = new Intent(getApplicationContext(), ProfileEditActivity.class);
                        startActivityForResult(intent, REQUEST_PERSONAL_DATA);
                        dialog.dismiss();
                    }
                })
                .setNegativeButton(R.string.cancel, (dialog, which) -> showReportTypePicker())
                .show();
            return false;
        } else {
            fillReportTypeField();
            return true;
        }
    }

    private void fillReportTypeField() {
        reportProblemTypeWrapper.setError(null);
        reportProblemType.setText(reportType);
    }

    private void openPhotoSelectorDialog() {

        AlertDialog.Builder imagePickerDialogBuilder = new AlertDialog.Builder(this, R.style.MyDialogTheme);

        View view = LayoutInflater.from(this).inflate(R.layout.image_picker_dialog, null);
        TextView cameraButton = ButterKnife.findById(view, R.id.camera_button);
        TextView galleryButton = ButterKnife.findById(view, R.id.gallery_button);

        imagePickerDialogBuilder
            .setTitle(this.getResources().getString(R.string.add_photos))
            .setView(view)
            .setPositiveButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss())
            .create();

        AlertDialog imagePickerDialog = imagePickerDialogBuilder.show();

        cameraButton.setOnClickListener(v -> {
            launchCamera();
            imagePickerDialog.dismiss();
        });

        galleryButton.setOnClickListener(v -> {
            openGallery();
            imagePickerDialog.dismiss();
        });
    }

    private void launchCamera() {
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        String timestamp = FormatUtils.formatLocalDateTimeToSeconds(LocalDateTime.now(ZoneOffset.UTC));
        photoFileName = "IMG_" + timestamp + ".jpg";
        intent.putExtra(MediaStore.EXTRA_OUTPUT, ImageUtils.getTakenPhotoFileUri(this, photoFileName));
        if (intent.resolveActivity(getPackageManager()) != null) {
            startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);
        }
    }

    private void openGallery() {
        Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
        intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
        if (intent.resolveActivity(getPackageManager()) != null) {
            startActivityForResult(intent, GALLERY_REQUEST_CODE);
        }
    }

    @OnClick(R.id.report_problem_take_photo)
    public void onTakePhotoClicked() {
        if (PermissionUtils.isAllPermissionsGranted(this, LOCATION_PERMISSIONS)) {
            openPhotoSelectorDialog();
        } else {
            ActivityCompat.requestPermissions(this, LOCATION_PERMISSIONS, LOCATION_PERMISSION_REQUEST_CODE);
        }
    }

    @OnClick(R.id.report_problem_type)
    public void onChooseProblemTypeClicked() {
        showReportTypePicker();
    }

    private void showReportTypePicker() {
        Intent intent = new Intent(this, ChooseReportTypeActivity.class);
        startActivityForResult(intent, REQUEST_CHOOSE_REPORT_TYPE);
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        switch (requestCode) {
            case LOCATION_PERMISSION_REQUEST_CODE:
                if (PermissionUtils.isAllPermissionsGranted(this, LOCATION_PERMISSIONS)) {
                    openPhotoSelectorDialog();
                } else {
                    Toast.makeText(this, R.string.error_need_camera_and_storage_permission, Toast.LENGTH_SHORT).show();
                }
                break;
            case MAP_PERMISSION_REQUEST_CODE:
                if (PermissionUtils.isAllPermissionsGranted(this, MAP_PERMISSIONS)) {
                    showPlacePicker(getCurrentFocus());
                } else {
                    Toast.makeText(this, R.string.error_need_location_permission, Toast.LENGTH_SHORT).show();
                }
                break;
            default:
                super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        }
    }

    private boolean isEditedByUser() {
        return reportProblemDescription.getText().length() > 0
            || reportProblemLocation.getText().length() > 0
            || (reportType != null && reportType.length() > 0)
            || (imagesURIs != null && imagesURIs.size() > 0);
    }

    @Override
    public void onBackPressed() {
        if (reportProblemDescription.hasFocus()) {
            KeyboardUtils.closeSoftKeyboard(this, reportProblemDescription);
        }
        if (isEditedByUser()) {
            new AlertDialog.Builder(this, R.style.MyDialogTheme)
                .setMessage(getString(R.string.discard_changes_title))
                .setIcon(android.R.drawable.ic_dialog_alert)
                .setPositiveButton(R.string.discard_changes_positive, (dialog, whichButton) ->
                    NewProblemActivity.super.onBackPressed())
                .setNegativeButton(R.string.discard_changes_negative, null).show();
        } else {
            super.onBackPressed();
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == RESULT_OK) {
            switch (requestCode) {
                case REQUEST_IMAGE_CAPTURE:
                    Uri takenImageUri = ImageUtils.getTakenPhotoFileUri(this, photoFileName);
                    setImagesInViewPager(takenImageUri);
                    break;
                case GALLERY_REQUEST_CODE:
                    ClipData clipData = data.getClipData();
                    if (clipData != null) {
                        for (int i = 0; i < clipData.getItemCount(); i++) {
                            setImagesInViewPager(clipData.getItemAt(i).getUri());
                        }
                    } else if (data.getData() != null) {
                        Uri uri = data.getData();
                        setImagesInViewPager(uri);
                    }
                    break;
                case REQUEST_PLACE_PICKER:
                    Place place = PlacePicker.getPlace(this, data);
                    locationCords = place.getLatLng();

                    Geocoder geocoder = new Geocoder(this);

                    List<Address> addresses = null;
                    try {
                        addresses = geocoder.getFromLocation(locationCords.latitude, locationCords.longitude, 1);
                    } catch (IOException e) {
                        LogApp.logCrash(e);
                    }
                    if (addresses != null && addresses.size() > 0) {
                        if (addresses.get(0).getLocality() != null) {
                            address = addresses.get(0).getAddressLine(0);
                            reportProblemLocationWrapper.setError(null);
                            reportProblemLocation.setText(address);
                        }
                    } else {
                        // Mostly when Geocoder throws IOException
                        // backup solution which in not 100% reliable
                        String[] addressSlice = place.getAddress().toString().split(", ");
                        address = addressSlice[0];
                        reportProblemLocationWrapper.setError(null);
                        reportProblemLocation.setText(address);
                    }
                    break;
                case REQUEST_PERSONAL_DATA:
                    fillReportTypeField();
                    Toast.makeText(this, R.string.personal_data_added, Toast.LENGTH_SHORT).show();
                    Toast.makeText(this, R.string.personal_data_sharing_enabled, Toast.LENGTH_SHORT).show();
                    break;
                case REQUEST_CHOOSE_REPORT_TYPE:
                    if (data.hasExtra(EXTRA_REPORT_TYPE)) {
                        reportType = data.getStringExtra(EXTRA_REPORT_TYPE);
                        validateContacts();
                    }
                    break;
            }
        } else {
            switch (requestCode) {
                case REQUEST_IMAGE_CAPTURE:
                    Toast.makeText(this, R.string.photo_capture_error, Toast.LENGTH_SHORT).show();
            }
        }
    }

    private void setImagesInViewPager(Uri uri) {
        imagesURIs.add(uri);
        String[] imagesPath = new String[imagesURIs.size()];
        for (int i = 0; i < imagesURIs.size(); i++) {
            String path = ImageUtils.getPhotoPathFromUri(this, imagesURIs.get(i));
            if (path != null) {
                imagesPath[i] = new File(path).toString();
            } else {
                imagesURIs.remove(uri);
                Toast.makeText(this, R.string.error_taking_image_from_server, Toast.LENGTH_LONG).show();
            }
        }
        if (imagesURIs.size() > 1) {
            problemImagesViewPagerIndicator.setVisibility(View.VISIBLE);
        }
        if (imagesURIs.size() > 0) {
            problemImagesViewPager.setAdapter(new ProblemImagesPagerAdapter<>(this, imagesPath));
        }
    }

    @OnClick(R.id.report_problem_location)
    public void onProblemLocationClicked(View view) {
        if ((PermissionUtils.isAllPermissionsGranted(this, MAP_PERMISSIONS))) {
            showPlacePicker(view);
        } else {
            requestPermissions(MAP_PERMISSIONS, MAP_PERMISSION_REQUEST_CODE);
        }
    }

    @Override
    public boolean onSupportNavigateUp() {
        onBackPressed();
        return false;
    }

    private void showPlacePicker(View view) {
        PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
        try {
            Intent intent = builder.build(this);
            Bundle bundle = ActivityOptionsCompat.makeScaleUpAnimation(view, 0, 0, view.getWidth(), view.getHeight()).toBundle();
            ActivityCompat.startActivityForResult(this, intent, REQUEST_PLACE_PICKER, bundle);
        } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
            LogApp.logCrash(e);
            Snackbar.make(view, R.string.check_google_play_services, Snackbar.LENGTH_INDEFINITE)
                .setAction(R.string.open, v -> {
                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com" +
                        ".google.android.gms"));
                    startActivity(intent);
                })
                .setActionTextColor(ContextCompat.getColor(this, R.color.snackbar_action_text))
                .show();
        }
    }
}


text:
package pod

import (
	v1 "k8s.io/api/core/v1"
)

// NodeSelection specifies where to run a pod, using a combination of fixed node name,
// node selector and/or affinity.
type NodeSelection struct {
	Name     string
	Selector map[string]string
	Affinity *v1.Affinity
}

// setNodeAffinityRequirement sets affinity with specified operator to nodeName to nodeSelection
func setNodeAffinityRequirement(nodeSelection *NodeSelection, operator v1.NodeSelectorOperator, nodeName string) {
	// Add node-anti-affinity.
	if nodeSelection.Affinity == nil {
		nodeSelection.Affinity = &v1.Affinity{}
	}
	if nodeSelection.Affinity.NodeAffinity == nil {
		nodeSelection.Affinity.NodeAffinity = &v1.NodeAffinity{}
	}
	if nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution == nil {
		nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution = &v1.NodeSelector{}
	}
	nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms = append(nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms,
		v1.NodeSelectorTerm{
			MatchFields: []v1.NodeSelectorRequirement{
				{Key: "metadata.name", Operator: operator, Values: []string{nodeName}},
			},
		})
}

// SetNodeAffinityTopologyRequirement sets node affinity to a specified topology
func SetNodeAffinityTopologyRequirement(nodeSelection *NodeSelection, topology map[string]string) {
	if nodeSelection.Affinity == nil {
		nodeSelection.Affinity = &v1.Affinity{}
	}
	if nodeSelection.Affinity.NodeAffinity == nil {
		nodeSelection.Affinity.NodeAffinity = &v1.NodeAffinity{}
	}
	if nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution == nil {
		nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution = &v1.NodeSelector{}
	}
	for k, v := range topology {
		nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms = append(nodeSelection.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms,
			v1.NodeSelectorTerm{
				MatchExpressions: []v1.NodeSelectorRequirement{
					{Key: k, Operator: v1.NodeSelectorOpIn, Values: []string{v}},
				},
			})

	}
}

// SetAffinity sets affinity to nodeName to nodeSelection
func SetAffinity(nodeSelection *NodeSelection, nodeName string) {
	setNodeAffinityRequirement(nodeSelection, v1.NodeSelectorOpIn, nodeName)
}

// SetAntiAffinity sets anti-affinity to nodeName to nodeSelection
func SetAntiAffinity(nodeSelection *NodeSelection, nodeName string) {
	setNodeAffinityRequirement(nodeSelection, v1.NodeSelectorOpNotIn, nodeName)
}

// SetNodeAffinity modifies the given pod object with
// NodeAffinity to the given node name.
func SetNodeAffinity(podSpec *v1.PodSpec, nodeName string) {
	nodeSelection := &NodeSelection{}
	SetAffinity(nodeSelection, nodeName)
	podSpec.Affinity = nodeSelection.Affinity
}

// SetNodeSelection modifies the given pod object with
// the specified NodeSelection
func SetNodeSelection(podSpec *v1.PodSpec, nodeSelection NodeSelection) {
	podSpec.NodeSelector = nodeSelection.Selector
	podSpec.Affinity = nodeSelection.Affinity
	// pod.Spec.NodeName should not be set directly because
	// it will bypass the scheduler, potentially causing
	// kubelet to Fail the pod immediately if it's out of
	// resources. Instead, we want the pod to remain
	// pending in the scheduler until the node has resources
	// freed up.
	if nodeSelection.Name != "" {
		SetNodeAffinity(podSpec, nodeSelection.Name)
	}
}


text:
module UsersHelper

  # Construct table rows for multiple users
  def construct_table_rows(users)
    result = {}
    users.each do |user|
      result[user.id] = construct_table_row(user)
    end
    result
  end

  # Construct a single table row
  def construct_table_row(user)
    result = {}
    result[:id] = user.id
    result[:user_name] = CGI.escapeHTML(user.user_name)
    result[:first_name] = CGI.escapeHTML(user.first_name)
    result[:last_name] = CGI.escapeHTML(user.last_name)
    @render_note_link = false
    if user.student?
      result[:grace_credits] = user.remaining_grace_credits.to_s + '/' + user.grace_credits.to_s
      if user.has_section?
        result[:section] = user.section.name
      else
        result[:section] = '-'
      end
      @render_note_link = true
    end
    result[:hidden] = user.hidden
    result[:filter_table_row_contents] =
       render_to_string :partial => 'users/table_row/filter_table_row.html.erb',
                        :locals => {:user => user,
                                    :controller => self.controller_name,
                                    :render_note_link => @render_note_link}
    result
  end

  # Construct a nicely formatted JSON response in the form of an array for our student table
  def construct_students_table_data(users)
    student_list = []
    users.each do |user|
      result = []
      result[0] = CGI.escapeHTML(user.user_name)
      result[1] = CGI.escapeHTML(user.last_name)
      result[2] = CGI.escapeHTML(user.first_name)
      student_list.push(result)
      @render_note_link = false
      if user.student?
        result[3] = user.remaining_grace_credits.to_s + '/' + user.grace_credits.to_s
        if user.has_section?
          result[4] = user.section.name
        else
          result[4] = '-'
        end
        @render_note_link = true
      end
      result[5] = user.hidden
      result[6] = "<%= link_to I18n.t(:edit), :controller => 'students', :action =>'edit', :id => #{user.id} %>"
    end
    return student_list
  end

end


text:
#pragma once

#include "cinder/audio/InputNode.h"
#include "cinder/audio/SamplePlayerNode.h"
#include "cinder/audio/Source.h"

#include <memory>

namespace cinder { namespace audio {

typedef std::shared_ptr<class Voice> VoiceRef;
typedef std::shared_ptr<class VoiceSamplePlayerNode> VoiceSamplePlayerNodeRef;

//! \brief Interface for performing high-level audio playback tasks.
//!
//! A Voice is an abstraction of something you can hear, and as such they send audio
//! to your computers output device. Currently supports file playback and processing audio with a callback function.
//! Each Voice has controls for setting the volume and pan of its signal, and supports
//! start(), stop(), and pause() functionality.
//!
//! Underneath, playback is managed by a Node, which can be retrieved via the virtual getNode() method to
//! perform more complex tasks.
//!
class Voice {
  public:
	//! Optional parameters passed into Voice::create() methods.
	struct Options {
		Options()
			: mChannels( 0 ), mMaxFramesForBufferPlayback( 96000 ), mConnectToMaster( true )
		{}

		//! Sets the number of channels for the Voice.
		Options& channels( size_t ch )							{ mChannels = ch; return *this; }

		//! \brief Sets the maximum number of frames acceptable for a VoiceSamplePlayerNode to use in-memory buffer playback via BufferPlayerNode
		//!
		//! If the file is larger than this, it will be streamed from disk using a FilePlayerNode. Default = 96,000.
		Options& maxFramesForBufferPlayback( size_t frames )	{ mMaxFramesForBufferPlayback = frames; return *this; }

		//! \brief Sets whether the Voice's output is automatically connected to master()->getOutput().
		//!
		//! If set to false, the user must manage the connection of its output node. Default = true, automaitically connects to master output.
		Options& connectToMaster( bool shouldConnect )			{ mConnectToMaster = shouldConnect; return *this; }

		//! Returns the number of configured channels. \see channels()
		size_t			getChannels() const						{ return mChannels; }
		//! Returns the configured frame allowance for buffer playback. \see maxFramesForBufferPlayback()
		size_t			getMaxFramesForBufferPlayback() const	{ return mMaxFramesForBufferPlayback; }
		//! Returns whether or not the Voice will be automatically connected to master()->getOutput().
		bool			getConnectToMaster() const				{ return mConnectToMaster; }

	  protected:
		size_t			mChannels, mMaxFramesForBufferPlayback;
		bool			mConnectToMaster;
	};

	virtual ~Voice();

	//! Creates a Voice that manages sample playback of an audio file pointed at with \a sourceFile.
	static VoiceSamplePlayerNodeRef create( const SourceFileRef &sourceFile, const Options &options = Options() );
	//! Creates a Voice that continuously calls \a callbackFn to process a Buffer of samples.
	static VoiceRef create( const CallbackProcessorFn &callbackFn, const Options &options = Options() );
	//! Clears all audio file buffers that that are cached in the Mixer
	static void clearBufferCache();

	//! Starts the Voice. Does nothing if currently playing. \note In the case of a VoiceSamplePlayerNode and the sample has reached EOF, start() will start from the beginning.
	virtual void start();
	//! Stops the Voice, resetting its state to the same as when it was created.
	virtual void stop();
	//! Pauses the Voice inits current state. start() will resume from here.
	virtual void pause();
	//! Returns whether the Voice is currently playing or not.
	virtual bool isPlaying() const;
	//! Returns the Node that is the source of this Voice's audio production. The Node type is determined by the Voice subclassed.
	virtual NodeRef getInputNode() const = 0;
	//! Returns the Node that is used for connected the Voice to the greater audio graph (by default, it is connected to Context::master()).
	virtual NodeRef getOutputNode() const;

	void setVolume( float volume );
	void setPan( float pos );

	float getVolume() const;
	float getPan() const;

  protected:
	Voice() : mBusId( 0 ) {}

  private:
	size_t mBusId;
	friend class MixerImpl;
};

//! \brief Concrete Voice for sample playback.
//!
//! Depending on the size of the specified file, playback will either be done in-memory (with BufferPlayerNode)
//! or streaming (with FilePlayerNode). The maximum frames for in-memory playback can be specified with Voice::Options::maxFramesForBufferPlayback()
//! Create with Voice::create( const SourceFileRef &sourceFile, const Options &options )
class VoiceSamplePlayerNode : public Voice {
  public:

	NodeRef getInputNode() const override			{ return mNode; }
	//! Returns a shared_ptr of the owned SamplePlayerNode.
	SamplePlayerNodeRef getSamplePlayerNode() const			{ return mNode; }

	void start() override;
	void stop() override;

  protected:
	VoiceSamplePlayerNode( const SourceFileRef &sourceFile, const Options &options );
	SamplePlayerNodeRef mNode;

	friend class Voice;
};

//! Concrete Voice for processing audio with a callback function. \see CallbackProcessorFn
class VoiceCallbackProcessor : public Voice {
  public:
	NodeRef getInputNode() const override			{ return mNode; }

  protected:
	VoiceCallbackProcessor( const CallbackProcessorFn &callbackFn, const Options &options );

	CallbackProcessorNodeRef mNode;
	friend class Voice;
};

} } // namespace cinder::audio


text:
{% load i18n %}

{% trans "Initial Databases" %}

{% trans "Optionally provide a comma separated list of databases to create:" %}

database1, database2, database3

{% trans "Initial Admin User" %}

{% blocktrans trimmed %}Create an optional initial user.
   This user will have access to all databases you create.{% endblocktrans %}

{% trans "Username (required)" %}

{% trans "Password (required)" %}

{% trans "Allowed Host (optional)" %}
    {% blocktrans trimmed %}Allow the user to connect from this host
    only. If not provided this user will be allowed to connect from anywhere.
    {% endblocktrans %}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Vernonia persericea H.Rob.

### Remarks
null