text:
<resources>

    <style name="Base.AppTheme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="colorButtonNormal">@color/colorAccent</item>
        <item name="colorControlNormal">@color/colorControlNormal</item>
        <item name="colorControlActivated">@color/colorControlHighlight</item>
        <item name="searchViewStyle">@style/AppTheme.SearchView</item>
        <item name="android:windowBackground">@color/colorWindowBackground</item>
    </style>

    <style name="AppTheme" parent="Base.AppTheme"/>

    <style name="AppTheme.NoActionBar" parent="Base.AppTheme">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.Transparent" parent="AppTheme.NoActionBar">
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="background">@android:color/transparent</item>
        <item name="android:windowAnimationStyle">@null</item>
    </style>

    <style name="AppTheme.SearchView" parent="Widget.AppCompat.Light.SearchView">
        <item name="searchHintIcon">@null</item>
        <item name="queryBackground">@null</item>
        <item name="submitBackground">@null</item>
    </style>

    <style name="AppTheme.Toolbar">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">?attr/actionBarSize</item>
        <item name="android:background">?attr/colorPrimary</item>
        <item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Light"/>

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

    <style name="AppTheme.TabLayout" parent="@style/Widget.Design.TabLayout">
        <item name="tabIndicatorHeight">@dimen/default_tab_indicator_height</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="tabMode">fixed</item>
        <item name="tabGravity">fill</item>
    </style>

    <style name="AppTheme.TabLayout.Dark" parent="AppTheme.TabLayout">
        <item name="tabIndicatorColor">?attr/colorAccent</item>
        <item name="tabBackground">?attr/colorPrimaryDark</item>
        <item name="tabTextAppearance">@style/AppTheme.Text.Tab</item>
        <item name="tabSelectedTextColor">?attr/colorAccent</item>
    </style>

    <style name="AppTheme.Text.Tab" parent="TextAppearance.Design.Tab">
        <item name="android:textSize">@dimen/text_secondary</item>
        <item name="android:textColor">@color/colorSecondary</item>
        <item name="textAllCaps">true</item>
    </style>

    <style name="AppTheme.Button" parent="Widget.AppCompat.Button.Colored">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">@dimen/button_height</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:textAllCaps">false</item>
        <item name="android:paddingLeft">@dimen/button_internal_padding</item>
        <item name="android:paddingRight">@dimen/button_internal_padding</item>
        <item name="android:gravity">center_vertical|center_horizontal</item>
        <item name="android:drawablePadding">@dimen/button_inline_margin_horizontal</item>
    </style>

    <!-- Flat button-->
    <style name="AppTheme.Button.Flat" parent="Widget.AppCompat.Button.Borderless">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">@dimen/button_height</item>
        <item name="android:textColor">@color/colorTextLinkNormal</item>
        <item name="android:textSize">@dimen/text_secondary</item>
        <item name="android:paddingLeft">@dimen/button_internal_padding</item>
        <item name="android:paddingRight">@dimen/button_internal_padding</item>
        <item name="android:textAllCaps">false</item>
        <item name="android:background">@drawable/btn_color_transparent</item>
        <item name="android:layout_gravity">center_vertical</item>
        <item name="android:drawablePadding">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Button.Flat.Edit">
        <item name="android:layout_gravity">center</item>
        <item name="android:layout_marginTop">@dimen/button_edit_margin_top</item>
    </style>

    <!-- Flat button-->
    <style name="AppTheme.Button.Flat.Full">
        <item name="android:layout_width">match_parent</item>
        <item name="android:textColor">@color/colorTextLinkNormal</item>
        <item name="android:background">@drawable/btn_color_primary_full</item>
        <item name="android:paddingLeft">0dp</item>
        <item name="android:paddingRight">0dp</item>
        <item name="android:textSize">@dimen/text_primary</item>
        <item name="android:textAllCaps">true</item>
    </style>

    <!-- Flat button-->
    <style name="AppTheme.Button.Flat.Colored">
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@drawable/btn_color_accent</item>
    </style>

    <style name="AppTheme.Button.Flat.Colored.White">
        <item name="android:textColor">@color/colorTextLinkNormal</item>
        <item name="android:background">@drawable/btn_color_primary</item>
    </style>

    <style name="AppTheme.Button.Flat.Colored.White.Dense">
        <item name="android:layout_height">@dimen/button_dense_height</item>
        <item name="android:textSize">@dimen/text_tertiary</item>
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
    </style>

    <style name="AppTheme.Button.Flat.Full.Colored">
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@drawable/btn_color_accent_full</item>
        <item name="android:textAllCaps">true</item>
    </style>

    <style name="AppTheme.Button.Flat.Primary">
        <item name="android:textColor">@color/colorTextPrimary</item>
    </style>

    <style name="AppTheme.Button.Flat.Secondary">
        <item name="android:textColor">@color/colorTextSecondary</item>
    </style>

    <!-- Full width flat button with text alignment on left -->
    <style name="AppTheme.Button.Flat.Full.Left">
        <item name="android:gravity">center_vertical|left</item>
        <item name="android:paddingLeft">@dimen/activity_horizontal_margin</item>
        <item name="android:paddingRight">@dimen/button_inline_margin_horizontal</item>
    </style>

    <!-- Flat dense button-->
    <style name="AppTheme.Button.Flat.Dense" parent="AppTheme.Button.Flat">
        <item name="android:layout_height">@dimen/button_dense_height</item>
        <item name="android:textSize">@dimen/text_tertiary</item>
    </style>

    <!-- Flat colered dense button-->
    <style name="AppTheme.Button.Flat.Colored.Dense">
        <item name="android:layout_height">@dimen/button_dense_height</item>
        <item name="android:textSize">@dimen/text_tertiary</item>
    </style>

    <!-- Flat dense button-->
    <style name="AppTheme.Button.Flat.Dense.Right" parent="AppTheme.Button.Flat">
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_gravity">center_vertical|right</item>
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginLeft">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Button.Flat.Right">
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_gravity">center_vertical|right</item>
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginLeft">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Button.Flat.Toolbar">
        <item name="android:textSize">@dimen/text_primary</item>
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_height">match_parent</item>
        <item name="android:layout_gravity">center_vertical|right</item>
        <item name="android:textAllCaps">true</item>
        <item name="android:layout_marginLeft">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Button.Flat.Left" parent="AppTheme.Button.Flat">
        <item name="android:layout_alignParentLeft">true</item>
        <item name="android:layout_gravity">center_vertical|left</item>
        <item name="android:layout_marginLeft">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginRight">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Button.Flat.Left.Inline" parent="AppTheme.Button.Flat">
        <item name="android:layout_alignParentLeft">true</item>
        <item name="android:layout_gravity">center_vertical|left</item>
        <item name="android:layout_marginLeft">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Button.Flat.Right.Inline" parent="AppTheme.Button.Flat">
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_gravity">center_vertical|right</item>
        <item name="android:layout_marginRight">@dimen/button_inline_margin_horizontal</item>
    </style>

    <!-- Icon button style -->
    <style name="AppTheme.ImageButton">
        <item name="android:layout_width">@dimen/button_icon_width</item>
        <item name="android:layout_height">@dimen/button_height</item>
        <item name="android:background">?attr/selectableItemBackground</item>
        <item name="android:layout_centerVertical">true</item>
        <item name="android:layout_centerInParent">true</item>
        <item name="android:scaleType">centerInside</item>
    </style>

    <style name="AppTheme.ImageButton.Toolbar">
        <item name="android:background">?attr/selectableItemBackgroundBorderless</item>
    </style>

    <!-- Icon button style -->
    <style name="AppTheme.ImageButton.Inline">
        <item name="android:layout_marginRight">@dimen/button_inline_margin_horizontal</item>
        <item name="android:layout_marginLeft">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.ImageButton.Right">
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
    </style>

    <!-- Button style >>> -->

    <!-- <<< Base Text styles -->
    <style name="AppTheme.Text">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textColor">@color/colorTextPrimary</item>
        <item name="android:gravity">center_vertical</item>
    </style>

    <style name="AppTheme.Text.SubHeader" parent="AppTheme.Text">
        <item name="android:gravity">left|center_vertical</item>
        <item name="android:textColor">@color/colorTextSecondary</item>
        <item name="android:textSize">@dimen/text_tertiary</item>
        <item name="android:minHeight">@dimen/text_tile_height_subheader</item>
        <item name="android:padding">@dimen/text_padding_default</item>
    </style>

    <style name="AppTheme.Text.SubHeader.Dense" parent="AppTheme.Text.SubHeader">
        <item name="android:gravity">left|center_vertical</item>
        <item name="android:padding">@null</item>
        <item name="android:paddingLeft">@dimen/text_padding_default</item>
        <item name="android:paddingRight">@dimen/text_padding_default</item>
    </style>

    <style name="AppTheme.Text.SubHeader.Empty" parent="AppTheme.Text">
        <item name="android:gravity">center</item>
        <item name="android:textSize">@dimen/text_title</item>
        <item name="android:textColor">@color/colorTextPrimary</item>
        <item name="android:layout_gravity">center</item>
        <item name="android:paddingTop">@dimen/text_margin_description</item>
        <item name="android:paddingBottom">@dimen/text_margin_description</item>
        <item name="android:paddingLeft">@dimen/text_padding_default</item>
        <item name="android:paddingRight">@dimen/text_padding_default</item>
    </style>

    <style name="AppTheme.Text.GridItem.Label" parent="AppTheme.Text">
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_width">wrap_content</item>
        <item name="android:gravity">center</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:textSize">@dimen/text_tertiary</item>
        <item name="android:layout_marginTop">@dimen/recycler_view_item_label_margin_vertical</item>
    </style>

    <style name="AppTheme.Text.Title" parent="AppTheme.Text">
        <item name="android:gravity">left</item>
        <item name="android:textSize">@dimen/text_title</item>
        <item name="android:minHeight">@dimen/text_tile_height</item>
    </style>

    <style name="AppTheme.Text.Toolbar.Title" parent="AppTheme.Text.Title">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:gravity">center_vertical|left</item>
        <item name="android:paddingRight">@dimen/text_padding_default</item>
        <item name="android:paddingLeft">@dimen/text_padding_toolbar_left</item>
    </style>

    <style name="AppTheme.Messagebar">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">@dimen/text_tile_height</item>
        <item name="android:textSize">@dimen/text_secondary</item>
        <item name="android:background">@color/colorAccent</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:minHeight">@dimen/list_item_height_single_line</item>
    </style>

    <style name="AppTheme.Grid.Error" parent="AppTheme.Messagebar">
        <item name="android:layout_height">match_parent</item>
        <item name="android:background">@color/colorPrimaryDark</item>
        <item name="android:layout_centerInParent">true</item>
    </style>

    <style name="AppTheme.Text.Body" parent="AppTheme.Text">
        <item name="android:gravity">left|center_vertical</item>
        <item name="android:textSize">@dimen/text_secondary</item>
        <item name="android:textColor">@color/colorTextPrimary</item>
    </style>

    <style name="AppTheme.Text.Label" parent="AppTheme.ListView.Text">
        <item name="android:textSize">@dimen/text_secondary</item>
        <item name="android:textColor">@color/colorTextSecondary</item>
        <item name="android:ellipsize">end</item>
        <item name="android:singleLine">true</item>
        <item name="android:minHeight">@dimen/text_tile_height_dense</item>
        <item name="android:drawablePadding">@dimen/text_padding_default</item>
    </style>

    <style name="AppTheme.Text.Label.Inline" parent="AppTheme.Text.Label">
        <item name="android:layout_marginLeft">@dimen/card_margin_horizontal</item>
        <item name="android:padding">@null</item>
        <item name="android:minHeight">@null</item>
        <item name="android:gravity">center_vertical</item>
        <item name="android:layout_gravity">center_vertical</item>
    </style>

    <style name="AppTheme.Text.Label.Right">
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginLeft">@dimen/text_padding_default</item>
    </style>

    <style name="AppTheme.Text.Label.Left">
        <item name="android:layout_marginLeft">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginRight">@dimen/text_padding_default</item>
    </style>

    <style name="AppTheme.Text.LabelInline" parent="AppTheme.ListView.Text">
        <item name="android:textSize">@dimen/text_secondary</item>
        <item name="android:textColor">@color/colorTextPrimary</item>
        <item name="android:layout_marginRight">@dimen/text_inline_margin_default</item>
        <item name="android:layout_marginTop">@dimen/text_inline_margin_default</item>
    </style>

    <style name="AppTheme.Text.Label.Body" parent="AppTheme.Text.Body">
        <item name="android:textSize">@dimen/text_primary</item>
        <item name="android:textColor">@color/colorTextPrimary</item>
    </style>

    <!-- Use if you want to show EditText like hint -->
    <style name="AppTheme.Text.Hint" parent="AppTheme.Text.Body">
        <item name="android:textColor">@color/colorTextSecondary</item>
    </style>
    <!-- Text styles >>> -->

    <style name="AppTheme.Text.Label.Colored">
        <item name="android:textColor">@color/colorAccent</item>
    </style>

    <style name="AppTheme.Text.Label.Body.Inline">
        <item name="android:layout_marginRight">@dimen/text_inline_margin_default</item>
    </style>

    <!-- EditText styles >>> -->

    <style name="AppTheme.ListView">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:paddingTop">@dimen/list_item_padding_vertical</item>
        <item name="android:paddingBottom">@dimen/list_item_padding_vertical</item>
    </style>

    <style name="AppTheme.ListView.Item">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:background">?android:attr/selectableItemBackground</item>
        <item name="android:orientation">vertical</item>
        <item name="android:clickable">true</item>
        <item name="android:paddingLeft">@dimen/list_item_margin_horizontal</item>
        <item name="android:paddingRight">@dimen/list_item_margin_horizontal</item>
        <item name="android:gravity">center_vertical</item>
    </style>

    <style name="AppTheme.ListView.Item.Single.Line" parent="AppTheme.ListView.Item">
        <item name="android:minHeight">@dimen/list_item_height_single_line</item>
    </style>

    <style name="AppTheme.ListView.Item.Single.Line.Dense" parent="AppTheme.ListView.Item">
        <item name="android:minHeight">@dimen/list_item_height_single_line_dense</item>
    </style>

    <style name="AppTheme.ListView.Item.Two.Line" parent="AppTheme.ListView.Item">
        <item name="android:minHeight">@dimen/list_item_height_two_line</item>
    </style>

    <!-- Same as list item but without a click and has a white background -->
    <style name="AppTheme.ListView.Item.Disabled">
        <item name="android:background">@color/white</item>
        <item name="android:clickable">false</item>
    </style>

    <!-- Same as list item single line but without a click and has a white background -->
    <style name="AppTheme.ListView.Item.Single.Line.Disabled" parent="AppTheme.ListView.Item.Disabled">
        <item name="android:minHeight">@dimen/list_item_height_single_line</item>
    </style>

    <!-- Same as list item two line but without a click and has a white background -->
    <style name="AppTheme.ListView.Item.Two.Line.Disabled" parent="AppTheme.ListView.Item.Disabled">
        <item name="android:minHeight">@dimen/list_item_height_two_line</item>
    </style>

    <style name="AppTheme.ListView.Item.Single.Line.Dense.Disabled" parent="AppTheme.ListView.Item.Disabled">
        <item name="android:minHeight">@dimen/list_item_height_single_line_dense</item>
    </style>

    <style name="AppTheme.ListView.Icon">
        <item name="android:layout_width">@dimen/list_item_icon_size</item>
        <item name="android:layout_height">@dimen/list_item_icon_size</item>
        <item name="android:layout_gravity">center_vertical</item>
        <item name="android:scaleType">center</item>
        <item name="android:padding">0dp</item>
    </style>

    <style name="AppTheme.ListView.Icon.Small">
        <item name="android:layout_width">@dimen/icon_height</item>
        <item name="android:layout_height">@dimen/icon_height</item>
    </style>

    <style name="AppTheme.ListView.Icon.Small.Left">
        <item name="android:layout_marginRight">@dimen/list_item_margin_horizontal</item>
    </style>

    <style name="AppTheme.ListView.Icon.Big" parent="AppTheme.ListView.Icon">
        <item name="android:layout_width">@dimen/list_item_icon_size_big</item>
        <item name="android:layout_height">@dimen/list_item_icon_size_big</item>
    </style>

    <style name="AppTheme.ListView.Icon.Big.Left" parent="AppTheme.ListView.Icon.Big">
        <item name="android:layout_marginRight">@dimen/list_item_margin_horizontal</item>
    </style>

    <style name="AppTheme.ListView.Icon.Big.Right" parent="AppTheme.ListView.Icon.Big">
        <item name="android:layout_marginLeft">@dimen/list_item_margin_horizontal</item>
    </style>

    <style name="AppTheme.ListView.Icon.Left" parent="AppTheme.ListView.Icon">
        <item name="android:layout_marginRight">@dimen/list_item_margin_horizontal</item>
    </style>

    <style name="AppTheme.ListView.Text" parent="AppTheme.Text">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
    </style>

    <style name="AppTheme.ListView.Text.Title.Single.Line" parent="AppTheme.ListView.Text">
        <item name="android:layout_gravity">center_vertical</item>
        <item name="android:layout_marginLeft">@dimen/list_item_margin_horizontal</item>
        <item name="android:ellipsize">end</item>
        <item name="android:singleLine">true</item>
    </style>

    <style name="AppTheme.ListView.Text.Title" parent="AppTheme.ListView.Text">
        <item name="android:textSize">@dimen/text_primary</item>
        <item name="android:layout_gravity">center_vertical</item>
        <item name="android:ellipsize">end</item>
        <item name="android:maxLines">1</item>
    </style>

    <style name="AppTheme.ListView.Text.Title.Light" parent="AppTheme.ListView.Text.Title">
        <item name="android:textColor">@color/colorSecondary</item>
    </style>

    <style name="AppTheme.ListView.Label.Icon" parent="AppTheme.ListView.Icon">
        <item name="android:layout_width">@dimen/proof_icon_size</item>
        <item name="android:layout_height">@dimen/proof_icon_size</item>
        <item name="android:layout_marginLeft">@dimen/list_item_margin_horizontal</item>
        <item name="android:scaleType">centerCrop</item>
        <item name="android:layout_alignParentLeft">true</item>
        <item name="android:layout_alignParentTop">true</item>
        <item name="android:layout_marginTop">@dimen/list_text_padding_vertical</item>
    </style>

    <style name="AppTheme.ListView.Text.Body" parent="AppTheme.ListView.Text">
        <item name="android:layout_gravity">center_vertical</item>
        <item name="android:textSize">@dimen/text_secondary</item>
        <item name="android:textColor">@color/colorTextSecondary</item>
        <item name="android:layout_marginTop">@dimen/list_text_padding_vertical</item>
    </style>

    <style name="AppTheme.Dialog.Alert" parent="Theme.AppCompat.Light.Dialog">
        <item name="android:textColorPrimary">@color/colorTextPrimary</item>
        <item name="android:background">@color/white</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.Dialog" parent="Theme.AppCompat.Dialog.Alert">
        <item name="android:textColorPrimary">@color/colorTextPrimary</item>
        <item name="android:background">@color/white</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:minWidth">@dimen/dialog_min_width</item>
    </style>

    <style name="AppTheme.Dialog.ButtonBar" parent="AppTheme">
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:padding">@dimen/dialog_default_button_bar_padding</item>
    </style>

    <style name="AppTheme.Dialog.Text" parent="AppTheme.Text">
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_width">match_parent</item>
    </style>

    <style name="AppTheme.Dialog.Text.Title" parent="AppTheme.Text">
        <item name="android:gravity">left</item>
        <item name="android:textSize">@dimen/text_title</item>
        <item name="android:paddingTop">@dimen/dialog_default_text_padding_horizontal</item>
        <item name="android:paddingBottom">@dimen/dialog_default_text_padding_horizontal</item>
        <item name="android:paddingLeft">@dimen/dialog_default_text_padding_horizontal</item>
    </style>

    <style name="AppTheme.Dialog.Text.Body">
        <item name="android:textColor">@color/colorTextPrimary</item>
        <item name="android:paddingLeft">@dimen/dialog_default_text_padding_horizontal</item>
        <item name="android:paddingRight">@dimen/dialog_default_text_padding_horizontal</item>
        <item name="android:textSize">@dimen/text_secondary</item>
    </style>

    <style name="AppTheme.Dialog.Alert.TextInputLayout">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:paddingLeft">@dimen/dialog_default_text_input_layout_padding_horizontal</item>
        <item name="android:paddingRight">@dimen/dialog_default_text_input_layout_padding_horizontal</item>
    </style>

    <style name="AppTheme.Dialog.Button.Flat" parent="AppTheme.Button.Flat">
        <item name="android:layout_marginTop">@dimen/button_dialog_top_margin</item>
        <item name="android:textColor">@color/colorTextLinkNormal</item>
        <item name="android:textSize">@dimen/text_tertiary</item>
        <item name="android:padding">@dimen/button_dialog_padding</item>
        <item name="android:gravity">center_vertical|center_horizontal</item>
        <item name="android:layout_gravity">right</item>
        <item name="android:layout_centerInParent">true</item>
        <item name="android:textAllCaps">true</item>
    </style>

    <!-- Progressbar style-->
    <style name="AppTheme.ProgressBar" parent="@style/Widget.AppCompat.ProgressBar">
        <item name="android:layout_width">@dimen/progress_bar_size</item>
        <item name="android:layout_height">@dimen/progress_bar_size</item>
        <item name="android:layout_gravity">center</item>
        <item name="android:indeterminate">true</item>
        <item name="color">@color/turquoise_blue</item>
    </style>

    <style name="AppTheme.ProgressBar.Medium" parent="AppTheme.ProgressBar">
        <item name="android:layout_width">@dimen/progress_bar_size_medium</item>
        <item name="android:layout_height">@dimen/progress_bar_size_medium</item>
        <item name="android:layout_centerVertical">true</item>
    </style>

    <style name="AppTheme.ProgressBar.Small" parent="AppTheme.ProgressBar">
        <item name="android:layout_width">@dimen/progress_bar_size_small</item>
        <item name="android:layout_height">@dimen/progress_bar_size_small</item>
        <item name="android:layout_centerVertical">true</item>
    </style>

    <style name="AppTheme.Divider">
        <item name="android:background">@color/colorDivider</item>
    </style>

    <style name="AppTheme.Divider.Horizontal" parent="AppTheme.Divider">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">@dimen/divider_height_horizontal</item>
    </style>

    <style name="AppTheme.Divider.Vertical" parent="AppTheme.Divider">
        <item name="android:layout_height">match_parent</item>
        <item name="android:layout_width">@dimen/divider_width_vertical</item>
        <item name="android:background">@color/colorDividerDark</item>
        <item name="android:layout_centerVertical">true</item>
        <item name="android:layout_marginLeft">@dimen/default_separator_margin_right</item>
        <item name="android:layout_marginRight">@dimen/default_separator_margin_right</item>
    </style>

    <!-- Image Button style end -->

    <style name="AppTheme.Item" parent="AppTheme.ListView.Item"/>
    <!--Image View style end-->

    <!--Switch compat style-->
    <style name="AppTheme.SwitchCompat">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_centerVertical">true</item>
        <item name="android:layout_gravity">right|center_vertical</item>
        <item name="android:checked">false</item>
        <item name="android:scaleType">fitCenter</item>
    </style>

    <!--Switch compat style-->
    <style name="AppTheme.SwitchCompat.Disabled">
        <item name="android:clickable">false</item>
    </style>

    <style name="AppTheme.CheckedTextView">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">?android:attr/listPreferredItemHeight</item>
        <item name="android:background">?android:attr/selectableItemBackground</item>
        <item name="android:drawablePadding">@dimen/activity_horizontal_padding</item>
        <item name="android:gravity">center_vertical</item>
        <item name="android:paddingLeft">?android:attr/listPreferredItemPaddingLeft</item>
        <item name="android:paddingRight">?android:attr/listPreferredItemPaddingRight</item>
        <item name="android:textSize">@dimen/text_primary</item>
        <item name="android:textColor">@color/black</item>
    </style>

    <!-- ToolbarSlidingLightText style  for activity's start -->
    <style name="AppTheme.Toolbar.Transparent" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:background">@android:color/transparent</item>
        <item name="background">@android:color/transparent</item>
    </style>
    <!-- ToolbarSlidingLightText style  for activity's end -->

    <style name="AppTheme.Text.Toolbar.Title.Home" parent="AppTheme.Text">
        <item name="android:gravity">center_vertical</item>
        <item name="android:textSize">@dimen/text_title</item>
        <item name="android:textColor">@color/white</item>
    </style>

    <style name="AppTheme.Text.Display">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/text_display</item>
        <item name="android:textColor">@color/colorTextPrimary</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="AppTheme.ImageButton.Dense" parent="AppTheme.ImageButton">
        <item name="android:layout_width">@dimen/button_dense_height</item>
        <item name="android:layout_marginLeft">@dimen/toolbar_button_bar_internal_padding</item>
        <item name="android:layout_height">@dimen/button_dense_height</item>
    </style>

    <style name="AppTheme.ListView.Horizontal">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginLeft">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
    </style>

    <style name="AppTheme.Button.Flat.Border">
        <item name="android:background">@drawable/btn_color_accent_border</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:layout_gravity">center</item>
    </style>

    <style name="AppTheme.Button.Flat.Border.Left">
        <item name="android:layout_gravity">center_vertical|left</item>
        <item name="android:layout_marginLeft">@dimen/text_inline_margin_default</item>
        <item name="android:layout_alignParentLeft">true</item>
    </style>

    <style name="AppTheme.Button.Flat.Border.Dense">
        <item name="android:layout_height">@dimen/button_dense_height</item>
    </style>

    <style name="AppTheme.Button.Flat.Border.Dense.Left">
        <item name="android:layout_marginLeft">@dimen/text_inline_margin_default</item>
    </style>

    <style name="AppTheme.Button.Flat.Border.Right">
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_gravity">center_vertical|right</item>
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginLeft">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Button.Flat.Colored.Right">
        <item name="android:layout_alignParentRight">true</item>
        <item name="android:layout_gravity">center_vertical|right</item>
        <item name="android:layout_marginRight">@dimen/activity_horizontal_margin</item>
        <item name="android:layout_marginLeft">@dimen/button_inline_margin_horizontal</item>
    </style>

    <style name="AppTheme.Divider.Horizontal.Dark" parent="AppTheme.Divider">
        <item name="android:background">@color/colorControlNormal</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">@dimen/divider_height_horizontal</item>
    </style>

    <style name="AppTheme.CardView">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:padding">@dimen/card_padding_horizontal</item>
        <item name="cardCornerRadius">@dimen/card_corner_radius</item>
        <item name="cardElevation">@dimen/card_elevation</item>
        <item name="android:layout_margin">@dimen/card_margin_horizontal</item>
    </style>

    <!-- Card View style-->
    <style name="AppTheme.CardView.Full">
        <item name="cardUseCompatPadding">false</item>
        <item name="cardPreventCornerOverlap">true</item>
        <item name="android:padding">@null</item>
        <item name="cardCornerRadius">@null</item>
        <item name="android:layout_margin">@null</item>
        <item name="android:layout_marginTop">0dp</item>
        <item name="android:layout_marginRight">0dp</item>
        <item name="android:layout_marginLeft">0dp</item>
        <item name="android:layout_marginBottom">@dimen/card_margin_vertical</item>
    </style>

    <!-- Button style for LinearLayouts which are clickable -->
    <style name="AppTheme.Button.List" parent="Widget.AppCompat.Button.Borderless">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">@dimen/list_item_height_single_line</item>
        <item name="android:textColor">@color/colorTextPrimary</item>
        <item name="android:background">@drawable/btn_color_primary_full</item>
        <item name="android:paddingLeft">@dimen/button_internal_padding</item>
        <item name="android:paddingRight">@dimen/button_internal_padding</item>
        <item name="android:textSize">@dimen/text_primary</item>
        <item name="android:gravity">left|center_vertical</item>
        <item name="android:textAllCaps">false</item>
    </style>

    <style name="AppTheme.Button.List.Two.Line" parent="AppTheme.Button.List">
        <item name="android:layout_height">wrap_content</item>
        <item name="android:minHeight">@dimen/list_item_height_two_line</item>
    </style>

    <style name="AppTheme.ImageButton.Icon">
        <item name="android:layout_width">@dimen/icon_width</item>
        <item name="android:layout_height">@dimen/icon_height</item>
    </style>

    <style name="AppTheme.Text.Display.Dense">
        <item name="android:textSize">@dimen/text_display_2</item>
    </style>

    <style name="AppTheme.ListView.NotificationIcon">
        <item name="android:layout_width">@dimen/list_item_notification_icon_size</item>
        <item name="android:layout_height">@dimen/list_item_notification_icon_size</item>
        <item name="android:layout_gravity">center_vertical</item>
        <item name="android:scaleType">center</item>
        <item name="android:layout_marginRight">@dimen/list_item_margin_horizontal</item>
        <item name="android:padding">0dp</item>
    </style>
</resources>


text:
from astropy.table import Table
from astropy.coordinates import SkyCoord
import astropy.units as u
import os
from copy import copy

'''
Combine some columns and clean-up the Bagetakos table
'''

cat_path = "/media/eric/Data_3/VLA/THINGS/"

tab = Table.read(os.path.join(cat_path, "bagetakos_bubbles.txt"),
                 format='ascii')

# Mostly I want to combine the center coordinate columns since they're
# separated into RAh, RAm, etc...

ra = ["{}h{}m{}".format(hour, minu, sec) for hour, minu, sec in
      zip(tab["RAh"], tab["RAm"], tab["RAs"])]
dec = ["{}{}d{}m{}".format(sign if sign == "-" else "+", hour, minu, sec)
       for sign, hour, minu, sec in
       zip(tab["DE-"], tab["DEd"], tab["DEm"], tab["DEs"])]

coords = SkyCoord([(r, d) for r, d in zip(ra, dec)], frame='fk5')

columns = copy(tab.colnames)

# Now remove the position columns
for name in ["RAh", "RAm", "RAs", "DE-", "DEd", "DEm", "DEs"]:
    columns.remove(name)

new_table = Table([tab[col] for col in columns] + [coords],
                  names=[tab[col].name for col in columns] + ["Coords"])

# Wrong units on the energy
new_table["log(E)"].unit = 1e50 * u.J

# Saving as an ecsv will read the coordinates back in as SkyCoords!
new_table.write(os.path.join(cat_path, "bagetakos_bubbles_reformatted.ecsv"),
                format='ascii.ecsv')

redpajama_set_name: RedPajamaGithub


text:
package ru.otus.korneev.hmw04.util;

import com.sun.management.GarbageCollectionNotificationInfo;

import javax.management.NotificationEmitter;
import javax.management.NotificationListener;
import javax.management.openmbean.CompositeData;
import java.lang.management.*;
import java.util.HashMap;
import java.util.Map;

public class MemoryUtil {
	private static Map<String, InfoAboutGC> info;

	static {
		info = new HashMap<>();
		info.put("Young GC", new InfoAboutGC());
		info.put("Old GC", new InfoAboutGC());
	}

	// Обработчик сообщений о сборке мусора
	private static NotificationListener gcHandler = (notification, handback) -> {
		if (notification.getType().equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) {
			GarbageCollectionNotificationInfo gcInfo = GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData());
			if (gcInfo.getGcAction().equals("end of minor GC")) {
				InfoAboutGC inf = info.get("Young GC");
				inf.incrementCount();
				inf.sumTime(gcInfo.getGcInfo().getDuration());
			} else if (gcInfo.getGcAction().equals("end of major GC")) {
				InfoAboutGC inf = info.get("Old GC");
				inf.incrementCount();
				inf.sumTime(gcInfo.getGcInfo().getDuration());
			}
		}
	};

	/**
	 * Запускает процесс мониторинга сборок мусора.
	 */
	public static void startGCMonitor() {
		for (GarbageCollectorMXBean mBean : ManagementFactory.getGarbageCollectorMXBeans()) {
			switch (mBean.getName()) {
				case "Copy":
				case "PS Scavenge":
				case "ParNew":
				case "G1 Young Generation":
					info.get("Young GC").setNameGC(mBean.getName());
					break;
				case "MarkSweepCompact":
				case "PS MarkSweep":
				case "ConcurrentMarkSweep":
				case "G1 Old Generation":
					info.get("Old GC").setNameGC(mBean.getName());
					break;
			}
			((NotificationEmitter) mBean).addNotificationListener(gcHandler, null, null);
		}
	}

	public static void printResult() {
		System.out.println(info.get("Young GC"));
		System.out.println(info.get("Old GC"));
	}
}


text:
package processtree

import (
	"sync"
)

type ProcessTree struct {
	Root         *SlaveNode
	ExecCommand  string
	SlavesByName map[string]*SlaveNode
	Commands     []*CommandNode
	StateChanged chan bool
}

type ProcessTreeNode struct {
	mu     sync.RWMutex
	Parent *SlaveNode
	Name   string
}

type CommandNode struct {
	ProcessTreeNode
	booting sync.RWMutex
	Aliases []string
}

func (tree *ProcessTree) NewCommandNode(name string, aliases []string, parent *SlaveNode) *CommandNode {
	x := &CommandNode{}
	x.Parent = parent
	x.Name = name
	x.Aliases = aliases
	tree.Commands = append(tree.Commands, x)
	return x
}

func (tree *ProcessTree) FindSlaveByName(name string) *SlaveNode {
	if name == "" {
		return tree.Root
	}
	return tree.SlavesByName[name]
}

func (tree *ProcessTree) FindCommand(requested string) *CommandNode {
	for _, command := range tree.Commands {
		if command.Name == requested {
			return command
		}
		for _, alias := range command.Aliases {
			if alias == requested {
				return command
			}
		}
	}
	return nil
}

func (tree *ProcessTree) AllCommandsAndAliases() []string {
	var values []string
	for _, command := range tree.Commands {
		values = append(values, command.Name)
		for _, alias := range command.Aliases {
			values = append(values, alias)
		}
	}
	return values
}

var restartMutex sync.Mutex

func (tree *ProcessTree) RestartNodesWithFeatures(files []string) {
	restartMutex.Lock()
	defer restartMutex.Unlock()
	tree.Root.trace("%d files changed, beginning with %q", len(files), files[0])
	tree.Root.restartNodesWithFeatures(tree, files)
}

// Serialized: restartMutex is always held when this is called.
func (node *SlaveNode) restartNodesWithFeatures(tree *ProcessTree, files []string) {
	for _, file := range files {
		if node.HasFeature(file) {
			node.trace("restarting for %q", file)
			node.RequestRestart()
			return
		}
	}
	for _, s := range node.Slaves {
		s.restartNodesWithFeatures(tree, files)
	}
}

// We implement sort.Interface - Len, Less, and Swap - on list of commands so
// we can use the sort package's generic Sort function.
type Commands []*CommandNode

func (c Commands) Len() int {
	return len(c)
}

func (c Commands) Swap(i, j int) {
	c[i], c[j] = c[j], c[i]
}

func (c Commands) Less(i, j int) bool {
	return c[i].Name < c[j].Name
}


text:
import i18next from 'i18next';
import { v4 as uuidV4 } from 'uuid';
import fixWebmDuration from 'webm-duration-fix';

import { IStore } from '../../../app/types';
import { getRoomName } from '../../../base/conference/functions';
import { MEDIA_TYPE } from '../../../base/media/constants';
import { getLocalTrack, getTrackState } from '../../../base/tracks/functions';
import { inIframe } from '../../../base/util/iframeUtils';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { stopLocalVideoRecording } from '../../actions.any';

interface ISelfRecording {
    on: boolean;
    withVideo: boolean;
}

interface ILocalRecordingManager {
    addAudioTrackToLocalRecording: (track: MediaStreamTrack) => void;
    audioContext: AudioContext | undefined;
    audioDestination: MediaStreamAudioDestinationNode | undefined;
    getFilename: () => string;
    initializeAudioMixer: () => void;
    isRecordingLocally: () => boolean;
    mediaType: string;
    mixAudioStream: (stream: MediaStream) => void;
    recorder: MediaRecorder | undefined;
    recordingData: Blob[];
    roomName: string;
    saveRecording: (recordingData: Blob[], filename: string) => void;
    selfRecording: ISelfRecording;
    startLocalRecording: (store: IStore, onlySelf: boolean) => void;
    stopLocalRecording: () => void;
    stream: MediaStream | undefined;
    totalSize: number;
}

const getMimeType = (): string => {
    const possibleTypes = [
        'video/mp4;codecs=h264',
        'video/webm;codecs=h264',
        'video/webm;codecs=vp9',
        'video/webm;codecs=vp8'
    ];

    for (const type of possibleTypes) {
        if (MediaRecorder.isTypeSupported(type)) {
            return type;
        }
    }
    throw new Error('No MIME Type supported by MediaRecorder');
};

const VIDEO_BIT_RATE = 2500000; // 2.5Mbps in bits

// Lazily initialize.
let preferredMediaType: string;

const LocalRecordingManager: ILocalRecordingManager = {
    recordingData: [],
    recorder: undefined,
    stream: undefined,
    audioContext: undefined,
    audioDestination: undefined,
    roomName: '',
    totalSize: 1073741824, // 1GB in bytes
    selfRecording: {
        on: false,
        withVideo: false
    },

    get mediaType() {
        if (!preferredMediaType) {
            preferredMediaType = getMimeType();
        }

        return preferredMediaType;
    },

    /**
     * Initializes audio context used for mixing audio tracks.
     *
     * @returns {void}
     */
    initializeAudioMixer() {
        this.audioContext = new AudioContext();
        this.audioDestination = this.audioContext.createMediaStreamDestination();
    },

    /**
     * Mixes multiple audio tracks to the destination media stream.
     *
     * @param {MediaStream} stream - The stream to mix.
     * @returns {void}
     * */
    mixAudioStream(stream) {
        if (stream.getAudioTracks().length > 0 && this.audioDestination) {
            this.audioContext?.createMediaStreamSource(stream).connect(this.audioDestination);
        }
    },

    /**
     * Adds audio track to the recording stream.
     *
     * @param {MediaStreamTrack} track - The track to be added.
     * @returns {void}
     */
    addAudioTrackToLocalRecording(track) {
        if (this.selfRecording.on) {
            return;
        }
        if (track) {
            const stream = new MediaStream([ track ]);

            this.mixAudioStream(stream);
        }
    },

    /**
     * Returns a filename based ono the Jitsi room name in the URL and timestamp.
     *
     * @returns {string}
     * */
    getFilename() {
        const now = new Date();
        const timestamp = now.toISOString();

        return `${this.roomName}_${timestamp}`;
    },

    /**
     * Saves local recording to file.
     *
     * @param {Array} recordingData - The recording data.
     * @param {string} filename - The name of the file.
     * @returns {void}
     * */
    async saveRecording(recordingData, filename) {
        // @ts-ignore
        const blob = await fixWebmDuration(new Blob(recordingData, { type: this.mediaType }));

        // @ts-ignore
        const url = window.URL.createObjectURL(blob);
        const a = document.createElement('a');

        const extension = this.mediaType.slice(this.mediaType.indexOf('/') + 1, this.mediaType.indexOf(';'));

        a.style.display = 'none';
        a.href = url;
        a.download = `${filename}.${extension}`;
        a.click();
    },

    /**
     * Stops local recording.
     *
     * @returns {void}
     * */
    stopLocalRecording() {
        if (this.recorder) {
            this.recorder.stop();
            this.recorder = undefined;
            this.audioContext = undefined;
            this.audioDestination = undefined;
            setTimeout(() => this.saveRecording(this.recordingData, this.getFilename()), 1000);
        }
    },

    /**
     * Starts a local recording.
     *
     * @param {IStore} store - The redux store.
     * @param {boolean} onlySelf - Whether to record only self streams.
     * @returns {void}
     */
    async startLocalRecording(store, onlySelf) {
        const { dispatch, getState } = store;

        // @ts-ignore
        const supportsCaptureHandle = Boolean(navigator.mediaDevices.setCaptureHandleConfig) && !inIframe();
        const tabId = uuidV4();

        this.selfRecording.on = onlySelf;
        this.recordingData = [];
        this.roomName = getRoomName(getState()) ?? '';
        let gdmStream: MediaStream = new MediaStream();
        const tracks = getTrackState(getState());

        if (onlySelf) {
            let audioTrack: MediaStreamTrack | undefined = getLocalTrack(tracks, MEDIA_TYPE.AUDIO)?.jitsiTrack?.track;
            let videoTrack: MediaStreamTrack | undefined = getLocalTrack(tracks, MEDIA_TYPE.VIDEO)?.jitsiTrack?.track;

            if (!audioTrack) {
                APP.conference.muteAudio(false);
                setTimeout(() => APP.conference.muteAudio(true), 100);
                await new Promise(resolve => {
                    setTimeout(resolve, 100);
                });
            }
            if (videoTrack && videoTrack.readyState !== 'live') {
                videoTrack = undefined;
            }
            audioTrack = getLocalTrack(getTrackState(getState()), MEDIA_TYPE.AUDIO)?.jitsiTrack?.track;
            if (!audioTrack && !videoTrack) {
                throw new Error('NoLocalStreams');
            }
            this.selfRecording.withVideo = Boolean(videoTrack);
            const localTracks = [];

            audioTrack && localTracks.push(audioTrack);
            videoTrack && localTracks.push(videoTrack);
            this.stream = new MediaStream(localTracks);
        } else {
            if (supportsCaptureHandle) {
                // @ts-ignore
                navigator.mediaDevices.setCaptureHandleConfig({
                    handle: `JitsiMeet-${tabId}`,
                    permittedOrigins: [ '*' ]
                });
            }
            const localAudioTrack = getLocalTrack(tracks, MEDIA_TYPE.AUDIO)?.jitsiTrack?.track;

            // Starting chrome 107, the recorder does not record any data if the audio stream has no tracks
            // To fix this we create a track for the local user(muted track)
            if (!localAudioTrack) {
                APP.conference.muteAudio(false);
                setTimeout(() => APP.conference.muteAudio(true), 100);
                await new Promise(resolve => {
                    setTimeout(resolve, 100);
                });
            }

            const currentTitle = document.title;

            document.title = i18next.t('localRecording.selectTabTitle');

            // @ts-ignore
            gdmStream = await navigator.mediaDevices.getDisplayMedia({
                // @ts-ignore
                video: { displaySurface: 'browser',
                    frameRate: 30 },
                audio: false,
                preferCurrentTab: true
            });
            document.title = currentTitle;

            // @ts-ignore
            const isBrowser = gdmStream.getVideoTracks()[0].getSettings().displaySurface === 'browser';

            if (!isBrowser || (supportsCaptureHandle // @ts-ignore
                && gdmStream.getVideoTracks()[0].getCaptureHandle()?.handle !== `JitsiMeet-${tabId}`)) {
                gdmStream.getTracks().forEach((track: MediaStreamTrack) => track.stop());
                throw new Error('WrongSurfaceSelected');
            }

            this.initializeAudioMixer();

            const allTracks = getTrackState(getState());

            allTracks.forEach((track: any) => {
                if (track.mediaType === MEDIA_TYPE.AUDIO) {
                    const audioTrack = track?.jitsiTrack?.track;

                    this.addAudioTrackToLocalRecording(audioTrack);
                }
            });
            this.stream = new MediaStream([
                ...this.audioDestination?.stream.getAudioTracks() || [],
                gdmStream.getVideoTracks()[0]
            ]);
        }

        this.recorder = new MediaRecorder(this.stream, {
            mimeType: this.mediaType,
            videoBitsPerSecond: VIDEO_BIT_RATE
        });
        this.recorder.addEventListener('dataavailable', e => {
            if (e.data && e.data.size > 0) {
                this.recordingData.push(e.data);
                this.totalSize -= e.data.size;
                if (this.totalSize <= 0) {
                    this.stopLocalRecording();
                }
            }
        });

        if (!onlySelf) {
            this.recorder.addEventListener('stop', () => {
                this.stream?.getTracks().forEach((track: MediaStreamTrack) => track.stop());
                gdmStream?.getTracks().forEach((track: MediaStreamTrack) => track.stop());
            });

            gdmStream?.addEventListener('inactive', () => {
                dispatch(stopLocalVideoRecording());
            });

            this.stream.addEventListener('inactive', () => {
                dispatch(stopLocalVideoRecording());
            });
        }

        this.recorder.start(5000);
    },

    /**
     * Whether or not we're currently recording locally.
     *
     * @returns {boolean}
     */
    isRecordingLocally() {
        return Boolean(this.recorder);
    }

};

export default LocalRecordingManager;


text:
const { getWebPreference } = process._linkedBinding('electron_renderer_web_frame');

const enableRemoteModule = getWebPreference(window, 'enableRemoteModule');

export const moduleList: ElectronInternal.ModuleEntry[] = [
  {
    name: 'contextBridge',
    loader: () => require('@electron/internal/renderer/api/context-bridge')
  },
  {
    name: 'crashReporter',
    loader: () => require('@electron/internal/renderer/api/crash-reporter')
  },
  {
    name: 'ipcRenderer',
    loader: () => require('@electron/internal/renderer/api/ipc-renderer')
  },
  {
    name: 'nativeImage',
    loader: () => require('@electron/internal/renderer/api/native-image')
  },
  {
    name: 'webFrame',
    loader: () => require('@electron/internal/renderer/api/web-frame')
  },
  // The internal modules, invisible unless you know their names.
  {
    name: 'deprecate',
    loader: () => require('@electron/internal/common/api/deprecate'),
    private: true
  }
];

if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
  moduleList.push({
    name: 'desktopCapturer',
    loader: () => require('@electron/internal/renderer/api/desktop-capturer')
  });
}

if (BUILDFLAG(ENABLE_REMOTE_MODULE) && enableRemoteModule) {
  moduleList.push({
    name: 'remote',
    loader: () => require('@electron/internal/renderer/api/remote')
  });
}


text:
from unittest import TestCase
from omnicanvas.graphics import BoxGraphic, Rectangle

class RectangleCreationTests(TestCase):

    def test_can_create_rectangle(self):
        rectangle = Rectangle(10, 30, 400, 500)
        self.assertIsInstance(rectangle, BoxGraphic)
        self.assertEqual(rectangle._x, 10)
        self.assertEqual(rectangle._y, 30)
        self.assertEqual(rectangle._width, 400)
        self.assertEqual(rectangle._height, 500)
        self.assertEqual(rectangle._fill_color, "#FFFFFF")
        self.assertEqual(rectangle._opacity, 1)
        self.assertEqual(rectangle._line_width, 1)
        self.assertEqual(rectangle._line_style, "-")
        self.assertEqual(rectangle._line_color, "#000000")
        self.assertEqual(rectangle._rotation, (0, 0, 0))
        self.assertEqual(rectangle._data, {})

    def test_rectangle_repr(self):
        rectangle = Rectangle(10, 30, 400, 500)
        self.assertEqual(str(rectangle), "<Rectangle 400×500 at (10,30)>")

class SvgTests(TestCase):

    def test_can_make_basic_svg(self):
        rectangle = Rectangle(10, 30, 400, 500)
        self.assertEqual(
         rectangle.to_svg(),
         '<rect x="10.0" y="30.0" width="400.0" height="500.0"'
         ' style="fill:#FFFFFF;stroke:#000000;" />'
        )

    def test_can_create_rotated_rectangle_svg(self):
        rectangle = Rectangle(10, 30, 400, 500, rotation=(200, 200, 45))
        self.assertEqual(
         rectangle.to_svg(),
         '<rect x="10.0" y="30.0" width="400.0" height="500.0"'
         ' style="fill:#FFFFFF;stroke:#000000;" transform="rotate(45.0 200.0 200.0)" />'
        )

    def test_data_in_rectangle_svg(self):
        rectangle = Rectangle(
         10, 30, 400, 500, data={"onclick":"func(true);", "a": "b"}
        )
        self.assertIn(
         'onclick="func(true);"',
         rectangle.to_svg()
        )
        self.assertIn(
         'a="b"',
         rectangle.to_svg()
        )


text:
require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'rack/mock'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rack-ssl-enforcer'

class Test::Unit::TestCase
end


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>org.apache.solr.search.grouping.distributed.command (Solr 4.10.1 API)</title>
<meta name="date" content="2014-09-24">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.apache.solr.search.grouping.distributed.command

Internal classes used to implement distributed result grouping

See: Description

Class Summary

Class
Description

Pair<A,B>

A simple data structure to hold a pair of typed objects.

QueryCommand

QueryCommand.Builder

QueryCommandResult

Encapsulates TopDocs and the number of matches.

SearchGroupsFieldCommand

Creates all the collectors needed for the first phase and how to handle the results.

SearchGroupsFieldCommand.Builder

TopGroupsFieldCommand

Defines all collectors for retrieving the second phase and how to handle the collector result.

TopGroupsFieldCommand.Builder

Package org.apache.solr.search.grouping.distributed.command Description

Internal classes used to implement distributed result grouping

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev Package

Next Package

Frames

No Frames

All Classes

          Copyright © 2000-2014 Apache Software Foundation.  All Rights Reserved.


text:
  void Dart_Test##name();                                                      \
  static const dart::TestCase kRegister##name(Dart_Test##name, #name,          \
                                              expectation);                    \
  void Dart_Test##name()

#define VM_UNIT_TEST_CASE(name) VM_UNIT_TEST_CASE_WITH_EXPECTATION(name, "Pass")

// The UNIT_TEST_CASE macro is used for tests that do not require any
// functionality provided by the VM. Tests declared using this macro will be run
// after the VM is cleaned up.
#define UNIT_TEST_CASE_WITH_EXPECTATION(name, expectation)                     \
  void Dart_Test##name();                                                      \
  static const dart::RawTestCase kRegister##name(Dart_Test##name, #name,       \
                                                 expectation);                 \
  void Dart_Test##name()

#define UNIT_TEST_CASE(name) UNIT_TEST_CASE_WITH_EXPECTATION(name, "Pass")

// The ISOLATE_UNIT_TEST_CASE macro is used for tests that need an isolate and
// zone in order to test its functionality. This macro is used for tests that
// are implemented using the VM code directly and do not use the Dart API
// for calling into the VM. The safepoint execution state of threads using
// this macro is transitioned from kThreadInNative to kThreadInVM.
#define ISOLATE_UNIT_TEST_CASE_WITH_EXPECTATION(name, expectation)             \
  static void Dart_TestHelper##name(Thread* thread);                           \
  VM_UNIT_TEST_CASE_WITH_EXPECTATION(name, expectation) {                      \
    TestIsolateScope __test_isolate__;                                         \
    Thread* __thread__ = Thread::Current();                                    \
    ASSERT(__thread__->isolate() == __test_isolate__.isolate());               \
    TransitionNativeToVM transition(__thread__);                               \
    StackZone __zone__(__thread__);                                            \
    HandleScope __hs__(__thread__);                                            \
    Dart_TestHelper##name(__thread__);                                         \
  }                                                                            \
  static void Dart_TestHelper##name(Thread* thread)

#define ISOLATE_UNIT_TEST_CASE(name)                                           \
  ISOLATE_UNIT_TEST_CASE_WITH_EXPECTATION(name, "Pass")

// The TEST_CASE macro is used for tests that need an isolate and zone
// in order to test its functionality. This macro is used for tests that
// are implemented using the Dart API for calling into the VM. The safepoint
// execution state of threads using this macro remains kThreadNative.
#define TEST_CASE_WITH_EXPECTATION(name, expectation)                          \
  static void Dart_TestHelper##name(Thread* thread);                           \
  VM_UNIT_TEST_CASE_WITH_EXPECTATION(name, expectation) {                      \
    TestIsolateScope __test_isolate__;                                         \
    Thread* __thread__ = Thread::Current();                                    \
    ASSERT(__thread__->isolate() == __test_isolate__.isolate());               \
    TransitionNativeToVM transition1(__thread__);                              \
    StackZone __zone__(__thread__);                                            \
    HandleScope __hs__(__thread__);                                            \
    TransitionVMToNative transition2(__thread__);                              \
    Dart_TestHelper##name(__thread__);                                         \
  }                                                                            \
  static void Dart_TestHelper##name(Thread* thread)

#define TEST_CASE(name) TEST_CASE_WITH_EXPECTATION(name, "Pass")

// The ASSEMBLER_TEST_GENERATE macro is used to generate a unit test
// for the assembler.
#define ASSEMBLER_TEST_GENERATE(name, assembler)                               \
  void AssemblerTestGenerate##name(compiler::Assembler* assembler)

// The ASSEMBLER_TEST_EXTERN macro is used to declare a unit test
// for the assembler.
#define ASSEMBLER_TEST_EXTERN(name)                                            \
  extern void AssemblerTestGenerate##name(compiler::Assembler* assembler);

// The ASSEMBLER_TEST_RUN macro is used to execute the assembler unit
// test generated using the ASSEMBLER_TEST_GENERATE macro.
// C++ callee-saved registers are not preserved. Arguments may be passed in.
#define ASSEMBLER_TEST_RUN_WITH_EXPECTATION(name, test, expectation)           \
  static void AssemblerTestRun##name(AssemblerTest* test);                     \
  ISOLATE_UNIT_TEST_CASE_WITH_EXPECTATION(name, expectation) {                 \
    volatile intptr_t far_branch_level = 0;                                    \
    while (true) {                                                             \
      LongJumpScope jump(thread);                                              \
      if (setjmp(*jump.Set()) == 0) {                                          \
        compiler::ObjectPoolBuilder object_pool_builder;                       \
        compiler::Assembler assembler(&object_pool_builder, far_branch_level); \
        AssemblerTest test("" #name, &assembler);                              \
        AssemblerTestGenerate##name(test.assembler());                         \
        test.Assemble();                                                       \
        AssemblerTestRun##name(&test);                                         \
        return;                                                                \
      } else {                                                                 \
        const Error& error = Error::Handle(thread->sticky_error());            \
        if (error.ptr() == Object::branch_offset_error().ptr()) {              \
          RELEASE_ASSERT(far_branch_level < 2);                                \
          far_branch_level++;                                                  \
        } else {                                                               \
          FATAL1("Unexpected error: %s\n", error.ToErrorCString());            \
        }                                                                      \
      }                                                                        \
    }                                                                          \
  }                                                                            \
  static void AssemblerTestRun##name(AssemblerTest* test)

#define ASSEMBLER_TEST_RUN(name, test)                                         \
  ASSEMBLER_TEST_RUN_WITH_EXPECTATION(name, test, "Pass")

#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64) ||                  \
    defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
#if defined(HOST_ARCH_ARM) || defined(HOST_ARCH_ARM64) ||                      \
    defined(HOST_ARCH_RISCV32) || defined(HOST_ARCH_RISCV64)
// Running on actual ARM hardware, execute code natively.
#define EXECUTE_TEST_CODE_INT32(name, entry) reinterpret_cast<name>(entry)()
#define EXECUTE_TEST_CODE_INT64(name, entry) reinterpret_cast<name>(entry)()
#define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1)          \
  reinterpret_cast<name>(entry)(long_arg0, long_arg1)
#define EXECUTE_TEST_CODE_FLOAT(name, entry) reinterpret_cast<name>(entry)()
#define EXECUTE_TEST_CODE_DOUBLE(name, entry) reinterpret_cast<name>(entry)()
#define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg)                      \
  reinterpret_cast<name>(entry)(float_arg)
#define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg)                     \
  reinterpret_cast<name>(entry)(double_arg)
#define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg)              \
  reinterpret_cast<name>(entry)(pointer_arg)
#define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg)               \
  reinterpret_cast<name>(entry)(pointer_arg)
#else
// Not running on ARM hardware, call simulator to execute code.
#if defined(ARCH_IS_64_BIT)
#define EXECUTE_TEST_CODE_INT64(name, entry)                                   \
  static_cast<int64_t>(                                                        \
      Simulator::Current()->Call(bit_cast<int64_t, uword>(entry), 0, 0, 0, 0))
#define EXECUTE_TEST_CODE_DOUBLE(name, entry)                                  \
  bit_cast<double, int64_t>(Simulator::Current()->Call(                        \
      bit_cast<int64_t, uword>(entry), 0, 0, 0, 0, true))
#define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg)              \
  static_cast<intptr_t>(Simulator::Current()->Call(                            \
      bit_cast<int64_t, uword>(entry),                                         \
      bit_cast<int64_t, intptr_t>(pointer_arg), 0, 0, 0))
#define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg)               \
  static_cast<int32_t>(Simulator::Current()->Call(                             \
      bit_cast<int64_t, uword>(entry),                                         \
      bit_cast<int64_t, intptr_t>(pointer_arg), 0, 0, 0))
#else
#define EXECUTE_TEST_CODE_INT32(name, entry)                                   \
  static_cast<int32_t>(                                                        \
      Simulator::Current()->Call(bit_cast<int32_t, uword>(entry), 0, 0, 0, 0))
#define EXECUTE_TEST_CODE_DOUBLE(name, entry)                                  \
  bit_cast<double, int64_t>(Simulator::Current()->Call(                        \
      bit_cast<int32_t, uword>(entry), 0, 0, 0, 0, true))
#define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg)              \
  static_cast<intptr_t>(Simulator::Current()->Call(                            \
      bit_cast<int32_t, uword>(entry),                                         \
      bit_cast<int32_t, intptr_t>(pointer_arg), 0, 0, 0))
#define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg)               \
  static_cast<int32_t>(Simulator::Current()->Call(                             \
      bit_cast<int32_t, uword>(entry),                                         \
      bit_cast<int32_t, intptr_t>(pointer_arg), 0, 0, 0))
#endif  // defined(ARCH_IS_64_BIT)
#define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1)          \
  static_cast<int64_t>(Simulator::Current()->Call(                             \
      bit_cast<int32_t, uword>(entry), Utils::Low32Bits(long_arg0),            \
      Utils::High32Bits(long_arg0), Utils::Low32Bits(long_arg1),               \
      Utils::High32Bits(long_arg1)))
#define EXECUTE_TEST_CODE_FLOAT(name, entry)                                   \
  bit_cast<float, int32_t>(Simulator::Current()->Call(                         \
      bit_cast<int32_t, uword>(entry), 0, 0, 0, 0, true))
#define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg)                      \
  static_cast<int32_t>(Simulator::Current()->Call(                             \
      bit_cast<int32_t, uword>(entry), bit_cast<int32_t, float>(float_arg), 0, \
      0, 0, false, true))
#define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg)                     \
  static_cast<int32_t>(Simulator::Current()->Call(                             \
      bit_cast<int32_t, uword>(entry),                                         \
      Utils::Low32Bits(bit_cast<int64_t, double>(double_arg)),                 \
      Utils::High32Bits(bit_cast<int64_t, double>(double_arg)), 0, 0, false,   \
      true))
#endif  // defined(HOST_ARCH_ARM)
#endif  // defined(TARGET_ARCH_{ARM, ARM64})

#define ZONE_STR(FMT, ...)                                                     \
  OS::SCreate(Thread::Current()->zone(), FMT, __VA_ARGS__)

inline Dart_Handle NewString(const char* str) {
  return Dart_NewStringFromCString(str);
}

namespace dart {

// Forward declarations.
namespace compiler {
class Assembler;
}
class CodeGenerator;
class VirtualMemory;

namespace bin {
// Snapshot pieces if we link in a snapshot, otherwise initialized to NULL.
extern const uint8_t* vm_snapshot_data;
extern const uint8_t* vm_snapshot_instructions;
extern const uint8_t* core_isolate_snapshot_data;
extern const uint8_t* core_isolate_snapshot_instructions;
}  // namespace bin

extern const uint8_t* platform_strong_dill;
extern const intptr_t platform_strong_dill_size;

class TesterState : public AllStatic {
 public:
  static const uint8_t* vm_snapshot_data;
  static Dart_IsolateGroupCreateCallback create_callback;
  static Dart_IsolateShutdownCallback shutdown_callback;
  static Dart_IsolateGroupCleanupCallback group_cleanup_callback;
  static const char** argv;
  static int argc;
};

class KernelBufferList {
 public:
  explicit KernelBufferList(const uint8_t* kernel_buffer)
      : kernel_buffer_(kernel_buffer), next_(NULL) {}

  KernelBufferList(const uint8_t* kernel_buffer, KernelBufferList* next)
      : kernel_buffer_(kernel_buffer), next_(next) {}

  ~KernelBufferList() {
    free(const_cast<uint8_t*>(kernel_buffer_));
    if (next_ != NULL) {
      delete next_;
    }
  }

  void AddBufferToList(const uint8_t* kernel_buffer);

 private:
  const uint8_t* kernel_buffer_;
  KernelBufferList* next_;
};

class TestCaseBase {
 public:
  explicit TestCaseBase(const char* name, const char* expectation);
  virtual ~TestCaseBase() {}

  const char* name() const { return name_; }
  const char* expectation() const { return expectation_; }

  virtual void Run() = 0;
  void RunTest();

  static void RunAll();
  static void RunAllRaw();
  static void CleanupState();
  static void AddToKernelBuffers(const uint8_t* kernel_buffer);

 protected:
  static KernelBufferList* current_kernel_buffers_;
  bool raw_test_;

 private:
  static TestCaseBase* first_;
  static TestCaseBase* tail_;

  TestCaseBase* next_;
  const char* name_;
  const char* expectation_;

  DISALLOW_COPY_AND_ASSIGN(TestCaseBase);
};

#define USER_TEST_URI "test-lib"
#define RESOLVED_USER_TEST_URI "file:///test-lib"
#define CORELIB_TEST_URI "dart:test-lib"

class TestCase : TestCaseBase {
 public:
  typedef void(RunEntry)();

  TestCase(RunEntry* run, const char* name, const char* expectation)
      : TestCaseBase(name, expectation), run_(run) {}

  static char* CompileTestScriptWithDFE(const char* url,
                                        const char* source,
                                        const uint8_t** kernel_buffer,
                                        intptr_t* kernel_buffer_size,
                                        bool incrementally = true,
                                        bool allow_compile_errors = false,
                                        const char* multiroot_filepaths = NULL,
                                        const char* multiroot_scheme = NULL);
  static char* CompileTestScriptWithDFE(const char* url,
                                        int sourcefiles_count,
                                        Dart_SourceFile sourcefiles[],
                                        const uint8_t** kernel_buffer,
                                        intptr_t* kernel_buffer_size,
                                        bool incrementally = true,
                                        bool allow_compile_errors = false,
                                        const char* multiroot_filepaths = NULL,
                                        const char* multiroot_scheme = NULL);
  static Dart_Handle LoadTestScript(
      const char* script,
      Dart_NativeEntryResolver resolver,
      const char* lib_uri = RESOLVED_USER_TEST_URI,
      bool finalize = true,
      bool allow_compile_errors = false);
  static Dart_Handle LoadTestScriptWithErrors(
      const char* script,
      Dart_NativeEntryResolver resolver = NULL,
      const char* lib_uri = RESOLVED_USER_TEST_URI,
      bool finalize = true);
  static Dart_Handle LoadTestLibrary(const char* lib_uri,
                                     const char* script,
                                     Dart_NativeEntryResolver resolver = NULL);
  static Dart_Handle LoadTestScriptWithDFE(
      int sourcefiles_count,
      Dart_SourceFile sourcefiles[],
      Dart_NativeEntryResolver resolver = NULL,
      bool finalize = true,
      bool incrementally = true,
      bool allow_compile_errors = false,
      const char* entry_script_uri = NULL,
      const char* multiroot_filepaths = NULL,
      const char* multiroot_scheme = NULL);
  static Dart_Handle LoadCoreTestScript(const char* script,
                                        Dart_NativeEntryResolver resolver);

  static Dart_Handle EvaluateExpression(const Library& lib,
                                        const String& expr,
                                        const Array& param_names,
                                        const Array& param_values);

  static Dart_Handle lib();
  static const char* url();
  static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer,
                                                    const char* name = NULL) {
    return CreateIsolate(buffer, 0, NULL, name);
  }
  static Dart_Isolate CreateTestIsolate(const char* name = nullptr,
                                        void* isolate_group_data = nullptr,
                                        void* isolate_data = nullptr);
  static Dart_Isolate CreateTestIsolateInGroup(const char* name,
                                               Dart_Isolate parent,
                                               void* group_data = nullptr,
                                               void* isolate_data = nullptr);

  static Dart_Handle library_handler(Dart_LibraryTag tag,
                                     Dart_Handle library,
                                     Dart_Handle url);

  virtual void Run();

  // Sets |script| to be the source used at next reload.
  static Dart_Handle SetReloadTestScript(const char* script);

  // Initiates the reload.
  static Dart_Handle TriggerReload(const uint8_t* kernel_buffer,
                                   intptr_t kernel_buffer_size);
  static Dart_Handle TriggerReload(const char* root_script_url);

  // Helper function which reloads the current isolate using |script|.
  static Dart_Handle ReloadTestScript(const char* script);

  // Helper function which reloads the current isolate using |script|.
  static Dart_Handle ReloadTestKernel(const uint8_t* kernel_buffer,
                                      intptr_t kernel_buffer_size);

  static void AddTestLib(const char* url, const char* source);
  static const char* GetTestLib(const char* url);

  // Return true if non-nullable experiment is enabled.
  static bool IsNNBD();

  static const char* NullableTag() { return IsNNBD() ? "?" : ""; }
  static const char* NullAssertTag() { return IsNNBD() ? "!" : ""; }
  static const char* LateTag() { return IsNNBD() ? "late" : ""; }

 private:
  static Dart_Handle TriggerReload(
      std::function<bool(IsolateGroup*, JSONStream*)> do_reload);

  // |data_buffer| can either be snapshot data, or kernel binary data.
  // If |data_buffer| is snapshot data, then |len| should be zero as snapshot
  // size is encoded within them. If |len| is non-zero, then |data_buffer|
  // will be treated as a kernel binary (but CreateIsolate will not
  // take ownership of the buffer) and |instr_buffer| will be ignored.
  static Dart_Isolate CreateIsolate(const uint8_t* data_buffer,
                                    intptr_t len,
                                    const uint8_t* instr_buffer,
                                    const char* name,
                                    void* group_data = nullptr,
                                    void* isolate_data = nullptr);

  static char* ValidateCompilationResult(Zone* zone,
                                         Dart_KernelCompilationResult result,
                                         const uint8_t** kernel_buffer,
                                         intptr_t* kernel_buffer_size,
                                         bool allow_compile_errors);

  RunEntry* const run_;
};

class RawTestCase : TestCaseBase {
 public:
  typedef void(RunEntry)();

  RawTestCase(RunEntry* run, const char* name, const char* expectation)
      : TestCaseBase(name, expectation), run_(run) {
    raw_test_ = true;
  }
  virtual void Run();

 private:
  RunEntry* const run_;
};

class TestIsolateScope {
 public:
  TestIsolateScope() {
    isolate_ = reinterpret_cast<Isolate*>(TestCase::CreateTestIsolate());
    Dart_EnterScope();  // Create a Dart API scope for unit tests.
  }
  ~TestIsolateScope() {
    Dart_ExitScope();  // Exit the Dart API scope created for unit tests.
    ASSERT(isolate_ == Isolate::Current());
    Dart_ShutdownIsolate();
    isolate_ = NULL;
  }
  Isolate* isolate() const { return isolate_; }

 private:
  Isolate* isolate_;

  DISALLOW_COPY_AND_ASSIGN(TestIsolateScope);
};

// Ensures core libraries are initialized, thereby allowing vm/cc tests to
// e.g. run functions using microtasks.
void SetupCoreLibrariesForUnitTest();

template <typename T>
struct is_void {
  static const bool value = false;
};

template <>
struct is_void<void> {
  static const bool value = true;
};

template <typename T>
struct is_double {
  static const bool value = false;
};

template <>
struct is_double<double> {
  static const bool value = true;
};

class AssemblerTest {
 public:
  AssemblerTest(const char* name, compiler::Assembler* assembler)
      : name_(name),
        assembler_(assembler),
        code_(Code::ZoneHandle()),
        disassembly_(Thread::Current()->zone()->Alloc<char>(DISASSEMBLY_SIZE)) {
    ASSERT(name != NULL);
    ASSERT(assembler != NULL);
  }
  ~AssemblerTest() {}

  compiler::Assembler* assembler() const { return assembler_; }

  const Code& code() const { return code_; }

  uword payload_start() const { return code_.PayloadStart(); }
  uword payload_size() const { return assembler_->CodeSize(); }
  uword entry() const { return code_.EntryPoint(); }

// Invoke/InvokeWithCodeAndThread is used to call assembler test functions
// using the ABI calling convention.
// ResultType is the return type of the assembler test function.
// ArgNType is the type of the Nth argument.
#if defined(USING_SIMULATOR)

#if defined(ARCH_IS_64_BIT)
  // TODO(fschneider): Make InvokeWithCodeAndThread<> more general and work on
  // 32-bit.
  // Since Simulator::Call always return a int64_t, bit_cast does not work
  // on 32-bit platforms when returning an int32_t. Since template functions
  // don't support partial specialization, we'd need to introduce a helper
  // class to support 32-bit return types.
  template <typename ResultType>
  ResultType InvokeWithCodeAndThread() {
    const bool fp_return = is_double<ResultType>::value;
    const bool fp_args = false;
    Thread* thread = Thread::Current();
    ASSERT(thread != NULL);
    return bit_cast<ResultType, int64_t>(Simulator::Current()->Call(
        bit_cast<intptr_t, uword>(entry()), reinterpret_cast<intptr_t>(&code_),
        reinterpret_cast<intptr_t>(thread), 0, 0, fp_return, fp_args));
  }
  template <typename ResultType, typename Arg1Type>
  ResultType InvokeWithCodeAndThread(Arg1Type arg1) {
    const bool fp_return = is_double<ResultType>::value;
    const bool fp_args = is_double<Arg1Type>::value;
    // TODO(fschneider): Support double arguments for simulator calls.
    COMPILE_ASSERT(!fp_args);
    Thread* thread = Thread::Current();
    ASSERT(thread != NULL);
    return bit_cast<ResultType, int64_t>(Simulator::Current()->Call(
        bit_cast<intptr_t, uword>(entry()), reinterpret_cast<intptr_t>(&code_),
        reinterpret_cast<intptr_t>(thread), reinterpret_cast<intptr_t>(arg1), 0,
        fp_return, fp_args));
  }
#endif  // ARCH_IS_64_BIT

  template <typename ResultType, typename Arg1Type>
  ResultType Invoke(Arg1Type arg1) {
    COMPILE_ASSERT(!is_double<Arg1Type>::value);
    const bool fp_args = false;
    const bool fp_return = false;
    return Simulator::Current()->Call(bit_cast<intptr_t, uword>(entry()),
                                      static_cast<intptr_t>(arg1), 0, 0, 0,
                                      fp_return, fp_args);
  }

  template <typename ResultType,
            typename Arg1Type,
            typename Arg2Type,
            typename Arg3Type>
  ResultType Invoke(Arg1Type arg1, Arg2Type arg2, Arg3Type arg3) {
    // TODO(fschneider): Support double arguments for simulator calls.
    COMPILE_ASSERT(is_void<ResultType>::value);
    COMPILE_ASSERT(!is_double<Arg1Type>::value);
    COMPILE_ASSERT(!is_double<Arg2Type>::value);
    COMPILE_ASSERT(!is_double<Arg3Type>::value);
    const bool fp_args = false;
    const bool fp_return = false;
    Simulator::Current()->Call(
        bit_cast<intptr_t, uword>(entry()), static_cast<intptr_t>(arg1),
        static_cast<intptr_t>(arg2), reinterpret_cast<intptr_t>(arg3), 0,
        fp_return, fp_args);
  }
#else
  template <typename ResultType>
  ResultType InvokeWithCodeAndThread() {
    Thread* thread = Thread::Current();
    ASSERT(thread != NULL);
    typedef ResultType (*FunctionType)(const Code&, Thread*);
    return reinterpret_cast<FunctionType>(entry())(code_, thread);
  }

  template <typename ResultType, typename Arg1Type>
  ResultType InvokeWithCodeAndThread(Arg1Type arg1) {
    Thread* thread = Thread::Current();
    ASSERT(thread != NULL);
    typedef ResultType (*FunctionType)(const Code&, Thread*, Arg1Type);
    return reinterpret_cast<FunctionType>(entry())(code_, thread, arg1);
  }

  template <typename ResultType, typename Arg1Type>
  ResultType Invoke(Arg1Type arg1) {
    typedef ResultType (*FunctionType)(Arg1Type);
    return reinterpret_cast<FunctionType>(entry())(arg1);
  }

  template <typename ResultType,
            typename Arg1Type,
            typename Arg2Type,
            typename Arg3Type>
  ResultType Invoke(Arg1Type arg1, Arg2Type arg2, Arg3Type arg3) {
    typedef ResultType (*FunctionType)(Arg1Type, Arg2Type, Arg3Type);
    return reinterpret_cast<FunctionType>(entry())(arg1, arg2, arg3);
  }
#endif  // defined(USING_SIMULATOR)

  // Assemble test and set code_.
  void Assemble();

  // Disassembly of the code with relative branch/jump targets.
  char* RelativeDisassembly() { return disassembly_; }

 private:
  const char* name_;
  compiler::Assembler* assembler_;
  Code& code_;
  static const intptr_t DISASSEMBLY_SIZE = 10240;
  char* disassembly_;

  DISALLOW_COPY_AND_ASSIGN(AssemblerTest);
};

class CompilerTest : public AllStatic {
 public:
  // Test the Compiler::CompileFunction functionality by checking the return
  // value to see if no parse errors were reported.
  static bool TestCompileFunction(const Function& function);
};

#define EXPECT_VALID(handle)                                                   \
  do {                                                                         \
    Dart_Handle tmp_handle = (handle);                                         \
    if (!Api::IsValid(tmp_handle)) {                                           \
      dart::Expect(__FILE__, __LINE__)                                         \
          .Fail(                                                               \
              "expected '%s' to be a valid handle but '%s' has already been "  \
              "freed\n",                                                       \
              #handle, #handle);                                               \
    }                                                                          \
    if (Dart_IsError(tmp_handle)) {                                            \
      dart::Expect(__FILE__, __LINE__)                                         \
          .Fail(                                                               \
              "expected '%s' to be a valid handle but found an error "         \
              "handle:\n"                                                      \
              "    '%s'\n",                                                    \
              #handle, Dart_GetError(tmp_handle));                             \
    }                                                                          \
  } while (0)

#define EXPECT_ERROR(handle, substring)                                        \
  do {                                                                         \
    Dart_Handle tmp_handle = (handle);                                         \
    if (Dart_IsError(tmp_handle)) {                                            \
      dart::Expect(__FILE__, __LINE__)                                         \
          .IsSubstring((substring), Dart_GetError(tmp_handle));                \
    } else {                                                                   \
      dart::Expect(__FILE__, __LINE__)                                         \
          .Fail(                                                               \
              "expected '%s' to be an error handle but found a valid "         \
              "handle.\n",                                                     \
              #handle);                                                        \
    }                                                                          \
  } while (0)

#define EXPECT_TRUE(handle)                                                    \
  do {                                                                         \
    Dart_Handle tmp_handle = (handle);                                         \
    if (Dart_IsBoolean(tmp_handle)) {                                          \
      bool value;                                                              \
      Dart_BooleanValue(tmp_handle, &value);                                   \
      if (!value) {                                                            \
        dart::Expect(__FILE__, __LINE__)                                       \
            .Fail("expected True, but was '%s'\n", #handle);                   \
      }                                                                        \
    } else {                                                                   \
      dart::Expect(__FILE__, __LINE__)                                         \
          .Fail("expected True, but was '%s'\n", #handle);                     \
    }                                                                          \
  } while (0)

#define EXPECT_NULL(handle)                                                    \
  do {                                                                         \
    Dart_Handle tmp_handle = (handle);                                         \
    if (!Dart_IsNull(tmp_handle)) {                                            \
      dart::Expect(__FILE__, __LINE__)                                         \
          .Fail("expected '%s' to be a null handle.\n", #handle);              \
    }                                                                          \
  } while (0)

#define EXPECT_NON_NULL(handle)                                                \
  do {                                                                         \
    Dart_Handle tmp_handle = (handle);                                         \
    if (Dart_IsNull(tmp_handle)) {                                             \
      dart::Expect(__FILE__, __LINE__)                                         \
          .Fail("expected '%s' to be a non-null handle.\n", #handle);          \
    }                                                                          \
  } while (0)

// Elide a substring which starts with some prefix and ends with some postfix.
//
// Prefix is inclusive, postfix is exclusive.
//
// This is used to remove non-deterministic or fragile substrings from
// JSON output.
//
// For example:
//
//    prefix = "classes"
//    in = "\"id\":\"classes/46\""
//
// Yields:
//
//    out = "\"id\":\"\""
//
// WARNING: This function is not safe to use if `in` is bigger than `out`!
void ElideJSONSubstring(const char* prefix,
                        const char* in,
                        char* out,
                        const char* postfix = "\"");

// Elide a substrings such as ",\"tokenPos\":4372,\"endTokenPos\":4430".
//
// Substring to be followed by "}".
//
// Modifies buffer in place.
void StripTokenPositions(char* buffer);

template <typename T>
class SetFlagScope : public ValueObject {
 public:
  SetFlagScope(T* flag, T value) : flag_(flag), original_value_(*flag) {
    *flag_ = value;
  }

  ~SetFlagScope() { *flag_ = original_value_; }

 private:
  T* flag_;
  T original_value_;
};

}  // namespace dart

#endif  // RUNTIME_VM_UNIT_TEST_H_


text:
<?php

class Telegram {
    public static function sendMessage() {

    }
}


text:
webapi-googlecharts-localization
================================


text:
<plugin id="fi.avaus.cordova.bouncy-scroll-blocker"
        version="0.0.1"
        xmlns="http://apache.org/cordova/ns/plugins/1.0"
        xmlns:android="http://schemas.android.com/apk/res/android">
    <name>BouncyScrollBlocker</name>
    <description>This is a Cordova plugin that disables the bouncy scroll effect on Windows Phone.</description>
    <repo>https://github.com/durkiewicz/cordova-plugin-bouncy-scroll-blocker.git</repo>

    <keywords>windows phone, wp8, bouncy scroll</keywords>
    <license>Apache 2.0</license>

    <author>Avaus Consulting</author>

    <engines>
        <engine name="cordova" version=">=3.0.0" />
    </engines>

    <js-module src="www/bouncy-scroll-blocker.js" name="BouncyScrollBlocker">
        <clobbers target="bouncyScrollBlocker" />
    </js-module>

    <platform name="wp8">
        <config-file target="config.xml" parent="/*">
            <feature name="BouncyScrollBlocker">
                <param name="wp-package" value="BouncyScrollBlocker" onload="true"/>
            </feature>
        </config-file>

        <source-file src="src/wp/BouncyScrollBlocker.cs" />
    </platform>
</plugin>


text:
#pragma once

#include <cc7/ByteArray.h>
#include <cc7/jni/JniHelperMacros.h>
#include <jni.h>

namespace cc7
{
namespace jni
{
	/**
	 Function creates a new instance of jstring object with characters copied
	 from given string object. The UTF8 encoding is expected on the input.
	 */
	jstring CopyToJavaString(JNIEnv * env, const std::string & str);

	/**
	 Function creates a new instance of jstring object with characters copied
	 from given char pointer. The UTF8 encoding is expected on the input.
	 If the provided char pointer is NULL, then the empty, but valid java string
	 object is returned.
	 */
	jstring CopyToJavaString(JNIEnv * env, const char * str);

	/**
	 Function creates a new instance of jstring object with characters copied
	 from given string object. The UTF8 encoding is expected on the input.
	 If the provided string has zero length then returns NULL.
	 */
	jstring CopyToNullableJavaString(JNIEnv * env, const std::string & str);

	/**
	 Function creates a new instance of jstring object with characters copied
	 from given char pointer. The UTF8 encoding is expected on the input.
	 If the provided char pointer is NULL or if string has zero length,
	 then returns NULL.
	 */
	jstring CopyToNullableJavaString(JNIEnv * env, const char * str);

	/**
	 Function creates a new instance of std::string with characters copied
	 from given java string. The UTF8 encoding is used for the conversion.
	 */
	std::string CopyFromJavaString(JNIEnv * env, jstring string);

	/**
	 Function creates a new instance of cc7::ByteArray, initialized with characters
	 from given java string. The UTF8 encoding is used for the conversion.
	 The function is very similar to 'CopyFromJavaString' but the destination C++
	 object is byte array instead of std::string. It's recommended to use this function
	 for conversion from strings which contains sensitive information, like passphrases.
	 */
	cc7::ByteArray CopyFromJavaStringToByteArray(JNIEnv * env, jstring string);

	/**
	 Function creates a new instance of java byte array object with bytes copied from
	 given range of bytes.
	 */
	jbyteArray CopyToJavaByteArray(JNIEnv * env, const cc7::ByteRange & range);

	/**
	 Function creates a new instance of java byte array object with bytes copied from
	 given range of bytes. If the provided range has zero length, then returns NULL.
	 */
	jbyteArray CopyToNullableJavaByteArray(JNIEnv * env, const cc7::ByteRange & range);

	/**
	 Function creates a new instance of cc7::ByteArray object with bytes copied
	 from given java byte array object.
	 */
	cc7::ByteArray CopyFromJavaByteArray(JNIEnv * env, jbyteArray array);

	/**
	 Function creates a new instance of arbitrary java object.
	 */
	jobject CreateJavaObject(JNIEnv * env, const char * clazz, const char * ctr_signature, ...);

} // cc7::jni
} // cc7


text:
package httpimg_test

import (
	"github.com/jung-kurt/gofpdf"
	"github.com/jung-kurt/gofpdf/contrib/httpimg"
	"github.com/jung-kurt/gofpdf/internal/example"
)

func ExampleRegister() {
	pdf := gofpdf.New("L", "mm", "A4", "")
	pdf.SetFont("Helvetica", "", 12)
	pdf.SetFillColor(200, 200, 220)
	pdf.AddPage()

	url := "https://github.com/jung-kurt/gofpdf/raw/master/image/logo_gofpdf.jpg?raw=true"
	httpimg.Register(pdf, url, "")
	pdf.Image(url, 15, 15, 267, 0, false, "", 0, "")
	fileStr := example.Filename("contrib_httpimg_Register")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated ../../pdf/contrib_httpimg_Register.pdf
}


text:
@interface HPMyThreadViewController : HPBaseTableViewController

@property(nonatomic, strong)NSArray *myThreads;

@end


text:
<?php

namespace ThisPageCannotBeFound\Signals;

/**
 * A Slot is a signal listener configuration object.
 *
 * @author Abel de Beer <abel@thispagecannotbefound.com>
 */
interface SlotInterface {

    /**
     * Executes the listener, passing the arguments.
     *
     * @param array $args Values to pass to the listener
     *
     * @return mixed Return value of executed listener
     */
    public function execute(array $args);

    /**
     * Returns the valid callable.
     *
     * @return callable
     */
    public function getListener();

    /**
     * Returns whether this listener should be removed after it has been executed.
     *
     * @return boolean
     */
    public function getOnce();
}


text:
package com.cezarykluczynski.stapi.model.comic_series.repository;

import com.cezarykluczynski.stapi.model.comic_series.entity.ComicSeries;
import com.cezarykluczynski.stapi.model.common.repository.PageAwareRepository;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ComicSeriesRepository extends JpaRepository<ComicSeries, Long>, PageAwareRepository<ComicSeries>, ComicSeriesRepositoryCustom {
}


text:
<?php
namespace Blogg\User;

use Silex\Application;
use Symfony\Component\HttpFoundation\Request;

class Controller
{
  private $app;

  public function __construct(Application $app)
  {
    $this->app = $app;
  }

  public function signUp(Request $request)
  {
    $errors = $this->validation($request);

    if ($errors) {
        return $this->app['twig']->render('register.html.twig', array(
          'firstName' => $request->get('firstName'),
          'lastName' => $request->get('lastName'),
          'username' => $request->get('username'),
          'emailAddress' => $request->get('emailAddress'),
          'errors' => $errors
        ));
    }

    $this->app['user.factory']->create($request);

    $this->app['orm.em']->flush();
    return $this->app->redirect($this->app['url_generator']->generate('login'));
  }

  public function validation(Request $request)
  {
    $errors = [];

    if ($this->app['user.repository']->findByUsername(mb_strtolower($request->get('username'), 'UTF-8'))) {
      $errors[] = 'Username already in use.';
    }
    if ($this->app['user.repository']->findByEmailAddress(mb_strtolower($request->get('emailAddress'), 'UTF-8'))) {
      $errors[] = 'Email address already in use';
    }
    if (!empty($request->get('password')) && ($request->get('password') == $request->get('password2'))) {
      if (strlen($request->get('password')) < 8) {
        $errors[] = 'Your Password Must Contain At Least 8 Characters!';
      }
      elseif(!preg_match("#[0-9]+#", $request->get('password'))) {
        $errors[] = 'Your Password Must Contain At Least 1 Number!';
      }
      elseif(!preg_match("#[A-Z]+#", $request->get('password'))) {
        $errors[] = 'Your Password Must Contain At Least 1 Capital Letter!';
      }
      elseif(!preg_match("#[a-z]+#", $request->get('password'))) {
        $errors[] = 'Your Password Must Contain At Least 1 Lowercase Letter!';
      }
    } elseif($request->get('password') !== $request->get('password2')) {
      $errors[] = 'Password does not match with the repeated password.';
    }

    if (empty($errors)) {
      return false;
    }

    return $errors;
  }

  public function update(Request $request)
  {
    $this->app['user.factory']->updateGeneralData($this->app['user'], $request);

    $this->app['orm.em']->flush();

    return $this->app->redirect($this->app['url_generator']->generate('profile'));
  }
}