text:
export JRUBY_HOME=$SOFTWARE_DIR/jruby-9.1.4.0
export PATH=$JRUBY_HOME/bin:$PATH

redpajama_set_name: RedPajamaGithub


text:
class AddAttachmentFirstPhotocopyToLessons < ActiveRecord::Migration
  def self.up
    change_table :lessons do |t|
      t.attachment :first_photocopy
    end
  end

  def self.down
    remove_attachment :lessons, :first_photocopy
  end
end


text: body{font:100% Helvetica,sans-serif;color:#333;backgroud-color:red}


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

<title>RecognitionResult</title>
<meta name="date" content="2015-10-08">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.microsoft.ProjectOxford

Class RecognitionResult

java.lang.Object

com.microsoft.ProjectOxford.RecognitionResult

public class RecognitionResult
extends java.lang.Object

In ShortPhrase mode the client gets one final multiple n-best choice result and
 in LongDictation mode the client will receive multiple final results (each with just a
 single choice), based on where the server thinks sentence pauses are.

Field Summary

Fields

Modifier and Type
Field and Description

RecognitionStatus
RecognitionStatus

Status on how the recognition was produced.

RecognizedPhrase[]
Results

A set of n-best confidence values and recognized texts

Constructor Summary

Constructors

Constructor and Description

RecognitionResult()

Method Summary

Methods inherited from class java.lang.Object

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

Field Detail

RecognitionStatus

public RecognitionStatus RecognitionStatus

Status on how the recognition was produced.  For example, was it produced as
 a result of successful reco, or as a result of canceling the connection, etc...

Results

public RecognizedPhrase[] Results

A set of n-best confidence values and recognized texts

Constructor Detail

RecognitionResult

public RecognitionResult()

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=constant._SC_BC_BASE_MAX.html">

Redirecting to constant._SC_BC_BASE_MAX.html...


text:
package org.terasology.input.device;

import org.terasology.input.ButtonState;
import org.terasology.input.Input;
import org.terasology.math.geom.Vector2i;

/**
 * @author Immortius
 */
public final class InputAction {
    private final Input input;
    private final ButtonState state;
    private final int delta;
    private final char inputChar;
    private final Vector2i mousePosition;

    public InputAction(Input input, ButtonState state, Vector2i mousePosition) {
        this.mousePosition = mousePosition;
        this.input = input;
        this.state = state;
        this.delta = 0;
        this.inputChar = '\0';
    }

    public InputAction(Input input, int delta, Vector2i mousePosition) {
        this.mousePosition = mousePosition;
        this.input = input;
        this.state = ButtonState.DOWN;
        this.delta = delta;
        this.inputChar = '\0';
    }

    public InputAction(Input input, ButtonState state, char inputChar) {
        this.mousePosition = null;
        this.input = input;
        this.state = state;
        this.delta = 0;
        this.inputChar = inputChar;
    }

    public InputAction(Input input, int delta, char inputChar) {
        this.mousePosition = null;
        this.input = input;
        this.state = ButtonState.DOWN;
        this.delta = delta;
        this.inputChar = inputChar;
    }

    /**
     * @return Whether this is an axis action (e.g. a mouse wheel or volume knob)
     */
    public boolean isAxisAction() {
        return delta != 0;
    }

    /**
     * @return The type of input involved in this action (mouse button/mouse wheel)
     */
    public Input getInput() {
        return input;
    }

    /**
     * @return The state of that input button
     */
    public ButtonState getState() {
        return state;
    }

    /**
     * @return For axis actions, the change in value
     */
    public int getTurns() {
        return delta;
    }

    public char getInputChar() {
        return inputChar;
    }

    public Vector2i getMousePosition() {
        return mousePosition;
    }

    @Override
    public String toString() {
        return "InputAction [" + this.input + " \'" + inputChar + "' (" + state + "), mouse: " + mousePosition + "]";
    }
}


text:
var AdminMain = window.AdminMain || {};

(function($){
    AdminMain.Func = {
        init: function () {
            AdminMain.Func.admin_submit_limit_records();
            AdminMain.Func.admin_search_keyword_form();
            AdminMain.Func.admin_order_field_data();
            AdminMain.Func.delete_item_lists_thumb_gallery();
            setTimeout(function(){
                $(".alert-success").slideUp();
            },5000);

            //to translate the daterange picker, please copy the "examples/daterange-fr.js" contents here before initialization
            $('input[name=date-range-picker]').daterangepicker({
                'applyClass' : 'btn-sm btn-success',
                'cancelClass' : 'btn-sm btn-default',
                locale: {
                    applyLabel: 'Apply',
                    cancelLabel: 'Cancel',
                }
            }, function(start, end, label){
                var start_date = Date.parse(start) / 1000;
                var end_date = Date.parse(end) / 1000;
                if(start_date > 0 && end_date > 0){
                    var value = start_date + '-' + end_date;
                    var redirect_url = AdminMain.Func.generate_url_hande_filter('date_range', value);
                    window.location.href = redirect_url;
                }

            });

            var tag_input = $('#form_tags');
            try{
                tag_input.tag(
                    {
                        placeholder:tag_input.attr('placeholder'),
                        //enable typeahead by specifying the source array
                        //source: ace.vars['US_STATES'],//defined in ace.js >> ace.enable_search_ahead
                        /**
                         //or fetch data from database, fetch those that match "query"
                         source: function(query, process) {
						  $.ajax({url: 'remote_source.php?q='+encodeURIComponent(query)})
						  .done(function(result_items){
							process(result_items);
						  });
						}
                         */
                    }
                )

                //programmatically add a new
                var $tag_obj = $('#form_tags').data('tag');
                var list_tags = $(".list_tags").val() ? JSON.parse($(".list_tags").val()) : [];
                if(list_tags.length > 0){
                    for(var i in list_tags){
                        $tag_obj.add(list_tags[i].tag_name);
                    }
                }

            }
            catch(e) {
                //display a textarea for old IE, because it doesn't support this plugin or another one I tried!
                tag_input.after('<textarea id="'+tag_input.attr('id')+'" name="'+tag_input.attr('name')+'" rows="10">'+tag_input.val()+'</textarea>').remove();
                //$('#form_tags').autosize({append: "\n"});
            }
        },

        admin_submit_limit_records : function(){
            $("#show_record_num").on('change', function(){
                var limit = $(this).val();
                var redirect_url = AdminMain.Func.generate_url_hande_filter('lm', limit);
                window.location.href = redirect_url;
            });
        },

        admin_search_keyword_form : function(){
            $("#search-keyword").keydown(function(e){
                var keyCode = e.which;
                if (keyCode == 13) {
                    var key = $(this).val();
                    var redirect_url = AdminMain.Func.generate_url_hande_filter('key', key);
                    window.location.href = redirect_url;
                }
            });
        },

        admin_order_field_data : function(){
            $(".admin_order_field").on('click',function(){
                var redirect_url = $(this).data('url');
                window.location.href = redirect_url;
            });
        },

        getURLParameter : function (name, url) {
            if (!url) url = location.href;
            name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
            var regexS = "[\\?&]"+name+"=([^&#]*)";
            var regex = new RegExp( regexS );
            var results = regex.exec( url );
            return results == null ? null : results[1];
        },

        generate_url_hande_filter : function(str_type, value){
            var pathname = $(location).attr('href');
            var parameter_url, redirect_url;
            if(pathname.indexOf(str_type + '=') == -1){
                parameter_url = pathname.indexOf('?') > 0 ? '&' + str_type + '='+value : '?' + str_type + '=' + value;
                redirect_url = pathname + parameter_url;
            } else {
                var param = AdminMain.Func.getURLParameter(str_type, pathname);
                redirect_url = pathname.replace(str_type + '='+param, str_type + '=' + value);
            }

            return redirect_url;
        },

        _plupload_files : function(url_upload_file, container, browse_button)
        {
            var uploader_file = new plupload.Uploader({
                // General settings
                runtimes : 'html5,flash,silverlight,html4',
                url : url_upload_file,

                // User can upload no more then 20 files in one go (sets multiple_queues to false)
                max_file_size : '2mb',

                chunk_size: '3mb',

                container: container,

                browse_button : browse_button,

                filters : {
                    // Specify what files to browse for
                    mime_types: [
                        {title : "Image files", extensions : "jpg,gif,png"},
                        {title : "Zip files", extensions : "zip"}
                    ]
                },

                // Rename files by clicking on their titles
                rename: true,

                // Sort files
                sortable: true,

                // Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
                dragdrop: true,

                // Views to activate
                views: {
                    //list: true,
                    thumbs: true, // Show thumbs
                    active: 'thumbs'
                },

                // Flash settings
                flash_swf_url : path_url_assset + 'js/plupload/Moxie.swf',

                // Silverlight settings
                silverlight_xap_url : path_url_assset + 'js/plupload/Moxie.xap',

                /*headers: {
                    "x-csrf-token" : $('meta[name="csrf-token"]').attr('content')
                },*/

                init : {
                    FilesAdded: function(up, files) {
                        up.start();
                    },
                    UploadComplete: function(up, files) {
                        var html ='';
                        $.each(files, function(i, file) {
                            html += '
' + file.name + ' (' + plupload.formatSize(file.size) + ')
';
                            //$("#filelist").append(html);
                        });
                    },
                    FileUploaded: function(up, files, response) {

                        var data = $.parseJSON(response.response);
                        setTimeout(function() {
                            $('div[id="'+files.id+'"]').remove();
                        }, 1000);

                        var lists_thumb = $(".lists_thumb").val() ? JSON.parse($(".lists_thumb").val()) : [];

                        if(data.status)
                        {
                            var image_file = {
                                'file' : data.file
                            };
                            var html_thumb ='';
                            if(data.file.length > 0){
                                //$.each(data.files, function(i, file) {
                                html_thumb += '
';
                                html_thumb += '';
                                html_thumb += '';
                                html_thumb += '
';
                                $("#"+container).append(html_thumb);
                                lists_thumb.push(image_file);
                                $(".lists_thumb").val(JSON.stringify(lists_thumb));
                                //});
                            }

                        }

                        AdminMain.Func.delete_item_lists_thumb_gallery(lists_thumb);

                    }
                }

            });

            uploader_file.init();
        },

        delete_item_lists_thumb_gallery : function(lists_thumb ){
            $(".thumb_uploaded .icon-delete").click(function(){
                var lists_del_file = $(".lists_del_file").val() ? JSON.parse($(".lists_del_file").val()) : [];
                var value = $(this).data('value');
                if($(this).data('id')) {
                    var id = $(this).data('id');
                    var del_file = {
                        'id' : id
                    };
                    lists_del_file.push(del_file);
                    $(".lists_del_file").val(JSON.stringify(lists_del_file));
                }
                if(!lists_thumb){
                    lists_thumb = JSON.parse($(".lists_thumb").val());
                }

                AdminMain.Func.removeItem(lists_thumb, value);
                $(".lists_thumb").val(JSON.stringify(lists_thumb));
                $(this).parent().remove();
            });
        },

        removeItem : function(array, item){
            for(var i in array){
                if(array[i].file==item){
                    array.splice(i,1);
                    break;
                }
            }
        }

    };
})(jQuery);

$(document).ready(function(){
    AdminMain.Func.init();
});


text:
namespace crashpad {
namespace test {
namespace {

class TestMultiprocessExec final : public MultiprocessExec {
 public:
  TestMultiprocessExec() : MultiprocessExec() {}

  ~TestMultiprocessExec() {}

 private:
  void MultiprocessParent() override {
    // Use Logging*File() instead of Checked*File() so that the test can fail
    // gracefully with a Google Test assertion if the child does not execute
    // properly.

    char c = 'z';
    ASSERT_TRUE(LoggingWriteFile(WritePipeHandle(), &c, 1));

    ASSERT_TRUE(LoggingReadFileExactly(ReadPipeHandle(), &c, 1));
    EXPECT_EQ(c, 'Z');
  }

  DISALLOW_COPY_AND_ASSIGN(TestMultiprocessExec);
};

TEST(MultiprocessExec, MultiprocessExec) {
  TestMultiprocessExec multiprocess_exec;
  base::FilePath child_test_executable = TestPaths::BuildArtifact(
      FILE_PATH_LITERAL("test"),
      FILE_PATH_LITERAL("multiprocess_exec_test_child"),
      TestPaths::FileType::kExecutable);
  multiprocess_exec.SetChildCommand(child_test_executable, nullptr);
  multiprocess_exec.Run();
}

CRASHPAD_CHILD_TEST_MAIN(SimpleMultiprocess) {
  char c;
  CheckedReadFileExactly(StdioFileHandle(StdioStream::kStandardInput), &c, 1);
  LOG_IF(FATAL, c != 'z');

  c = 'Z';
  CheckedWriteFile(StdioFileHandle(StdioStream::kStandardOutput), &c, 1);
  return 0;
}

TEST(MultiprocessExec, MultiprocessExecSimpleChild) {
  TestMultiprocessExec exec;
  exec.SetChildTestMainFunction("SimpleMultiprocess");
  exec.Run();
}

CRASHPAD_CHILD_TEST_MAIN(SimpleMultiprocessReturnsNonZero) {
  return 123;
}

class TestMultiprocessExecEmpty final : public MultiprocessExec {
 public:
  TestMultiprocessExecEmpty() = default;
  ~TestMultiprocessExecEmpty() = default;

 private:
  void MultiprocessParent() override {}

  DISALLOW_COPY_AND_ASSIGN(TestMultiprocessExecEmpty);
};

TEST(MultiprocessExec, MultiprocessExecSimpleChildReturnsNonZero) {
  TestMultiprocessExecEmpty exec;
  exec.SetChildTestMainFunction("SimpleMultiprocessReturnsNonZero");
  exec.SetExpectedChildTermination(
      Multiprocess::TerminationReason::kTerminationNormal, 123);
  exec.Run();
}

#if !defined(OS_WIN)

CRASHPAD_CHILD_TEST_MAIN(BuiltinTrapChild) {
  __builtin_trap();
  return EXIT_SUCCESS;
}

class TestBuiltinTrapTermination final : public MultiprocessExec {
 public:
  TestBuiltinTrapTermination() {
    SetChildTestMainFunction("BuiltinTrapChild");
    SetExpectedChildTerminationBuiltinTrap();
  }

  ~TestBuiltinTrapTermination() = default;

 private:
  void MultiprocessParent() override {}

  DISALLOW_COPY_AND_ASSIGN(TestBuiltinTrapTermination);
};

TEST(MultiprocessExec, BuiltinTrapTermination) {
  TestBuiltinTrapTermination test;
  test.Run();
}

#endif  // !OS_WIN

}  // namespace
}  // namespace test
}  // namespace crashpad


text:
namespace Nager.TemplateBuilder.Model
{
    public enum ProjectTemplate
    {
        WindowsClassicDesktopClassLibrary,
        WindowsClassicDesktopConsoleApp,
        WindowsClassicDesktopWindowsFormsApp,
        NetStandardClassLibrary,
    }
}


text:
import creditCardType from 'credit-card-type';

import { isNumber } from '@proton/shared/lib/helpers/validators';

import { Icon } from '../../components';
import Input, { InputTwoProps } from '../../components/v2/input/Input';

const banks = require.context('@proton/styles/assets/img/credit-card-icons', true, /.svg$/);

const banksMap = banks.keys().reduce<{ [key: string]: () => string }>((acc, key) => {
    acc[key] = () => banks(key);
    return acc;
}, {});

const getBankSvg = (type = '') => {
    const key = `./cc-${type}.svg`;

    if (!banksMap[key]) {
        return;
    }

    return banksMap[key]();
};

const isValidNumber = (v: string) => !v || isNumber(v);

const withGaps = (value = '', gaps: number[] = []) => {
    return [...value].reduce((acc, digit, index) => {
        if (gaps.includes(index)) {
            return `${acc} ${digit}`;
        }
        return `${acc}${digit}`;
    }, '');
};

interface Props extends Omit<InputTwoProps, 'value' | 'onChange' | 'onValue'> {
    value: string;
    onChange: (value: string) => void;
}

const CardNumberInput = ({ value, onChange, ...rest }: Props) => {
    const [firstCreditCardType] = creditCardType(value);
    const { type = '', niceType = '', gaps = [] } = firstCreditCardType || {};
    const bankIcon = getBankSvg(type);
    const valueWithGaps = gaps.length ? withGaps(value, gaps) : value;

    return (
        <Input
            autoComplete="cc-number"
            name="cardnumber"
            placeholder="0000 0000 0000 0000"
            maxLength={23}
            className="pl0"
            onChange={({ target }) => {
                const val = target.value.replace(/\s/g, '');
                if (isValidNumber(val)) {
                    onChange(val);
                }
            }}
            value={valueWithGaps}
            prefix={
                value && bankIcon ? (
                    <img src={bankIcon} title={niceType} alt={niceType} width="20" />
                ) : (
                    <Icon name="credit-card" />
                )
            }
            {...rest}
        />
    );
};

export default CardNumberInput;


text:
CREATE TABLE [dbo].[DatabaseTasks]
(
	[Id] INT NOT NULL PRIMARY KEY IDENTITY,
	[Name] nvarchar(50) NOT NULL,
	[ConnectionString] NVARcHAR(256) NOT NULL,
	[Package] NVARCHAR(256) NOT NULL,
	[DatabaseName] NVARcHAR(50) NOT NULL,
	EnviromentId int NOT NULL,
    [Repository] NVARCHAR(256) NOT NULL,
    [AgentId] INT NOT NULL,
    [ApplicationId] INT NOT NULL,
    [Position] INT NOT NULL DEFAULT 1,
    [Deleted] BIT NOT NULL DEFAULT 0,
    CONSTRAINT [FK_DatabaseTasks_ToEnviroments] FOREIGN KEY (EnviromentId) REFERENCES [Enviroments]([Id]),
	CONSTRAINT [FK_DatabaseTasks_ToApplications] FOREIGN KEY (ApplicationId) REFERENCES Applications([Id]),
    CONSTRAINT [FK_DatabaseTasks_ToAgents] FOREIGN KEY ([AgentId]) REFERENCES [Agents]([Id])
)


text:
drop view IF EXISTS ap_paid_nok;
drop view IF EXISTS ap_paid_nok1;

--View definition with cte
CREATE VIEW ap_paid_nok AS
 WITH cte(ap_id, ac_amount) AS (
         SELECT ap.id, sum(ac.amount) AS sum
           FROM ap ap
      JOIN acc_trans ac ON ac.trans_id = ap.id
   JOIN account_link al ON al.account_id = ac.chart_id
  WHERE al.description = 'AP'::text
  GROUP BY ap.id
 HAVING sum(ac.amount) <> 0::numeric
        )
 SELECT cte.ac_amount, e.name, ap.id, ap.invnumber, ap.transdate, ap.taxincluded, ap.amount, ap.netamount, ap.duedate, ap.invoice, ap.ordnumber, ap.curr, ap.notes, ap.person_id, ap.till, ap.quonumber, ap.intnotes, ap.shipvia, ap.language_code, ap.ponumber, ap.shippingpoint, ap.on_hold, ap.approved, ap.reverse, ap.terms, ap.description, ap.force_closed, ap.crdate
   FROM ap ap, entity_credit_account eca, entity e, cte cte
  WHERE ap.id = cte.ap_id AND ap.entity_credit_account = eca.id AND eca.entity_id = e.id;

--View definition unfolded
CREATE VIEW ap_paid_nok1 AS
SELECT sum(ac.amount) AS balance, e.name, ap.id, ap.invnumber, ap.transdate, ap.taxincluded, ap.amount, ap.netamount, ap.duedate, ap.invoice, ap.ordnumber, ap.curr, ap.notes, ap.person_id, ap.till, ap.quonumber, ap.intnotes, ap.shipvia, ap.language_code, ap.ponumber, ap.shippingpoint, ap.on_hold, ap.approved, ap.reverse, ap.terms, ap.description, ap.force_closed, ap.crdate
   FROM ap
   JOIN entity_credit_account eca ON ap.entity_credit_account = eca.id
   JOIN entity e ON eca.entity_id = e.id
   JOIN acc_trans ac ON ac.trans_id = ap.id
   JOIN account_link al ON al.description = 'AP'::text AND al.account_id = ac.chart_id
  GROUP BY e.name, ap.id, ap.invnumber, ap.transdate, ap.taxincluded, ap.amount, ap.netamount, ap.duedate, ap.invoice, ap.ordnumber, ap.curr, ap.notes, ap.person_id, ap.till, ap.quonumber, ap.intnotes, ap.shipvia, ap.language_code, ap.ponumber, ap.shippingpoint, ap.on_hold, ap.approved, ap.reverse, ap.terms, ap.description, ap.force_closed, ap.crdate
 HAVING sum(ac.amount) <> 0::numeric;

--example of instead trigger on view working under openjpa
CREATE OR REPLACE FUNCTION ap_paid_nok1_delete()
RETURNS TRIGGER AS
$$
BEGIN
 IF TG_OP <> 'DELETE' then
  RAISE EXCEPTION 'TG_OP should be DELETE';
 END IF;
 delete from acc_trans where trans_id=OLD.id;
 DELETE FROM ap WHERE id=OLD.id;
return OLD;
END;
$$ language plpgsql;

CREATE TRIGGER ap_paid_nok1_delete INSTEAD OF DELETE ON ap_paid_nok1 FOR EACH ROW EXECUTE PROCEDURE ap_paid_nok1_delete();


text:
/**
 *
 */
package chapter1AdvancedClassDesign.chapter1_4CodingEqualsHashCodeAndToString.hashCode;

import chapter1AdvancedClassDesign.chapter1_4CodingEqualsHashCodeAndToString.toString.ManParent;

/**
 * @author tkurt
 * Date: Mar 28, 2016 1:15:58 PM
 *
 */
public class Man extends chapter1AdvancedClassDesign.chapter1_4CodingEqualsHashCodeAndToString.equals.Man {

	public Man(int manId, String name, String sex, String martialStatus, double height, int weight) {
		super(manId, name, sex, martialStatus, height, weight);
	}

	/**
	 * A hash code is a number that puts instances of a class into a finite number of categories.
	 *
	 * The hash code is just a number. On the exam, you can just use a primitive number as is or divide
     * to get a smaller int .
     *
     * Remember that all of the instance variables don't need to be used in a
     * hashCode() method. It is common not to include boolean and char variables in the hash code.
     *
     * Three Conditions for Contract are exist;
     *
     * -Within the same program, the result of hashCode() must not change. This means that
     *  you shouldn't include variables that change in figuring out the hash code.
     *
     * -If equals() returns true when called with two objects, calling hashCode() on each of
     *  those objects must return the same result. This means hashCode() can use a subset of
     *  the variables that equals() uses.
     *
     * -If equals() returns false when called with two objects, calling hashCode() on each of
     *  those objects does not have to return a different result. This means hashCode() results
     *  do not need to be unique when called on unequal objects.
	 */
	@Override
	public int hashCode() {

		return super.hashCode();
	}

}


text:
import { render } from '@testing-library/react-native';
import * as React from 'react';

import BaseNavigationContainer from '../BaseNavigationContainer';
import Screen from '../Screen';
import useNavigation from '../useNavigation';
import useNavigationBuilder from '../useNavigationBuilder';
import MockRouter from './__fixtures__/MockRouter';

it('gets navigation prop from context', () => {
  expect.assertions(1);

  const TestNavigator = (props: any): any => {
    const { state, descriptors } = useNavigationBuilder(MockRouter, props);

    return state.routes.map((route) => descriptors[route.key].render());
  };

  const Test = () => {
    const navigation = useNavigation();

    expect(navigation.navigate).toBeDefined();

    return null;
  };

  render(
    <BaseNavigationContainer>
      <TestNavigator>
        <Screen name="foo" component={Test} />
      </TestNavigator>
    </BaseNavigationContainer>
  );
});

it("gets navigation's parent from context", () => {
  expect.assertions(1);

  const TestNavigator = (props: any): any => {
    const { state, descriptors } = useNavigationBuilder(MockRouter, props);

    return state.routes.map((route) => descriptors[route.key].render());
  };

  const Test = () => {
    const navigation = useNavigation();

    expect(navigation.getParent()).toBeDefined();

    return null;
  };

  render(
    <BaseNavigationContainer>
      <TestNavigator>
        <Screen name="foo">
          {() => (
            <TestNavigator>
              <Screen name="bar" component={Test} />
            </TestNavigator>
          )}
        </Screen>
      </TestNavigator>
    </BaseNavigationContainer>
  );
});

it("gets navigation's parent's parent from context", () => {
  expect.assertions(2);

  const TestNavigator = (props: any): any => {
    const { state, descriptors } = useNavigationBuilder(MockRouter, props);

    return state.routes.map((route) => descriptors[route.key].render());
  };

  const Test = () => {
    const navigation = useNavigation();
    const parent = navigation.getParent();

    expect(parent).toBeDefined();
    if (parent !== undefined) {
      expect(parent.navigate).toBeDefined();
    }

    return null;
  };

  render(
    <BaseNavigationContainer>
      <TestNavigator>
        <Screen name="foo">
          {() => (
            <TestNavigator>
              <Screen name="bar">
                {() => (
                  <TestNavigator>
                    <Screen name="quo" component={Test} />
                  </TestNavigator>
                )}
              </Screen>
            </TestNavigator>
          )}
        </Screen>
      </TestNavigator>
    </BaseNavigationContainer>
  );
});

it('gets navigation from container from context', () => {
  expect.assertions(1);

  const TestNavigator = (props: any): any => {
    const { state, descriptors } = useNavigationBuilder(MockRouter, props);

    return state.routes.map((route) => descriptors[route.key].render());
  };

  const Test = () => {
    const navigation = useNavigation();

    expect(navigation.navigate).toBeDefined();

    return null;
  };

  render(
    <BaseNavigationContainer>
      <Test />
      <TestNavigator>
        <Screen name="foo">{() => null}</Screen>
      </TestNavigator>
    </BaseNavigationContainer>
  );
});

it('throws if called outside a navigation context', () => {
  expect.assertions(1);

  const Test = () => {
    // eslint-disable-next-line react-hooks/rules-of-hooks
    expect(() => useNavigation()).toThrow(
      "Couldn't find a navigation object. Is your component inside NavigationContainer?"
    );

    return null;
  };

  render(<Test />);
});


text:
https://infopolit14.github.io/phoneBookMy

### Sites screens
View | Edit
------------ | -------------
![Alt text](screenshots/view.png?raw=true "Optional Title") | ![Alt text](screenshots/edit.png?raw=true "Optional Title")
Search | Valid
 |
![Alt text](screenshots/valid.png?raw=true "Optional Title") | ![Alt text](screenshots/search.png?raw=true "Optional Title")


text:
from __future__ import print_function

import json
import os
import shutil
import sys
import tempfile
import unittest

from tracing.extras.symbolizer import symbolize_trace

_THIS_DIR_PATH = os.path.abspath(os.path.dirname(__file__))
_TRACING_DIR = os.path.abspath(
    os.path.join(_THIS_DIR_PATH,
                 os.path.pardir,
                 os.path.pardir,
                 os.path.pardir))
_PY_UTILS_PATH = os.path.abspath(os.path.join(
    _TRACING_DIR,
    os.path.pardir,
    'common',
    'py_utils'))
sys.path.append(_PY_UTILS_PATH)
import py_utils.cloud_storage as cloud_storage  # pylint: disable=wrong-import-position

def _DownloadFromCloudStorage(path):
  print('Downloading %s from gcs.' % (path))
  cloud_storage.GetIfChanged(path, cloud_storage.PARTNER_BUCKET)

class SymbolizeTraceEndToEndTest(unittest.TestCase):
  def _ValidateTrace(self, trace_path, expectations):
    with symbolize_trace.OpenTraceFile(trace_path, 'r') as trace_file:
      trace = symbolize_trace.Trace(json.load(trace_file))
    # Find the browser process.
    browser = None
    for process in trace.processes:
      if process.name == expectations['process']:
        browser = process
    self.assertTrue(browser)

    # Look for a frame with a symbolize name, and check that it has the right
    # parent.
    frames = browser.stack_frame_map.frame_by_id
    exact = expectations['frame_exact']
    found = False
    for _, frame in frames.items():
      if frame.name.strip() == exact['frame_name']:
        parent_id = frame.parent_id
        if frames[parent_id].name.strip() == exact['parent_name']:
          found = True
          break

    self.assertTrue(found)

  def _RunSymbolizationOnTrace(self, pre_symbolization, expectations,
                               extra_options):
    trace_presymbolization_path = os.path.join(
        _THIS_DIR_PATH, 'data', pre_symbolization)
    _DownloadFromCloudStorage(trace_presymbolization_path)
    self.assertTrue(os.path.exists(trace_presymbolization_path))

    temporary_fd, temporary_trace = tempfile.mkstemp(suffix='.json.gz')

    symbolization_options = ['--only-symbolize-chrome-symbols',
                             '--no-backup',
                             '--cloud-storage-bucket',
                             cloud_storage.PARTNER_BUCKET,
                             temporary_trace]

    symbolization_options.extend(extra_options)

    # On windows, a pre-built version of addr2line-pdb is provided.
    if sys.platform == 'win32':
      addr2line_path = os.path.join(
          _THIS_DIR_PATH, 'data', 'addr2line-pdb.exe')
      _DownloadFromCloudStorage(addr2line_path)
      self.assertTrue(os.path.exists(addr2line_path))
      symbolization_options += ['--addr2line-executable', addr2line_path]

    # Execute symbolization and compare results with the expected trace.
    try:
      shutil.copy(trace_presymbolization_path, temporary_trace)
      self.assertTrue(symbolize_trace.main(symbolization_options))
      self._ValidateTrace(temporary_trace, expectations)
    finally:
      os.close(temporary_fd)
      if os.path.exists(temporary_trace):
        os.remove(temporary_trace)

  def testMacv2(self):
    if sys.platform != 'darwin':
      return
    # The corresponding macOS Chrome symbols must be uploaded to
    # "gs://chrome-partner-telemetry/desktop-symbolizer-test/66.0.3334.0/mac64/Google Chrome.dSYM.tar.bz2"
    # since the waterfall bots do not have access to the chrome-unsigned bucket.
    expectations = {}
    expectations['process'] = 'Browser'
    expectations['frame_exact'] = {
        'parent_name': 'ProfileImpl::OnPrefsLoaded(Profile::CreateMode, bool)',
        'frame_name': 'ProfileImpl::OnLocaleReady()'
    }
    self._RunSymbolizationOnTrace(
        'mac_trace_v2_presymbolization.json.gz',
        expectations, [])

  def testMacv2Breakpad(self):
    # The corresponding macOS Chrome symbols must be uploaded to
    # "gs://chrome-partner-telemetry/desktop-symbolizer-test/66.0.3334.0/mac64/breakpad-info"
    # since the waterfall bots do not have access to the chrome-unsigned bucket.
    expectations = {}
    expectations['process'] = 'Browser'
    expectations['frame_exact'] = {
        'parent_name': 'ProfileImpl::OnPrefsLoaded(Profile::CreateMode, bool)',
        'frame_name': 'ProfileImpl::OnLocaleReady()'
    }
    self._RunSymbolizationOnTrace(
        'mac_trace_v2_presymbolization.json.gz',
        expectations, ['--use-breakpad-symbols'])

  def testWin64v1(self):
    if sys.platform != 'win32':
      return

    expectations = {}
    expectations['process'] = 'Browser'
    expectations['frame_exact'] = {
        'parent_name': 'ChromeMain',
        'frame_name': 'content::ContentMain'
    }
    # The corresponding Win64 Chrome symbols must be uploaded to
    # "gs://chrome-partner-telemetry/desktop-symbolizer-test/61.0.3130.0/"
    # "win64-pgo/chrome-win32-syms.zip"
    # and the corresponding executables to
    # "gs://chrome-partner-telemetry/desktop-symbolizer-test/61.0.3130.0/"
    # "win64-pgo/chrome-win64-pgo.zip"
    # since the waterfall bots do not have access to the chrome-unsigned bucket.
    self._RunSymbolizationOnTrace('windows_trace_v1_presymbolization.json.gz',
                                  expectations,
                                  [])

  def testWin64v2(self):
    if sys.platform != 'win32':
      return

    expectations = {}
    expectations['process'] = 'Browser'
    expectations['frame_exact'] = {
        'parent_name': 'base::MessagePumpWin::Run',
        'frame_name': 'base::MessagePumpForUI::DoRunLoop'
    }
    # The corresponding Win64 Chrome symbols must be uploaded to
    # "gs://chrome-partner-telemetry/desktop-symbolizer-test/61.0.3142.0/"
    # "win64-pgo/chrome-win32-syms.zip"
    # and the corresponding executables to
    # "gs://chrome-partner-telemetry/desktop-symbolizer-test/61.0.3142.0/"
    # "win64-pgo/chrome-win64-pgo.zip"
    # since the waterfall bots do not have access to the chrome-unsigned bucket.
    self._RunSymbolizationOnTrace('windows_trace_v2_presymbolization.json.gz',
                                  expectations,
                                  [])

  def testLinuxv2(self):
    # The corresponding Linux breakpad symbols must be uploaded to
    # "gs://chrome-partner-telemetry/desktop-symbolizer-test/64.0.3282.24/linux64/breakpad-info.zip"
    # since the waterfall bots do not have access to the chrome-unsigned bucket.
    expectations = {}
    expectations['process'] = 'Renderer'
    expectations['frame_exact'] = {
        'parent_name': 'cc::LayerTreeSettings::LayerTreeSettings(cc::LayerTreeSettings const&)',
        'frame_name': 'viz::ResourceSettings::ResourceSettings(viz::ResourceSettings const&)'
    }
    self._RunSymbolizationOnTrace(
        'linux_trace_v2_presymbolization.json.gz',
        expectations,
        ['--use-breakpad-symbols'])

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


text:
criterion: 16
category: Security, privacy, tools and standards
phase: alpha
---

#### Prompts

* What open standards are you using?
* Are you complying with the open standards board's decisions?
* Are you imposing vendor technology choices on users?
* What standards are you using to reduce lock-in?
* Have you engaged with the identity assurance team in GDS?

#### Evidence

Service Manager able to:

* Explain what open standards the service is using during the alpha
* Explain how they are complying with the open standards board's decisions during the alpha
* Explain how they are avoiding imposing vendor technology decisions on users and reducing lock-in during the alpha
* Confirm that they have engaged with the identity assurance team in GDS


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Caloplaca furfuracea var. furfuracea

### Remarks
null


text:
package com.demon.commontools;

import android.app.Application;
import android.content.Context;
import android.test.ApplicationTestCase;

import com.demon.commontools.net.NetworkUtil;
import com.demon.commontools.utils.LogUtils;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }

    private static final String TAG = "ApplicationTest";

    public void testNetworkUtil() {
        Context ctx = getContext();
        boolean enable = NetworkUtil.isNetworkAvaialble(ctx);
        int networkType = NetworkUtil.getNetworkType(ctx);
        int simpleNetworkType = NetworkUtil.getSimpleNetworkType(ctx);
        LogUtils.d(TAG, "enable = " + enable + "  networkType = "
                + networkType + "   simpleNetworkType = " + simpleNetworkType);
//        throw new RuntimeException("ahahahha");
    }
}


text: Notebook to record activities while vacationing


text:
<?php

namespace BD\SubberBundle\Command;

use BD\Subber\ReleaseSubtitles\TestedSubtitle;
use BD\Subber\Subtitles\Subtitle;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Lists subtitles for a video file.
 */
class ListSubtitlesCommand extends ContainerAwareCommand
{
    public function configure()
    {
        $this->setName('subber:list-subtitles');
        $this->addArgument('downloaded-release', InputArgument::REQUIRED, 'The name of the downloaded release file');
        $this->addOption('video-file', 'f', InputOption::VALUE_OPTIONAL, 'The path to the video file the subtitle subtitles must be listed for', false);
    }

    public function execute(InputInterface $input, OutputInterface $output)
    {
        $printSubtitleCallback = function (TestedSubtitle $subtitle) use ($output) {
            $output->writeln(
                sprintf(
                    "%s\n".
                    "  - url: %s\n".
                    "  - language: %s\n".
                    "  - rating: %s\n".
                    '  - author: %s',
                    $subtitle->getName(), $subtitle->getUrl(), $subtitle->getLanguage(), $subtitle->getRating(), $subtitle->getAuthor()
                )
            );
        };

        $downloadedRelease = $input->getArgument('downloaded-release');

        $output->writeln("Listing subtitles for $downloadedRelease");

        $factory = $this->getContainer()->get('bd_subber.release_subtitles.index_factory');
        $collection = $factory->build($downloadedRelease);

        if ($collection->hasBestSubtitle()) {
            $output->writeln('');
            $output->write('Best subtitle: ');
            $printSubtitleCallback($collection->getBestSubtitle());
        }

        $acceptableSubtitles = $collection->getCompatibleSubtitles();
        if (count($acceptableSubtitles) > 1) {
            $output->writeln('');
            $output->writeln('Other compatible subtitles ('.count($collection->getCompatibleSubtitles()).'):');
            array_map($printSubtitleCallback, $acceptableSubtitles);
        }

        $output->writeln('');
        $incompatibleSubtitles = $collection->getIncompatibleSubtitles();
        if (count($incompatibleSubtitles) > 1) {
            $output->writeln('Incompatible subtitles ('.count($incompatibleSubtitles).'):');
            array_map($printSubtitleCallback, $incompatibleSubtitles);
        }
    }
}


text:
__author__ = 'mroohian'

from abc import ABCMeta, abstractmethod
from salad.exceptions import ElementIsNotVisible
from salad.logger import logger

class PageObject:
    __metaclass__ = ABCMeta

    @abstractmethod
    def __init__(self):
        pass

    @abstractmethod
    def get_url(self, **args):
        raise NotImplemented(' get_url is undefined in page %s' % self.__class__.__name__)

    @abstractmethod
    def is_current(self, url, page_url):
        raise NotImplemented(' is_current is undefined in page %s' % self.__class__.__name__)

    def get_element(self, element_name):
        func_name = 'get_' + element_name
        try:
            func = getattr(self, func_name)
        # check if function exists
        except AttributeError:
            return None

        # TODO: make sure function doesn't throw an error
        element = func()

        # make sure element is not null
        if element is None:
            logger.warn(' %s element could not be found in page %s' % (element_name, self.__class__.__name__))

        return element

    def get_visible_element(self, element_name):
        element = self.get_element(element_name)
        if not element:
            raise ValueError('"%s" element could not be found in page %s' % (element_name, self.__class__.__name__))
        if not element.is_displayed():
            raise ElementIsNotVisible("The page element exist, but it is not visible. "
                                      "page element: %s, page: %s" %
                                      (element_name, self.__class__.__name__))
        return element


text:
require 'httparty'
require 'rash'

require 'inpay/case_normalizer'

module InPay
  class Client
    include HTTParty

    base_uri 'https://api.inpay.pl'
    query_string_normalizer CaseNormalizer

    def initialize(api_key)
      @api_key = api_key
    end

    def create_invoice(amount, params = {})
      params.merge! api_key: @api_key
      params.merge! amount: amount, currency: :PLN

      perform_request '/invoice/create', params
    end

    def invoice_status(code)
      perform_request '/invoice/status', invoice_code: code
    end

    private

    def perform_request(path, params = {})
      result = self.class.post path, body: params
      Hashie::Rash.new result.parsed_response
    end
  end
end


text: from gym_m3d.envs.m3d_environment import m3d


text:
//
// Symbols.cs
//
// Author:
//   Jb Evain (jbevain@gmail.com)
//
// Copyright (c) 2008 - 2010 Jb Evain
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System;
using System.IO;
using System.Runtime.InteropServices;
using SR = System.Reflection;
using ScriptSharp.Collections.Generic;

namespace ScriptSharp.Importer.IL.Cil {

	[StructLayout (LayoutKind.Sequential)]
    internal /* public */ struct ImageDebugDirectory {
		public int Characteristics;
		public int TimeDateStamp;
		public short MajorVersion;
		public short MinorVersion;
		public int Type;
		public int SizeOfData;
		public int AddressOfRawData;
		public int PointerToRawData;
	}

    internal /* public */ sealed class Scope : IVariableDefinitionProvider {

		Instruction start;
		Instruction end;

		Collection<Scope> scopes;
		Collection<VariableDefinition> variables;

		public Instruction Start {
			get { return start; }
			set { start = value; }
		}

		public Instruction End {
			get { return end; }
			set { end = value; }
		}

		public bool HasScopes {
			get { return !scopes.IsNullOrEmpty (); }
		}

		public Collection<Scope> Scopes {
			get {
				if (scopes == null)
					scopes = new Collection<Scope> ();

				return scopes;
			}
		}

		public bool HasVariables {
			get { return !variables.IsNullOrEmpty (); }
		}

		public Collection<VariableDefinition> Variables {
			get {
				if (variables == null)
					variables = new Collection<VariableDefinition> ();

				return variables;
			}
		}
	}

    internal /* public */ struct InstructionSymbol {

		public readonly int Offset;
		public readonly SequencePoint SequencePoint;

		public InstructionSymbol (int offset, SequencePoint sequencePoint)
		{
			this.Offset = offset;
			this.SequencePoint = sequencePoint;
		}
	}

    internal /* public */ sealed class MethodSymbols {

#if !IL_READ_ONLY
		internal int code_size;
		internal MetadataToken method_token;
		internal MetadataToken local_var_token;
#endif
        internal string method_name;
		internal Collection<VariableDefinition> variables;
		internal Collection<InstructionSymbol> instructions;

		public bool HasVariables {
			get { return !variables.IsNullOrEmpty (); }
		}

		public Collection<VariableDefinition> Variables {
			get {
				if (variables == null)
					variables = new Collection<VariableDefinition> ();

				return variables;
			}
		}

		public Collection<InstructionSymbol> Instructions {
			get {
				if (instructions == null)
					instructions = new Collection<InstructionSymbol> ();

				return instructions;
			}
		}

#if !IL_READ_ONLY
		public int CodeSize {
			get { return code_size; }
		}
#endif

		public string MethodName {
			get { return method_name; }
		}

#if !IL_READ_ONLY
		public MetadataToken MethodToken {
			get { return method_token; }
		}

        public MetadataToken LocalVarToken {
			get { return local_var_token; }
		}
#endif

        public MethodSymbols (string methodName)
		{
			this.method_name = methodName;
		}
	}

    internal /* public */ delegate Instruction InstructionMapper(int offset);

    internal /* public */ interface ISymbolReader : IDisposable {

		bool ProcessDebugHeader (ImageDebugDirectory directory, byte [] header);
		void Read (MethodBody body, InstructionMapper mapper);
		void Read (MethodSymbols symbols);
	}

    internal /* public */ interface ISymbolReaderProvider {

		ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName);
		ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream);
	}

	static class SymbolProvider {

		static readonly string symbol_kind = Type.GetType ("Mono.Runtime") != null ? "Mdb" : "Pdb";

		static SR.AssemblyName GetPlatformSymbolAssemblyName ()
		{
			var cecil_name = typeof (SymbolProvider).Assembly.GetName ();

			var name = new SR.AssemblyName {
				Name = "Mono.Cecil." + symbol_kind,
				Version = cecil_name.Version,
			};

			name.SetPublicKeyToken (cecil_name.GetPublicKeyToken ());

			return name;
		}

		static Type GetPlatformType (string fullname)
		{
			var type = Type.GetType (fullname);
			if (type != null)
				return type;

			var assembly_name = GetPlatformSymbolAssemblyName ();

			type = Type.GetType (fullname + ", " + assembly_name.FullName);
			if (type != null)
				return type;

			try {
				var assembly = SR.Assembly.Load (assembly_name);
				if (assembly != null)
					return assembly.GetType (fullname);
			} catch (FileNotFoundException) {
#if !CF
			} catch (FileLoadException) {
#endif
			}

			return null;
		}

		static ISymbolReaderProvider reader_provider;

		public static ISymbolReaderProvider GetPlatformReaderProvider ()
		{
			if (reader_provider != null)
				return reader_provider;

			var type = GetPlatformType (GetProviderTypeName ("ReaderProvider"));
			if (type == null)
				return null;

			return reader_provider = (ISymbolReaderProvider) Activator.CreateInstance (type);
		}

		static string GetProviderTypeName (string name)
		{
			return "Mono.Cecil." + symbol_kind + "." + symbol_kind + name;
		}

#if !IL_READ_ONLY

        static ISymbolWriterProvider writer_provider;

		public static ISymbolWriterProvider GetPlatformWriterProvider ()
		{
			if (writer_provider != null)
				return writer_provider;

			var type = GetPlatformType (GetProviderTypeName ("WriterProvider"));
			if (type == null)
				return null;

			return writer_provider = (ISymbolWriterProvider) Activator.CreateInstance (type);
		}

#endif
	}

#if !IL_READ_ONLY

    internal /* public */ interface ISymbolWriter : IDisposable {

		bool GetDebugHeader (out ImageDebugDirectory directory, out byte [] header);
		void Write (MethodBody body);
		void Write (MethodSymbols symbols);
	}

    internal /* public */ interface ISymbolWriterProvider {

		ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName);
		ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream);
	}

#endif
}


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.neatorobotics.sdk.android.example.robots.RobotsActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:contentScrim="@color/colorPrimary"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleMarginEnd="64dp"
            android:fitsSystemWindows="true">
            <!-- PARALLAX CONTENT -->
            <ImageView
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:src="@drawable/dashboard_top_image"
                android:scaleType="centerCrop"/>

            <!-- TOOLBAR -->
            <androidx.appcompat.widget.Toolbar
                app:layout_collapseMode="pin"
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@android:color/transparent"
                app:popupTheme="@style/AppTheme.PopupOverlay" />

        </com.google.android.material.appbar.CollapsingToolbarLayout>

    </com.google.android.material.appbar.AppBarLayout>

    <include
        layout="@layout/content_robots" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>


text:
package io.gomint.world;

/**
 * @author BlackyPaw
 * @version 1.0
 */
public enum GameDifficulty {

	PEACEFUL( 0 ),
	EASY( 1 ),
	NORMAL( 2 ),
	HARD( 3 );

	private int difficultyDegree;

	GameDifficulty( int difficultyDegree ) {
		this.difficultyDegree = difficultyDegree;
	}

	/**
	 * Gets the degree of difficulty used inside binary formats such as the NBT inside any level.dat file to
	 * represent the game difficulty as an integer.
	 *
	 * @return The difficulty's degree
	 */
	public int getDifficultyDegree() {
		return this.difficultyDegree;
	}

	/**
	 * Gets a difficulty given its degree. Returns the difficulty matching the degree or null if no difficulty is
	 * assigned to the degree specified.
	 *
	 * @param degree The degree to get the difficulty of
	 * @return The game difficulty or null if not found
	 */
	public static GameDifficulty valueOf( int degree ) {
		return ( degree == 0 ? PEACEFUL : ( degree == 1 ? EASY : ( degree == 2 ? NORMAL : ( degree == 3 ? HARD : null ) ) ) );
	}

}


text:
using System.Collections.Generic;
using System.IO.Abstractions;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Newtonsoft.Json;
using SonarLint.VisualStudio.Core;
using SonarLint.VisualStudio.Core.Binding;
using SonarLint.VisualStudio.Core.CFamily;
using SonarLint.VisualStudio.Integration.CFamily;

namespace SonarLint.VisualStudio.Integration.UnitTests.CFamily
{
    [TestClass]
    public class CFamilyRuleConfigProviderTests
    {
        [TestMethod]
        public void Get_StandaloneMode()
        {
            // Arrange
            var builder = new TestEnvironmentBuilder(SonarLintMode.Standalone)
            {
                ConnectedModeSettings = new UserSettings(new RulesSettings
                {
                    Rules = new Dictionary<string, RuleConfig>
                    {
                        {  "cpp:rule1", new RuleConfig { Level = RuleLevel.Off } },
                        {  "cpp:rule2", new RuleConfig { Level = RuleLevel.On } },
                        {  "cpp:rule3", new RuleConfig { Level = RuleLevel.On } },
                        {  "XXX:rule3", new RuleConfig { Level = RuleLevel.On } }
                    }
                }),

                StandaloneModeSettings = new UserSettings(new RulesSettings
                {
                    Rules = new Dictionary<string, RuleConfig>
                    {
                        {  "cpp:rule1", new RuleConfig { Level = RuleLevel.On } },
                        {  "cpp:rule2", new RuleConfig { Level = RuleLevel.Off } },
                        {  "cpp:rule4", new RuleConfig { Level = RuleLevel.On } },
                        {  "XXX:rule3", new RuleConfig { Level = RuleLevel.On } }
                    }
                }),

                SonarWayConfig = new DummyCFamilyRulesConfig("cpp")
                    .AddRule("rule1", IssueSeverity.Blocker, isActive: false)
                    .AddRule("rule2", IssueSeverity.Critical, isActive: false)
                    .AddRule("rule3", IssueSeverity.Major, isActive: true)
                    .AddRule("rule4", IssueSeverity.Minor, isActive: false)
            };

            var testSubject = builder.CreateTestSubject();

            // Act
            var result = testSubject.GetRulesConfiguration("cpp");

            // Assert
            result.ActivePartialRuleKeys.Should().BeEquivalentTo("rule1", "rule3", "rule4");
            result.AllPartialRuleKeys.Should().BeEquivalentTo("rule1", "rule2", "rule3", "rule4");

            builder.AssertConnectedSettingsNotAccessed();
        }

        [TestMethod]
        [DataRow(SonarLintMode.Connected)]
        [DataRow(SonarLintMode.LegacyConnected)]
        public void Get_ConnectedMode(SonarLintMode mode)
        {
            // Arrange
            var builder = new TestEnvironmentBuilder(mode)
            {
                ConnectedModeSettings = new UserSettings(new RulesSettings
                {
                    Rules = new Dictionary<string, RuleConfig>
                    {
                        { "cpp:rule1", new RuleConfig { Level = RuleLevel.Off, Severity = null } },
                        { "cpp:rule2", new RuleConfig { Level = RuleLevel.On, Severity = IssueSeverity.Blocker } },
                        { "cpp:rule3", new RuleConfig { Level = RuleLevel.On, Severity = IssueSeverity.Critical } },
                        { "XXX:rule4", new RuleConfig { Level = RuleLevel.On, Severity = IssueSeverity.Info } }
                    }
                }),

                StandaloneModeSettings = new UserSettings(new RulesSettings
                {
                    Rules = new Dictionary<string, RuleConfig>
                    {
                        { "cpp:rule1", new RuleConfig { Level = RuleLevel.On } },
                        { "cpp:rule2", new RuleConfig { Level = RuleLevel.Off } },
                        { "cpp:rule4", new RuleConfig { Level = RuleLevel.On } },
                        { "XXX:rule4", new RuleConfig { Level = RuleLevel.On } }
                    }
                }),

                SonarWayConfig = new DummyCFamilyRulesConfig("cpp")
                    .AddRule("rule1", IssueSeverity.Info, isActive: false)
                    .AddRule("rule2", IssueSeverity.Major, isActive: false)
                    .AddRule("rule3", IssueSeverity.Minor, isActive: true)
                    .AddRule("rule4", IssueSeverity.Blocker, isActive: false)
            };

            var testSubject = builder.CreateTestSubject();

            // Act
            var result = testSubject.GetRulesConfiguration("cpp");

            // Assert
            result.ActivePartialRuleKeys.Should().BeEquivalentTo("rule2", "rule3");
            result.AllPartialRuleKeys.Should().BeEquivalentTo("rule1", "rule2", "rule3", "rule4");

            result.RulesMetadata["rule1"].DefaultSeverity.Should().Be(IssueSeverity.Info);     // not set in ConnectedModeSettings so should use default
            result.RulesMetadata["rule2"].DefaultSeverity.Should().Be(IssueSeverity.Blocker);  // ConnectedModeSetting should override the default
            result.RulesMetadata["rule3"].DefaultSeverity.Should().Be(IssueSeverity.Critical); // ConnectedModeSetting should override the default
            result.RulesMetadata["rule4"].DefaultSeverity.Should().Be(IssueSeverity.Blocker); // ConnectedModeSetting should override the default

            builder.AssertStandaloneSettingsNotAccessed();
            builder.Logger.AssertOutputStringExists(Resources.Strings.CFamily_UsingConnectedModeSettings);
        }

        [TestMethod]
        [DataRow(SonarLintMode.Connected)]
        [DataRow(SonarLintMode.LegacyConnected)]
        public void Get_ConnectedMode_MissingSettings_StandaloneModeSettingsUsed(SonarLintMode mode)
        {
            // Arrange
            var builder = new TestEnvironmentBuilder(mode)
            {
                ConnectedSettingsFileExists = false,

                StandaloneModeSettings = new UserSettings(new RulesSettings
                {
                    Rules = new Dictionary<string, RuleConfig>
                    {
                        {  "cpp:rule1", new RuleConfig { Level = RuleLevel.On } },
                        {  "cpp:rule2", new RuleConfig { Level = RuleLevel.Off } },
                        {  "cpp:rule4", new RuleConfig { Level = RuleLevel.On } },
                        {  "XXX:rule3", new RuleConfig { Level = RuleLevel.On } }
                    }
                }),

                SonarWayConfig = new DummyCFamilyRulesConfig("cpp")
                    .AddRule("rule1", IssueSeverity.Info, isActive: false)
                    .AddRule("rule2", IssueSeverity.Major, isActive: false)
                    .AddRule("rule3", IssueSeverity.Minor, isActive: true)
                    .AddRule("rule4", IssueSeverity.Blocker, isActive: false)
            };

            var testSubject = builder.CreateTestSubject();

            // Act
            var result = testSubject.GetRulesConfiguration("cpp");

            // Assert
            result.ActivePartialRuleKeys.Should().BeEquivalentTo("rule1", "rule3", "rule4");
            result.AllPartialRuleKeys.Should().BeEquivalentTo("rule1", "rule2", "rule3", "rule4");

            builder.Logger.AssertOutputStringExists(Resources.Strings.CFamily_UnableToLoadConnectedModeSettings);
        }

        private class TestEnvironmentBuilder
        {
            private readonly Mock<IUserSettingsProvider> standaloneSettingsProviderMock;
            private readonly Mock<ICFamilyRulesConfigProvider> sonarWayProviderMock;

            private readonly Mock<IFileSystem> fileSystemMock;

            private readonly Mock<IHost> host;
            private readonly ConfigurableActiveSolutionBoundTracker activeSolutionBoundTracker;
            private readonly Mock<ISolutionRuleSetsInformationProvider> rulesetInfoProviderMock;

            private readonly SonarLintMode bindingMode;

            public UserSettings StandaloneModeSettings { get; set; }
            public UserSettings ConnectedModeSettings { get; set; }
            public DummyCFamilyRulesConfig SonarWayConfig { get; set; }

            public bool ConnectedSettingsFileExists { get; set; } = true;

            public TestLogger Logger { get; }

            public TestEnvironmentBuilder(SonarLintMode mode)
            {
                standaloneSettingsProviderMock = new Mock<IUserSettingsProvider>();
                fileSystemMock = new Mock<IFileSystem>();
                Logger = new TestLogger();

                sonarWayProviderMock = new Mock<ICFamilyRulesConfigProvider>();
                activeSolutionBoundTracker = new ConfigurableActiveSolutionBoundTracker();
                rulesetInfoProviderMock = new Mock<ISolutionRuleSetsInformationProvider>();

                // Register the local services
                host = new Mock<IHost>();
                host.Setup(x => x.GetService(typeof(ISolutionRuleSetsInformationProvider))).Returns(rulesetInfoProviderMock.Object);

                bindingMode = mode;
            }

            public CFamilyRuleConfigProvider CreateTestSubject()
            {
                // Data: set up the binding configuration
                var projectToReturn = new BoundSonarQubeProject(new System.Uri("http://localhost:9000"),
                    "sqProjectKey", "sqProjectName");
                activeSolutionBoundTracker.CurrentConfiguration = new BindingConfiguration(projectToReturn, bindingMode, "c:\\test\\");

                // Data: user-configured settings
                standaloneSettingsProviderMock.Setup(x => x.UserSettings).Returns(StandaloneModeSettings);

                // Data: connected mode settings
                var connectedSettingsFilesPath = activeSolutionBoundTracker.CurrentConfiguration.BuildPathUnderConfigDirectory(Language.Cpp.FileSuffixAndExtension);
                var connectedSettingsData = JsonConvert.SerializeObject(ConnectedModeSettings?.RulesSettings, Formatting.Indented);

                fileSystemMock.Setup(x => x.File.Exists(connectedSettingsFilesPath)).Returns(ConnectedSettingsFileExists);
                fileSystemMock.Setup(x => x.File.ReadAllText(connectedSettingsFilesPath))
                    .Returns(connectedSettingsData);

                // Data: SonarWay configuration
                sonarWayProviderMock.Setup(x => x.GetRulesConfiguration(It.IsAny<string>()))
                    .Returns(SonarWayConfig);

                var testSubject = new CFamilyRuleConfigProvider(host.Object, activeSolutionBoundTracker, standaloneSettingsProviderMock.Object, Logger,
                    sonarWayProviderMock.Object, fileSystemMock.Object);

                return testSubject;
            }

            public void AssertConnectedSettingsNotAccessed()
            {
                fileSystemMock.Verify(x => x.File.Exists(It.IsAny<string>()), Times.Never);
                fileSystemMock.Verify(x => x.File.ReadAllText(It.IsAny<string>()), Times.Never);
            }

            public void AssertStandaloneSettingsNotAccessed()
            {
                standaloneSettingsProviderMock.Verify(x => x.UserSettings, Times.Never);
            }
        }
    }
}


text:
SoilGuru
========

SoilGuru logs soil moisture readings using Ardruino and Python.

Read more on this Hack in the Blog post and tutorial. This project is open source.

Authored by @MichielHuijse and @kartikkumar.


text:
package com.baasbox.android.samples.aloa;

/**
 * Created by Andrea Tortorella on 11/08/14.
 */
public final class Configuration {

    private Configuration(){}

    public static final String GCM_SENDER_ID = BuildConfig.SENDERID; // replace with your own sender id

    public static final String APPCODE = "1234567890";

    public static final String API_DOMAIN = "192.168.56.1";

    public static final int PORT = 9000;

}


text:
using System;

namespace QuantConnect.Securities
{
    /// <summary>
    /// Represents the key to a single entry in the <see cref="MarketHoursDatabase"/> or the <see cref="SymbolPropertiesDatabase"/>
    /// </summary>
    public class SecurityDatabaseKey : IEquatable<SecurityDatabaseKey>
    {
        private const string Wildcard = "[*]";

        /// <summary>
        /// The market. If null, ignore market filtering
        /// </summary>
        public readonly string Market;
        /// <summary>
        /// The symbol. If null, ignore symbol filtering
        /// </summary>
        public readonly string Symbol;
        /// <summary>
        /// The security type
        /// </summary>
        public readonly SecurityType SecurityType;
        /// <summary>
        /// Initializes a new instance of the <see cref="SecurityDatabaseKey"/> class
        /// </summary>
        /// <param name="market">The market</param>
        /// <param name="symbol">The symbol. specify null to apply to all symbols in market/security type</param>
        /// <param name="securityType">The security type</param>
        public SecurityDatabaseKey(string market, string symbol, SecurityType securityType)
        {
            Market = market;
            SecurityType = securityType;
            Symbol = symbol;
        }

        /// <summary>
        /// Parses the specified string as a <see cref="SecurityDatabaseKey"/>
        /// </summary>
        /// <param name="key">The string representation of the key</param>
        /// <returns>A new <see cref="SecurityDatabaseKey"/> instance</returns>
        public static SecurityDatabaseKey Parse(string key)
        {
            var parts = key.Split('-');
            if (parts.Length != 3)
            {
                throw new ArgumentException("The specified key was not in the expected format: " + key);
            }
            SecurityType type;
            if (!Enum.TryParse(parts[0], out type))
            {
                throw new ArgumentException("Unable to parse '" + parts[2] + "' as a SecurityType.");
            }

            var market = parts[1];
            if (market == Wildcard) market = null;

            var symbol = parts[2];
            if (symbol == Wildcard) symbol = null;

            return new SecurityDatabaseKey(market, symbol, type);
        }

        #region Equality members

        public bool Equals(SecurityDatabaseKey other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return string.Equals(Market, other.Market) && Equals(Symbol, other.Symbol) && SecurityType == other.SecurityType;
        }

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

        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = (Market != null ? Market.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Symbol != null ? Symbol.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (int)SecurityType;
                return hashCode;
            }
        }

        public static bool operator ==(SecurityDatabaseKey left, SecurityDatabaseKey right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(SecurityDatabaseKey left, SecurityDatabaseKey right)
        {
            return !Equals(left, right);
        }

        #endregion

        public override string ToString()
        {
            return string.Format("{0}-{1}-{2}", SecurityType, Market ?? Wildcard, Symbol ?? Wildcard);
        }
    }
}


text: from .reaction import AsyncReactions, Reactions