text:
<resources>
    <string name="app_name">WGPlaner</string>
    <string name="add_item_activity">Add Item</string>
    <string name="set_up_group_activity">Create Group</string>
    <string name="join_group_activity">Join Group</string>
    <string name="profile_settings_activity">Your Profile</string>
    <string name="group_settings_activity">Your Group</string>
    <string name="title_activity_home">Home</string>

    <string name="action_settings">Settings</string>
    <string name="action_sort">Sort</string>

    <string name="splash_screen_failed_to_connect">Connection to Server failed</string>
    <string name="splash_screen_connection_timeout">Connection Timeout</string>
    <string name="splash_screen_swipe_to_refresh">Swipe down to refresh</string>

    <!-- String related to NavView -->
    <string name="navigation_drawer_open">Open navigation drawer</string>
    <string name="navigation_drawer_close">Close navigation drawer</string>
    <string name="nav_dashboard">Dashboard</string>
    <string name="nav_shopping_list">Shopping List</string>
    <string name="nav_accounting">Accounting</string>
    <string name="nav_bought_items">Bought Items</string>
    <string name="nav_rosters">Rosters</string>
    <string name="nav_calendar">Calendar</string>
    <string name="nav_pinboard">Pinboard</string>
    <string name="nav_section_sections">Sections</string>
    <string name="nav_section_settings">Settings</string>
    <string name="nav_general_settings">General</string>
    <string name="nav_profile_settings">Profile</string>
    <string name="nav_group_settings">Group</string>

    <!-- Registration Strings -->
    <string name="nav_back">Navigate back</string>
    <string name="header_welcome">Welcome!</string>
    <string name="header_username">Please pick a descriptive Username so that your friends recognize you</string>
    <string name="header_profile_picture">You can upload a profile picture, if you want to</string>
    <string name="header_email_address">You can state an email address, if you want to</string>
    <string name="text_welcome">You\'re about to register for the WGPlaner Android Application.\n\nWe will guide you through the Registration progress…</string>
    <string name="btn_continue">Continue</string>
    <string name="btn_skip">Skip</string>
    <string name="input_username_hint">Username</string>
    <string name="input_email_hint">EMail</string>
    <string name="warning_input_username_empty">Please pick a Username!</string>
    <string name="logo_content_description">WGPlaner Logo</string>

    <!-- AddItem strings -->
    <string name="add_item_name_hint">Product name</string>
    <string name="add_item_number_hint">Number</string>
    <string name="add_item_requested_for_hint">Requested for</string>
    <string name="add_item_add_requested_for_label">Add User</string>
    <string name="add_item_add_requested_for_pick_users">Pick Users</string>
    <string name="add_item_add_requested_for_positive">OK</string>
    <string name="add_item_add_requested_for_negative">Cancel</string>
    <string name="add_item_requested_for_close_content_description">Remove user</string>

    <!-- SetUp Strings -->
    <string name="set_up_group_name_hint">Group name</string>
    <string name="set_up_group_currency_hint">Currency</string>
    <string name="set_up_group_name_error">Please enter a group name</string>
    <string name="set_up_group_currency_error">Please pick a currency</string>
    <string name="set_up_group_header">Dear %s</string>
    <string name="set_up_group_body_key">In order to use all available features of the WGPlaner Application you have to be member of a group.\n\nTherefore you can either join an existing group by entering the corresponding access key or create a new group</string>
    <string name="set_up_key_hint">Key</string>
    <string name="set_up_btn_create_group">Create group</string>
    <string name="set_up_btn_join_group">Join group</string>

    <string name="full_screen_add_save_item">SAVE</string>

    <string name="dialog_discard_message">Discard draft?</string>
    <string name="dialog_discard_positive">Discard</string>
    <string name="dialog_discard_negative">Cancel</string>

    <!-- Server-Result Strings -->
    <string name="user_unauthorized">Unauthorized</string>
    <string name="server_connection_failed">Connection to Server failed</string>

    <string name="section_title_set_up_group">Group SetUp</string>
    <string name="section_title_shopping_list">Shopping List</string>
    <string name="section_title_pinboard">Pinboard</string>
    <string name="section_title_bought_items">Bought Items</string>

    <!-- Product related strings -->
    <string name="product_attribute_number">Number</string>
    <string name="product_attribute_requested_by">Requested by</string>
    <string name="product_attribute_requested_for">Requested for</string>
    <string name="product_attribute_price">Price</string>
    <string name="product_action_add_price">Add Price</string>
    <string name="product_action_change_price">Change Price</string>

    <string name="group_label">Group</string>
    <string name="asset_statements" translatable="false">[{\n  \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n  \"target\": {\n    \"namespace\": \"web\",\n    \"site\": \"https://api.wgplaner.ameyering.de\",\n  }\n}]</string>

    <!-- Profile Settings strings -->
    <string name="profile_settings_btn_leave_group">Leave Group</string>
    <string name="profile_settings_username_hint">Name</string>
    <string name="profile_settings_btn_save_changes">Save Changes</string>
    <string name="delete_display_name_error">You can not delete your Name</string>
    <string name="edit_profile_button">EDIT</string>

    <!-- BackNavigation String -->
    <string name="back_press_leave_notification">Press back again to leave the Application</string>

    <string name="user_detail_email_default">Not specified</string>
    <string name="currency">Currency</string>
    <string name="euro">Euro</string>
    <string name="dollar">Dollar</string>
    <string name="members">Groupmembers</string>
    <string name="addUser">Add User</string>

    <!-- Group Settings strings -->
    <string name="delete_group_name_error"> You can not delete the Name</string>
    <string name="delete_currency_error"> You can not delete the Currency</string>

    <string name="load_profile_picture_error">Failed to load Picture</string>

    <!-- UserDialog Strings -->
    <string name="joined_at_hint">Joined at</string>
    <string name="dialog_invite_friends_title">Access Key</string>
    <string name="dialog_invite_friends_button_copy">Copy</string>
    <string name="dialog_invite_friends_button_share">Share</string>
    <string name="send_to">Send to</string>

    <string name="dialog_leave_group_title">Leave group</string>
    <string name="dialog_leave_group_message">Are you sure?</string>
    <string name="dialog_leave_group_positive">Leave Group</string>

    <string name="access_key_copied">Access Key copied to Clipboard</string>
    <string name="generate_access_key_error">Failed to generate Access Key</string>

    <string name="invalid_email">Please state a valid EMail or no EMail</string>
    <string name="fill_out_all_fields">Please fill out all fields</string>

    <string name="sort_by_label_requested_for">Requested for</string>
    <string name="sort_by_label_requested_by">Requested by</string>
    <string name="sort_by_label_category">Category</string>
    <string name="sort_by_label_name">Name</string>

    <string name="search_title">Search</string>

    <string name="bill_detail_cost_label">Costs</string>
    <string name="bill_detail_items_label">Items</string>
    <string name="bill_detail_action_pay">mark as paid</string>
    <string name="bill_detail_action">complete billing</string>

    <string name="bought_items_action_mode_menu_bill">bill items</string>
    <string name="bought_items_action_mode_menu_undo">undo</string>
    <string name="bought_items_action_mode_selected_label">selected</string>
    <string name="bought_items_action_mode_price_not_set">not set</string>

    <string name="item_detail_action_add_price">Add price</string>
    <string name="item_detail_label_bought_on">Bought on</string>
    <string name="item_detail_label_bought_by">Bought by</string>
    <string name="item_detail_label_requested_by">Requested by</string>
    <string name="item_detail_label_requested_for">Requested for</string>

    <string name="error_invalid_currency">Please enter a valid currency</string>
    <string name="error_group_name_invalid">Please enter a group name</string>

    <string name="add_price_dialog">Add price</string>
    <string name="add_price_hint">Price</string>
    <string name="dialog_add_price_positive">Add Price</string>
    <string name="dialog_add_price_negative">Cancel</string>
    <string name="dialog_add_price_error">Please provide a price or cancel</string>

    <string name="create_bill_add_due_date_hint">Due Date</string>
    <string name="create_bill_due_date_error">Please select a date one week after today</string>
    <string name="create_bill_title">Create Bill</string>
    <string name="create_bill_items_label">Items</string>
    <string name="create_bill_recipients_label">Recipients</string>
    <string name="item_detail_label_amount">Amount</string>
    <string name="item_detail_title">Item</string>
    <string name="item_detail_amount_format">%s pieces</string>

    <string name="group_settings_action_add_member">Add</string>
    <string name="group_settings_action_remove_member">Remove</string>
    <string name="group_settings_action_make_admin">Make Admin</string>
    <string name="group_settings_label_members">Members</string>
    <string name="group_settings_name_error">Please provide a name</string>
    <string name="group_settings_currency_error">Please select a valid currency</string>

    <string name="section_shopping_list_no_items">There are currently no items in the shopping list</string>
    <string name="share_join_intent_chooser">Share access key</string>
    <string name="share_join_intent_subject">Join our WGPlaner Group!</string>
    <string name="share_join_intent_text">Click the link to join our WGPlaner Group: %s</string>

    <string name="section_bills_received_bills_tab">Received</string>
    <string name="section_bills_sent_bills_tab">Sent</string>
    <string name="section_title_bills">Bills</string>

    <string name="pick_image">Pick image</string>
    <string name="generate_image">Generate standard Image</string>

    <string name="cost_recipient_sum_label">Sum</string>
    <string name="cost_recipient_status_label">Status</string>
    <string name="cost_recipient_action_confirm">Confirm Payment</string>
    <string name="bill_detail_owner_label">Owner</string>
    <string name="bill_detail_recipients_label">Recipients</string>

    <string name="bought_items_empty">There are currently no bought Items which aren\'t billed yet</string>
    <string name="bill_list_empty">There are currently no bills to display</string>

    <string name="user_attribute_name">Name</string>
    <string name="user_attribute_email">Email</string>
    <string name="user_attribute_created_at">Joined at</string>
    <string name="edit_display_name_title">Edit Name</string>
    <string name="edit_email_title">Edit Email</string>
    <string name="load_image_failed">Loading of image failed</string>
</resources>


text:
Object methods can be overridden on prototypes.

Object methods can be overridden on instances.

Object methods extend to all prototypes.

## Minor

- `#array`
-- Returns `true` if *self* is an array, `false` otherwise.

- `#bool`
-- Returns `true` if *self* is a boolean, `false` otherwise.

- `#empty`
-- Returns `true` if *self* has no own properties, `false` otherwise. Returns undefined on non-objects. *Note: __Array__ and __String__ have their own `#empty` methods.*

- `#func`
-- Returns `true` if *self* is a function, `false` otherwise.

- `#numeric`
-- Returns `true` if *self* is a numeric value, `false` otherwise. `NaN` is *not* numeric, `Infinity` is.

- `#object`
-- Returns `true` if *self* is an object.

- `#size`
-- For objects, returns the number of *own* properties.
-- Size returns a value specific to each type. See individual documentation.

- `#string`
-- Returns `true` if *self* is a string value, `false` otherwise.

- `#type`
-- Returns a string representation of *self's* type.

## Major

- `#eql(value)`
-- Returns `true` if *self* strictly equals the supplied argument, `false` otherise.

- `#fetch(val, sub)`
-- Returns value of *self*'s `val` property. If property does not exist *sub* is the return value. if *sub* is a function, the return value of invoking that function is returned.

redpajama_set_name: RedPajamaGithub


text:
namespace Nancy.Tests
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Xunit;

    public static class ShouldAssertExtensions
    {
        public static void ShouldStartWith(this string actual, string expected)
        {
            Assert.True(actual.StartsWith(expected), String.Format("Expected to start with {0} but ended with {1}", expected, actual));
        }

        public static void ShouldEndWith(this string actual, string expected)
        {
            Assert.True(actual.EndsWith(expected), String.Format("Expected to end with {0} but ended with {1}", expected, actual));
        }

        public static void ShouldMatch<T>(this T actual, Func<T, bool> condition)
        {
            Assert.True(condition.Invoke(actual));
        }

        public static void ShouldBeEmpty(this string actual)
        {
            Assert.True(string.IsNullOrEmpty(actual));
        }

        public static void ShouldNotBeEmpty(this string actual)
        {
            Assert.False(string.IsNullOrEmpty(actual));
        }

        public static void ShouldImplementInterface<T>(this Type actual)
        {
            var found =
                actual.GetInterfaces().Contains(typeof(T));

            Assert.True(found);
        }

        public static void ShouldContainType<T>(this IEnumerable collection)
        {
            var selection =
                from c in collection.Cast<object>()
                where c.GetType().IsAssignableFrom(typeof(T))
                select c;

            Assert.True(selection.Any());
        }

        public static void ShouldContainInOrder(this string actual, params string[] values)
        {
            int index = 0;
            foreach (string value in values)
            {
                int nextIndex = actual.IndexOf(value, index);
                Assert.True(nextIndex >= 0, string.Format("Looking for {0}", value));
                index = nextIndex + value.Length;
            }
        }

        public static void ShouldContain(this string actual, string expected)
        {
            Assert.True(actual.Contains(expected), string.Format("'{0}' does not contain '{1}'", actual, expected));
        }

        public static void ShouldNotContain(this string actual, string expected)
        {
            Assert.False(actual.Contains(expected), string.Format("'{0}' does contain '{1}'", actual, expected));
        }

        public static void ShouldHave<T>(this IEnumerable<T> list, Func<T, bool> predicate)
        {
            Assert.True(list.Any(predicate));
        }

        public static void ShouldHaveCount<T>(this IEnumerable<T> list, int expected)
        {
            list.Count().ShouldEqual(expected);
        }

        public static void ShouldBeTrue(this bool actual)
        {
            Assert.True(actual);
        }

        public static void ShouldBeFalse(this bool actual)
        {
            Assert.False(actual);
        }

        public static void ShouldEqual(this object actual, object expected)
        {
            Assert.Equal(expected, actual);
        }

        public static void ShouldEqual(this DateTime actual, DateTime expected)
        {
            Assert.Equal(expected.Year, actual.Year);
            Assert.Equal(expected.Month, actual.Month);
            Assert.Equal(expected.Day, actual.Day);
            Assert.Equal(expected.Hour, actual.Hour);
            Assert.Equal(expected.Minute, actual.Minute);
            Assert.Equal(expected.Second, actual.Second);
        }

        public static void ShouldEqualSequence<T>(this IEnumerable<T> actual, IEnumerable<T> expected)
        {
            Assert.True(actual.SequenceEqual(expected));
        }

        public static void ShouldBeGreaterThan(this int actual, int smallestValueNotAccepted)
        {
            Assert.True(actual > smallestValueNotAccepted);
        }

        public static void ShouldNotEqual(this object actual, object expected)
        {
            Assert.NotEqual(expected, actual);
        }

        public static void ShouldNotBeSameAs(this object actual, object expected)
        {
            Assert.NotSame(expected, actual);
        }

        public static void ShouldBeSameAs(this object actual, object expected)
        {
            Assert.Same(expected, actual);
        }

        public static void ShouldBeNull(this object actual)
        {
            Assert.Null(actual);
        }

        public static void ShouldNotBeNull(this object actual)
        {
            Assert.NotNull(actual);
        }

        public static void ShouldBeOfType<T>(this Type asserted)
        {
            Assert.True(asserted == typeof(T));
        }

        public static void ShouldBeOfType<T>(this object asserted)
        {
            asserted.ShouldBeOfType(typeof(T));
        }

        public static void ShouldBeOfType(this object asserted, Type expected)
        {
            Assert.IsAssignableFrom(expected, asserted);
        }

        public static void ShouldNotBeOfType<T>(this object asserted)
        {
            Assert.True(!asserted.GetType().Equals(typeof(T)));
        }

        public static void ShouldBeThrownBy(this Type expectedType, Action context)
        {
            try
            {
                context();
            }
            catch (Exception thrownException)
            {
                Assert.Equal(expectedType, thrownException.GetType());
            }
        }

        public static void ShouldEqual(this MemoryStream stream, string expected, bool trim = false)
        {
            stream.Position = 0;
            using (var reader = new StreamReader(stream))
            {
                var actual = reader.ReadToEnd();

                if (trim)
                {
                    actual = actual.Trim();
                }

                actual.ShouldEqual(expected);
            }
        }
    }
}


text:
class AFramer
{
protected:
	size_t	_frame;
	double	_fps;
	double	_start;
	double	_end;

	inline void	calcFPS();
	double		latence() const;
public:
	AFramer(size_t frame);
	virtual ~AFramer();

	void	start();
	void	end();
	void	reset();

	size_t		getFrame() const;
	void		setFrame(size_t frame);

	virtual bool	wait() const = 0;
	virtual double	time() const = 0;
};

#endif


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../../../css/Hui.css" />

            小红书

                <input type="text" name="keyword" placeholder="请输入关键字..." id="H-header-search-text" class="H-width-100-percent H-box-sizing-border-box H-border-none H-padding-horizontal-both-10 H-font-size-14 H-padding-vertical-both-5 H-theme-background-color-transparent H-theme-font-color-black H-padding-horizontal-left-25" />

            福利社

消息

            User

                首页

                发现

                消息

                我


text:
function openClassDetail(){
	var args = {
		id: this.id
	};

	var sessionDetail = Alloy.createController("classdetail", args);
	sessionDetail.openMainWindow($.ClassesTab);
}

var titleLabel = Titanium.UI.createLabel({
    color:'#FBC9BA',
    text:'Mis Clases',
    font:{fontWeight:'bold', fontSize:'16'}
});

if(OS_IOS) {
   $.classWindow.setTitleControl(titleLabel);
}

Alloy.Globals.veriftDataBase();
var db = Titanium.Database.open('Events');
var rows = db.execute("SELECT * FROM Class c LEFT JOIN Rel_UserClass r where c.GroupID = r.GroupID and r.ConsultantID = '" + Alloy.Globals.loggedUser + "' and c.EventID = " + Alloy.Globals.seminarID);

var results = [];
while (rows.isValidRow()) {
          results.push({
            classID: rows.fieldByName('ClassID'),
            className: rows.fieldByName('ClassName'),
            classDate: rows.fieldByName('ClassDate'),
            classTime: rows.fieldByName('ClassTime'),
            classVenue: rows.fieldByName('Venue'),
            classImageURL: rows.fieldByName('ClassImageURL')
          });

          rows.next();
}
rows.close();

itemRows = [];
for (var c=0;c<results.length;c++)
{
	var item = results[c];
	var row = Ti.UI.createTableViewRow({height:'150', layout:'horizontal',id:item.classID, hasChild:true});
	row.addEventListener('click', openClassDetail);

	var imagePhoto = Ti.UI.createImageView({image:item.classImageURL, width:'100px', left:'10'});
	row.add(imagePhoto);

	var customView = Ti.UI.createView({
		id:'rowContainer',
		layout:'vertical',
		textAlign:Ti.UI.TEXT_ALIGNMENT_LEFT,
		width: Ti.UI.FILL
		});

	var classNameLabel = Ti.UI.createLabel({
		id: 'sessionName',
		text: item.className,
		font: { fontSize: 14, fontWeight:'bold'},
		color: "black",
		textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
		top: 10,
		left: 5
	});
	customView.add(classNameLabel);

	var venueLabel = Ti.UI.createLabel({
		id: 'textInfo',
		text: item.classVenue,
		font: { fontSize: 11},
		color: "gray",
		textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
		left: 5
	});
	customView.add(venueLabel);

	var classDate = Ti.UI.createLabel({
		id: 'textInfo',
		text: item.classDate,
		font: { fontSize: 11},
		color: "gray",
		textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
		left: 5
	});
	customView.add(classDate);

	var classTime = Ti.UI.createLabel({
		id: 'textInfo',
		text: item.classTime,
		font: { fontSize: 11},
		color: "gray",
		textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
		left: 5
	});
	customView.add(classTime);

	row.add(customView);

	itemRows[c] = row;
}

$.classTable.data = itemRows;
db.close();


text:
@(requests: List[lila.team.RequestWithUser])(implicit ctx: Context)

@title = @{ requests.size + " join requests"  }

@team.layout(
title = title,
currentTab = "requests".some) {

@title

  @team.requests(requests, none)

}


text:
package de.unioninvestment.eai.portal.portlet.crud.domain.model;

import com.google.common.collect.ImmutableMap;
import com.vaadin.ui.UI;
import de.unioninvestment.eai.portal.portlet.crud.config.CompoundSearchConfig;
import de.unioninvestment.eai.portal.portlet.crud.domain.events.CompoundQueryChangedEvent;
import de.unioninvestment.eai.portal.portlet.crud.domain.events.CompoundQueryChangedEventHandler;
import de.unioninvestment.eai.portal.portlet.crud.domain.exception.BusinessException;
import de.unioninvestment.eai.portal.portlet.crud.domain.model.TableColumn.Searchable;
import de.unioninvestment.eai.portal.portlet.crud.domain.model.filter.*;
import de.unioninvestment.eai.portal.portlet.crud.domain.search.SearchableTablesFinder;
import de.unioninvestment.eai.portal.support.vaadin.junit.AbstractSpringPortletContextTest;
import de.unioninvestment.eai.portal.support.vaadin.junit.LiferayContext;
import org.apache.lucene.queryparser.classic.ParseException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.test.context.ContextConfiguration;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.*;

import static java.util.Arrays.asList;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.*;

@ContextConfiguration({ "/eai-portal-web-test-applicationcontext.xml" })
public class CompoundSearchTest extends AbstractSpringPortletContextTest {

	private CompoundSearch search;

	@Mock
	private SearchableTablesFinder searchableTablesFinderMock;
	@Mock
	private Table tableMock;
	@Mock
	private TableColumns columnsMock;
	@Mock
	private DataContainer containerMock;
	@Mock
	private CompoundQueryChangedEventHandler handlerMock;

	@Rule
	public LiferayContext context = new LiferayContext();

	@Captor
	private ArgumentCaptor<CompoundQueryChangedEvent> eventCaptor;

	@Mock
	private OptionList selectOptionsListMock, selectTextOptionsListMock;

	@Before
	public void setUp() {
		MockitoAnnotations.initMocks(this);
		CompoundSearchConfig config = new CompoundSearchConfig();

		when(tableMock.getColumns()).thenReturn(columnsMock);
		when(tableMock.getContainer()).thenReturn(containerMock);
		TableColumn masterColumn = new TableColumn.Builder() //
				.name("MASTER") //
				.searchable(Searchable.DEFAULT) //
				.build();
		TableColumn secondColumn = new TableColumn.Builder() //
				.name("SECOND") //
				.searchable(Searchable.DEFAULT) //
				.build();
		TableColumn thirdColumn = new TableColumn.Builder() //
				.name("THIRD") //
				.searchable(Searchable.TRUE) //
				.build();
		TableColumn numericColumn = new TableColumn.Builder() //
				.name("NUMERIC") //
				.searchable(Searchable.TRUE) //
				.build();
		DateTableColumn timestampColumn = new DateTableColumn.Builder() //
				.name("TIMESTAMP") //
				.searchable(Searchable.TRUE) //
				.build();
		SelectionTableColumn selectColumn = new SelectionTableColumn.Builder() //
				.name("SELECT") //
				.searchable(Searchable.TRUE) //
				.optionList(selectOptionsListMock) //
				.build();
		SelectionTableColumn selectTextColumn = new SelectionTableColumn.Builder() //
				.name("SELECTTEXT") //
				.searchable(Searchable.TRUE) //
				.optionList(selectTextOptionsListMock) //
				.build();
		when(columnsMock.iterator()).thenReturn(
				asList(masterColumn, secondColumn, thirdColumn, numericColumn,
						timestampColumn, selectColumn, selectTextColumn)
						.iterator());
		doReturn(
				asList("MASTER", "SECOND", "THIRD", "NUMERIC", "TIMESTAMP",
						"SELECT", "SELECTTEXT", "NOTINTABLE"))
				.when(columnsMock).getSearchableColumnPrefixes();
		doReturn(ImmutableMap.of("MASTER", "MASTER", "SECOND", "SECOND")).when(columnsMock)
				.getDefaultSearchablePrefixes();

		doReturn(String.class).when(containerMock).getType("MASTER");
		doReturn(String.class).when(containerMock).getType("SECOND");
		doReturn(String.class).when(containerMock).getType("THIRD");
		doReturn(BigDecimal.class).when(containerMock).getType("NUMERIC");
		doReturn(Timestamp.class).when(containerMock).getType("TIMESTAMP");
		doReturn(Integer.class).when(containerMock).getType("SELECT");
		doReturn(String.class).when(containerMock).getType("SELECTTEXT");

		when(columnsMock.contains("SELECT")).thenReturn(true);
		when(columnsMock.isSelection("SELECT")).thenReturn(true);
		when(columnsMock.getDropdownSelections("SELECT")).thenReturn(
				selectOptionsListMock);
		when(selectOptionsListMock.getOptions(null)).thenReturn(
				ImmutableMap.of("1", "Option 1", "2", "Option 2", "3",
						"Option 3"));
		when(selectOptionsListMock.getKey("Option 3", null)).thenReturn("3");

		when(columnsMock.contains("SELECTTEXT")).thenReturn(true);
		when(columnsMock.isSelection("SELECTTEXT")).thenReturn(true);
		when(columnsMock.getDropdownSelections("SELECTTEXT")).thenReturn(
				selectTextOptionsListMock);
		when(selectTextOptionsListMock.getOptions(null)).thenReturn(
				ImmutableMap.of("Option 1", "Option 1", "Option 2", "Option 2",
						"Option 3", "Option 3"));
		when(selectTextOptionsListMock.getKey("Option 3", null)).thenReturn(
				"Option 3");

		search = new CompoundSearch(config);
		search.searchableTablesFinder = searchableTablesFinderMock;

		ArrayList<Table> tables = new ArrayList<Table>();
		tables.add(tableMock);

		when(searchableTablesFinderMock.findSearchableTables(search, null))
				.thenReturn((tables));

		when(UI.getCurrent().getLocale()).thenReturn(Locale.GERMANY);
	}

	@Test
	public void shouldDeliverSearchableColumnsInRightOrder() {
		assertThat(
				search.getSearchableColumns().getSearchableColumnPrefixes(),
				equalTo((Collection<String>)asList("MASTER", "SECOND", "NUMERIC", "SELECT", "SELECTTEXT",
						"THIRD", "TIMESTAMP")));
	}

	/* Text fields */

	@Test
	public void shouldConvertDefaultQueryToStartsWithFilter()
			throws ParseException {
		search.search("myterm");
		List<Filter> filters = asList((Filter) new Any(asList(
				(Filter) new StartsWith("MASTER", "myterm", false),
				new StartsWith("SECOND", "myterm", false))));
		verifyReplaceFilters(filters);
	}

	private void verifyReplaceFilters(List<Filter> filters) {
		verify(containerMock).replaceFilters(filters, false, true);
	}

	@Test
	public void shouldConvertEmptyQueryStringToRemoveAllFilters()
			throws ParseException {
		search.search("");
		verifyRemoveAllFilters();
	}

	@Test
	public void shouldConvertNullQueryStringToRemoveAllFilters()
			throws ParseException {
		search.search(null);
		verifyRemoveAllFilters();
	}

	@Test
	public void shouldConvertBooleanORQuery() throws ParseException {
		search.search("MASTER:myterm OR SECOND:myterm");
		List<Filter> filters = asList((Filter) new Any(asList(
				(Filter) new StartsWith("MASTER", "myterm", false),
				new StartsWith("SECOND", "myterm", false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldIgnoreInvalidPartsOfORQuery() throws ParseException {
		search.search("MASTER:myterm OR NUMERIC:invalidNumber");
		List<Filter> filters = filterList(new StartsWith("MASTER", "myterm",
				false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldFailWithFirstMessageIfAllPartsOfORQueryAreInvalid()
			throws ParseException {
		try {
			search.search("TIMESTAMP:invalidTimestamp OR NUMERIC:invalidNumber");
			fail();
		} catch (BusinessException e) {
			assertThat(
					e.getCode(),
					is("portlet.crud.error.compoundsearch.dateConversionFailed"));
		}
	}

	private List<Filter> filterList(Filter... filterArray) {
		return asList(filterArray);
	}

	@Test
	public void shouldConvertBooleanANDQuery() throws ParseException {
		search.search("MASTER:myterm AND SECOND:myterm");
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new StartsWith("MASTER", "myterm", false),
				new StartsWith("SECOND", "myterm", false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldRejectBooleanMixedQuery() throws ParseException {
		try {
			search.search("MASTER:myterm AND SECOND:myterm OR THIRD:myterm");
			fail("Expected BusinessException");
		} catch (BusinessException e) {
			assertThat(
					e.getCode(),
					is("portlet.crud.error.compoundsearch.mixedBooleansProhibited"));
		}
	}

	@Test
	public void shouldConvertBooleanNotAndQuery() throws ParseException {
		search.search("NOT MASTER:myterm AND SECOND:myterm");
		List<Filter> filters = asList((Filter) new All(asList((Filter) new Not(
				asList((Filter) new StartsWith("MASTER", "myterm", false))),
				new StartsWith("SECOND", "myterm", false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertBooleanNotOrQuery() throws ParseException {
		search.search("NOT MASTER:myterm OR SECOND:myterm");
		List<Filter> filters = asList((Filter) new Any(asList((Filter) new Not(
				asList((Filter) new StartsWith("MASTER", "myterm", false))),
				new StartsWith("SECOND", "myterm", false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertBooleanMixedQueryWithBraces()
			throws ParseException {
		search.search("(MASTER:myterm AND SECOND:myterm) OR THIRD:myterm");
		Filter allFilter = new All(asList((Filter) new StartsWith("MASTER",
				"myterm", false), new StartsWith("SECOND", "myterm", false)),
				false);
		List<Filter> filters = asList((Filter) new Any(asList(allFilter,
				new StartsWith("THIRD", "myterm", false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertMultiwordTermToStartsWith() throws ParseException {
		search.search("THIRD:\"my long  phrase\"");
		List<Filter> filters = asList((Filter) new StartsWith("THIRD",
				"my long  phrase", false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertMultiwordSelectionToEqualsOnIntegerKey()
			throws ParseException {
		search.search("SELECT:\"Option 3\"");
		List<Filter> filters = asList((Filter) new Equal("SELECT", 3, false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertMultiwordSelectionToEqualsOnTextualKey()
			throws ParseException {
		search.search("SELECTTEXT:\"Option 3\"");
		List<Filter> filters = asList((Filter) new Equal("SELECTTEXT",
				"Option 3", false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertDefaultNegatedQuery() throws ParseException {
		search.search("-myterm");
		List<Filter> filters = asList((Filter) new Not(asList((Filter) new Any(
				asList((Filter) new StartsWith("MASTER", "myterm", false),
						new StartsWith("SECOND", "myterm", false))))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertBeingCaseInsensitiveForFieldNames() throws ParseException {
		search.search("third:\"my long phrase\"");
		List<Filter> filters = asList((Filter) new StartsWith("THIRD",
				"my long phrase", false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertBeingCaseInsensitiveForFieldNamesInSelects() throws ParseException {
		search.search("selecttext:\"Option 3\"");
		List<Filter> filters = asList((Filter) new Equal("SELECTTEXT",
				"Option 3", false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldIgnoreNonMatchingField() throws ParseException {
		search.search("NOTINTABLE:4711");
		verifyRemoveAllFilters();
	}

	@Test
	public void shouldIgnoreNonMatchingFieldInRangeQuery()
			throws ParseException {
		search.search("NOTINTABLE:[4711 TO 5822]");
		verifyRemoveAllFilters();
	}

	@Test
	public void shouldIgnoreNonMatchingFieldInMatchAllQuery()
			throws ParseException {
		search.search("NOTINTABLE:\"*\"");
		verifyRemoveAllFilters();
	}

	@Test
	public void shouldIgnoreNonMatchingFieldInPrefixQuery()
			throws ParseException {
		search.search("NOTINTABLE:hello*");
		verifyRemoveAllFilters();
	}

	@Test
	public void shouldIgnoreNonMatchingFieldInWildcardQuery()
			throws ParseException {
		search.search("NOTINTABLE:hell*o");
		verifyRemoveAllFilters();
	}

	@Test
	public void shouldIgnoreNonMatchingFieldInPhraseQuery()
			throws ParseException {
		search.search("NOTINTABLE:\"a b c\"");
		verifyRemoveAllFilters();
	}

	private void verifyRemoveAllFilters() {
		verifyReplaceFilters(Collections.<Filter> emptyList());
	}

	@Test
	public void shouldIgnoreNonMatchingFieldInAnyClause() throws ParseException {
		search.search("(MASTER:1315 OR NOTINTABLE:4711)");
		List<Filter> filters = asList((Filter) new StartsWith("MASTER", "1315",
				false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldIgnoreNonMatchingFieldInAllClause() throws ParseException {
		search.search("(MASTER:1315 AND NOTINTABLE:4711)");
		List<Filter> filters = asList((Filter) new StartsWith("MASTER", "1315",
				false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertNotEqualsQuery() throws ParseException {
		search.search("-THIRD:myter");
		List<Filter> filters = asList((Filter) new Not(
				asList((Filter) new StartsWith("THIRD", "myter", false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertNotNullQuery() throws ParseException {
		search.search("THIRD:\"*\"");
		List<Filter> filters = asList((Filter) new Not(
				asList((Filter) new IsNull("THIRD"))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertStartsWithQuery() throws ParseException {
		search.search("THIRD:myter*");
		List<Filter> filters = asList((Filter) new StartsWith("THIRD", "myter",
				false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertWildcardTermInBracketsToWildcard()
			throws ParseException {
		search.search("THIRD:\"*myter*\"");
		List<Filter> filters = asList((Filter) new Wildcard("THIRD", "*myter*",
				false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertWildcardQueryWithStarInMiddle()
			throws ParseException {
		search.search("THIRD:my*ter");
		List<Filter> filters = asList((Filter) new Wildcard("THIRD", "my*ter",
				false));
		verifyReplaceFilters(filters);
	}

	/* Numeric fields */

	@Test
	public void shouldConvertToEqualForNumericFields() throws ParseException {
		search.search("NUMERIC:4711");
		List<Filter> filters = asList((Filter) new Equal("NUMERIC",
				new BigDecimal("4711")));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertSingleDateToRangeForDateFields()
			throws ParseException {
		search.search("TIMESTAMP:23.12.2013");
		Date startDate = new GregorianCalendar(2013, 11, 23).getTime();
		Date endDate = new GregorianCalendar(2013, 11, 24).getTime();
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new Greater("TIMESTAMP", startDate, true), new Less(
						"TIMESTAMP", endDate, false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertRangeForTextFields() throws ParseException {
		search.search("MASTER:[4711 TO 5228]");
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new Greater("MASTER", "4711", true), new Less(
						"MASTER", "5228", true))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertRangeForTextFieldsWithExclusion()
			throws ParseException {
		search.search("MASTER:{4711 TO 5228}");
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new Greater("MASTER", "4711", false), new Less(
						"MASTER", "5228", false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertRangeForNumericFields() throws ParseException {
		search.search("NUMERIC:[4711 TO 5228]");
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new Greater("NUMERIC", new BigDecimal(4711), true),
				new Less("NUMERIC", new BigDecimal("5228"), true))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertRangeForNumericFieldsWithExclusion()
			throws ParseException {
		search.search("NUMERIC:{4711 TO 5228}");
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new Greater("NUMERIC", new BigDecimal(4711), false),
				new Less("NUMERIC", new BigDecimal("5228"), false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertRangeForDateFieldsWithMonthGranularity()
			throws ParseException {
		search.search("TIMESTAMP:[11.12.2013 TO 31.12.2013]");
		Date startDate = new GregorianCalendar(2013, 11, 11).getTime();
		Date endDate = new GregorianCalendar(2014, 0, 1).getTime();
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new Greater("TIMESTAMP", startDate, true), new Less(
						"TIMESTAMP", endDate, false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldConvertRangeForDateFieldsWithMonthGranularityAndExclusion()
			throws ParseException {
		search.search("TIMESTAMP:{11.12.2013 TO 31.12.2013}");
		Date startDate = new GregorianCalendar(2013, 11, 12).getTime();
		Date endDate = new GregorianCalendar(2013, 11, 31).getTime();
		List<Filter> filters = asList((Filter) new All(asList(
				(Filter) new Greater("TIMESTAMP", startDate, true), new Less(
						"TIMESTAMP", endDate, false))));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldFailWithReadableMessageOnUnknownQueryType()
			throws ParseException {
		try {
			search.search("MASTER:Test~");
			fail("Expected BusinessException");
		} catch (BusinessException e) {
			assertThat(
					e.getCode(),
					is("portlet.crud.error.compoundsearch.unsupportedQuerySyntax"));
			assertThat(e.getArgs()[0], is((Object) "MASTER:test~2"));
		}
	}

	@Test
	public void shouldFailWithReadableMessageOnNumberConversionFailure()
			throws ParseException {
		try {
			search.search("NUMERIC:Test");
			fail("Expected BusinessException");
		} catch (BusinessException e) {
			assertThat(
					e.getCode(),
					is("portlet.crud.error.compoundsearch.numberConversionFailed"));
			assertThat(e.getArgs()[0], is((Object) "NUMERIC"));
			assertThat(e.getArgs()[1], is((Object) "Test"));
		}
	}

	@Test
	public void shouldSearchByQueryString() {
		search.search("MASTER:myterm");
		List<Filter> filters = asList((Filter) (Filter) new StartsWith(
				"MASTER", "myterm", false));
		verifyReplaceFilters(filters);
	}

	@Test
	public void shouldFailOnInvalidQueryString() {
		try {
			search.search("*");
			fail();
		} catch (BusinessException e) {
			assertThat(e.getCode(),
					is("portlet.crud.error.compoundsearch.invalidQuery"));
			assertThat(e.getArgs()[0], is((Object) "*"));
		}
	}

	@Test
	public void shouldInformUIAboutChangedQueryString() {
		search.addQueryChangedEventHandler(handlerMock);
		search.search("MASTER:myterm");
		verify(handlerMock).onQueryChange(eventCaptor.capture());
		assertThat(eventCaptor.getValue().getQueryString(), is("MASTER:myterm"));
		assertThat(eventCaptor.getValue().getSource(), is(search));
	}

	@Test
	public void shouldInformIfQueryIsInvalid() {
		assertThat(search.isValidQuery("*"), is(false));
	}

	@Test
	public void shouldInformIfQueryIsValid() {
		assertThat(search.isValidQuery("4711"), is(true));
	}
}


text:
package lfs

import (
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"runtime"
	"strings"

	"github.com/github/git-lfs/git"
	"github.com/github/git-lfs/vendor/_nuts/github.com/rubyist/tracerx"
)

const Version = "0.5.1"

var (
	LargeSizeThreshold = 5 * 1024 * 1024
	TempDir            = filepath.Join(os.TempDir(), "git-lfs")
	UserAgent          string
	LocalWorkingDir    string
	LocalGitDir        string
	LocalMediaDir      string
	LocalLogDir        string
	checkedTempDir     string
)

func TempFile(prefix string) (*os.File, error) {
	if checkedTempDir != TempDir {
		if err := os.MkdirAll(TempDir, 0755); err != nil {
			return nil, err
		}
		checkedTempDir = TempDir
	}

	return ioutil.TempFile(TempDir, prefix)
}

func ResetTempDir() error {
	checkedTempDir = ""
	return os.RemoveAll(TempDir)
}

func LocalMediaPath(sha string) (string, error) {
	path := filepath.Join(LocalMediaDir, sha[0:2], sha[2:4])
	if err := os.MkdirAll(path, 0755); err != nil {
		return "", fmt.Errorf("Error trying to create local media directory in '%s': %s", path, err)
	}

	return filepath.Join(path, sha), nil
}

func Environ() []string {
	osEnviron := os.Environ()
	env := make([]string, 6, len(osEnviron)+6)
	env[0] = fmt.Sprintf("LocalWorkingDir=%s", LocalWorkingDir)
	env[1] = fmt.Sprintf("LocalGitDir=%s", LocalGitDir)
	env[2] = fmt.Sprintf("LocalMediaDir=%s", LocalMediaDir)
	env[3] = fmt.Sprintf("TempDir=%s", TempDir)
	env[4] = fmt.Sprintf("ConcurrentTransfers=%d", Config.ConcurrentTransfers())
	env[5] = fmt.Sprintf("BatchTransfer=%v", Config.BatchTransfer())

	for _, e := range osEnviron {
		if !strings.Contains(e, "GIT_") {
			continue
		}
		env = append(env, e)
	}

	return env
}

func InRepo() bool {
	return LocalWorkingDir != ""
}

func init() {
	var err error

	tracerx.DefaultKey = "GIT"
	tracerx.Prefix = "trace git-lfs: "

	LocalWorkingDir, LocalGitDir, err = resolveGitDir()
	if err == nil {
		LocalMediaDir = filepath.Join(LocalGitDir, "lfs", "objects")
		LocalLogDir = filepath.Join(LocalMediaDir, "logs")
		TempDir = filepath.Join(LocalGitDir, "lfs", "tmp")

		if err := os.MkdirAll(LocalMediaDir, 0755); err != nil {
			panic(fmt.Errorf("Error trying to create objects directory in '%s': %s", LocalMediaDir, err))
		}

		if err := os.MkdirAll(LocalLogDir, 0755); err != nil {
			panic(fmt.Errorf("Error trying to create log directory in '%s': %s", LocalLogDir, err))
		}

		if err := os.MkdirAll(TempDir, 0755); err != nil {
			panic(fmt.Errorf("Error trying to create temp directory in '%s': %s", TempDir, err))
		}

	}

	gitVersion, err := git.Config.Version()
	if err != nil {
		gitVersion = "unknown"
	}

	UserAgent = fmt.Sprintf("git-lfs/%s (GitHub; %s %s; git %s; go %s)", Version,
		runtime.GOOS,
		runtime.GOARCH,
		strings.Replace(gitVersion, "git version ", "", 1),
		strings.Replace(runtime.Version(), "go", "", 1))
}

func resolveGitDir() (string, string, error) {
	wd, err := os.Getwd()
	if err != nil {
		return "", "", err
	}

	return recursiveResolveGitDir(wd)
}

func recursiveResolveGitDir(dir string) (string, string, error) {
	var cleanDir = filepath.Clean(dir)
	if cleanDir[len(cleanDir)-1] == os.PathSeparator {
		return "", "", fmt.Errorf("Git repository not found")
	}

	if filepath.Base(dir) == gitExt {
		// We're in the `.git` directory.  Make no assumptions about the working directory.
		return "", dir, nil
	}

	gitDir := filepath.Join(dir, gitExt)
	info, err := os.Stat(gitDir)
	if err != nil {
		// Found neither a directory nor a file named `.git`.
		// Move one directory up.
		return recursiveResolveGitDir(filepath.Dir(dir))
	}

	if !info.IsDir() {
		// Found a file named `.git` (we're in a submodule).
		return resolveDotGitFile(gitDir)
	}

	// Found the `.git` directory.
	return dir, gitDir, nil
}

func resolveDotGitFile(file string) (string, string, error) {
	// The local working directory is the directory the `.git` file is located in.
	wd := filepath.Dir(file)

	// The `.git` file tells us where the submodules `.git` directory is.
	gitDir, err := processDotGitFile(file)
	if err != nil {
		return "", "", err
	}

	return wd, gitDir, nil
}

func processDotGitFile(file string) (string, error) {
	f, err := os.Open(file)
	if err != nil {
		return "", err
	}
	defer f.Close()

	data := make([]byte, 512)
	n, err := f.Read(data)
	if err != nil {
		return "", err
	}

	contents := string(data[0:n])

	if !strings.HasPrefix(contents, gitPtrPrefix) {
		// The `.git` file has no entry telling us about gitdir.
		return "", nil
	}

	dir := strings.TrimSpace(strings.Split(contents, gitPtrPrefix)[1])

	if filepath.IsAbs(dir) {
		// The .git file contains an absolute path.
		return dir, nil
	}

	// The .git file contains a relative path.
	// Create an absolute path based on the directory the .git file is located in.
	absDir := filepath.Join(filepath.Dir(file), dir)

	return absDir, nil
}

// Shut down any cached or otherwise persistent structures
func Shutdown() {
	ShutdownApiContexts()
}

const (
	gitExt       = ".git"
	gitPtrPrefix = "gitdir: "
)


text:
class CreateNodes < ActiveRecord::Migration
  def change
    create_table :nodes do |t|
      t.string :name
    end
  end
end


text:
module Util.Lens where

import Control.Monad.Reader
import Data.Lens

look :: (MonadReader env m) => Lens env b -> m b
look l = liftM (getL l) ask


text:
const func = require('../src/unique-paths');
const assert = require('assert');
describe('unique-paths', function () {
    describe('#uniquePaths()', function () {
        it('should return 10 when m=3 and n=4', function () {
            let ret = func(3, 4);
            assert.equal(ret, 10);
        });
    });
});


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface psidev.psi.mi.jami.model.Allostery (PSI :: JAMI - Java framework for molecular interactions 3.2.12 API)</title>
<meta name="date" content="2021-08-20">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
psidev.psi.mi.jami.model.Allostery

Packages that use Allostery

Package
Description

psidev.psi.mi.jami.model.impl

psidev.psi.mi.jami.utils.clone

psidev.psi.mi.jami.utils.comparator.cooperativity

psidev.psi.mi.jami.xml.io.writer.elements

psidev.psi.mi.jami.xml.io.writer.elements.impl.abstracts.xml30

psidev.psi.mi.jami.xml.io.writer.elements.impl.extended.xml30

psidev.psi.mi.jami.xml.io.writer.elements.impl.xml30

psidev.psi.mi.jami.xml.model.extension

Uses of Allostery in psidev.psi.mi.jami.model.impl

Classes in psidev.psi.mi.jami.model.impl that implement Allostery

Modifier and Type
Class and Description

class
DefaultAllostery<T extends AllostericEffector>

Default implementation for Allostery

 Notes: The equals and hashcode methods have NOT been overridden because the Allostery object is a complex object.

Uses of Allostery in psidev.psi.mi.jami.utils.clone

Methods in psidev.psi.mi.jami.utils.clone with parameters of type Allostery

Modifier and Type
Method and Description

static <T extends AllostericEffector>
void
CooperativeEffectCloner.copyAndOverrideAllosteryProperties(Allostery<T> source,
                                  Allostery<T> target)

This method will copy  basic properties and allostery specific properties from allostery source to allostery target.

static <T extends AllostericEffector>
void
CooperativeEffectCloner.copyAndOverrideAllosteryProperties(Allostery<T> source,
                                  Allostery<T> target)

This method will copy  basic properties and allostery specific properties from allostery source to allostery target.

Uses of Allostery in psidev.psi.mi.jami.utils.comparator.cooperativity

Methods in psidev.psi.mi.jami.utils.comparator.cooperativity with parameters of type Allostery

Modifier and Type
Method and Description

static boolean
DefaultExactAllosteryComparator.areEquals(Allostery allostery1,
         Allostery allostery2)

Use DefaultExactAllosteryComparator to know if two allostery are equals.

static boolean
DefaultExactAllosteryComparator.areEquals(Allostery allostery1,
         Allostery allostery2)

Use DefaultExactAllosteryComparator to know if two allostery are equals.

static boolean
DefaultAllosteryComparator.areEquals(Allostery allostery1,
         Allostery allostery2)

Use DefaultAllosteryComparator to know if two allostery are equals.

static boolean
DefaultAllosteryComparator.areEquals(Allostery allostery1,
         Allostery allostery2)

Use DefaultAllosteryComparator to know if two allostery are equals.

static boolean
UnambiguousAllosteryComparator.areEquals(Allostery effect1,
         Allostery effect2)

Use UnambiguousAllosteryComparator to know if two allostery are equals.

static boolean
UnambiguousAllosteryComparator.areEquals(Allostery effect1,
         Allostery effect2)

Use UnambiguousAllosteryComparator to know if two allostery are equals.

static boolean
UnambiguousExactAllosteryComparator.areEquals(Allostery effect1,
         Allostery effect2)

Use UnambiguousExactAllosteryComparator to know if two allostery are equals.

static boolean
UnambiguousExactAllosteryComparator.areEquals(Allostery effect1,
         Allostery effect2)

Use UnambiguousExactAllosteryComparator to know if two allostery are equals.

int
AllosteryComparator.compare(Allostery allostery1,
       Allostery allostery2)

It will first compare basic cooperative effect properties using CooperativeEffectBaseComparator.

int
AllosteryComparator.compare(Allostery allostery1,
       Allostery allostery2)

It will first compare basic cooperative effect properties using CooperativeEffectBaseComparator.

int
UnambiguousAllosteryComparator.compare(Allostery effect1,
       Allostery effect2)

It will first compare basic cooperative effect properties using CooperativeEffectBaseComparator.

int
UnambiguousAllosteryComparator.compare(Allostery effect1,
       Allostery effect2)

It will first compare basic cooperative effect properties using CooperativeEffectBaseComparator.

int
UnambiguousExactAllosteryComparator.compare(Allostery effect1,
       Allostery effect2)

It will first compare basic cooperative effect properties using CooperativeEffectBaseComparator.

int
UnambiguousExactAllosteryComparator.compare(Allostery effect1,
       Allostery effect2)

It will first compare basic cooperative effect properties using CooperativeEffectBaseComparator.

Uses of Allostery in psidev.psi.mi.jami.xml.io.writer.elements

Methods in psidev.psi.mi.jami.xml.io.writer.elements that return types with arguments of type Allostery

Modifier and Type
Method and Description

static PsiXmlElementWriter<Allostery>
PsiXmlElementWriterFactory.createAllosteryWriter(XMLStreamWriter streamWriter,
                     boolean expanded,
                     PsiXmlObjectCache objectIndex,
                     PsiXmlVariableNameWriter<CvTerm> cvWriter,
                     PsiXmlElementWriter<Annotation> attributeWriter,
                     PsiXmlPublicationWriter publicationWriter)

createAllosteryWriter.

Uses of Allostery in psidev.psi.mi.jami.xml.io.writer.elements.impl.abstracts.xml30

Methods in psidev.psi.mi.jami.xml.io.writer.elements.impl.abstracts.xml30 that return types with arguments of type Allostery

Modifier and Type
Method and Description

PsiXmlElementWriter<Allostery>
AbstractXmlModelledInteractionWriter.getAllosteryWriter()

Getter for the field allosteryWriter.

Method parameters in psidev.psi.mi.jami.xml.io.writer.elements.impl.abstracts.xml30 with type arguments of type Allostery

Modifier and Type
Method and Description

void
AbstractXmlModelledInteractionWriter.setAllosteryWriter(PsiXmlElementWriter<Allostery> allosteryWriter)

Setter for the field allosteryWriter.

Uses of Allostery in psidev.psi.mi.jami.xml.io.writer.elements.impl.extended.xml30

Methods in psidev.psi.mi.jami.xml.io.writer.elements.impl.extended.xml30 that return types with arguments of type Allostery

Modifier and Type
Method and Description

PsiXmlElementWriter<Allostery>
AbstractXmlModelledInteractionWriter.getAllosteryWriter()

Getter for the field allosteryWriter.

Method parameters in psidev.psi.mi.jami.xml.io.writer.elements.impl.extended.xml30 with type arguments of type Allostery

Modifier and Type
Method and Description

void
AbstractXmlModelledInteractionWriter.setAllosteryWriter(PsiXmlElementWriter<Allostery> allosteryWriter)

Setter for the field allosteryWriter.

Uses of Allostery in psidev.psi.mi.jami.xml.io.writer.elements.impl.xml30

Methods in psidev.psi.mi.jami.xml.io.writer.elements.impl.xml30 with parameters of type Allostery

Modifier and Type
Method and Description

protected void
XmlAllosteryWriter.writeAllostericEffector(Allostery object)

writeAllostericEffector.

protected void
XmlAllosteryWriter.writeAllostericMechanism(Allostery object)

writeAllostericMechanism.

protected void
XmlAllosteryWriter.writeAllostericMolecule(Allostery object)

writeAllostericMolecule.

protected void
XmlAllosteryWriter.writeAllosteryType(Allostery object)

writeAllosteryType.

protected void
XmlAllosteryWriter.writeOtherProperties(Allostery object)

writeOtherProperties.

Uses of Allostery in psidev.psi.mi.jami.xml.model.extension

Classes in psidev.psi.mi.jami.xml.model.extension that implement Allostery

Modifier and Type
Class and Description

class
XmlAllostery<T extends AllostericEffector>

XML implementation of Allostery

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2021. All rights reserved.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>ODFPY: odf/odfmanifest.py File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

ODFPY
    1.2.0

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

 All Classes Namespaces Files Functions Variables

Classes |
Namespaces |
Functions |
Variables

odfmanifest.py File Reference

Go to the source code of this file.

Classes

class  	odf.odfmanifest.ODFManifestHandler

 	The ODFManifestHandler parses a manifest file and produces a list of content.  More...

Namespaces

  	odf.odfmanifest

Functions

def 	odf.odfmanifest.manifestlist

def 	odf.odfmanifest.odfmanifest

Variables

string 	odf.odfmanifest.MANIFESTNS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"

tuple 	odf.odfmanifest.result = odfmanifest(sys.argv[1])

odf

odfmanifest.py

Generated on Tue Oct 28 2014 13:47:24 for ODFPY by

     1.8.7


text:
<?php
namespace SubjectivePHP\Spl\DataStructures;

/**
 * Defines an immutable key/value pair.
 */
final class ImmutableKeyValuePair implements KeyValuePairInterface
{
    /**
     * The key in the key/value pair.
     *
     * @var mixed
     */
    private $key;

    /**
     * The value in the key/value pair.
     *
     * @var mixed
     */
    private $value;

    /**
     * Construct a new KeyValuePair.
     *
     * @param mixed $key   The key of the pair.
     * @param mixed $value The value of the pair.
     */
    public function __construct($key, $value)
    {
        $this->key = $key;
        $this->value = $value;
    }

    /**
     * Gets the key in the key/value pair.
     *
     * @return mixed
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Gets the value in the key/value pair.
     *
     * @return mixed
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Ensures deep copy when cloning.
     *
     * @return void
     */
    public function __clone()
    {
        $this->key = is_object($this->key) ? clone $this->key : $this->key;
        $this->value = is_object($this->value) ? clone $this->value : $this->value;
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.iit.sat.itmd4515.jsharma3.fp.MLM.service;

import edu.iit.sat.itmd4515.jsharma3.fp.MLM.Combos;
import edu.iit.sat.itmd4515.jsharma3.fp.MLM.Products;
import java.util.List;
import javax.ejb.Stateless;

/**
 *
 * @author Jay
 */
@Stateless
public class CombosService extends AbstractService<Combos> {

    public CombosService() {
        super(Combos.class);
    }

    @Override
    public List<Combos> findAll() {
        return getEntityManager().createNamedQuery("Combos.findAll",Combos.class).getResultList();
    }

   public void create(Combos combos,Products products){
        combos = getEntityManager().getReference(Combos.class, combos.getId());

        products.getCombos().add(combos);

        getEntityManager().persist(combos);
    }

    public void delete(Combos combos,Products products){

        combos = getEntityManager().getReference(Combos.class, combos.getId());
        products = getEntityManager().getReference(Products.class, products.getId());

        products.getCombos().remove(combos);
        combos.getProducts().remove(products);

        if(combos.getProducts().isEmpty()){

            getEntityManager().remove(combos);
        }
    }
}


text:
require 'active_model'
require 'rspec'


text:
#import "JitsiViewController.h"
#import "JitsiWidgetData.h"

#if __has_include(<MatrixSDK/MXJingleCallStack.h>)
@import JitsiMeet;

static const NSString *kJitsiDataErrorKey = @"error";

@interface JitsiViewController () <JitsiMeetViewDelegate>

// The jitsi-meet SDK view
@property (nonatomic, weak) IBOutlet JitsiMeetView *jitsiMeetView;

@property (nonatomic, strong) NSString *conferenceId;
@property (nonatomic, strong) NSURL *serverUrl;
@property (nonatomic) BOOL startWithVideo;

@end

@implementation JitsiViewController

#pragma mark - Class methods

+ (UINib *)nib
{
    return [UINib nibWithNibName:NSStringFromClass(self.class)
                          bundle:[NSBundle bundleForClass:self.class]];
}

+ (instancetype)jitsiViewController
{
    JitsiViewController *jitsiViewController = [[[self class] alloc] initWithNibName:NSStringFromClass(self.class)
                                          bundle:[NSBundle bundleForClass:self.class]];
    return jitsiViewController;
}

#pragma mark - Life cycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.jitsiMeetView.delegate = self;

    [self joinConference];
}

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

#pragma mark - Public

- (void)openWidget:(Widget*)widget withVideo:(BOOL)aVideo
           success:(void (^)(void))success
           failure:(void (^)(NSError *error))failure
{
    self.startWithVideo = aVideo;
    _widget = widget;

    MXWeakify(self);

    [_widget widgetUrl:^(NSString * _Nonnull widgetUrl) {

        MXStrongifyAndReturnIfNil(self);

        // Use widget data from Matrix Widget API v2 first
        [self extractWidgetDataFromWidget:widget];

        if (!self.conferenceId)
        {
            // Else try v1
            [self extractWidgetDataFromUrlString:widgetUrl];
        }

        if (self.conferenceId)
        {
            if (success)
            {
                success();
            }
        }
        else
        {
            NSLog(@"[JitsiVC] Failed to load widget: %@. Widget event: %@", widget, widget.widgetEvent);

            if (failure)
            {
                failure(nil);
            }
        }

    } failure:^(NSError * _Nonnull error) {

        NSLog(@"[JitsiVC] Failed to load widget 2: %@. Widget event: %@", widget, widget.widgetEvent);

        if (failure)
        {
            failure(nil);
        }
    }];
}

- (void)hangup
{
    [self.jitsiMeetView leave];
}

#pragma mark - Private

// Extract data based on Matrix Widget V2 widget data
- (void)extractWidgetDataFromWidget:(Widget*)widget
{
    JitsiWidgetData *jitsiWidgetData = [JitsiWidgetData modelFromJSON:widget.data];
    if (jitsiWidgetData)
    {
        self.conferenceId = jitsiWidgetData.conferenceId;
        if (jitsiWidgetData.domain)
        {
            NSString *serverUrlString = [NSString stringWithFormat:@"https://%@", jitsiWidgetData.domain];
            self.serverUrl = [NSURL URLWithString:serverUrlString];
        }
        self.startWithVideo = !jitsiWidgetData.isAudioOnly;
    }
}

// Extract data based on Matrix Widget V1 URL
- (void)extractWidgetDataFromUrlString:(NSString*)widgetUrlString
{
    // Extract the jitsi conference id from the widget url
    NSString *confId;
    NSURL *url = [NSURL URLWithString:widgetUrlString];
    if (url)
    {
        NSURLComponents *components = [[NSURLComponents new] initWithURL:url resolvingAgainstBaseURL:NO];
        NSArray *queryItems = [components queryItems];

        for (NSURLQueryItem *item in queryItems)
        {
            if ([item.name isEqualToString:@"confId"])
            {
                confId = item.value;
                break;
            }
        }
    }

    self.conferenceId = confId;
}

- (void)joinConference
{
    [self joinConferenceWithId:self.conferenceId andServerUrl:self.serverUrl];
}

- (void)joinConferenceWithId:(NSString*)conferenceId andServerUrl:(NSURL*)serverUrl
{
    if (conferenceId)
    {
        // Get info about the room and our user
        MXSession *session = self.widget.mxSession;
        MXRoomSummary *roomSummary = [session roomSummaryWithRoomId:self.widget.roomId];

        MXRoom *room = [session roomWithRoomId:self.widget.roomId];
        MXRoomMember *roomMember = [room.dangerousSyncState.members memberWithUserId:session.myUser.userId];

        NSString *userDisplayName = roomMember.displayname;
        NSString *avatar = [session.mediaManager urlOfContent:roomMember.avatarUrl];
        NSURL *avatarUrl = [NSURL URLWithString:avatar];

        JitsiMeetConferenceOptions *jitsiMeetConferenceOptions = [JitsiMeetConferenceOptions fromBuilder:^(JitsiMeetConferenceOptionsBuilder * _Nonnull builder) {

            if (serverUrl)
            {
                builder.serverURL = serverUrl;
            }
            builder.room = conferenceId;
            builder.videoMuted = !self.startWithVideo;

            builder.subject = roomSummary.displayname;
            builder.userInfo = [[JitsiMeetUserInfo alloc] initWithDisplayName:userDisplayName
                                                                     andEmail:nil
                                                                    andAvatar:avatarUrl];
        }];

        [self.jitsiMeetView join:jitsiMeetConferenceOptions];
    }
}

#pragma mark - JitsiMeetViewDelegate

- (void)conferenceWillJoin:(NSDictionary *)data
{
}

- (void)conferenceJoined:(NSDictionary *)data
{
}

- (void)conferenceTerminated:(NSDictionary *)data
{
    if (data[kJitsiDataErrorKey] != nil)
    {
        NSLog(@"[JitsiViewController] conferenceTerminated - data: %@", data);
    }
    else
    {
        dispatch_async(dispatch_get_main_queue(), ^{

            // The conference is over. Let the delegate close this view controller.
            if (self.delegate)
            {
                [self.delegate jitsiViewController:self dismissViewJitsiController:nil];
            }
            else
            {
                // Do it ourself
                [self dismissViewControllerAnimated:YES completion:nil];
            }
        });
    }
}

- (void)enterPictureInPicture:(NSDictionary *)data
{
    if (self.delegate)
    {
        [self.delegate jitsiViewController:self goBackToApp:nil];
    }
}

@end

#endif


text:
package gov.nasa.jpf.jvm;

import gov.nasa.jpf.util.test.TestJPF;
import gov.nasa.jpf.vm.ClassInfo;
import gov.nasa.jpf.vm.ClassParseException;
import gov.nasa.jpf.vm.FieldInfo;
import gov.nasa.jpf.vm.MethodInfo;

import java.io.File;

import org.junit.Test;

/**
 * unit test for ClassInfo initialization
 */
public class ClassInfoTest extends TestJPF {

  @interface X {
    String value() default "nothing";
  }

  @interface Y {
    int[] value();
  }

  @X
  public static class MyClass implements Cloneable {
    public static final int D = 42;

    @X("data") String s;

    public MyClass(String s) {
      this.s = s;
      foo();
    }

    public static int whatIsIt() {
      int d = D;
      switch (d) {
        case 41:
          d = -1;
          break;
        case 42:
          d = 0;
          break;
        case 43:
          d = 1;
          break;
        default:
          d = 2;
          break;
      }
      return d;
    }

    public boolean isItTheAnswer (boolean b, @X @Y({1,2,3}) int d, String s){
      switch (d){
        case 42: return true;
        default: return false;
      }
    }

    protected void foo() throws IndexOutOfBoundsException {
      @X int d = D;

      Object[] a = new Object[2];
      String s = "blah";
      a[0] = s;

      String x = (String)a[0];
      Object o = a;
      if (o instanceof Object[]){
        o = x;
      }
      if (o instanceof String){
        o = null;
      }

      Object[][] aa = new Object[2][2];

      try {
        char c = s.charAt(d);
      } catch (IndexOutOfBoundsException ioobx) {
        System.out.println("too big");
        throw ioobx;
      }
    }

    @X
    String getString() {
      return s;
    }
  }

  @Test
  public void testClassFileInitialization() {
    File file = new File("build/tests/gov/nasa/jpf/jvm/ClassInfoTest$MyClass.class");

    try {
      ClassInfo ci = new NonResolvedClassInfo( "gov.nasa.jpf.jvm.ClassInfoTest$MyClass", file);

      assert ci.getName().equals("gov.nasa.jpf.jvm.ClassInfoTest$MyClass");

      System.out.println("-- declared instance fields");
      for (FieldInfo fi : ci.getDeclaredInstanceFields()){
        System.out.print(fi.getType());
        System.out.print(' ');
        System.out.println(fi.getName());
      }

      assert ci.getNumberOfDeclaredInstanceFields() == 1;
      assert ci.getNumberOfStaticFields() == 1;

      System.out.println();
      System.out.println("-- methods");
      for (MethodInfo mi : ci){
        System.out.println(mi.getUniqueName());
      }

    } catch (ClassParseException cfx){
      //cfx.printStackTrace();
      fail("ClassParseException: " + cfx);
    }
  }

}


text:
function privFunc = getPrivateFunction(privateDir, funcName)
% GETPRIVATEFUNCTION returns a handle to a function given as string.
%
% It allows to use functions which are not be accessible from the current
% scope, like for example functions stored in 'private' folders.

% 2015 Alberto Comin, LMU Muenchen

oldDir = cd(privateDir);         % go to the private directory
privFunc = str2func(funcName);   % get the private function handle
cd(oldDir);                      % go back to the original directory
end


text:
package uk.me.lings.scalaguice
package binder

import com.google.inject._
import com.google.inject.binder._
import java.lang.annotation.{Annotation => JAnnotation}

/**
 * Proxy for [[com.google.inject.binder.ScopedBindingBuilder]]
 */
trait ScopedBindingBuilderProxy extends ScopedBindingBuilder
                          with Proxy {

  override def self: ScopedBindingBuilder

  def asEagerSingleton = self asEagerSingleton
  def in(scope: Scope) = self in scope
  def in(scopeAnnotation: Class[_ <: JAnnotation]) = self in scopeAnnotation
}

/**
 * Proxy for [[com.google.inject.binder.LinkedBindingBuilder]]
 */
trait LinkedBindingBuilderProxy[T] extends LinkedBindingBuilder[T]
                          with ScopedBindingBuilderProxy {

  override def self: LinkedBindingBuilder[T]

  def to(implementation: Class[_ <: T]) = self to implementation
  def to(implementation: TypeLiteral[_ <: T]) = self to implementation
  def to(targetKey: Key[_ <: T]) = self to targetKey
  def toInstance(instance: T) = self toInstance instance
  def toProvider(provider: Provider[_ <: T]) = self toProvider provider
  def toProvider(provider: Class[_ <: Provider[_ <: T]]) = self toProvider provider
  def toProvider(providerKey: Key[_ <: Provider[_ <: T]]) = self toProvider providerKey
}

/**
 * Proxy for [[com.google.inject.binder.AnnotatedBindingBuilder]]
 */
trait AnnotatedBindingBuilderProxy[T] extends AnnotatedBindingBuilder[T]
                           with LinkedBindingBuilderProxy[T] {

  override def self: AnnotatedBindingBuilder[T]

  def annotatedWith(annotation: JAnnotation) = self annotatedWith annotation
  def annotatedWith(annotationType: Class[_ <: JAnnotation]) = self annotatedWith annotationType
}


text:
// Copyright (c) 2012, Event Store LLP
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// Neither the name of the Event Store LLP nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

using System;
using System.ComponentModel;
using System.Linq;
using System.Net;
using EventStore.Common.Utils;
using Newtonsoft.Json.Linq;

namespace EventStore.Common.Options
{
    public static class OptionContainerHelpers
    {
        public static T ConvertFromJToken<T>(JToken token)
        {
            if (token.Type == JTokenType.String)
                return ConvertFromString<T>(token.Value<string>());

            return token.Value<T>();
        }

        public static T ConvertFromString<T>(string value)
        {
            Ensure.NotNull(value, "value");

            Type tt = typeof(T);
            bool nullable = tt.IsValueType
                            && tt.IsGenericType
                            && !tt.IsGenericTypeDefinition
                            && tt.GetGenericTypeDefinition() == typeof (Nullable<>);
            Type targetType = nullable ? tt.GetGenericArguments()[0] : typeof(T);
            TypeConverter conv = TypeDescriptor.GetConverter(targetType);

            if (targetType == typeof(IPAddress))
                conv = new IPAddressTypeConverter();

			if (targetType == typeof(IPEndPoint))
				conv = new IPEndPointTypeConverter();

            return (T)conv.ConvertFromString(value);
        }

        public static JToken GetTokenByJsonPath(JObject json, string[] jsonPath)
        {
            Ensure.NotNull(jsonPath, "jsonPath");
            Ensure.Positive(jsonPath.Length, "jsonPath.Length");

            JToken obj = json;
            for (int i = 0; i < jsonPath.Length - 1; ++i)
            {
                if (obj.Type != JTokenType.Object)
                    return null;
                var p = ((JObject)obj).Property(jsonPath[i]);
                if (p == null || p.Value == null)
                    return null;
                obj = p.Value;
            }

            if (obj.Type != JTokenType.Object)
                return null;

            var prop = ((JObject)obj).Property(jsonPath.Last());
            if (prop == null)
                return null;

            var value = prop.Value;
            return value;
        }
    }
}


text:
import os
from config import STRIPE_KEYS
from time import sleep

import stripe
from salesforce_bulk import SalesforceBulk
from simple_salesforce import Salesforce

stripe.api_key = STRIPE_KEYS["secret_key"]

# get Stripe emails
customers = stripe.Customer.list(limit=100)
stripe_emails = set(
    (x["email"].lower() for x in customers.auto_paging_iter() if x["email"])
)

# then compare to SF
query = "SELECT All_In_One_EMail__c FROM Contact"

SALESFORCE = {
    "USERNAME": os.getenv("SALESFORCE_USERNAME"),
    "PASSWORD": os.getenv("SALESFORCE_PASSWORD"),
    "HOST": os.getenv("SALESFORCE_HOST"),
    "TOKEN": os.getenv("SALESFORCE_TOKEN"),
    "CLIENT_ID": os.getenv("SALESFORCE_CLIENT_ID"),
    "CLIENT_SECRET": os.getenv("SALESFORCE_CLIENT_SECRET"),
}

USER = SALESFORCE["USERNAME"]
PASS = SALESFORCE["PASSWORD"]
TOKEN = SALESFORCE["TOKEN"]
HOST = SALESFORCE["HOST"]

sf = Salesforce(username=USER, password=PASS, security_token=TOKEN)

bulk = SalesforceBulk(sessionId=sf.session_id, host=HOST)

job = bulk.create_query_job("Contact", contentType="CSV")

batch = bulk.query(job, query)
while not bulk.is_batch_done(job, batch):
    sleep(3)
bulk.close_job(job)

rows = bulk.get_batch_result_iter(job, batch, parse_csv=True)
bulk_email = list(rows)
email_list = []
emails_sf = [x["All_In_One_EMail__c"] for x in bulk_email]
print("The following email addresses appear in Stripe but not Salesforce: \n")
for field in emails_sf:
    for email in field.split(","):
        if email != "":
            email_list.append(email.strip())
diff = stripe_emails.difference(email_list)
for item in diff:
    print(item)


text:
class GetRes(object):
    def __init__(self, target_name):
        self.target_name = target_name

class GetAtt(GetRes):
    def __init__(self, target_name, attr):
        super(GetAtt, self).__init__(target_name)
        self.attr = attr

class RsrcDef(object):
    def __init__(self, properties, depends_on):
        self.properties = properties
        self.depends_on = depends_on

class Template(object):

    def __init__(self, resources={}, key=None):
        self.key = key
        self.resources = resources

    def __repr__(self):
        return 'Template(%r)' % self.resources


text:
// Copyright (c) 2016 Tag Games Ltd. All rights reserved

#pragma once

#include "Http.h"
#include "Json.h"
#include <queue>

/**
* Represents a generic response from a ChilliConnect API Request
*/
struct FChilliConnectResponse
{
	/**
	 * Did the request complete and return a valid 200 HTTP response
	 */
	bool bWasOk;

	/**
	 * Any ChilliConnect Error Code returned by the request
	 */
	uint8 ErrorCode;

	/**
	 * The HTTP resposne code of the API re
	 */
	uint8 HttpCode;

	/**
	 * Any ChilliConnect Error Message returned by the request
	 */
	FString ErrorMessage;

	/**
	 * The JSON body of the response from the ChilliConnectRequest
	 */
	TSharedPtr<FJsonObject> Body;
};

/**
 * Represents the response from a CreatedPlayer API Request
 */
struct FCreatePlayerResponse : FChilliConnectResponse
{
	/**
	 * The ChilliConnectID of the newly created plauer
	 */
	FString ChilliConnectID;

	/**
	 * The ChilliConnectID of the newly created player
	 */
	FString ChilliConnectSecret;
};

/**
 * Represents the response from a LoginPlayer API Request
 */
struct FLoginResponse : FChilliConnectResponse
{
	/**
	 * The AccessToken returned from a succesfull login. Is used to
	 * authenticate subsequent requests
	 */
	FString AccessToken;
};

/**
 * Represents the response from a AddLeaderboardScore API Request
 */
struct FAddLeaderboardScoreResponse : FChilliConnectResponse
{
	/*
	 * The players position within the leaderboard
	 */
	uint8 GlobalRank;

	/*
	* The total number of scores posted to the leaderboard
	*/
	uint8 GlobalTotal;
};

class CHILLICONNECTEXAMPLE_API FChilliConnect
{

public:

	FChilliConnect();

	/**
	 * Event broadcast when PlayerCreated API request returns
	*/
	DECLARE_EVENT_OneParam(FChilliConnect, FPlayerCreatedEvent, FCreatePlayerResponse);

	/**
	* Event broadcast when LoginPlayer API request returns
	*/
	DECLARE_EVENT_OneParam(FChilliConnect, FPlayerLoggedInEvent, FLoginResponse);

	/**
	* Event broadcast when AddLeaderboardScore API request returns
	*/
	DECLARE_EVENT_OneParam(FChilliConnect, FLeaderboardScoreAddedEvent, FAddLeaderboardScoreResponse);

	/**
	 * Create a new Player account in ChilliConnect. Response can by handled by subscribing to the
	 * FPlayerCreatedEvent.
	 */
	void CreatePlayer();

	/**
	 * Login a player account to ChilliConnect. Response can be handled by subscribing to the
	 * FPlayerLoggedInEvent
	 */
	void LoginPlayer(FString ChilliConnectID, FString ChilliConnectSecret);

	/**
	* Add a leaderboard score. Response can be handled by subscribing to the FAddLeaderboardScoreResponse
	*/
	void AddLeaderboardScore(FString AccessToken, FString LeaderboardKey, uint8 Score);

	FPlayerCreatedEvent& OnPlayerCreated() { return PlayerCreatedEvent; };
	FPlayerLoggedInEvent& OnPlayerLoggedIn() { return PlayerLoggedInEvent; };
	FLeaderboardScoreAddedEvent& OnLeaderboardScoreAdded() { return LeaderboardScoreAddedEvent; };

	void Update();

private:

	enum ERequestType
	{
		CreatePlayerRequestType,
		LoginPlayerRequestType,
		AddLeaderboardScoreRequestType
	};

	struct FPendingRequest
	{
		FPendingRequest(FHttpRequestPtr&& request, ERequestType type)
			: Request(std::move(request)), Type(type) {}

		FHttpRequestPtr Request;
		ERequestType Type;
	};

	FString GameToken;

	FHttpRequestPtr ProcessingRequest;
	std::queue<FPendingRequest> PendingRequests;

	TSharedPtr<FJsonObject> DeserialiseHttpResponse(FHttpResponsePtr HttpResponse);

	void QueueRequest(FHttpRequestPtr&& HttpRequest, ERequestType RequestType);
	void OnRequestFinished(ERequestType RequestType, const FHttpResponsePtr& HttpResponse);
	bool PopulateResponse(const FHttpResponsePtr& HttpResponse, FChilliConnectResponse& ChilliConnectResponse);

	void OnCreatePlayerFinished(const FHttpResponsePtr& HttpResponse);
	void OnLoginFinished(const FHttpResponsePtr& HttpResponse);
	void OnAddLeaderboardScoreFinished(const FHttpResponsePtr& HttpResponse);

	void SetJsonRequestBody(const FHttpRequestPtr& HttpRequest, TSharedPtr<FJsonObject> Json);

	FPlayerCreatedEvent PlayerCreatedEvent;
	FPlayerLoggedInEvent PlayerLoggedInEvent;
	FLeaderboardScoreAddedEvent LeaderboardScoreAddedEvent;

};


text:
package message

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"io"
	"os"
)

var useNumber = true

func init() {
	if os.Getenv("BENTHOS_USE_NUMBER") == "false" {
		useNumber = false
	}
}

//------------------------------------------------------------------------------

type rwData struct {
	rawBytes  []byte
	jsonCache interface{}
	metadata  map[string]string
}

// Part represents a single Benthos message.
type Part struct {
	data *rwData
	ctx  context.Context
}

// NewPart initializes a new message part.
func NewPart(data []byte) *Part {
	return &Part{
		data: &rwData{
			rawBytes: data,
		},
		ctx: context.Background(),
	}
}

//------------------------------------------------------------------------------

// Copy creates a shallow copy of the message part.
func (p *Part) Copy() *Part {
	var clonedMeta map[string]string
	if p.data.metadata != nil {
		clonedMeta = make(map[string]string, len(p.data.metadata))
		for k, v := range p.data.metadata {
			clonedMeta[k] = v
		}
	}
	return &Part{
		data: &rwData{
			rawBytes:  p.data.rawBytes,
			metadata:  clonedMeta,
			jsonCache: p.data.jsonCache,
		},
		ctx: p.ctx,
	}
}

// DeepCopy creates a new deep copy of the message part.
func (p *Part) DeepCopy() *Part {
	var clonedMeta map[string]string
	if p.data.metadata != nil {
		clonedMeta = make(map[string]string, len(p.data.metadata))
		for k, v := range p.data.metadata {
			clonedMeta[k] = v
		}
	}
	var clonedJSON interface{}
	if p.data.jsonCache != nil {
		var err error
		if clonedJSON, err = cloneGeneric(p.data.jsonCache); err != nil {
			clonedJSON = nil
		}
	}
	var np []byte
	if p.data != nil {
		np = make([]byte, len(p.data.rawBytes))
		copy(np, p.data.rawBytes)
	}
	return &Part{
		data: &rwData{
			rawBytes:  np,
			metadata:  clonedMeta,
			jsonCache: clonedJSON,
		},
		ctx: p.ctx,
	}
}

//------------------------------------------------------------------------------

// GetContext either returns a context attached to the message part, or
// context.Background() if one hasn't been previously attached.
func GetContext(p *Part) context.Context {
	return p.ctx
}

// WithContext returns the same message part wrapped with a context, this
// context can subsequently be received with GetContext.
func WithContext(ctx context.Context, p *Part) *Part {
	return p.WithContext(ctx)
}

// GetContext returns the underlying context attached to this message part.
func (p *Part) GetContext() context.Context {
	return p.ctx
}

// WithContext returns the underlying message part with a different context
// attached.
func (p *Part) WithContext(ctx context.Context) *Part {
	newP := *p
	newP.ctx = ctx
	return &newP
}

//------------------------------------------------------------------------------

// Get returns the body of the message part.
func (p *Part) Get() []byte {
	if len(p.data.rawBytes) == 0 && p.data.jsonCache != nil {
		var buf bytes.Buffer
		enc := json.NewEncoder(&buf)
		enc.SetEscapeHTML(false)
		err := enc.Encode(p.data.jsonCache)
		if err != nil {
			return nil
		}
		if buf.Len() > 1 {
			p.data.rawBytes = buf.Bytes()[:buf.Len()-1]
		}
	}
	return p.data.rawBytes
}

// JSON attempts to parse the message part as a JSON document and returns the
// result.
func (p *Part) JSON() (interface{}, error) {
	if p.data.jsonCache != nil {
		return p.data.jsonCache, nil
	}
	if p.data.rawBytes == nil {
		return nil, ErrMessagePartNotExist
	}

	dec := json.NewDecoder(bytes.NewReader(p.data.rawBytes))
	if useNumber {
		dec.UseNumber()
	}

	err := dec.Decode(&p.data.jsonCache)
	if err != nil {
		return nil, err
	}

	var dummy json.RawMessage
	if err = dec.Decode(&dummy); err == io.EOF {
		return p.data.jsonCache, nil
	}

	p.data.jsonCache = nil
	if err = dec.Decode(&dummy); err == nil || err == io.EOF {
		err = errors.New("message contains multiple valid documents")
	}
	return nil, err
}

// Set the value of the message part.
func (p *Part) Set(data []byte) *Part {
	p.data.rawBytes = data
	p.data.jsonCache = nil
	return p
}

// SetJSON attempts to marshal a JSON document into a byte slice and stores the
// result as the contents of the message part.
func (p *Part) SetJSON(jObj interface{}) {
	p.data.rawBytes = nil
	if jObj == nil {
		p.data.rawBytes = []byte(`null`)
	}
	p.data.jsonCache = jObj
}

//------------------------------------------------------------------------------

// MetaGet returns a metadata value if a key exists, otherwise an empty string.
func (p *Part) MetaGet(key string) string {
	if p.data.metadata == nil {
		return ""
	}
	return p.data.metadata[key]
}

// MetaSet sets the value of a metadata key.
func (p *Part) MetaSet(key, value string) {
	if p.data.metadata == nil {
		p.data.metadata = map[string]string{
			key: value,
		}
		return
	}
	p.data.metadata[key] = value
}

// MetaDelete removes the value of a metadata key.
func (p *Part) MetaDelete(key string) {
	if p.data.metadata == nil {
		return
	}
	delete(p.data.metadata, key)
}

// MetaIter iterates each metadata key/value pair.
func (p *Part) MetaIter(f func(k, v string) error) error {
	if p.data.metadata == nil {
		// Warning: If we remove this we need to compensate with a way to force
		// initialisation
		p.data.metadata = map[string]string{}
		return nil
	}
	for ak, av := range p.data.metadata {
		if err := f(ak, av); err != nil {
			return err
		}
	}
	return nil
}

//------------------------------------------------------------------------------

// IsEmpty returns true if the message part is empty.
func (p *Part) IsEmpty() bool {
	return len(p.data.rawBytes) == 0 && p.data.jsonCache == nil
}


text:
#import "UIGestureRecognizer.h"

// This will work for normal left-click long presses OR a right-click. The right-click will always
// be recognized as a long press regardless of how long the user holds down the right mouse button
// and it doesn't worry about allowableMovement and the other parameters that the regular long
// press would normally need to be worried about.

// Note that technically the long press gesture is continuous but a right click is discrete in Chameleon,
// so this is sort of a hack as it immediately switches to UIGestureRecognizerStateBegan in that case and
// ends up never switching to UIGestureRecognizerStateEnded. Since the right click "gesture" is discrete,
// it ends up getting aborted/reset before that happens. So if you want your long press recognizer to work
// with right clicks, make sure you take action when the state switches to UIGestureRecognizerStateBegan
// instead of UIGestureRecognizerStateEnded.

@interface UILongPressGestureRecognizer : UIGestureRecognizer
@property (nonatomic) CFTimeInterval minimumPressDuration;
@property (nonatomic) CGFloat allowableMovement;
@property (nonatomic) NSUInteger numberOfTapsRequired;
@property (nonatomic) NSInteger numberOfTouchesRequired;
@end


text:
package com.intellij.uiDesigner.propertyInspector.editors;

import com.intellij.ui.ListCellRendererWrapper;
import com.intellij.uiDesigner.propertyInspector.InplaceContext;
import com.intellij.uiDesigner.radComponents.RadComponent;
import com.intellij.uiDesigner.shared.BorderType;

import javax.swing.*;

/**
 * @author Anton Katilin
 * @author Vladimir Kondratyev
 */
public final class BorderTypeEditor extends ComboBoxPropertyEditor<BorderType> {
  public BorderTypeEditor(){
    myCbx.setModel(new DefaultComboBoxModel(BorderType.getAllTypes()));
    myCbx.setRenderer(new ListCellRendererWrapper<BorderType>() {
      @Override
      public void customize(JList list, BorderType value, int index, boolean selected, boolean hasFocus) {
        final BorderType type = value != null ? value : BorderType.NONE;
        setText(type.getName());
      }
    });
  }

  public JComponent getComponent(final RadComponent ignored, final BorderType value, final InplaceContext inplaceContext){
    myCbx.setSelectedItem(value);
    return myCbx;
  }
}


text:
package com.sequenceiq.cloudbreak.audit.converter;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import com.cloudera.thunderhead.service.audit.AuditProto;
import com.sequenceiq.cloudbreak.audit.converter.builder.ApiRequestDataBuilderProvider;
import com.sequenceiq.cloudbreak.audit.model.ApiRequestData;

class ApiRequestDataBuildUpdaterTest {

    @Mock
    private ApiRequestDataBuilderProvider mockBuilderProvider;

    @Mock
    private AuditProto.ApiRequestData.Builder mockApiRequestDataBuilder;

    @Mock
    private ApiRequestData mockApiRequestData;

    @Mock
    private AuditProto.AuditEvent.Builder mockAuditEventBuilder;

    @Mock
    private AuditProto.ApiRequestData mockApiRequestDataBuilderResult;

    private ApiRequestDataBuildUpdater underTest;

    @BeforeEach
    void setUp() {
        MockitoAnnotations.initMocks(this);
        when(mockBuilderProvider.getNewApiRequestDataBuilder()).thenReturn(mockApiRequestDataBuilder);
        when(mockApiRequestDataBuilder.setMutating(anyBoolean())).thenReturn(mockApiRequestDataBuilder);
        when(mockApiRequestDataBuilder.build()).thenReturn(mockApiRequestDataBuilderResult);

        underTest = new ApiRequestDataBuildUpdater(mockBuilderProvider);
    }

    @AfterEach
    void checkAfter() {
        verify(mockApiRequestDataBuilder, times(1)).setMutating(anyBoolean());
        verify(mockApiRequestData, times(1)).getApiVersion();
        verify(mockApiRequestData, times(1)).getRequestParameters();
        verify(mockApiRequestData, times(1)).getUserAgent();
        verify(mockAuditEventBuilder, times(1)).setApiRequestData(any(AuditProto.ApiRequestData.class));
        verify(mockAuditEventBuilder, times(1)).setApiRequestData(mockApiRequestDataBuilderResult);
    }

    @Test
    void testUpdateWhenApiVersionIsNull() {
        when(mockApiRequestData.getApiVersion()).thenReturn(null);

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, never()).setApiVersion(any());
    }

    @Test
    void testUpdateWhenApiVersionIsEmpty() {
        when(mockApiRequestData.getApiVersion()).thenReturn("");

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, never()).setApiVersion(any());
    }

    @Test
    void testUpdateWhenApiVersionIsNotEmpty() {
        String apiVersionValue = "someApiVersion";
        when(mockApiRequestData.getApiVersion()).thenReturn(apiVersionValue);

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, times(1)).setApiVersion(any());
        verify(mockApiRequestDataBuilder, times(1)).setApiVersion(apiVersionValue);
    }

    @Test
    void testUpdateWhenRequestParameterIsNull() {
        when(mockApiRequestData.getRequestParameters()).thenReturn(null);

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, never()).setRequestParameters(any());
    }

    @Test
    void testUpdateWhenRequestParameterIsEmpty() {
        when(mockApiRequestData.getRequestParameters()).thenReturn("");

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, never()).setRequestParameters(any());
    }

    @Test
    void testUpdateWhenRequestParameterIsNotEmpty() {
        String requestParams = "someRequestParamValue";
        when(mockApiRequestData.getRequestParameters()).thenReturn(requestParams);

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, times(1)).setRequestParameters(any());
        verify(mockApiRequestDataBuilder, times(1)).setRequestParameters(requestParams);
    }

    @Test
    void testUpdateWhenUserAgentIsNull() {
        when(mockApiRequestData.getUserAgent()).thenReturn(null);

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, never()).setUserAgent(any());
    }

    @Test
    void testUpdateWhenUserAgentIsEmpty() {
        when(mockApiRequestData.getUserAgent()).thenReturn("");

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, never()).setUserAgent(any());
    }

    @Test
    void testUpdateWhenUserAgentIsNotEmpty() {
        String userAgentValue = "someUserAgentValue";
        when(mockApiRequestData.getUserAgent()).thenReturn(userAgentValue);

        underTest.update(mockAuditEventBuilder, mockApiRequestData);

        verify(mockApiRequestDataBuilder, times(1)).setUserAgent(any());
        verify(mockApiRequestDataBuilder, times(1)).setUserAgent(userAgentValue);
    }

}


text:
[Danilo Vaz](/mentores/perfis/danilo_vaz.md)

## Meu Nome
Yuri Brunetto

## Qual meu sonho na carreira?
Primeiramente conseguir um emprego em alguma start-up ou trabalhar com produto. Depois, morar fora do país sendo front-end developer. :+1:

## Alguns links para me conhecer melhor
[Facebook](https://www.facebook.com/brunettoyuri)
[Twitter](https://twitter.com/yuribrunetto)
[LinkedIn](https://br.linkedin.com/in/yuri-brunetto-3b8625a6)


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!--<item name="actionBarStyle">@style/ActionBar.Solid.Sunshine</item>-->
    </style>

    <!-- ActionBar style -->
    <style name="ActionBar.Solid.Sunshine" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
        <item name="background">@color/sunshine_blue</item>
    </style>

    <!-- Main activity action bar style -->
    <style name="ActionBar.Solid.Sunshine.NoTitle" parent="@style/ActionBar.Solid.Sunshine">
        <item name="displayOptions">useLogo|showHome</item>
        <item name="logo">@drawable/ic_logo</item>
    </style>

    <!-- Main activity theme -->
    <style name="ForecastTheme" parent="AppTheme">
        <item name="actionBarStyle">@style/ActionBar.Solid.Sunshine.NoTitle</item>
    </style>

    <style name="boldText">
        <item name="android:textStyle">bold|italic</item>
        <item name="android:textColor">#000000</item>
    </style>

    <style name="list_choice_mode">
        <item name="android:choiceMode">none</item>
    </style>

</resources>


text:
<?php
namespace TgBotApi\Http\Client;

use InvalidArgumentException;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

class TelegramBotClientFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        if (!isset($config['telegram'])) {
            throw new InvalidArgumentException('Missing "telegram" config key');
        }

        $telegramConfig = $config['telegram'];
        if (!isset($telegramConfig['token'])) {
            throw new InvalidArgumentException('Missing "token" telegram config key');
        }
        $service = new TelegramBotClient;
        $service->setToken($telegramConfig['token']);

        if (isset($telegramConfig['options'])) {
            $service->setOptions($telegramConfig['options']);
        }
        return $service;
    }

}


text:
package org.fastcatsearch.datasource.reader;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.minidev.json.parser.ParseException;
import org.fastcatsearch.datasource.SourceModifier;
import org.fastcatsearch.datasource.reader.annotation.SourceReader;
import org.fastcatsearch.ir.common.IRException;
import org.fastcatsearch.ir.config.SingleSourceConfig;
import org.fastcatsearch.util.JSONParser;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@SourceReader(name = "JSON_LIST_FILE")
public class JSONListFileReader extends AbstractFileReader {

    private JSONParser jsonParser;

    public JSONListFileReader() {
        jsonParser = new JSONParser();
    }

    public JSONListFileReader(String collectionId, File filePath, SingleSourceConfig singleSourceConfig, SourceModifier sourceModifier, String lastIndexTime) throws IRException {
        super(collectionId, filePath, singleSourceConfig, sourceModifier, lastIndexTime);
        jsonParser = new JSONParser();
    }

    @Override
    protected Map<String, Object> parse(BufferedReader reader) throws IRException, IOException {
        String line = reader.readLine();
        if (line == null) {
            throw new IOException("EOF");
        }
        line = line.trim();
        if (line.length() == 0) {
            return null;
        }
        try {
            return jsonParser.parse(line);
        } catch (ParseException e) {
            logger.error("error while convert json to map : " + line, e);
        }
        return null;
    }

    @Override
    protected void initReader(BufferedReader reader) throws IRException, IOException {
        //do nothing
    }

}


text:
const { app, BrowserWindow } = require('electron')
const url = require('url')
const path = require('path')

const isCoverage = Boolean(process.argv.find(p => p === '--coverage'))

app.on('ready', () => {
  let editorWindow = new BrowserWindow({ width: 1024, height: 768 })
  let mainUrl = url.format({
    pathname: isCoverage ? path.join(__dirname, 'coverage.html') : path.join(__dirname, 'browser.html'),
    protocol: 'file:',
    slashes: true
  })
  editorWindow.webContents.openDevTools()
  editorWindow.loadURL(mainUrl)
})

app.on('window-all-closed', () => {
  process.exit(0)
  // app.quit()
})