text
stringlengths 2
1.04M
| meta
dict |
---|---|
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.view;
public final class R {
public static final class anim {
public static final int abc_fade_in=0x7f040000;
public static final int abc_fade_out=0x7f040001;
public static final int abc_slide_in_bottom=0x7f040002;
public static final int abc_slide_in_top=0x7f040003;
public static final int abc_slide_out_bottom=0x7f040004;
public static final int abc_slide_out_top=0x7f040005;
}
public static final class attr {
/** Custom divider drawable to use for elements in the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarDivider=0x7f010015;
/** Custom item state list drawable background for action bar items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarItemBackground=0x7f010016;
/** Reference to a theme that should be used to inflate popups
shown by widgets in the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarPopupTheme=0x7f01000f;
/** Size of the Action Bar, including the contextual
bar used to present Action Modes.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>May be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>wrap_content</code></td><td>0</td><td></td></tr>
</table>
*/
public static final int actionBarSize=0x7f010014;
/** Reference to a style for the split Action Bar. This style
controls the split component that holds the menu/action
buttons. actionBarStyle is still used for the primary
bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarSplitStyle=0x7f010011;
/** Reference to a style for the Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarStyle=0x7f010010;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarTabBarStyle=0x7f01000b;
/** Default style for tabs within an action bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarTabStyle=0x7f01000a;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarTabTextStyle=0x7f01000c;
/** Reference to a theme that should be used to inflate the
action bar. This will be inherited by any widget inflated
into the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarTheme=0x7f010012;
/** Reference to a theme that should be used to inflate widgets
and layouts destined for the action bar. Most of the time
this will be a reference to the current theme, but when
the action bar has a significantly different contrast
profile than the rest of the activity the difference
can become important. If this is set to @null the current
theme will be used.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarWidgetTheme=0x7f010013;
/** Default action button style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionButtonStyle=0x7f01002d;
/** Default ActionBar dropdown style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionDropDownStyle=0x7f010028;
/** An optional layout to be used as an action view.
See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionLayout=0x7f010072;
/** TextAppearance style that will be applied to text that
appears within action menu items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionMenuTextAppearance=0x7f010017;
/** Color for text that appears within action menu items.
Color for text that appears within action menu items.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int actionMenuTextColor=0x7f010018;
/** Background drawable to use for action mode UI
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeBackground=0x7f01001b;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCloseButtonStyle=0x7f01001a;
/** Drawable to use for the close action mode button
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCloseDrawable=0x7f01001d;
/** Drawable to use for the Copy action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCopyDrawable=0x7f01001f;
/** Drawable to use for the Cut action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCutDrawable=0x7f01001e;
/** Drawable to use for the Find action button in WebView selection action modes
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeFindDrawable=0x7f010023;
/** Drawable to use for the Paste action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModePasteDrawable=0x7f010020;
/** PopupWindow style to use for action modes when showing as a window overlay.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModePopupWindowStyle=0x7f010025;
/** Drawable to use for the Select all action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeSelectAllDrawable=0x7f010021;
/** Drawable to use for the Share action button in WebView selection action modes
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeShareDrawable=0x7f010022;
/** Background drawable to use for action mode UI in the lower split bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeSplitBackground=0x7f01001c;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeStyle=0x7f010019;
/** Drawable to use for the Web Search action button in WebView selection action modes
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeWebSearchDrawable=0x7f010024;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionOverflowButtonStyle=0x7f01000d;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionOverflowMenuStyle=0x7f01000e;
/** The name of an optional ActionProvider class to instantiate an action view
and perform operations such as default action for that menu item.
See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int actionProviderClass=0x7f010074;
/** The name of an optional View class to instantiate and use as an
action view. See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int actionViewClass=0x7f010073;
/** Default ActivityChooserView style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int activityChooserViewStyle=0x7f010034;
/** Specifies a background drawable for the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int background=0x7f01005d;
/** Specifies a background drawable for the bottom component of a split action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int backgroundSplit=0x7f01005f;
/** Specifies a background drawable for a second stacked row of the action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int backgroundStacked=0x7f01005e;
/** The size of the bars when they are parallel to each other
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int barSize=0x7f01009f;
/** A style that may be applied to Buttons placed within a
LinearLayout with the style buttonBarStyle to form a button bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int buttonBarButtonStyle=0x7f01002f;
/** A style that may be applied to horizontal LinearLayouts
to form a button bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int buttonBarStyle=0x7f01002e;
/** Close button icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int closeIcon=0x7f01007c;
/** Specifies a layout to use for the "close" item at the starting edge.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int closeItemLayout=0x7f01006d;
/** Text to set as the content description for the collapse button.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int collapseContentDescription=0x7f010094;
/** Icon drawable to use for the collapse button.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int collapseIcon=0x7f010093;
/** The drawing color for the bars
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int color=0x7f010099;
/** Bright complement to the primary branding color. By default, this is the color applied
to framework controls (via colorControlActivated).
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorAccent=0x7f01004f;
/** The color applied to framework buttons in their normal state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorButtonNormal=0x7f010053;
/** The color applied to framework controls in their activated (ex. checked) state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorControlActivated=0x7f010051;
/** The color applied to framework control highlights (ex. ripples, list selectors).
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorControlHighlight=0x7f010052;
/** The color applied to framework controls in their normal state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorControlNormal=0x7f010050;
/** The primary branding color for the app. By default, this is the color applied to the
action bar background.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorPrimary=0x7f01004d;
/** Dark variant of the primary branding color. By default, this is the color applied to
the status bar (via statusBarColor) and navigation bar (via navigationBarColor).
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorPrimaryDark=0x7f01004e;
/** The color applied to framework switch thumbs in their normal state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int colorSwitchThumbNormal=0x7f010054;
/** Commit icon shown in the query suggestion row
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int commitIcon=0x7f010080;
/** Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int contentInsetEnd=0x7f010068;
/** Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int contentInsetLeft=0x7f010069;
/** Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int contentInsetRight=0x7f01006a;
/** Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int contentInsetStart=0x7f010067;
/** Specifies a layout for custom navigation. Overrides navigationMode.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int customNavigationLayout=0x7f010060;
/** Whether this spinner should mark child views as enabled/disabled when
the spinner itself is enabled/disabled.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int disableChildrenWhenDisabled=0x7f010078;
/** Options affecting how the action bar is displayed.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr>
<tr><td><code>showHome</code></td><td>0x2</td><td></td></tr>
<tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr>
<tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr>
<tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr>
<tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr>
</table>
*/
public static final int displayOptions=0x7f010056;
/** Specifies the drawable used for item dividers.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int divider=0x7f01005c;
/** A drawable that may be used as a horizontal divider between visual elements.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int dividerHorizontal=0x7f010033;
/** Size of padding on either end of a divider.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int dividerPadding=0x7f010089;
/** A drawable that may be used as a vertical divider between visual elements.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int dividerVertical=0x7f010032;
/** The total size of the drawable
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int drawableSize=0x7f01009b;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int drawerArrowStyle=0x7f0100a1;
/** ListPopupWindow compatibility
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int dropDownListViewStyle=0x7f010045;
/** The preferred item height for dropdown lists.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int dropdownListPreferredItemHeight=0x7f010029;
/** EditText background drawable.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int editTextBackground=0x7f01003a;
/** EditText text foreground color.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int editTextColor=0x7f010039;
/** Elevation for the action bar itself
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int elevation=0x7f01006b;
/** The drawable to show in the button for expanding the activities overflow popup.
<strong>Note:</strong> Clients would like to set this drawable
as a clue about the action the chosen activity will perform. For
example, if share activity is to be chosen the drawable should
give a clue that sharing is to be performed.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int expandActivityOverflowButtonDrawable=0x7f010085;
/** The max gap between the bars when they are parallel to each other
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int gapBetweenBars=0x7f01009c;
/** Go button icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int goIcon=0x7f01007d;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int height=0x7f010001;
/** Set true to hide the action bar on a vertical nested scroll of content.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int hideOnContentScroll=0x7f010066;
/** Specifies a drawable to use for the 'home as up' indicator.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int homeAsUpIndicator=0x7f01002c;
/** Specifies a layout to use for the "home" section of the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int homeLayout=0x7f010061;
/** Specifies the drawable used for the application icon.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int icon=0x7f01005a;
/** The default state of the SearchView. If true, it will be iconified when not in
use and expanded when clicked.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int iconifiedByDefault=0x7f01007a;
/** Specifies a style resource to use for an indeterminate progress spinner.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int indeterminateProgressStyle=0x7f010063;
/** The maximal number of items initially shown in the activity list.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int initialActivityCount=0x7f010084;
/** Specifies whether the theme is light, otherwise it is dark.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int isLightTheme=0x7f010002;
/** Specifies padding that should be applied to the left and right sides of
system-provided items in the bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int itemPadding=0x7f010065;
/** The layout to use for the search view.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int layout=0x7f010079;
/** Drawable used as a background for selected list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int listChoiceBackgroundIndicator=0x7f01004c;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int listPopupWindowStyle=0x7f010046;
/** The preferred list item height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemHeight=0x7f010040;
/** A larger, more robust list item height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemHeightLarge=0x7f010042;
/** A smaller, sleeker list item height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemHeightSmall=0x7f010041;
/** The preferred padding along the left edge of list items.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemPaddingLeft=0x7f010043;
/** The preferred padding along the right edge of list items.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemPaddingRight=0x7f010044;
/** Specifies the drawable used for the application logo.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int logo=0x7f01005b;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int maxButtonHeight=0x7f010091;
/** When set to true, all children with a weight will be considered having
the minimum size of the largest child. If false, all children are
measured normally.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int measureWithLargestChild=0x7f010087;
/** The size of the middle bar when top and bottom bars merge into middle bar to form an arrow
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int middleBarArrowSize=0x7f01009e;
/** Text to set as the content description for the navigation button
located at the start of the toolbar.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int navigationContentDescription=0x7f010096;
/** Icon drawable to use for the navigation button located at
the start of the toolbar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int navigationIcon=0x7f010095;
/** The type of navigation to use.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>normal</code></td><td>0</td><td> Normal static title text </td></tr>
<tr><td><code>listMode</code></td><td>1</td><td> The action bar will use a selection list for navigation. </td></tr>
<tr><td><code>tabMode</code></td><td>2</td><td> The action bar will use a series of horizontal tabs for navigation. </td></tr>
</table>
*/
public static final int navigationMode=0x7f010055;
/** Whether the popup window should overlap its anchor view.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int overlapAnchor=0x7f010098;
/** Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int paddingEnd=0x7f01006f;
/** Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int paddingStart=0x7f01006e;
/** The background of a panel when it is inset from the left and right edges of the screen.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int panelBackground=0x7f010049;
/** Default Panel Menu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int panelMenuListTheme=0x7f01004b;
/** Default Panel Menu width.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int panelMenuListWidth=0x7f01004a;
/** Default PopupMenu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int popupMenuStyle=0x7f010037;
/** Reference to a layout to use for displaying a prompt in the dropdown for
spinnerMode="dropdown". This layout must contain a TextView with the id
{@code @android:id/text1} to be populated with the prompt text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int popupPromptView=0x7f010077;
/** Reference to a theme that should be used to inflate popups
shown by widgets in the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int popupTheme=0x7f01006c;
/** Default PopupWindow style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int popupWindowStyle=0x7f010038;
/** Whether space should be reserved in layout when an icon is missing.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int preserveIconSpacing=0x7f010070;
/** Specifies the horizontal padding on either end for an embedded progress bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int progressBarPadding=0x7f010064;
/** Specifies a style resource to use for an embedded progress bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int progressBarStyle=0x7f010062;
/** The prompt to display when the spinner's dialog is shown.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int prompt=0x7f010075;
/** Background for the section containing the search query
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int queryBackground=0x7f010082;
/** An optional query hint string to be displayed in the empty query field.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int queryHint=0x7f01007b;
/** Search icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchIcon=0x7f01007e;
/** Style for the search query widget.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewStyle=0x7f01003f;
/** A style that may be applied to buttons or other selectable items
that should react to pressed and focus states, but that do not
have a clear visual border along the edges.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int selectableItemBackground=0x7f010030;
/** Background drawable for borderless standalone items that need focus/pressed states.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int selectableItemBackgroundBorderless=0x7f010031;
/** How this item should display in the Action Bar, if present.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>never</code></td><td>0</td><td> Never show this item in an action bar, show it in the overflow menu instead.
Mutually exclusive with "ifRoom" and "always". </td></tr>
<tr><td><code>ifRoom</code></td><td>1</td><td> Show this item in an action bar if there is room for it as determined
by the system. Favor this option over "always" where possible.
Mutually exclusive with "never" and "always". </td></tr>
<tr><td><code>always</code></td><td>2</td><td> Always show this item in an actionbar, even if it would override
the system's limits of how much stuff to put there. This may make
your action bar look bad on some screens. In most cases you should
use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never". </td></tr>
<tr><td><code>withText</code></td><td>4</td><td> When this item is shown as an action in the action bar, show a text
label with it even if it has an icon representation. </td></tr>
<tr><td><code>collapseActionView</code></td><td>8</td><td> This item's action view collapses to a normal menu
item. When expanded, the action view takes over a
larger segment of its container. </td></tr>
</table>
*/
public static final int showAsAction=0x7f010071;
/** Setting for which dividers to show.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>beginning</code></td><td>1</td><td></td></tr>
<tr><td><code>middle</code></td><td>2</td><td></td></tr>
<tr><td><code>end</code></td><td>4</td><td></td></tr>
</table>
*/
public static final int showDividers=0x7f010088;
/** Whether to draw on/off text.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int showText=0x7f0100a8;
/** Whether bars should rotate or not during transition
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int spinBars=0x7f01009a;
/** Default Spinner style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int spinnerDropDownItemStyle=0x7f01002b;
/** Display mode for spinner options.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>dialog</code></td><td>0</td><td> Spinner options will be presented to the user as a dialog window. </td></tr>
<tr><td><code>dropdown</code></td><td>1</td><td> Spinner options will be presented to the user as an inline dropdown
anchored to the spinner widget itself. </td></tr>
</table>
*/
public static final int spinnerMode=0x7f010076;
/** Default Spinner style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int spinnerStyle=0x7f01002a;
/** Whether to split the track and leave a gap for the thumb drawable.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int splitTrack=0x7f0100a7;
/** State identifier indicating the popup will be above the anchor.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int state_above_anchor=0x7f010097;
/** Background for the section containing the action (e.g. voice search)
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int submitBackground=0x7f010083;
/** Specifies subtitle text used for navigationMode="normal"
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int subtitle=0x7f010057;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int subtitleTextAppearance=0x7f01008b;
/** Specifies a style to use for subtitle text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int subtitleTextStyle=0x7f010059;
/** Layout for query suggestion rows
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int suggestionRowLayout=0x7f010081;
/** Minimum width for the switch component
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int switchMinWidth=0x7f0100a5;
/** Minimum space between the switch and caption text
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int switchPadding=0x7f0100a6;
/** Default style for the Switch widget.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int switchStyle=0x7f01003b;
/** TextAppearance style for text displayed on the switch thumb.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int switchTextAppearance=0x7f0100a4;
/** Present the text in ALL CAPS. This may use a small-caps form when available.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a boolean value, either "<code>true</code>" or "<code>false</code>".
*/
public static final int textAllCaps=0x7f010086;
/** Text color, typeface, size, and style for the text inside of a popup menu.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceLargePopupMenu=0x7f010026;
/** The preferred TextAppearance for the primary text of list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceListItem=0x7f010047;
/** The preferred TextAppearance for the primary text of small list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceListItemSmall=0x7f010048;
/** Text color, typeface, size, and style for system search result subtitle. Defaults to primary inverse text color.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceSearchResultSubtitle=0x7f01003d;
/** Text color, typeface, size, and style for system search result title. Defaults to primary inverse text color.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceSearchResultTitle=0x7f01003c;
/** Text color, typeface, size, and style for small text inside of a popup menu.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceSmallPopupMenu=0x7f010027;
/** Text color for urls in search suggestions, used by things like global search
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int textColorSearchUrl=0x7f01003e;
/** Specifies a theme override for a view. When a theme override is set, the
view will be inflated using a {@link android.content.Context} themed with
the specified resource. During XML inflation, any child views under the
view with a theme override will inherit the themed context.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int theme=0x7f010092;
/** The thickness (stroke size) for the bar paint
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int thickness=0x7f0100a0;
/** Amount of padding on either side of text within the switch thumb.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int thumbTextPadding=0x7f0100a3;
/** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int title=0x7f010000;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int titleMarginBottom=0x7f010090;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int titleMarginEnd=0x7f01008e;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int titleMarginStart=0x7f01008d;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int titleMarginTop=0x7f01008f;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int titleMargins=0x7f01008c;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int titleTextAppearance=0x7f01008a;
/** Specifies a style to use for title text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int titleTextStyle=0x7f010058;
/** Default Toolar NavigationButtonStyle
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int toolbarNavigationButtonStyle=0x7f010036;
/** Default Toolbar style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int toolbarStyle=0x7f010035;
/** The size of the top and bottom bars when they merge to the middle bar to form an arrow
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int topBottomBarArrowSize=0x7f01009d;
/** Drawable to use as the "track" that the switch thumb slides within.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int track=0x7f0100a2;
/** Voice button icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int voiceIcon=0x7f01007f;
/** Flag indicating whether this window should have an Action Bar
in place of the usual title bar.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowActionBar=0x7f010003;
/** Flag indicating whether this window's Action Bar should overlay
application content. Does nothing if the window would not
have an Action Bar.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowActionBarOverlay=0x7f010004;
/** Flag indicating whether action modes should overlay window content
when there is not reserved space for their UI (such as an Action Bar).
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowActionModeOverlay=0x7f010005;
/** A fixed height for the window along the major axis of the screen,
that is, when in portrait. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowFixedHeightMajor=0x7f010009;
/** A fixed height for the window along the minor axis of the screen,
that is, when in landscape. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowFixedHeightMinor=0x7f010007;
/** A fixed width for the window along the major axis of the screen,
that is, when in landscape. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowFixedWidthMajor=0x7f010006;
/** A fixed width for the window along the minor axis of the screen,
that is, when in portrait. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowFixedWidthMinor=0x7f010008;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs=0x7f050000;
public static final int abc_action_bar_embed_tabs_pre_jb=0x7f050001;
public static final int abc_action_bar_expanded_action_views_exclusive=0x7f050002;
/** Whether action menu items should be displayed in ALLCAPS or not.
Defaults to true. If this is not appropriate for specific locales
it should be disabled in that locale's resources.
*/
public static final int abc_config_actionMenuItemAllCaps=0x7f050005;
/** Whether action menu items should obey the "withText" showAsAction
flag. This may be set to false for situations where space is
extremely limited.
Whether action menu items should obey the "withText" showAsAction.
This may be set to false for situations where space is
extremely limited.
*/
public static final int abc_config_allowActionMenuItemTextWithIcon=0x7f050004;
public static final int abc_config_showMenuShortcutsWhenKeyboardPresent=0x7f050003;
}
public static final class color {
public static final int abc_background_cache_hint_selector_material_dark=0x7f060031;
public static final int abc_background_cache_hint_selector_material_light=0x7f060032;
public static final int abc_input_method_navigation_guard=0x7f060003;
public static final int abc_primary_text_disable_only_material_dark=0x7f060033;
public static final int abc_primary_text_disable_only_material_light=0x7f060034;
public static final int abc_primary_text_material_dark=0x7f060035;
public static final int abc_primary_text_material_light=0x7f060036;
public static final int abc_search_url_text=0x7f060037;
public static final int abc_search_url_text_normal=0x7f060000;
public static final int abc_search_url_text_pressed=0x7f060002;
public static final int abc_search_url_text_selected=0x7f060001;
public static final int abc_secondary_text_material_dark=0x7f060038;
public static final int abc_secondary_text_material_light=0x7f060039;
public static final int accent_material_dark=0x7f06000f;
public static final int accent_material_light=0x7f06000e;
public static final int background_floating_material_dark=0x7f060006;
public static final int background_floating_material_light=0x7f060007;
public static final int background_material_dark=0x7f060004;
public static final int background_material_light=0x7f060005;
/** White 50%
*/
public static final int bright_foreground_disabled_material_dark=0x7f060016;
/** Black 50%
*/
public static final int bright_foreground_disabled_material_light=0x7f060017;
public static final int bright_foreground_inverse_material_dark=0x7f060018;
public static final int bright_foreground_inverse_material_light=0x7f060019;
public static final int bright_foreground_material_dark=0x7f060014;
public static final int bright_foreground_material_light=0x7f060015;
public static final int button_material_dark=0x7f060010;
public static final int button_material_light=0x7f060011;
public static final int dim_foreground_disabled_material_dark=0x7f06001c;
public static final int dim_foreground_disabled_material_light=0x7f06001d;
public static final int dim_foreground_material_dark=0x7f06001a;
public static final int dim_foreground_material_light=0x7f06001b;
/** TODO: This is 40% alpha on the default accent color.
*/
public static final int highlighted_text_material_dark=0x7f060020;
/** TODO: This is 40% alpha on the default accent color.
*/
public static final int highlighted_text_material_light=0x7f060021;
public static final int hint_foreground_material_dark=0x7f06001e;
public static final int hint_foreground_material_light=0x7f06001f;
public static final int link_text_material_dark=0x7f060022;
public static final int link_text_material_light=0x7f060023;
public static final int material_blue_grey_800=0x7f06002e;
public static final int material_blue_grey_900=0x7f06002f;
public static final int material_blue_grey_950=0x7f060030;
public static final int material_deep_teal_200=0x7f06002c;
public static final int material_deep_teal_500=0x7f06002d;
public static final int primary_dark_material_dark=0x7f06000a;
public static final int primary_dark_material_light=0x7f06000b;
public static final int primary_material_dark=0x7f060008;
public static final int primary_material_light=0x7f060009;
public static final int primary_text_default_material_dark=0x7f060026;
public static final int primary_text_default_material_light=0x7f060024;
/** 30% of default values
*/
public static final int primary_text_disabled_material_dark=0x7f06002a;
/** 26% of default values
*/
public static final int primary_text_disabled_material_light=0x7f060028;
public static final int ripple_material_dark=0x7f06000c;
public static final int ripple_material_light=0x7f06000d;
public static final int secondary_text_default_material_dark=0x7f060027;
public static final int secondary_text_default_material_light=0x7f060025;
public static final int secondary_text_disabled_material_dark=0x7f06002b;
public static final int secondary_text_disabled_material_light=0x7f060029;
public static final int switch_thumb_normal_material_dark=0x7f060012;
public static final int switch_thumb_normal_material_light=0x7f060013;
}
public static final class dimen {
/** Default height of an action bar.
Default height of an action bar.
Default height of an action bar.
*/
public static final int abc_action_bar_default_height_material=0x7f070014;
/** Default padding of an action bar.
Default padding of an action bar.
Default padding of an action bar.
*/
public static final int abc_action_bar_default_padding_material=0x7f070015;
/** Vertical padding around action bar icons.
*/
public static final int abc_action_bar_icon_vertical_padding_material=0x7f070016;
/** Size of the indeterminate Progress Bar
Size of the indeterminate Progress Bar
*/
public static final int abc_action_bar_progress_bar_size=0x7f070005;
/** Maximum height for a stacked tab bar as part of an action bar
*/
public static final int abc_action_bar_stacked_max_height=0x7f070004;
/** Maximum width for a stacked action bar tab. This prevents
action bar tabs from becoming too wide on a wide screen when only
a few are present.
*/
public static final int abc_action_bar_stacked_tab_max_width=0x7f070003;
/** Bottom margin for action bar subtitles
*/
public static final int abc_action_bar_subtitle_bottom_margin_material=0x7f070018;
/** Top margin for action bar subtitles
*/
public static final int abc_action_bar_subtitle_top_margin_material=0x7f070017;
public static final int abc_action_button_min_height_material=0x7f07001b;
public static final int abc_action_button_min_width_material=0x7f07001a;
public static final int abc_action_button_min_width_overflow_material=0x7f070019;
/** The maximum width we would prefer dialogs to be. 0 if there is no
maximum (let them grow as large as the screen). Actual values are
specified for -large and -xlarge configurations.
see comment in values/config.xml
see comment in values/config.xml
*/
public static final int abc_config_prefDialogWidth=0x7f070002;
/** Default insets (outer padding) around controls
*/
public static final int abc_control_inset_material=0x7f070010;
/** Default inner padding within controls
*/
public static final int abc_control_padding_material=0x7f070011;
/** Width of the icon in a dropdown list
*/
public static final int abc_dropdownitem_icon_width=0x7f07000b;
/** Text padding for dropdown items
*/
public static final int abc_dropdownitem_text_padding_left=0x7f070009;
public static final int abc_dropdownitem_text_padding_right=0x7f07000a;
public static final int abc_panel_menu_list_width=0x7f070006;
/** Preferred width of the search view.
*/
public static final int abc_search_view_preferred_width=0x7f070008;
/** Minimum width of the search view text entry area.
Minimum width of the search view text entry area.
Minimum width of the search view text entry area.
Minimum width of the search view text entry area.
Minimum width of the search view text entry area.
*/
public static final int abc_search_view_text_min_width=0x7f070007;
public static final int abc_text_size_body_1_material=0x7f070025;
public static final int abc_text_size_body_2_material=0x7f070024;
public static final int abc_text_size_button_material=0x7f070027;
public static final int abc_text_size_caption_material=0x7f070026;
public static final int abc_text_size_display_1_material=0x7f07001f;
public static final int abc_text_size_display_2_material=0x7f07001e;
public static final int abc_text_size_display_3_material=0x7f07001d;
public static final int abc_text_size_display_4_material=0x7f07001c;
public static final int abc_text_size_headline_material=0x7f070020;
public static final int abc_text_size_large_material=0x7f070028;
public static final int abc_text_size_medium_material=0x7f070029;
public static final int abc_text_size_menu_material=0x7f070023;
public static final int abc_text_size_small_material=0x7f07002a;
public static final int abc_text_size_subhead_material=0x7f070022;
/** Use the default subtitle sizes on tablets.
Default text size for action bar subtitle.
*/
public static final int abc_text_size_subtitle_material_toolbar=0x7f070013;
public static final int abc_text_size_title_material=0x7f070021;
/** Use the default title sizes on tablets.
Default text size for action bar title.
*/
public static final int abc_text_size_title_material_toolbar=0x7f070012;
/** The platform's desired fixed height for a dialog along the major axis
(the screen is in portrait). This may be either a fraction or a dimension.
The platform's desired fixed height for a dialog along the major axis
(the screen is in portrait). This may be either a fraction or a dimension.
The platform's desired fixed height for a dialog along the major axis
(the screen is in portrait). This may be either a fraction or a dimension.
*/
public static final int dialog_fixed_height_major=0x7f07000e;
/** The platform's desired fixed height for a dialog along the minor axis
(the screen is in landscape). This may be either a fraction or a dimension.
The platform's desired fixed height for a dialog along the minor axis
(the screen is in landscape). This may be either a fraction or a dimension.
The platform's desired fixed height for a dialog along the minor axis
(the screen is in landscape). This may be either a fraction or a dimension.
*/
public static final int dialog_fixed_height_minor=0x7f07000f;
/** The platform's desired fixed width for a dialog along the major axis
(the screen is in landscape). This may be either a fraction or a dimension.
The platform's desired fixed width for a dialog along the major axis
(the screen is in landscape). This may be either a fraction or a dimension.
The platform's desired fixed width for a dialog along the major axis
(the screen is in landscape). This may be either a fraction or a dimension.
*/
public static final int dialog_fixed_width_major=0x7f07000c;
/** The platform's desired fixed width for a dialog along the minor axis
(the screen is in portrait). This may be either a fraction or a dimension.
The platform's desired fixed width for a dialog along the minor axis
(the screen is in portrait). This may be either a fraction or a dimension.
The platform's desired fixed width for a dialog along the minor axis
(the screen is in portrait). This may be either a fraction or a dimension.
*/
public static final int dialog_fixed_width_minor=0x7f07000d;
public static final int disabled_alpha_material_dark=0x7f070001;
public static final int disabled_alpha_material_light=0x7f070000;
}
public static final class drawable {
public static final int abc_ab_share_pack_holo_dark=0x7f020000;
public static final int abc_ab_share_pack_holo_light=0x7f020001;
public static final int abc_btn_check_material=0x7f020002;
public static final int abc_btn_check_to_on_mtrl_000=0x7f020003;
public static final int abc_btn_check_to_on_mtrl_015=0x7f020004;
public static final int abc_btn_radio_material=0x7f020005;
public static final int abc_btn_radio_to_on_mtrl_000=0x7f020006;
public static final int abc_btn_radio_to_on_mtrl_015=0x7f020007;
public static final int abc_btn_switch_to_on_mtrl_00001=0x7f020008;
public static final int abc_btn_switch_to_on_mtrl_00012=0x7f020009;
public static final int abc_cab_background_internal_bg=0x7f02000a;
public static final int abc_cab_background_top_material=0x7f02000b;
public static final int abc_cab_background_top_mtrl_alpha=0x7f02000c;
public static final int abc_edit_text_material=0x7f02000d;
public static final int abc_ic_ab_back_mtrl_am_alpha=0x7f02000e;
public static final int abc_ic_clear_mtrl_alpha=0x7f02000f;
public static final int abc_ic_commit_search_api_mtrl_alpha=0x7f020010;
public static final int abc_ic_go_search_api_mtrl_alpha=0x7f020011;
public static final int abc_ic_menu_copy_mtrl_am_alpha=0x7f020012;
public static final int abc_ic_menu_cut_mtrl_alpha=0x7f020013;
public static final int abc_ic_menu_moreoverflow_mtrl_alpha=0x7f020014;
public static final int abc_ic_menu_paste_mtrl_am_alpha=0x7f020015;
public static final int abc_ic_menu_selectall_mtrl_alpha=0x7f020016;
public static final int abc_ic_menu_share_mtrl_alpha=0x7f020017;
public static final int abc_ic_search_api_mtrl_alpha=0x7f020018;
public static final int abc_ic_voice_search_api_mtrl_alpha=0x7f020019;
public static final int abc_item_background_holo_dark=0x7f02001a;
public static final int abc_item_background_holo_light=0x7f02001b;
public static final int abc_list_divider_mtrl_alpha=0x7f02001c;
public static final int abc_list_focused_holo=0x7f02001d;
public static final int abc_list_longpressed_holo=0x7f02001e;
public static final int abc_list_pressed_holo_dark=0x7f02001f;
public static final int abc_list_pressed_holo_light=0x7f020020;
public static final int abc_list_selector_background_transition_holo_dark=0x7f020021;
public static final int abc_list_selector_background_transition_holo_light=0x7f020022;
public static final int abc_list_selector_disabled_holo_dark=0x7f020023;
public static final int abc_list_selector_disabled_holo_light=0x7f020024;
public static final int abc_list_selector_holo_dark=0x7f020025;
public static final int abc_list_selector_holo_light=0x7f020026;
public static final int abc_menu_hardkey_panel_mtrl_mult=0x7f020027;
public static final int abc_popup_background_mtrl_mult=0x7f020028;
public static final int abc_spinner_mtrl_am_alpha=0x7f020029;
public static final int abc_switch_thumb_material=0x7f02002a;
public static final int abc_switch_track_mtrl_alpha=0x7f02002b;
public static final int abc_tab_indicator_material=0x7f02002c;
public static final int abc_tab_indicator_mtrl_alpha=0x7f02002d;
public static final int abc_textfield_activated_mtrl_alpha=0x7f02002e;
public static final int abc_textfield_default_mtrl_alpha=0x7f02002f;
public static final int abc_textfield_search_activated_mtrl_alpha=0x7f020030;
public static final int abc_textfield_search_default_mtrl_alpha=0x7f020031;
public static final int abc_textfield_search_material=0x7f020032;
public static final int ic_launcher=0x7f020033;
}
public static final class id {
public static final int action_bar=0x7f090031;
public static final int action_bar_activity_content=0x7f090003;
public static final int action_bar_container=0x7f090030;
public static final int action_bar_root=0x7f09002c;
public static final int action_bar_spinner=0x7f090002;
public static final int action_bar_subtitle=0x7f09001f;
public static final int action_bar_title=0x7f09001e;
public static final int action_context_bar=0x7f090032;
public static final int action_menu_divider=0x7f090005;
public static final int action_menu_presenter=0x7f090006;
public static final int action_mode_bar=0x7f09002e;
public static final int action_mode_bar_stub=0x7f09002d;
public static final int action_mode_close_button=0x7f090020;
public static final int activity_chooser_view_content=0x7f090021;
public static final int always=0x7f090014;
public static final int beginning=0x7f09001b;
public static final int bt_load=0x7f090040;
public static final int bt_save=0x7f090041;
public static final int checkbox=0x7f090029;
public static final int collapseActionView=0x7f090015;
public static final int decor_content_parent=0x7f09002f;
public static final int default_activity_button=0x7f090024;
public static final int dialog=0x7f090019;
public static final int disableHome=0x7f09000d;
public static final int dropdown=0x7f09001a;
public static final int edit_query=0x7f090033;
public static final int end=0x7f09001c;
public static final int expand_activities_button=0x7f090022;
public static final int expanded_menu=0x7f090028;
public static final int home=0x7f090000;
public static final int homeAsUp=0x7f09000e;
public static final int icon=0x7f090026;
public static final int ifRoom=0x7f090016;
public static final int image=0x7f090023;
public static final int listMode=0x7f09000a;
public static final int list_item=0x7f090025;
public static final int middle=0x7f09001d;
public static final int never=0x7f090017;
public static final int none=0x7f09000f;
public static final int normal=0x7f09000b;
public static final int progress_circular=0x7f090007;
public static final int progress_horizontal=0x7f090008;
public static final int radio=0x7f09002b;
public static final int search_badge=0x7f090035;
public static final int search_bar=0x7f090034;
public static final int search_button=0x7f090036;
public static final int search_close_btn=0x7f09003b;
public static final int search_edit_frame=0x7f090037;
public static final int search_go_btn=0x7f09003d;
public static final int search_mag_icon=0x7f090038;
public static final int search_plate=0x7f090039;
public static final int search_src_text=0x7f09003a;
public static final int search_voice_btn=0x7f09003e;
public static final int shortcut=0x7f09002a;
public static final int showCustom=0x7f090010;
public static final int showHome=0x7f090011;
public static final int showTitle=0x7f090012;
public static final int split_action_bar=0x7f090004;
public static final int submit_area=0x7f09003c;
public static final int tabMode=0x7f09000c;
public static final int title=0x7f090027;
public static final int tv_data=0x7f09003f;
public static final int up=0x7f090001;
public static final int useLogo=0x7f090013;
public static final int withText=0x7f090018;
public static final int wrap_content=0x7f090009;
}
public static final class integer {
/** The maximum number of action buttons that should be permitted within
an action bar/action mode. This will be used to determine how many
showAsAction="ifRoom" items can fit. "always" items can override this.
The maximum number of action buttons that should be permitted within
an action bar/action mode. This will be used to determine how many
showAsAction="ifRoom" items can fit. "always" items can override this.
The maximum number of action buttons that should be permitted within
an action bar/action mode. This will be used to determine how many
showAsAction="ifRoom" items can fit. "always" items can override this.
The maximum number of action buttons that should be permitted within
an action bar/action mode. This will be used to determine how many
showAsAction="ifRoom" items can fit. "always" items can override this.
The maximum number of action buttons that should be permitted within
an action bar/action mode. This will be used to determine how many
showAsAction="ifRoom" items can fit. "always" items can override this.
The maximum number of action buttons that should be permitted within
an action bar/action mode. This will be used to determine how many
showAsAction="ifRoom" items can fit. "always" items can override this.
The maximum number of action buttons that should be permitted within
an action bar/action mode. This will be used to determine how many
showAsAction="ifRoom" items can fit. "always" items can override this.
*/
public static final int abc_max_action_buttons=0x7f080000;
}
public static final class layout {
public static final int abc_action_bar_title_item=0x7f030000;
public static final int abc_action_bar_up_container=0x7f030001;
public static final int abc_action_bar_view_list_nav_layout=0x7f030002;
public static final int abc_action_menu_item_layout=0x7f030003;
public static final int abc_action_menu_layout=0x7f030004;
public static final int abc_action_mode_bar=0x7f030005;
public static final int abc_action_mode_close_item_material=0x7f030006;
public static final int abc_activity_chooser_view=0x7f030007;
public static final int abc_activity_chooser_view_include=0x7f030008;
public static final int abc_activity_chooser_view_list_item=0x7f030009;
public static final int abc_expanded_menu_layout=0x7f03000a;
public static final int abc_list_menu_item_checkbox=0x7f03000b;
public static final int abc_list_menu_item_icon=0x7f03000c;
public static final int abc_list_menu_item_layout=0x7f03000d;
public static final int abc_list_menu_item_radio=0x7f03000e;
public static final int abc_popup_menu_item_layout=0x7f03000f;
public static final int abc_screen_content_include=0x7f030010;
public static final int abc_screen_simple=0x7f030011;
public static final int abc_screen_simple_overlay_action_mode=0x7f030012;
public static final int abc_screen_toolbar=0x7f030013;
public static final int abc_search_dropdown_item_icons_2line=0x7f030014;
public static final int abc_search_view=0x7f030015;
public static final int abc_simple_dropdown_hint=0x7f030016;
public static final int activity_main=0x7f030017;
public static final int support_simple_spinner_dropdown_item=0x7f030018;
}
public static final class string {
/** Content description for the action bar "home" affordance. [CHAR LIMIT=NONE]
*/
public static final int abc_action_bar_home_description=0x7f0a0001;
/** Formatting string for describing the action bar's title/home/up affordance.
This is a single tappable "button" that includes the app icon, the Up indicator
(usually a "<" chevron) and the window title text.
%1$s is the title. %2$s is the description of what tapping/clicking the whole
thing is going to do.
*/
public static final int abc_action_bar_home_description_format=0x7f0a0005;
/** Just like action_bar_home_description_format, but this one will be used
if the window is also providing subtitle text.
%1$s is the title. %2$s is the subtitle. %3$s is the description of what
tapping/clicking the whole thing is going to do.
*/
public static final int abc_action_bar_home_subtitle_description_format=0x7f0a0006;
/** Content description for the action bar "up" affordance. [CHAR LIMIT=NONE]
*/
public static final int abc_action_bar_up_description=0x7f0a0002;
/** Content description for the action menu overflow button. [CHAR LIMIT=NONE]
*/
public static final int abc_action_menu_overflow_description=0x7f0a0003;
/** Label for the "Done" button on the far left of action mode toolbars.
*/
public static final int abc_action_mode_done=0x7f0a0000;
/** Title for a button to expand the list of activities in ActivityChooserView [CHAR LIMIT=25]
*/
public static final int abc_activity_chooser_view_see_all=0x7f0a000d;
/** ActivityChooserView - accessibility support
Description of the shwoing of a popup window with activities to choose from. [CHAR LIMIT=NONE]
*/
public static final int abc_activitychooserview_choose_application=0x7f0a000c;
/** SearchView accessibility description for clear button [CHAR LIMIT=NONE]
*/
public static final int abc_searchview_description_clear=0x7f0a0009;
/** SearchView accessibility description for search text field [CHAR LIMIT=NONE]
*/
public static final int abc_searchview_description_query=0x7f0a0008;
/** SearchView accessibility description for search button [CHAR LIMIT=NONE]
*/
public static final int abc_searchview_description_search=0x7f0a0007;
/** SearchView accessibility description for submit button [CHAR LIMIT=NONE]
*/
public static final int abc_searchview_description_submit=0x7f0a000a;
/** SearchView accessibility description for voice button [CHAR LIMIT=NONE]
*/
public static final int abc_searchview_description_voice=0x7f0a000b;
/** Description of the choose target button in a ShareActionProvider (share UI). [CHAR LIMIT=NONE]
*/
public static final int abc_shareactionprovider_share_with=0x7f0a000f;
/** Description of a share target (both in the list of such or the default share button) in a ShareActionProvider (share UI). [CHAR LIMIT=NONE]
*/
public static final int abc_shareactionprovider_share_with_application=0x7f0a000e;
/** Content description for the Toolbar icon used to collapse an expanded action mode. [CHAR LIMIT=NONE]
*/
public static final int abc_toolbar_collapse_description=0x7f0a0004;
public static final int app_name=0x7f0a0010;
public static final int hello_world=0x7f0a0011;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f0b00eb;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f0b00ec;
public static final int Base_TextAppearance_AppCompat=0x7f0b0098;
public static final int Base_TextAppearance_AppCompat_Body1=0x7f0b00a3;
public static final int Base_TextAppearance_AppCompat_Body2=0x7f0b00a2;
public static final int Base_TextAppearance_AppCompat_Button=0x7f0b00a6;
public static final int Base_TextAppearance_AppCompat_Caption=0x7f0b00a4;
public static final int Base_TextAppearance_AppCompat_Display1=0x7f0b009c;
public static final int Base_TextAppearance_AppCompat_Display2=0x7f0b009b;
public static final int Base_TextAppearance_AppCompat_Display3=0x7f0b009a;
public static final int Base_TextAppearance_AppCompat_Display4=0x7f0b0099;
public static final int Base_TextAppearance_AppCompat_Headline=0x7f0b009d;
/** Deprecated text styles
Deprecated text styles
Now deprecated styles
*/
public static final int Base_TextAppearance_AppCompat_Inverse=0x7f0b00a7;
public static final int Base_TextAppearance_AppCompat_Large=0x7f0b00a8;
public static final int Base_TextAppearance_AppCompat_Large_Inverse=0x7f0b00a9;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large=0x7f0b0085;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small=0x7f0b0086;
public static final int Base_TextAppearance_AppCompat_Medium=0x7f0b00aa;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse=0x7f0b00ab;
public static final int Base_TextAppearance_AppCompat_Menu=0x7f0b00a5;
public static final int Base_TextAppearance_AppCompat_SearchResult=0x7f0b0087;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle=0x7f0b0089;
/** Search View result styles
*/
public static final int Base_TextAppearance_AppCompat_SearchResult_Title=0x7f0b0088;
public static final int Base_TextAppearance_AppCompat_Small=0x7f0b00ac;
public static final int Base_TextAppearance_AppCompat_Small_Inverse=0x7f0b00ad;
public static final int Base_TextAppearance_AppCompat_Subhead=0x7f0b00a0;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse=0x7f0b00a1;
public static final int Base_TextAppearance_AppCompat_Title=0x7f0b009e;
public static final int Base_TextAppearance_AppCompat_Title_Inverse=0x7f0b009f;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu=0x7f0b0070;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle=0x7f0b0072;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse=0x7f0b0074;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title=0x7f0b0071;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse=0x7f0b0073;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle=0x7f0b006f;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title=0x7f0b006e;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem=0x7f0b007b;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large=0x7f0b0083;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small=0x7f0b0084;
public static final int Base_TextAppearance_AppCompat_Widget_Switch=0x7f0b0097;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item=0x7f0b007c;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle=0x7f0b0092;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title=0x7f0b0091;
public static final int Base_Theme_AppCompat=0x7f0b00cf;
/** Menu/item attributes
*/
public static final int Base_Theme_AppCompat_CompactMenu=0x7f0b00d2;
public static final int Base_Theme_AppCompat_Dialog=0x7f0b00d4;
public static final int Base_Theme_AppCompat_Dialog_FixedSize=0x7f0b00d6;
/** We're not large, so redirect to Theme.AppCompat
*/
public static final int Base_Theme_AppCompat_DialogWhenLarge=0x7f0b00d8;
public static final int Base_Theme_AppCompat_Light=0x7f0b00d0;
public static final int Base_Theme_AppCompat_Light_DarkActionBar=0x7f0b00d1;
public static final int Base_Theme_AppCompat_Light_Dialog=0x7f0b00d5;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize=0x7f0b00d7;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge=0x7f0b00d9;
/** Overlay themes
*/
public static final int Base_ThemeOverlay_AppCompat=0x7f0b00da;
public static final int Base_ThemeOverlay_AppCompat_ActionBar=0x7f0b00dd;
public static final int Base_ThemeOverlay_AppCompat_Dark=0x7f0b00dc;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar=0x7f0b00de;
public static final int Base_ThemeOverlay_AppCompat_Light=0x7f0b00db;
public static final int Base_V11_Theme_AppCompat=0x7f0b00df;
public static final int Base_V11_Theme_AppCompat_Dialog=0x7f0b00e1;
public static final int Base_V11_Theme_AppCompat_Light=0x7f0b00e0;
public static final int Base_V11_Theme_AppCompat_Light_Dialog=0x7f0b00e2;
public static final int Base_V14_Theme_AppCompat=0x7f0b00e3;
public static final int Base_V14_Theme_AppCompat_Dialog=0x7f0b00e5;
public static final int Base_V14_Theme_AppCompat_Light=0x7f0b00e4;
public static final int Base_V14_Theme_AppCompat_Light_Dialog=0x7f0b00e6;
public static final int Base_V21_Theme_AppCompat=0x7f0b00e7;
public static final int Base_V21_Theme_AppCompat_Dialog=0x7f0b00e9;
public static final int Base_V21_Theme_AppCompat_Light=0x7f0b00e8;
public static final int Base_V21_Theme_AppCompat_Light_Dialog=0x7f0b00ea;
/** Base platform-dependent theme providing an action bar in a dark-themed activity.
*/
public static final int Base_V7_Theme_AppCompat=0x7f0b00cd;
public static final int Base_V7_Theme_AppCompat_Dialog=0x7f0b00d3;
/** Base platform-dependent theme providing an action bar in a light-themed activity.
*/
public static final int Base_V7_Theme_AppCompat_Light=0x7f0b00ce;
public static final int Base_Widget_AppCompat_ActionBar=0x7f0b005f;
public static final int Base_Widget_AppCompat_ActionBar_Solid=0x7f0b0061;
public static final int Base_Widget_AppCompat_ActionBar_TabBar=0x7f0b0066;
public static final int Base_Widget_AppCompat_ActionBar_TabText=0x7f0b006a;
public static final int Base_Widget_AppCompat_ActionBar_TabView=0x7f0b0068;
/** Action Button Styles
*/
public static final int Base_Widget_AppCompat_ActionButton=0x7f0b0063;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode=0x7f0b0064;
public static final int Base_Widget_AppCompat_ActionButton_Overflow=0x7f0b0065;
public static final int Base_Widget_AppCompat_ActionMode=0x7f0b006d;
/** TODO. Needs updating for Material
*/
public static final int Base_Widget_AppCompat_ActivityChooserView=0x7f0b008c;
public static final int Base_Widget_AppCompat_AutoCompleteTextView=0x7f0b008a;
public static final int Base_Widget_AppCompat_CompoundButton_Switch=0x7f0b0096;
public static final int Base_Widget_AppCompat_DrawerArrowToggle=0x7f0b0095;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner=0x7f0b0079;
public static final int Base_Widget_AppCompat_EditText=0x7f0b0094;
public static final int Base_Widget_AppCompat_Light_ActionBar=0x7f0b0060;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid=0x7f0b0062;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar=0x7f0b0067;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText=0x7f0b006b;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse=0x7f0b006c;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView=0x7f0b0069;
public static final int Base_Widget_AppCompat_Light_ActivityChooserView=0x7f0b008d;
public static final int Base_Widget_AppCompat_Light_AutoCompleteTextView=0x7f0b008b;
public static final int Base_Widget_AppCompat_Light_PopupMenu=0x7f0b0082;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow=0x7f0b0080;
/** Popup Menu
*/
public static final int Base_Widget_AppCompat_ListPopupWindow=0x7f0b007e;
/** Spinner Widgets
*/
public static final int Base_Widget_AppCompat_ListView_DropDown=0x7f0b007a;
public static final int Base_Widget_AppCompat_ListView_Menu=0x7f0b007d;
public static final int Base_Widget_AppCompat_PopupMenu=0x7f0b0081;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow=0x7f0b007f;
public static final int Base_Widget_AppCompat_PopupWindow=0x7f0b008e;
public static final int Base_Widget_AppCompat_ProgressBar=0x7f0b0076;
/** Progress Bar
Progress Bar
*/
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal=0x7f0b0075;
public static final int Base_Widget_AppCompat_SearchView=0x7f0b0093;
/** Spinner Widgets
*/
public static final int Base_Widget_AppCompat_Spinner=0x7f0b0077;
public static final int Base_Widget_AppCompat_Spinner_DropDown_ActionBar=0x7f0b0078;
public static final int Base_Widget_AppCompat_Toolbar=0x7f0b008f;
/**
Widget.AppCompat.Toolbar style is purposely ommitted. This is because the support
Toolbar implementation is used on ALL platforms and relies on the unbundled attrs.
The supporting Toolbar styles below only use basic attrs so work fine.
*/
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation=0x7f0b0090;
public static final int Platform_AppCompat=0x7f0b00c9;
public static final int Platform_AppCompat_Dialog=0x7f0b00cb;
public static final int Platform_AppCompat_Light=0x7f0b00ca;
public static final int Platform_AppCompat_Light_Dialog=0x7f0b00cc;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem=0x7f0b00b4;
public static final int RtlOverlay_Widget_AppCompat_ActionButton_CloseMode=0x7f0b00b5;
public static final int RtlOverlay_Widget_AppCompat_ActionButton_Overflow=0x7f0b00b6;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem=0x7f0b00b7;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup=0x7f0b00b8;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text=0x7f0b00b9;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown=0x7f0b00af;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1=0x7f0b00b1;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2=0x7f0b00b2;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query=0x7f0b00b0;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text=0x7f0b00b3;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon=0x7f0b00ae;
/** Text styles
*/
public static final int TextAppearance_AppCompat=0x7f0b0038;
public static final int TextAppearance_AppCompat_Body1=0x7f0b0043;
public static final int TextAppearance_AppCompat_Body2=0x7f0b0042;
public static final int TextAppearance_AppCompat_Button=0x7f0b004d;
public static final int TextAppearance_AppCompat_Caption=0x7f0b0044;
public static final int TextAppearance_AppCompat_Display1=0x7f0b003c;
public static final int TextAppearance_AppCompat_Display2=0x7f0b003b;
public static final int TextAppearance_AppCompat_Display3=0x7f0b003a;
public static final int TextAppearance_AppCompat_Display4=0x7f0b0039;
public static final int TextAppearance_AppCompat_Headline=0x7f0b003d;
public static final int TextAppearance_AppCompat_Inverse=0x7f0b0046;
public static final int TextAppearance_AppCompat_Large=0x7f0b0047;
public static final int TextAppearance_AppCompat_Large_Inverse=0x7f0b0048;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle=0x7f0b0053;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title=0x7f0b0052;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large=0x7f0b0029;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small=0x7f0b002a;
public static final int TextAppearance_AppCompat_Medium=0x7f0b0049;
public static final int TextAppearance_AppCompat_Medium_Inverse=0x7f0b004a;
public static final int TextAppearance_AppCompat_Menu=0x7f0b0045;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle=0x7f0b002c;
public static final int TextAppearance_AppCompat_SearchResult_Title=0x7f0b002b;
public static final int TextAppearance_AppCompat_Small=0x7f0b004b;
public static final int TextAppearance_AppCompat_Small_Inverse=0x7f0b004c;
public static final int TextAppearance_AppCompat_Subhead=0x7f0b0040;
public static final int TextAppearance_AppCompat_Subhead_Inverse=0x7f0b0041;
public static final int TextAppearance_AppCompat_Title=0x7f0b003e;
public static final int TextAppearance_AppCompat_Title_Inverse=0x7f0b003f;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu=0x7f0b0015;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle=0x7f0b0005;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse=0x7f0b0007;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title=0x7f0b0004;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse=0x7f0b0006;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle=0x7f0b0018;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse=0x7f0b0056;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title=0x7f0b0017;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse=0x7f0b0055;
public static final int TextAppearance_AppCompat_Widget_DropDownItem=0x7f0b0019;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large=0x7f0b0027;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small=0x7f0b0028;
public static final int TextAppearance_AppCompat_Widget_Switch=0x7f0b004e;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item=0x7f0b001f;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle=0x7f0b0037;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title=0x7f0b0036;
/** Themes in the "Theme.AppCompat" family will contain an action bar by default.
If Holo themes are available on the current platform version they will be used.
A limited Holo-styled action bar will be provided on platform versions older
than 3.0. (API 11)
These theme declarations contain any version-independent specification. Items
that need to vary based on platform version should be defined in the corresponding
"Theme.Base" theme.
Platform-independent theme providing an action bar in a dark-themed activity.
*/
public static final int Theme_AppCompat=0x7f0b00ba;
/** Menu/item attributes
*/
public static final int Theme_AppCompat_CompactMenu=0x7f0b00c3;
public static final int Theme_AppCompat_Dialog=0x7f0b00c1;
public static final int Theme_AppCompat_DialogWhenLarge=0x7f0b00bf;
/** Platform-independent theme providing an action bar in a light-themed activity.
*/
public static final int Theme_AppCompat_Light=0x7f0b00bb;
/** Platform-independent theme providing an action bar in a dark-themed activity.
*/
public static final int Theme_AppCompat_Light_DarkActionBar=0x7f0b00bc;
public static final int Theme_AppCompat_Light_Dialog=0x7f0b00c2;
public static final int Theme_AppCompat_Light_DialogWhenLarge=0x7f0b00c0;
public static final int Theme_AppCompat_Light_NoActionBar=0x7f0b00be;
public static final int Theme_AppCompat_NoActionBar=0x7f0b00bd;
public static final int ThemeOverlay_AppCompat=0x7f0b00c4;
/** Theme overlay that replaces the normal control color, which by default is the same as the
secondary text color, with the primary text color.
*/
public static final int ThemeOverlay_AppCompat_ActionBar=0x7f0b00c7;
/** Theme overlay that replaces colors with their dark versions but preserves
the value of colorAccent, colorPrimary and its variants.
*/
public static final int ThemeOverlay_AppCompat_Dark=0x7f0b00c6;
/** Theme overlay that replaces colors with their dark versions and replaces the normal
control color, which by default is the same as the secondary text color, with the primary
text color.
*/
public static final int ThemeOverlay_AppCompat_Dark_ActionBar=0x7f0b00c8;
/** Theme overlay that replaces colors with their light versions but preserves
the value of colorAccent, colorPrimary and its variants.
*/
public static final int ThemeOverlay_AppCompat_Light=0x7f0b00c5;
/** Styles in here can be extended for customisation in your application. Each utilises
one of the.styles. If Holo themes are available on the current platform version
they will be used instead of the compat styles.
*/
public static final int Widget_AppCompat_ActionBar=0x7f0b0000;
public static final int Widget_AppCompat_ActionBar_Solid=0x7f0b0002;
public static final int Widget_AppCompat_ActionBar_TabBar=0x7f0b000d;
public static final int Widget_AppCompat_ActionBar_TabText=0x7f0b0011;
public static final int Widget_AppCompat_ActionBar_TabView=0x7f0b000f;
public static final int Widget_AppCompat_ActionButton=0x7f0b000a;
/** This style has an extra indirection to properly set RTL attributes. See styles_rtl.xml
*/
public static final int Widget_AppCompat_ActionButton_CloseMode=0x7f0b000b;
public static final int Widget_AppCompat_ActionButton_Overflow=0x7f0b000c;
public static final int Widget_AppCompat_ActionMode=0x7f0b0016;
public static final int Widget_AppCompat_ActivityChooserView=0x7f0b002f;
public static final int Widget_AppCompat_AutoCompleteTextView=0x7f0b002d;
public static final int Widget_AppCompat_CompoundButton_Switch=0x7f0b0033;
public static final int Widget_AppCompat_DrawerArrowToggle=0x7f0b0012;
/** This style has an extra indirection to properly set RTL attributes. See styles_rtl.xml
*/
public static final int Widget_AppCompat_DropDownItem_Spinner=0x7f0b001d;
public static final int Widget_AppCompat_EditText=0x7f0b0032;
public static final int Widget_AppCompat_Light_ActionBar=0x7f0b0001;
public static final int Widget_AppCompat_Light_ActionBar_Solid=0x7f0b0003;
/**
The following themes are deprecated.
*/
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse=0x7f0b004f;
public static final int Widget_AppCompat_Light_ActionBar_TabBar=0x7f0b000e;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse=0x7f0b0050;
public static final int Widget_AppCompat_Light_ActionBar_TabText=0x7f0b0013;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse=0x7f0b0014;
public static final int Widget_AppCompat_Light_ActionBar_TabView=0x7f0b0010;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse=0x7f0b0051;
public static final int Widget_AppCompat_Light_ActionButton=0x7f0b0059;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode=0x7f0b005b;
public static final int Widget_AppCompat_Light_ActionButton_Overflow=0x7f0b005a;
public static final int Widget_AppCompat_Light_ActionMode_Inverse=0x7f0b0054;
public static final int Widget_AppCompat_Light_ActivityChooserView=0x7f0b0030;
public static final int Widget_AppCompat_Light_AutoCompleteTextView=0x7f0b002e;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner=0x7f0b0057;
public static final int Widget_AppCompat_Light_ListPopupWindow=0x7f0b005e;
public static final int Widget_AppCompat_Light_ListView_DropDown=0x7f0b005d;
public static final int Widget_AppCompat_Light_PopupMenu=0x7f0b0024;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow=0x7f0b0022;
public static final int Widget_AppCompat_Light_SearchView=0x7f0b0058;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar=0x7f0b005c;
public static final int Widget_AppCompat_ListPopupWindow=0x7f0b0020;
public static final int Widget_AppCompat_ListView_DropDown=0x7f0b001e;
public static final int Widget_AppCompat_ListView_Menu=0x7f0b0025;
public static final int Widget_AppCompat_PopupMenu=0x7f0b0023;
public static final int Widget_AppCompat_PopupMenu_Overflow=0x7f0b0021;
public static final int Widget_AppCompat_PopupWindow=0x7f0b0026;
public static final int Widget_AppCompat_ProgressBar=0x7f0b0009;
public static final int Widget_AppCompat_ProgressBar_Horizontal=0x7f0b0008;
public static final int Widget_AppCompat_SearchView=0x7f0b0031;
public static final int Widget_AppCompat_Spinner=0x7f0b001a;
public static final int Widget_AppCompat_Spinner_DropDown=0x7f0b001b;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar=0x7f0b001c;
/** Toolbar
*/
public static final int Widget_AppCompat_Toolbar=0x7f0b0034;
public static final int Widget_AppCompat_Toolbar_Button_Navigation=0x7f0b0035;
}
public static final class styleable {
/** ============================================
Attributes used to style the Action Bar.
These should be set on your theme; the default actionBarStyle will
propagate them to the correct elements as needed.
Please Note: when overriding attributes for an ActionBar style
you must specify each attribute twice: once with the "android:"
namespace prefix and once without.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionBar_background com.example.view:background}</code></td><td> Specifies a background drawable for the action bar.</td></tr>
<tr><td><code>{@link #ActionBar_backgroundSplit com.example.view:backgroundSplit}</code></td><td> Specifies a background drawable for the bottom component of a split action bar.</td></tr>
<tr><td><code>{@link #ActionBar_backgroundStacked com.example.view:backgroundStacked}</code></td><td> Specifies a background drawable for a second stacked row of the action bar.</td></tr>
<tr><td><code>{@link #ActionBar_contentInsetEnd com.example.view:contentInsetEnd}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #ActionBar_contentInsetLeft com.example.view:contentInsetLeft}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #ActionBar_contentInsetRight com.example.view:contentInsetRight}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #ActionBar_contentInsetStart com.example.view:contentInsetStart}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #ActionBar_customNavigationLayout com.example.view:customNavigationLayout}</code></td><td> Specifies a layout for custom navigation.</td></tr>
<tr><td><code>{@link #ActionBar_displayOptions com.example.view:displayOptions}</code></td><td> Options affecting how the action bar is displayed.</td></tr>
<tr><td><code>{@link #ActionBar_divider com.example.view:divider}</code></td><td> Specifies the drawable used for item dividers.</td></tr>
<tr><td><code>{@link #ActionBar_elevation com.example.view:elevation}</code></td><td> Elevation for the action bar itself </td></tr>
<tr><td><code>{@link #ActionBar_height com.example.view:height}</code></td><td> Specifies a fixed height.</td></tr>
<tr><td><code>{@link #ActionBar_hideOnContentScroll com.example.view:hideOnContentScroll}</code></td><td> Set true to hide the action bar on a vertical nested scroll of content.</td></tr>
<tr><td><code>{@link #ActionBar_homeAsUpIndicator com.example.view:homeAsUpIndicator}</code></td><td> Up navigation glyph </td></tr>
<tr><td><code>{@link #ActionBar_homeLayout com.example.view:homeLayout}</code></td><td> Specifies a layout to use for the "home" section of the action bar.</td></tr>
<tr><td><code>{@link #ActionBar_icon com.example.view:icon}</code></td><td> Specifies the drawable used for the application icon.</td></tr>
<tr><td><code>{@link #ActionBar_indeterminateProgressStyle com.example.view:indeterminateProgressStyle}</code></td><td> Specifies a style resource to use for an indeterminate progress spinner.</td></tr>
<tr><td><code>{@link #ActionBar_itemPadding com.example.view:itemPadding}</code></td><td> Specifies padding that should be applied to the left and right sides of
system-provided items in the bar.</td></tr>
<tr><td><code>{@link #ActionBar_logo com.example.view:logo}</code></td><td> Specifies the drawable used for the application logo.</td></tr>
<tr><td><code>{@link #ActionBar_navigationMode com.example.view:navigationMode}</code></td><td> The type of navigation to use.</td></tr>
<tr><td><code>{@link #ActionBar_popupTheme com.example.view:popupTheme}</code></td><td> Reference to a theme that should be used to inflate popups
shown by widgets in the action bar.</td></tr>
<tr><td><code>{@link #ActionBar_progressBarPadding com.example.view:progressBarPadding}</code></td><td> Specifies the horizontal padding on either end for an embedded progress bar.</td></tr>
<tr><td><code>{@link #ActionBar_progressBarStyle com.example.view:progressBarStyle}</code></td><td> Specifies a style resource to use for an embedded progress bar.</td></tr>
<tr><td><code>{@link #ActionBar_subtitle com.example.view:subtitle}</code></td><td> Specifies subtitle text used for navigationMode="normal" </td></tr>
<tr><td><code>{@link #ActionBar_subtitleTextStyle com.example.view:subtitleTextStyle}</code></td><td> Specifies a style to use for subtitle text.</td></tr>
<tr><td><code>{@link #ActionBar_title com.example.view:title}</code></td><td> Specifies title text used for navigationMode="normal" </td></tr>
<tr><td><code>{@link #ActionBar_titleTextStyle com.example.view:titleTextStyle}</code></td><td> Specifies a style to use for title text.</td></tr>
</table>
@see #ActionBar_background
@see #ActionBar_backgroundSplit
@see #ActionBar_backgroundStacked
@see #ActionBar_contentInsetEnd
@see #ActionBar_contentInsetLeft
@see #ActionBar_contentInsetRight
@see #ActionBar_contentInsetStart
@see #ActionBar_customNavigationLayout
@see #ActionBar_displayOptions
@see #ActionBar_divider
@see #ActionBar_elevation
@see #ActionBar_height
@see #ActionBar_hideOnContentScroll
@see #ActionBar_homeAsUpIndicator
@see #ActionBar_homeLayout
@see #ActionBar_icon
@see #ActionBar_indeterminateProgressStyle
@see #ActionBar_itemPadding
@see #ActionBar_logo
@see #ActionBar_navigationMode
@see #ActionBar_popupTheme
@see #ActionBar_progressBarPadding
@see #ActionBar_progressBarStyle
@see #ActionBar_subtitle
@see #ActionBar_subtitleTextStyle
@see #ActionBar_title
@see #ActionBar_titleTextStyle
*/
public static final int[] ActionBar = {
0x7f010000, 0x7f010001, 0x7f01002c, 0x7f010055,
0x7f010056, 0x7f010057, 0x7f010058, 0x7f010059,
0x7f01005a, 0x7f01005b, 0x7f01005c, 0x7f01005d,
0x7f01005e, 0x7f01005f, 0x7f010060, 0x7f010061,
0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065,
0x7f010066, 0x7f010067, 0x7f010068, 0x7f010069,
0x7f01006a, 0x7f01006b, 0x7f01006c
};
/**
<p>
@attr description
Specifies a background drawable for the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:background
*/
public static final int ActionBar_background = 11;
/**
<p>
@attr description
Specifies a background drawable for the bottom component of a split action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.example.view:backgroundSplit
*/
public static final int ActionBar_backgroundSplit = 13;
/**
<p>
@attr description
Specifies a background drawable for a second stacked row of the action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.example.view:backgroundStacked
*/
public static final int ActionBar_backgroundStacked = 12;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetEnd
*/
public static final int ActionBar_contentInsetEnd = 22;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetLeft
*/
public static final int ActionBar_contentInsetLeft = 23;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetRight
*/
public static final int ActionBar_contentInsetRight = 24;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetStart
*/
public static final int ActionBar_contentInsetStart = 21;
/**
<p>
@attr description
Specifies a layout for custom navigation. Overrides navigationMode.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:customNavigationLayout
*/
public static final int ActionBar_customNavigationLayout = 14;
/**
<p>
@attr description
Options affecting how the action bar is displayed.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr>
<tr><td><code>showHome</code></td><td>0x2</td><td></td></tr>
<tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr>
<tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr>
<tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr>
<tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr>
</table>
<p>This is a private symbol.
@attr name com.example.view:displayOptions
*/
public static final int ActionBar_displayOptions = 4;
/**
<p>
@attr description
Specifies the drawable used for item dividers.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:divider
*/
public static final int ActionBar_divider = 10;
/**
<p>
@attr description
Elevation for the action bar itself
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:elevation
*/
public static final int ActionBar_elevation = 25;
/**
<p>
@attr description
Specifies a fixed height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:height
*/
public static final int ActionBar_height = 1;
/**
<p>
@attr description
Set true to hide the action bar on a vertical nested scroll of content.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:hideOnContentScroll
*/
public static final int ActionBar_hideOnContentScroll = 20;
/**
<p>
@attr description
Up navigation glyph
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:homeAsUpIndicator
*/
public static final int ActionBar_homeAsUpIndicator = 2;
/**
<p>
@attr description
Specifies a layout to use for the "home" section of the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:homeLayout
*/
public static final int ActionBar_homeLayout = 15;
/**
<p>
@attr description
Specifies the drawable used for the application icon.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:icon
*/
public static final int ActionBar_icon = 8;
/**
<p>
@attr description
Specifies a style resource to use for an indeterminate progress spinner.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:indeterminateProgressStyle
*/
public static final int ActionBar_indeterminateProgressStyle = 17;
/**
<p>
@attr description
Specifies padding that should be applied to the left and right sides of
system-provided items in the bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:itemPadding
*/
public static final int ActionBar_itemPadding = 19;
/**
<p>
@attr description
Specifies the drawable used for the application logo.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:logo
*/
public static final int ActionBar_logo = 9;
/**
<p>
@attr description
The type of navigation to use.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>normal</code></td><td>0</td><td> Normal static title text </td></tr>
<tr><td><code>listMode</code></td><td>1</td><td> The action bar will use a selection list for navigation. </td></tr>
<tr><td><code>tabMode</code></td><td>2</td><td> The action bar will use a series of horizontal tabs for navigation. </td></tr>
</table>
<p>This is a private symbol.
@attr name com.example.view:navigationMode
*/
public static final int ActionBar_navigationMode = 3;
/**
<p>
@attr description
Reference to a theme that should be used to inflate popups
shown by widgets in the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:popupTheme
*/
public static final int ActionBar_popupTheme = 26;
/**
<p>
@attr description
Specifies the horizontal padding on either end for an embedded progress bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:progressBarPadding
*/
public static final int ActionBar_progressBarPadding = 18;
/**
<p>
@attr description
Specifies a style resource to use for an embedded progress bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:progressBarStyle
*/
public static final int ActionBar_progressBarStyle = 16;
/**
<p>
@attr description
Specifies subtitle text used for navigationMode="normal"
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:subtitle
*/
public static final int ActionBar_subtitle = 5;
/**
<p>
@attr description
Specifies a style to use for subtitle text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:subtitleTextStyle
*/
public static final int ActionBar_subtitleTextStyle = 7;
/**
<p>
@attr description
Specifies title text used for navigationMode="normal"
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:title
*/
public static final int ActionBar_title = 0;
/**
<p>
@attr description
Specifies a style to use for title text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:titleTextStyle
*/
public static final int ActionBar_titleTextStyle = 6;
/** Valid LayoutParams for views placed in the action bar as custom views.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionBarLayout_android_layout_gravity android:layout_gravity}</code></td><td></td></tr>
</table>
@see #ActionBarLayout_android_layout_gravity
*/
public static final int[] ActionBarLayout = {
0x010100b3
};
/**
<p>This symbol is the offset where the {@link android.R.attr#layout_gravity}
attribute's value can be found in the {@link #ActionBarLayout} array.
@attr name android:layout_gravity
*/
public static final int ActionBarLayout_android_layout_gravity = 0;
/** Attributes that can be used with a ActionMenuItemView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionMenuItemView_android_minWidth android:minWidth}</code></td><td></td></tr>
</table>
@see #ActionMenuItemView_android_minWidth
*/
public static final int[] ActionMenuItemView = {
0x0101013f
};
/**
<p>This symbol is the offset where the {@link android.R.attr#minWidth}
attribute's value can be found in the {@link #ActionMenuItemView} array.
@attr name android:minWidth
*/
public static final int ActionMenuItemView_android_minWidth = 0;
/** Size of padding on either end of a divider.
*/
public static final int[] ActionMenuView = {
};
/** Attributes that can be used with a ActionMode.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionMode_background com.example.view:background}</code></td><td> Specifies a background for the action mode bar.</td></tr>
<tr><td><code>{@link #ActionMode_backgroundSplit com.example.view:backgroundSplit}</code></td><td> Specifies a background for the split action mode bar.</td></tr>
<tr><td><code>{@link #ActionMode_closeItemLayout com.example.view:closeItemLayout}</code></td><td> Specifies a layout to use for the "close" item at the starting edge.</td></tr>
<tr><td><code>{@link #ActionMode_height com.example.view:height}</code></td><td> Specifies a fixed height for the action mode bar.</td></tr>
<tr><td><code>{@link #ActionMode_subtitleTextStyle com.example.view:subtitleTextStyle}</code></td><td> Specifies a style to use for subtitle text.</td></tr>
<tr><td><code>{@link #ActionMode_titleTextStyle com.example.view:titleTextStyle}</code></td><td> Specifies a style to use for title text.</td></tr>
</table>
@see #ActionMode_background
@see #ActionMode_backgroundSplit
@see #ActionMode_closeItemLayout
@see #ActionMode_height
@see #ActionMode_subtitleTextStyle
@see #ActionMode_titleTextStyle
*/
public static final int[] ActionMode = {
0x7f010001, 0x7f010058, 0x7f010059, 0x7f01005d,
0x7f01005f, 0x7f01006d
};
/**
<p>
@attr description
Specifies a background for the action mode bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:background
*/
public static final int ActionMode_background = 3;
/**
<p>
@attr description
Specifies a background for the split action mode bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.example.view:backgroundSplit
*/
public static final int ActionMode_backgroundSplit = 4;
/**
<p>
@attr description
Specifies a layout to use for the "close" item at the starting edge.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:closeItemLayout
*/
public static final int ActionMode_closeItemLayout = 5;
/**
<p>
@attr description
Specifies a fixed height for the action mode bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:height
*/
public static final int ActionMode_height = 0;
/**
<p>
@attr description
Specifies a style to use for subtitle text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:subtitleTextStyle
*/
public static final int ActionMode_subtitleTextStyle = 2;
/**
<p>
@attr description
Specifies a style to use for title text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:titleTextStyle
*/
public static final int ActionMode_titleTextStyle = 1;
/** Attrbitutes for a ActivityChooserView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActivityChooserView_expandActivityOverflowButtonDrawable com.example.view:expandActivityOverflowButtonDrawable}</code></td><td> The drawable to show in the button for expanding the activities overflow popup.</td></tr>
<tr><td><code>{@link #ActivityChooserView_initialActivityCount com.example.view:initialActivityCount}</code></td><td> The maximal number of items initially shown in the activity list.</td></tr>
</table>
@see #ActivityChooserView_expandActivityOverflowButtonDrawable
@see #ActivityChooserView_initialActivityCount
*/
public static final int[] ActivityChooserView = {
0x7f010084, 0x7f010085
};
/**
<p>
@attr description
The drawable to show in the button for expanding the activities overflow popup.
<strong>Note:</strong> Clients would like to set this drawable
as a clue about the action the chosen activity will perform. For
example, if share activity is to be chosen the drawable should
give a clue that sharing is to be performed.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:expandActivityOverflowButtonDrawable
*/
public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1;
/**
<p>
@attr description
The maximal number of items initially shown in the activity list.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:initialActivityCount
*/
public static final int ActivityChooserView_initialActivityCount = 0;
/** Attributes that can be used with a CompatTextView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #CompatTextView_textAllCaps com.example.view:textAllCaps}</code></td><td> Present the text in ALL CAPS.</td></tr>
</table>
@see #CompatTextView_textAllCaps
*/
public static final int[] CompatTextView = {
0x7f010086
};
/**
<p>
@attr description
Present the text in ALL CAPS. This may use a small-caps form when available.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This is a private symbol.
@attr name com.example.view:textAllCaps
*/
public static final int CompatTextView_textAllCaps = 0;
/** Attributes that can be used with a DrawerArrowToggle.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #DrawerArrowToggle_barSize com.example.view:barSize}</code></td><td> The size of the bars when they are parallel to each other </td></tr>
<tr><td><code>{@link #DrawerArrowToggle_color com.example.view:color}</code></td><td> The drawing color for the bars </td></tr>
<tr><td><code>{@link #DrawerArrowToggle_drawableSize com.example.view:drawableSize}</code></td><td> The total size of the drawable </td></tr>
<tr><td><code>{@link #DrawerArrowToggle_gapBetweenBars com.example.view:gapBetweenBars}</code></td><td> The max gap between the bars when they are parallel to each other </td></tr>
<tr><td><code>{@link #DrawerArrowToggle_middleBarArrowSize com.example.view:middleBarArrowSize}</code></td><td> The size of the middle bar when top and bottom bars merge into middle bar to form an arrow </td></tr>
<tr><td><code>{@link #DrawerArrowToggle_spinBars com.example.view:spinBars}</code></td><td> Whether bars should rotate or not during transition </td></tr>
<tr><td><code>{@link #DrawerArrowToggle_thickness com.example.view:thickness}</code></td><td> The thickness (stroke size) for the bar paint </td></tr>
<tr><td><code>{@link #DrawerArrowToggle_topBottomBarArrowSize com.example.view:topBottomBarArrowSize}</code></td><td> The size of the top and bottom bars when they merge to the middle bar to form an arrow </td></tr>
</table>
@see #DrawerArrowToggle_barSize
@see #DrawerArrowToggle_color
@see #DrawerArrowToggle_drawableSize
@see #DrawerArrowToggle_gapBetweenBars
@see #DrawerArrowToggle_middleBarArrowSize
@see #DrawerArrowToggle_spinBars
@see #DrawerArrowToggle_thickness
@see #DrawerArrowToggle_topBottomBarArrowSize
*/
public static final int[] DrawerArrowToggle = {
0x7f010099, 0x7f01009a, 0x7f01009b, 0x7f01009c,
0x7f01009d, 0x7f01009e, 0x7f01009f, 0x7f0100a0
};
/**
<p>
@attr description
The size of the bars when they are parallel to each other
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:barSize
*/
public static final int DrawerArrowToggle_barSize = 6;
/**
<p>
@attr description
The drawing color for the bars
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:color
*/
public static final int DrawerArrowToggle_color = 0;
/**
<p>
@attr description
The total size of the drawable
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:drawableSize
*/
public static final int DrawerArrowToggle_drawableSize = 2;
/**
<p>
@attr description
The max gap between the bars when they are parallel to each other
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:gapBetweenBars
*/
public static final int DrawerArrowToggle_gapBetweenBars = 3;
/**
<p>
@attr description
The size of the middle bar when top and bottom bars merge into middle bar to form an arrow
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:middleBarArrowSize
*/
public static final int DrawerArrowToggle_middleBarArrowSize = 5;
/**
<p>
@attr description
Whether bars should rotate or not during transition
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:spinBars
*/
public static final int DrawerArrowToggle_spinBars = 1;
/**
<p>
@attr description
The thickness (stroke size) for the bar paint
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:thickness
*/
public static final int DrawerArrowToggle_thickness = 7;
/**
<p>
@attr description
The size of the top and bottom bars when they merge to the middle bar to form an arrow
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:topBottomBarArrowSize
*/
public static final int DrawerArrowToggle_topBottomBarArrowSize = 4;
/** Attributes that can be used with a LinearLayoutCompat.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #LinearLayoutCompat_android_baselineAligned android:baselineAligned}</code></td><td> When set to false, prevents the layout from aligning its children's
baselines.</td></tr>
<tr><td><code>{@link #LinearLayoutCompat_android_baselineAlignedChildIndex android:baselineAlignedChildIndex}</code></td><td> When a linear layout is part of another layout that is baseline
aligned, it can specify which of its children to baseline align to
(that is, which child TextView).</td></tr>
<tr><td><code>{@link #LinearLayoutCompat_android_gravity android:gravity}</code></td><td></td></tr>
<tr><td><code>{@link #LinearLayoutCompat_android_orientation android:orientation}</code></td><td> Should the layout be a column or a row? Use "horizontal"
for a row, "vertical" for a column.</td></tr>
<tr><td><code>{@link #LinearLayoutCompat_android_weightSum android:weightSum}</code></td><td> Defines the maximum weight sum.</td></tr>
<tr><td><code>{@link #LinearLayoutCompat_divider com.example.view:divider}</code></td><td> Drawable to use as a vertical divider between buttons.</td></tr>
<tr><td><code>{@link #LinearLayoutCompat_dividerPadding com.example.view:dividerPadding}</code></td><td> Size of padding on either end of a divider.</td></tr>
<tr><td><code>{@link #LinearLayoutCompat_measureWithLargestChild com.example.view:measureWithLargestChild}</code></td><td> When set to true, all children with a weight will be considered having
the minimum size of the largest child.</td></tr>
<tr><td><code>{@link #LinearLayoutCompat_showDividers com.example.view:showDividers}</code></td><td> Setting for which dividers to show.</td></tr>
</table>
@see #LinearLayoutCompat_android_baselineAligned
@see #LinearLayoutCompat_android_baselineAlignedChildIndex
@see #LinearLayoutCompat_android_gravity
@see #LinearLayoutCompat_android_orientation
@see #LinearLayoutCompat_android_weightSum
@see #LinearLayoutCompat_divider
@see #LinearLayoutCompat_dividerPadding
@see #LinearLayoutCompat_measureWithLargestChild
@see #LinearLayoutCompat_showDividers
*/
public static final int[] LinearLayoutCompat = {
0x010100af, 0x010100c4, 0x01010126, 0x01010127,
0x01010128, 0x7f01005c, 0x7f010087, 0x7f010088,
0x7f010089
};
/**
<p>
@attr description
When set to false, prevents the layout from aligning its children's
baselines. This attribute is particularly useful when the children
use different values for gravity. The default value is true.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#baselineAligned}.
@attr name android:baselineAligned
*/
public static final int LinearLayoutCompat_android_baselineAligned = 2;
/**
<p>
@attr description
When a linear layout is part of another layout that is baseline
aligned, it can specify which of its children to baseline align to
(that is, which child TextView).
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#baselineAlignedChildIndex}.
@attr name android:baselineAlignedChildIndex
*/
public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3;
/**
<p>This symbol is the offset where the {@link android.R.attr#gravity}
attribute's value can be found in the {@link #LinearLayoutCompat} array.
@attr name android:gravity
*/
public static final int LinearLayoutCompat_android_gravity = 0;
/**
<p>
@attr description
Should the layout be a column or a row? Use "horizontal"
for a row, "vertical" for a column. The default is
horizontal.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#orientation}.
@attr name android:orientation
*/
public static final int LinearLayoutCompat_android_orientation = 1;
/**
<p>
@attr description
Defines the maximum weight sum. If unspecified, the sum is computed
by adding the layout_weight of all of the children. This can be
used for instance to give a single child 50% of the total available
space by giving it a layout_weight of 0.5 and setting the weightSum
to 1.0.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#weightSum}.
@attr name android:weightSum
*/
public static final int LinearLayoutCompat_android_weightSum = 4;
/**
<p>
@attr description
Drawable to use as a vertical divider between buttons.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:divider
*/
public static final int LinearLayoutCompat_divider = 5;
/**
<p>
@attr description
Size of padding on either end of a divider.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:dividerPadding
*/
public static final int LinearLayoutCompat_dividerPadding = 8;
/**
<p>
@attr description
When set to true, all children with a weight will be considered having
the minimum size of the largest child. If false, all children are
measured normally.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:measureWithLargestChild
*/
public static final int LinearLayoutCompat_measureWithLargestChild = 6;
/**
<p>
@attr description
Setting for which dividers to show.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>beginning</code></td><td>1</td><td></td></tr>
<tr><td><code>middle</code></td><td>2</td><td></td></tr>
<tr><td><code>end</code></td><td>4</td><td></td></tr>
</table>
<p>This is a private symbol.
@attr name com.example.view:showDividers
*/
public static final int LinearLayoutCompat_showDividers = 7;
/** Attributes that can be used with a LinearLayoutCompat_Layout.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #LinearLayoutCompat_Layout_android_layout_gravity android:layout_gravity}</code></td><td></td></tr>
<tr><td><code>{@link #LinearLayoutCompat_Layout_android_layout_height android:layout_height}</code></td><td></td></tr>
<tr><td><code>{@link #LinearLayoutCompat_Layout_android_layout_weight android:layout_weight}</code></td><td></td></tr>
<tr><td><code>{@link #LinearLayoutCompat_Layout_android_layout_width android:layout_width}</code></td><td></td></tr>
</table>
@see #LinearLayoutCompat_Layout_android_layout_gravity
@see #LinearLayoutCompat_Layout_android_layout_height
@see #LinearLayoutCompat_Layout_android_layout_weight
@see #LinearLayoutCompat_Layout_android_layout_width
*/
public static final int[] LinearLayoutCompat_Layout = {
0x010100b3, 0x010100f4, 0x010100f5, 0x01010181
};
/**
<p>This symbol is the offset where the {@link android.R.attr#layout_gravity}
attribute's value can be found in the {@link #LinearLayoutCompat_Layout} array.
@attr name android:layout_gravity
*/
public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0;
/**
<p>This symbol is the offset where the {@link android.R.attr#layout_height}
attribute's value can be found in the {@link #LinearLayoutCompat_Layout} array.
@attr name android:layout_height
*/
public static final int LinearLayoutCompat_Layout_android_layout_height = 2;
/**
<p>This symbol is the offset where the {@link android.R.attr#layout_weight}
attribute's value can be found in the {@link #LinearLayoutCompat_Layout} array.
@attr name android:layout_weight
*/
public static final int LinearLayoutCompat_Layout_android_layout_weight = 3;
/**
<p>This symbol is the offset where the {@link android.R.attr#layout_width}
attribute's value can be found in the {@link #LinearLayoutCompat_Layout} array.
@attr name android:layout_width
*/
public static final int LinearLayoutCompat_Layout_android_layout_width = 1;
/** Attributes that can be used with a ListPopupWindow.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ListPopupWindow_android_dropDownHorizontalOffset android:dropDownHorizontalOffset}</code></td><td> Amount of pixels by which the drop down should be offset horizontally.</td></tr>
<tr><td><code>{@link #ListPopupWindow_android_dropDownVerticalOffset android:dropDownVerticalOffset}</code></td><td> Amount of pixels by which the drop down should be offset vertically.</td></tr>
</table>
@see #ListPopupWindow_android_dropDownHorizontalOffset
@see #ListPopupWindow_android_dropDownVerticalOffset
*/
public static final int[] ListPopupWindow = {
0x010102ac, 0x010102ad
};
/**
<p>
@attr description
Amount of pixels by which the drop down should be offset horizontally.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownHorizontalOffset}.
@attr name android:dropDownHorizontalOffset
*/
public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0;
/**
<p>
@attr description
Amount of pixels by which the drop down should be offset vertically.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownVerticalOffset}.
@attr name android:dropDownVerticalOffset
*/
public static final int ListPopupWindow_android_dropDownVerticalOffset = 1;
/** Base attributes that are available to all groups.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #MenuGroup_android_checkableBehavior android:checkableBehavior}</code></td><td> Whether the items are capable of displaying a check mark.</td></tr>
<tr><td><code>{@link #MenuGroup_android_enabled android:enabled}</code></td><td> Whether the items are enabled.</td></tr>
<tr><td><code>{@link #MenuGroup_android_id android:id}</code></td><td> The ID of the group.</td></tr>
<tr><td><code>{@link #MenuGroup_android_menuCategory android:menuCategory}</code></td><td> The category applied to all items within this group.</td></tr>
<tr><td><code>{@link #MenuGroup_android_orderInCategory android:orderInCategory}</code></td><td> The order within the category applied to all items within this group.</td></tr>
<tr><td><code>{@link #MenuGroup_android_visible android:visible}</code></td><td> Whether the items are shown/visible.</td></tr>
</table>
@see #MenuGroup_android_checkableBehavior
@see #MenuGroup_android_enabled
@see #MenuGroup_android_id
@see #MenuGroup_android_menuCategory
@see #MenuGroup_android_orderInCategory
@see #MenuGroup_android_visible
*/
public static final int[] MenuGroup = {
0x0101000e, 0x010100d0, 0x01010194, 0x010101de,
0x010101df, 0x010101e0
};
/**
<p>
@attr description
Whether the items are capable of displaying a check mark.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#checkableBehavior}.
@attr name android:checkableBehavior
*/
public static final int MenuGroup_android_checkableBehavior = 5;
/**
<p>
@attr description
Whether the items are enabled.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#enabled}.
@attr name android:enabled
*/
public static final int MenuGroup_android_enabled = 0;
/**
<p>
@attr description
The ID of the group.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#id}.
@attr name android:id
*/
public static final int MenuGroup_android_id = 1;
/**
<p>
@attr description
The category applied to all items within this group.
(This will be or'ed with the orderInCategory attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#menuCategory}.
@attr name android:menuCategory
*/
public static final int MenuGroup_android_menuCategory = 3;
/**
<p>
@attr description
The order within the category applied to all items within this group.
(This will be or'ed with the category attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#orderInCategory}.
@attr name android:orderInCategory
*/
public static final int MenuGroup_android_orderInCategory = 4;
/**
<p>
@attr description
Whether the items are shown/visible.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#visible}.
@attr name android:visible
*/
public static final int MenuGroup_android_visible = 2;
/** Base attributes that are available to all Item objects.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #MenuItem_actionLayout com.example.view:actionLayout}</code></td><td> An optional layout to be used as an action view.</td></tr>
<tr><td><code>{@link #MenuItem_actionProviderClass com.example.view:actionProviderClass}</code></td><td> The name of an optional ActionProvider class to instantiate an action view
and perform operations such as default action for that menu item.</td></tr>
<tr><td><code>{@link #MenuItem_actionViewClass com.example.view:actionViewClass}</code></td><td> The name of an optional View class to instantiate and use as an
action view.</td></tr>
<tr><td><code>{@link #MenuItem_android_alphabeticShortcut android:alphabeticShortcut}</code></td><td> The alphabetic shortcut key.</td></tr>
<tr><td><code>{@link #MenuItem_android_checkable android:checkable}</code></td><td> Whether the item is capable of displaying a check mark.</td></tr>
<tr><td><code>{@link #MenuItem_android_checked android:checked}</code></td><td> Whether the item is checked.</td></tr>
<tr><td><code>{@link #MenuItem_android_enabled android:enabled}</code></td><td> Whether the item is enabled.</td></tr>
<tr><td><code>{@link #MenuItem_android_icon android:icon}</code></td><td> The icon associated with this item.</td></tr>
<tr><td><code>{@link #MenuItem_android_id android:id}</code></td><td> The ID of the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_menuCategory android:menuCategory}</code></td><td> The category applied to the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_numericShortcut android:numericShortcut}</code></td><td> The numeric shortcut key.</td></tr>
<tr><td><code>{@link #MenuItem_android_onClick android:onClick}</code></td><td> Name of a method on the Context used to inflate the menu that will be
called when the item is clicked.</td></tr>
<tr><td><code>{@link #MenuItem_android_orderInCategory android:orderInCategory}</code></td><td> The order within the category applied to the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_title android:title}</code></td><td> The title associated with the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_titleCondensed android:titleCondensed}</code></td><td> The condensed title associated with the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_visible android:visible}</code></td><td> Whether the item is shown/visible.</td></tr>
<tr><td><code>{@link #MenuItem_showAsAction com.example.view:showAsAction}</code></td><td> How this item should display in the Action Bar, if present.</td></tr>
</table>
@see #MenuItem_actionLayout
@see #MenuItem_actionProviderClass
@see #MenuItem_actionViewClass
@see #MenuItem_android_alphabeticShortcut
@see #MenuItem_android_checkable
@see #MenuItem_android_checked
@see #MenuItem_android_enabled
@see #MenuItem_android_icon
@see #MenuItem_android_id
@see #MenuItem_android_menuCategory
@see #MenuItem_android_numericShortcut
@see #MenuItem_android_onClick
@see #MenuItem_android_orderInCategory
@see #MenuItem_android_title
@see #MenuItem_android_titleCondensed
@see #MenuItem_android_visible
@see #MenuItem_showAsAction
*/
public static final int[] MenuItem = {
0x01010002, 0x0101000e, 0x010100d0, 0x01010106,
0x01010194, 0x010101de, 0x010101df, 0x010101e1,
0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5,
0x0101026f, 0x7f010071, 0x7f010072, 0x7f010073,
0x7f010074
};
/**
<p>
@attr description
An optional layout to be used as an action view.
See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionLayout
*/
public static final int MenuItem_actionLayout = 14;
/**
<p>
@attr description
The name of an optional ActionProvider class to instantiate an action view
and perform operations such as default action for that menu item.
See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:actionProviderClass
*/
public static final int MenuItem_actionProviderClass = 16;
/**
<p>
@attr description
The name of an optional View class to instantiate and use as an
action view. See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:actionViewClass
*/
public static final int MenuItem_actionViewClass = 15;
/**
<p>
@attr description
The alphabetic shortcut key. This is the shortcut when using a keyboard
with alphabetic keys.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#alphabeticShortcut}.
@attr name android:alphabeticShortcut
*/
public static final int MenuItem_android_alphabeticShortcut = 9;
/**
<p>
@attr description
Whether the item is capable of displaying a check mark.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#checkable}.
@attr name android:checkable
*/
public static final int MenuItem_android_checkable = 11;
/**
<p>
@attr description
Whether the item is checked. Note that you must first have enabled checking with
the checkable attribute or else the check mark will not appear.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#checked}.
@attr name android:checked
*/
public static final int MenuItem_android_checked = 3;
/**
<p>
@attr description
Whether the item is enabled.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#enabled}.
@attr name android:enabled
*/
public static final int MenuItem_android_enabled = 1;
/**
<p>
@attr description
The icon associated with this item. This icon will not always be shown, so
the title should be sufficient in describing this item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#icon}.
@attr name android:icon
*/
public static final int MenuItem_android_icon = 0;
/**
<p>
@attr description
The ID of the item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#id}.
@attr name android:id
*/
public static final int MenuItem_android_id = 2;
/**
<p>
@attr description
The category applied to the item.
(This will be or'ed with the orderInCategory attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#menuCategory}.
@attr name android:menuCategory
*/
public static final int MenuItem_android_menuCategory = 5;
/**
<p>
@attr description
The numeric shortcut key. This is the shortcut when using a numeric (e.g., 12-key)
keyboard.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#numericShortcut}.
@attr name android:numericShortcut
*/
public static final int MenuItem_android_numericShortcut = 10;
/**
<p>
@attr description
Name of a method on the Context used to inflate the menu that will be
called when the item is clicked.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#onClick}.
@attr name android:onClick
*/
public static final int MenuItem_android_onClick = 12;
/**
<p>
@attr description
The order within the category applied to the item.
(This will be or'ed with the category attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#orderInCategory}.
@attr name android:orderInCategory
*/
public static final int MenuItem_android_orderInCategory = 6;
/**
<p>
@attr description
The title associated with the item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#title}.
@attr name android:title
*/
public static final int MenuItem_android_title = 7;
/**
<p>
@attr description
The condensed title associated with the item. This is used in situations where the
normal title may be too long to be displayed.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#titleCondensed}.
@attr name android:titleCondensed
*/
public static final int MenuItem_android_titleCondensed = 8;
/**
<p>
@attr description
Whether the item is shown/visible.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#visible}.
@attr name android:visible
*/
public static final int MenuItem_android_visible = 4;
/**
<p>
@attr description
How this item should display in the Action Bar, if present.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>never</code></td><td>0</td><td> Never show this item in an action bar, show it in the overflow menu instead.
Mutually exclusive with "ifRoom" and "always". </td></tr>
<tr><td><code>ifRoom</code></td><td>1</td><td> Show this item in an action bar if there is room for it as determined
by the system. Favor this option over "always" where possible.
Mutually exclusive with "never" and "always". </td></tr>
<tr><td><code>always</code></td><td>2</td><td> Always show this item in an actionbar, even if it would override
the system's limits of how much stuff to put there. This may make
your action bar look bad on some screens. In most cases you should
use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never". </td></tr>
<tr><td><code>withText</code></td><td>4</td><td> When this item is shown as an action in the action bar, show a text
label with it even if it has an icon representation. </td></tr>
<tr><td><code>collapseActionView</code></td><td>8</td><td> This item's action view collapses to a normal menu
item. When expanded, the action view takes over a
larger segment of its container. </td></tr>
</table>
<p>This is a private symbol.
@attr name com.example.view:showAsAction
*/
public static final int MenuItem_showAsAction = 13;
/** Attributes that can be used with a MenuView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #MenuView_android_headerBackground android:headerBackground}</code></td><td> Default background for the menu header.</td></tr>
<tr><td><code>{@link #MenuView_android_horizontalDivider android:horizontalDivider}</code></td><td> Default horizontal divider between rows of menu items.</td></tr>
<tr><td><code>{@link #MenuView_android_itemBackground android:itemBackground}</code></td><td> Default background for each menu item.</td></tr>
<tr><td><code>{@link #MenuView_android_itemIconDisabledAlpha android:itemIconDisabledAlpha}</code></td><td> Default disabled icon alpha for each menu item that shows an icon.</td></tr>
<tr><td><code>{@link #MenuView_android_itemTextAppearance android:itemTextAppearance}</code></td><td> Default appearance of menu item text.</td></tr>
<tr><td><code>{@link #MenuView_android_verticalDivider android:verticalDivider}</code></td><td> Default vertical divider between menu items.</td></tr>
<tr><td><code>{@link #MenuView_android_windowAnimationStyle android:windowAnimationStyle}</code></td><td> Default animations for the menu.</td></tr>
<tr><td><code>{@link #MenuView_preserveIconSpacing com.example.view:preserveIconSpacing}</code></td><td> Whether space should be reserved in layout when an icon is missing.</td></tr>
</table>
@see #MenuView_android_headerBackground
@see #MenuView_android_horizontalDivider
@see #MenuView_android_itemBackground
@see #MenuView_android_itemIconDisabledAlpha
@see #MenuView_android_itemTextAppearance
@see #MenuView_android_verticalDivider
@see #MenuView_android_windowAnimationStyle
@see #MenuView_preserveIconSpacing
*/
public static final int[] MenuView = {
0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e,
0x0101012f, 0x01010130, 0x01010131, 0x7f010070
};
/**
<p>
@attr description
Default background for the menu header.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#headerBackground}.
@attr name android:headerBackground
*/
public static final int MenuView_android_headerBackground = 4;
/**
<p>
@attr description
Default horizontal divider between rows of menu items.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#horizontalDivider}.
@attr name android:horizontalDivider
*/
public static final int MenuView_android_horizontalDivider = 2;
/**
<p>
@attr description
Default background for each menu item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#itemBackground}.
@attr name android:itemBackground
*/
public static final int MenuView_android_itemBackground = 5;
/**
<p>
@attr description
Default disabled icon alpha for each menu item that shows an icon.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#itemIconDisabledAlpha}.
@attr name android:itemIconDisabledAlpha
*/
public static final int MenuView_android_itemIconDisabledAlpha = 6;
/**
<p>
@attr description
Default appearance of menu item text.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#itemTextAppearance}.
@attr name android:itemTextAppearance
*/
public static final int MenuView_android_itemTextAppearance = 1;
/**
<p>
@attr description
Default vertical divider between menu items.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#verticalDivider}.
@attr name android:verticalDivider
*/
public static final int MenuView_android_verticalDivider = 3;
/**
<p>
@attr description
Default animations for the menu.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#windowAnimationStyle}.
@attr name android:windowAnimationStyle
*/
public static final int MenuView_android_windowAnimationStyle = 0;
/**
<p>
@attr description
Whether space should be reserved in layout when an icon is missing.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:preserveIconSpacing
*/
public static final int MenuView_preserveIconSpacing = 7;
/** Attributes that can be used with a PopupWindow.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #PopupWindow_android_popupBackground android:popupBackground}</code></td><td></td></tr>
<tr><td><code>{@link #PopupWindow_overlapAnchor com.example.view:overlapAnchor}</code></td><td> Whether the popup window should overlap its anchor view.</td></tr>
</table>
@see #PopupWindow_android_popupBackground
@see #PopupWindow_overlapAnchor
*/
public static final int[] PopupWindow = {
0x01010176, 0x7f010098
};
/**
<p>This symbol is the offset where the {@link android.R.attr#popupBackground}
attribute's value can be found in the {@link #PopupWindow} array.
@attr name android:popupBackground
*/
public static final int PopupWindow_android_popupBackground = 0;
/**
<p>
@attr description
Whether the popup window should overlap its anchor view.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:overlapAnchor
*/
public static final int PopupWindow_overlapAnchor = 1;
/** Attributes that can be used with a PopupWindowBackgroundState.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #PopupWindowBackgroundState_state_above_anchor com.example.view:state_above_anchor}</code></td><td> State identifier indicating the popup will be above the anchor.</td></tr>
</table>
@see #PopupWindowBackgroundState_state_above_anchor
*/
public static final int[] PopupWindowBackgroundState = {
0x7f010097
};
/**
<p>
@attr description
State identifier indicating the popup will be above the anchor.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:state_above_anchor
*/
public static final int PopupWindowBackgroundState_state_above_anchor = 0;
/** Attributes that can be used with a SearchView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #SearchView_android_focusable android:focusable}</code></td><td></td></tr>
<tr><td><code>{@link #SearchView_android_imeOptions android:imeOptions}</code></td><td> The IME options to set on the query text field.</td></tr>
<tr><td><code>{@link #SearchView_android_inputType android:inputType}</code></td><td> The input type to set on the query text field.</td></tr>
<tr><td><code>{@link #SearchView_android_maxWidth android:maxWidth}</code></td><td> An optional maximum width of the SearchView.</td></tr>
<tr><td><code>{@link #SearchView_closeIcon com.example.view:closeIcon}</code></td><td> Close button icon </td></tr>
<tr><td><code>{@link #SearchView_commitIcon com.example.view:commitIcon}</code></td><td> Commit icon shown in the query suggestion row </td></tr>
<tr><td><code>{@link #SearchView_goIcon com.example.view:goIcon}</code></td><td> Go button icon </td></tr>
<tr><td><code>{@link #SearchView_iconifiedByDefault com.example.view:iconifiedByDefault}</code></td><td> The default state of the SearchView.</td></tr>
<tr><td><code>{@link #SearchView_layout com.example.view:layout}</code></td><td> The layout to use for the search view.</td></tr>
<tr><td><code>{@link #SearchView_queryBackground com.example.view:queryBackground}</code></td><td> Background for the section containing the search query </td></tr>
<tr><td><code>{@link #SearchView_queryHint com.example.view:queryHint}</code></td><td> An optional query hint string to be displayed in the empty query field.</td></tr>
<tr><td><code>{@link #SearchView_searchIcon com.example.view:searchIcon}</code></td><td> Search icon </td></tr>
<tr><td><code>{@link #SearchView_submitBackground com.example.view:submitBackground}</code></td><td> Background for the section containing the action (e.</td></tr>
<tr><td><code>{@link #SearchView_suggestionRowLayout com.example.view:suggestionRowLayout}</code></td><td> Layout for query suggestion rows </td></tr>
<tr><td><code>{@link #SearchView_voiceIcon com.example.view:voiceIcon}</code></td><td> Voice button icon </td></tr>
</table>
@see #SearchView_android_focusable
@see #SearchView_android_imeOptions
@see #SearchView_android_inputType
@see #SearchView_android_maxWidth
@see #SearchView_closeIcon
@see #SearchView_commitIcon
@see #SearchView_goIcon
@see #SearchView_iconifiedByDefault
@see #SearchView_layout
@see #SearchView_queryBackground
@see #SearchView_queryHint
@see #SearchView_searchIcon
@see #SearchView_submitBackground
@see #SearchView_suggestionRowLayout
@see #SearchView_voiceIcon
*/
public static final int[] SearchView = {
0x010100da, 0x0101011f, 0x01010220, 0x01010264,
0x7f010079, 0x7f01007a, 0x7f01007b, 0x7f01007c,
0x7f01007d, 0x7f01007e, 0x7f01007f, 0x7f010080,
0x7f010081, 0x7f010082, 0x7f010083
};
/**
<p>This symbol is the offset where the {@link android.R.attr#focusable}
attribute's value can be found in the {@link #SearchView} array.
@attr name android:focusable
*/
public static final int SearchView_android_focusable = 0;
/**
<p>
@attr description
The IME options to set on the query text field.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#imeOptions}.
@attr name android:imeOptions
*/
public static final int SearchView_android_imeOptions = 3;
/**
<p>
@attr description
The input type to set on the query text field.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#inputType}.
@attr name android:inputType
*/
public static final int SearchView_android_inputType = 2;
/**
<p>
@attr description
An optional maximum width of the SearchView.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#maxWidth}.
@attr name android:maxWidth
*/
public static final int SearchView_android_maxWidth = 1;
/**
<p>
@attr description
Close button icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:closeIcon
*/
public static final int SearchView_closeIcon = 7;
/**
<p>
@attr description
Commit icon shown in the query suggestion row
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:commitIcon
*/
public static final int SearchView_commitIcon = 11;
/**
<p>
@attr description
Go button icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:goIcon
*/
public static final int SearchView_goIcon = 8;
/**
<p>
@attr description
The default state of the SearchView. If true, it will be iconified when not in
use and expanded when clicked.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:iconifiedByDefault
*/
public static final int SearchView_iconifiedByDefault = 5;
/**
<p>
@attr description
The layout to use for the search view.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:layout
*/
public static final int SearchView_layout = 4;
/**
<p>
@attr description
Background for the section containing the search query
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:queryBackground
*/
public static final int SearchView_queryBackground = 13;
/**
<p>
@attr description
An optional query hint string to be displayed in the empty query field.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:queryHint
*/
public static final int SearchView_queryHint = 6;
/**
<p>
@attr description
Search icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:searchIcon
*/
public static final int SearchView_searchIcon = 9;
/**
<p>
@attr description
Background for the section containing the action (e.g. voice search)
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:submitBackground
*/
public static final int SearchView_submitBackground = 14;
/**
<p>
@attr description
Layout for query suggestion rows
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:suggestionRowLayout
*/
public static final int SearchView_suggestionRowLayout = 12;
/**
<p>
@attr description
Voice button icon
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:voiceIcon
*/
public static final int SearchView_voiceIcon = 10;
/** Attributes that can be used with a Spinner.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #Spinner_android_background android:background}</code></td><td></td></tr>
<tr><td><code>{@link #Spinner_android_dropDownHorizontalOffset android:dropDownHorizontalOffset}</code></td><td> Horizontal offset from the spinner widget for positioning the dropdown
in spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_android_dropDownSelector android:dropDownSelector}</code></td><td> List selector to use for spinnerMode="dropdown" display.</td></tr>
<tr><td><code>{@link #Spinner_android_dropDownVerticalOffset android:dropDownVerticalOffset}</code></td><td> Vertical offset from the spinner widget for positioning the dropdown in
spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_android_dropDownWidth android:dropDownWidth}</code></td><td> Width of the dropdown in spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_android_gravity android:gravity}</code></td><td> Gravity setting for positioning the currently selected item.</td></tr>
<tr><td><code>{@link #Spinner_android_popupBackground android:popupBackground}</code></td><td> Background drawable to use for the dropdown in spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_disableChildrenWhenDisabled com.example.view:disableChildrenWhenDisabled}</code></td><td> Whether this spinner should mark child views as enabled/disabled when
the spinner itself is enabled/disabled.</td></tr>
<tr><td><code>{@link #Spinner_popupPromptView com.example.view:popupPromptView}</code></td><td> Reference to a layout to use for displaying a prompt in the dropdown for
spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_prompt com.example.view:prompt}</code></td><td> The prompt to display when the spinner's dialog is shown.</td></tr>
<tr><td><code>{@link #Spinner_spinnerMode com.example.view:spinnerMode}</code></td><td> Display mode for spinner options.</td></tr>
</table>
@see #Spinner_android_background
@see #Spinner_android_dropDownHorizontalOffset
@see #Spinner_android_dropDownSelector
@see #Spinner_android_dropDownVerticalOffset
@see #Spinner_android_dropDownWidth
@see #Spinner_android_gravity
@see #Spinner_android_popupBackground
@see #Spinner_disableChildrenWhenDisabled
@see #Spinner_popupPromptView
@see #Spinner_prompt
@see #Spinner_spinnerMode
*/
public static final int[] Spinner = {
0x010100af, 0x010100d4, 0x01010175, 0x01010176,
0x01010262, 0x010102ac, 0x010102ad, 0x7f010075,
0x7f010076, 0x7f010077, 0x7f010078
};
/**
<p>This symbol is the offset where the {@link android.R.attr#background}
attribute's value can be found in the {@link #Spinner} array.
@attr name android:background
*/
public static final int Spinner_android_background = 1;
/**
<p>
@attr description
Horizontal offset from the spinner widget for positioning the dropdown
in spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownHorizontalOffset}.
@attr name android:dropDownHorizontalOffset
*/
public static final int Spinner_android_dropDownHorizontalOffset = 5;
/**
<p>
@attr description
List selector to use for spinnerMode="dropdown" display.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownSelector}.
@attr name android:dropDownSelector
*/
public static final int Spinner_android_dropDownSelector = 2;
/**
<p>
@attr description
Vertical offset from the spinner widget for positioning the dropdown in
spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownVerticalOffset}.
@attr name android:dropDownVerticalOffset
*/
public static final int Spinner_android_dropDownVerticalOffset = 6;
/**
<p>
@attr description
Width of the dropdown in spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownWidth}.
@attr name android:dropDownWidth
*/
public static final int Spinner_android_dropDownWidth = 4;
/**
<p>
@attr description
Gravity setting for positioning the currently selected item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#gravity}.
@attr name android:gravity
*/
public static final int Spinner_android_gravity = 0;
/**
<p>
@attr description
Background drawable to use for the dropdown in spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#popupBackground}.
@attr name android:popupBackground
*/
public static final int Spinner_android_popupBackground = 3;
/**
<p>
@attr description
Whether this spinner should mark child views as enabled/disabled when
the spinner itself is enabled/disabled.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:disableChildrenWhenDisabled
*/
public static final int Spinner_disableChildrenWhenDisabled = 10;
/**
<p>
@attr description
Reference to a layout to use for displaying a prompt in the dropdown for
spinnerMode="dropdown". This layout must contain a TextView with the id
{@code @android:id/text1} to be populated with the prompt text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:popupPromptView
*/
public static final int Spinner_popupPromptView = 9;
/**
<p>
@attr description
The prompt to display when the spinner's dialog is shown.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:prompt
*/
public static final int Spinner_prompt = 7;
/**
<p>
@attr description
Display mode for spinner options.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>dialog</code></td><td>0</td><td> Spinner options will be presented to the user as a dialog window. </td></tr>
<tr><td><code>dropdown</code></td><td>1</td><td> Spinner options will be presented to the user as an inline dropdown
anchored to the spinner widget itself. </td></tr>
</table>
<p>This is a private symbol.
@attr name com.example.view:spinnerMode
*/
public static final int Spinner_spinnerMode = 8;
/** Attributes that can be used with a SwitchCompat.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #SwitchCompat_android_textOff android:textOff}</code></td><td> Text to use when the switch is in the unchecked/"off" state.</td></tr>
<tr><td><code>{@link #SwitchCompat_android_textOn android:textOn}</code></td><td> Text to use when the switch is in the checked/"on" state.</td></tr>
<tr><td><code>{@link #SwitchCompat_android_thumb android:thumb}</code></td><td> Drawable to use as the "thumb" that switches back and forth.</td></tr>
<tr><td><code>{@link #SwitchCompat_showText com.example.view:showText}</code></td><td> Whether to draw on/off text.</td></tr>
<tr><td><code>{@link #SwitchCompat_splitTrack com.example.view:splitTrack}</code></td><td> Whether to split the track and leave a gap for the thumb drawable.</td></tr>
<tr><td><code>{@link #SwitchCompat_switchMinWidth com.example.view:switchMinWidth}</code></td><td> Minimum width for the switch component </td></tr>
<tr><td><code>{@link #SwitchCompat_switchPadding com.example.view:switchPadding}</code></td><td> Minimum space between the switch and caption text </td></tr>
<tr><td><code>{@link #SwitchCompat_switchTextAppearance com.example.view:switchTextAppearance}</code></td><td> TextAppearance style for text displayed on the switch thumb.</td></tr>
<tr><td><code>{@link #SwitchCompat_thumbTextPadding com.example.view:thumbTextPadding}</code></td><td> Amount of padding on either side of text within the switch thumb.</td></tr>
<tr><td><code>{@link #SwitchCompat_track com.example.view:track}</code></td><td> Drawable to use as the "track" that the switch thumb slides within.</td></tr>
</table>
@see #SwitchCompat_android_textOff
@see #SwitchCompat_android_textOn
@see #SwitchCompat_android_thumb
@see #SwitchCompat_showText
@see #SwitchCompat_splitTrack
@see #SwitchCompat_switchMinWidth
@see #SwitchCompat_switchPadding
@see #SwitchCompat_switchTextAppearance
@see #SwitchCompat_thumbTextPadding
@see #SwitchCompat_track
*/
public static final int[] SwitchCompat = {
0x01010124, 0x01010125, 0x01010142, 0x7f0100a2,
0x7f0100a3, 0x7f0100a4, 0x7f0100a5, 0x7f0100a6,
0x7f0100a7, 0x7f0100a8
};
/**
<p>
@attr description
Text to use when the switch is in the unchecked/"off" state.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#textOff}.
@attr name android:textOff
*/
public static final int SwitchCompat_android_textOff = 1;
/**
<p>
@attr description
Text to use when the switch is in the checked/"on" state.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#textOn}.
@attr name android:textOn
*/
public static final int SwitchCompat_android_textOn = 0;
/**
<p>
@attr description
Drawable to use as the "thumb" that switches back and forth.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#thumb}.
@attr name android:thumb
*/
public static final int SwitchCompat_android_thumb = 2;
/**
<p>
@attr description
Whether to draw on/off text.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:showText
*/
public static final int SwitchCompat_showText = 9;
/**
<p>
@attr description
Whether to split the track and leave a gap for the thumb drawable.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:splitTrack
*/
public static final int SwitchCompat_splitTrack = 8;
/**
<p>
@attr description
Minimum width for the switch component
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:switchMinWidth
*/
public static final int SwitchCompat_switchMinWidth = 6;
/**
<p>
@attr description
Minimum space between the switch and caption text
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:switchPadding
*/
public static final int SwitchCompat_switchPadding = 7;
/**
<p>
@attr description
TextAppearance style for text displayed on the switch thumb.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:switchTextAppearance
*/
public static final int SwitchCompat_switchTextAppearance = 5;
/**
<p>
@attr description
Amount of padding on either side of text within the switch thumb.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:thumbTextPadding
*/
public static final int SwitchCompat_thumbTextPadding = 4;
/**
<p>
@attr description
Drawable to use as the "track" that the switch thumb slides within.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:track
*/
public static final int SwitchCompat_track = 3;
/** These are the standard attributes that make up a complete theme.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #Theme_actionBarDivider com.example.view:actionBarDivider}</code></td><td> Custom divider drawable to use for elements in the action bar.</td></tr>
<tr><td><code>{@link #Theme_actionBarItemBackground com.example.view:actionBarItemBackground}</code></td><td> Custom item state list drawable background for action bar items.</td></tr>
<tr><td><code>{@link #Theme_actionBarPopupTheme com.example.view:actionBarPopupTheme}</code></td><td> Reference to a theme that should be used to inflate popups
shown by widgets in the action bar.</td></tr>
<tr><td><code>{@link #Theme_actionBarSize com.example.view:actionBarSize}</code></td><td> Size of the Action Bar, including the contextual
bar used to present Action Modes.</td></tr>
<tr><td><code>{@link #Theme_actionBarSplitStyle com.example.view:actionBarSplitStyle}</code></td><td> Reference to a style for the split Action Bar.</td></tr>
<tr><td><code>{@link #Theme_actionBarStyle com.example.view:actionBarStyle}</code></td><td> Reference to a style for the Action Bar </td></tr>
<tr><td><code>{@link #Theme_actionBarTabBarStyle com.example.view:actionBarTabBarStyle}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_actionBarTabStyle com.example.view:actionBarTabStyle}</code></td><td> Default style for tabs within an action bar </td></tr>
<tr><td><code>{@link #Theme_actionBarTabTextStyle com.example.view:actionBarTabTextStyle}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_actionBarTheme com.example.view:actionBarTheme}</code></td><td> Reference to a theme that should be used to inflate the
action bar.</td></tr>
<tr><td><code>{@link #Theme_actionBarWidgetTheme com.example.view:actionBarWidgetTheme}</code></td><td> Reference to a theme that should be used to inflate widgets
and layouts destined for the action bar.</td></tr>
<tr><td><code>{@link #Theme_actionButtonStyle com.example.view:actionButtonStyle}</code></td><td> Default action button style.</td></tr>
<tr><td><code>{@link #Theme_actionDropDownStyle com.example.view:actionDropDownStyle}</code></td><td> Default ActionBar dropdown style.</td></tr>
<tr><td><code>{@link #Theme_actionMenuTextAppearance com.example.view:actionMenuTextAppearance}</code></td><td> TextAppearance style that will be applied to text that
appears within action menu items.</td></tr>
<tr><td><code>{@link #Theme_actionMenuTextColor com.example.view:actionMenuTextColor}</code></td><td> Color for text that appears within action menu items.</td></tr>
<tr><td><code>{@link #Theme_actionModeBackground com.example.view:actionModeBackground}</code></td><td> Background drawable to use for action mode UI </td></tr>
<tr><td><code>{@link #Theme_actionModeCloseButtonStyle com.example.view:actionModeCloseButtonStyle}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_actionModeCloseDrawable com.example.view:actionModeCloseDrawable}</code></td><td> Drawable to use for the close action mode button </td></tr>
<tr><td><code>{@link #Theme_actionModeCopyDrawable com.example.view:actionModeCopyDrawable}</code></td><td> Drawable to use for the Copy action button in Contextual Action Bar </td></tr>
<tr><td><code>{@link #Theme_actionModeCutDrawable com.example.view:actionModeCutDrawable}</code></td><td> Drawable to use for the Cut action button in Contextual Action Bar </td></tr>
<tr><td><code>{@link #Theme_actionModeFindDrawable com.example.view:actionModeFindDrawable}</code></td><td> Drawable to use for the Find action button in WebView selection action modes </td></tr>
<tr><td><code>{@link #Theme_actionModePasteDrawable com.example.view:actionModePasteDrawable}</code></td><td> Drawable to use for the Paste action button in Contextual Action Bar </td></tr>
<tr><td><code>{@link #Theme_actionModePopupWindowStyle com.example.view:actionModePopupWindowStyle}</code></td><td> PopupWindow style to use for action modes when showing as a window overlay.</td></tr>
<tr><td><code>{@link #Theme_actionModeSelectAllDrawable com.example.view:actionModeSelectAllDrawable}</code></td><td> Drawable to use for the Select all action button in Contextual Action Bar </td></tr>
<tr><td><code>{@link #Theme_actionModeShareDrawable com.example.view:actionModeShareDrawable}</code></td><td> Drawable to use for the Share action button in WebView selection action modes </td></tr>
<tr><td><code>{@link #Theme_actionModeSplitBackground com.example.view:actionModeSplitBackground}</code></td><td> Background drawable to use for action mode UI in the lower split bar </td></tr>
<tr><td><code>{@link #Theme_actionModeStyle com.example.view:actionModeStyle}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_actionModeWebSearchDrawable com.example.view:actionModeWebSearchDrawable}</code></td><td> Drawable to use for the Web Search action button in WebView selection action modes </td></tr>
<tr><td><code>{@link #Theme_actionOverflowButtonStyle com.example.view:actionOverflowButtonStyle}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_actionOverflowMenuStyle com.example.view:actionOverflowMenuStyle}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_activityChooserViewStyle com.example.view:activityChooserViewStyle}</code></td><td> Default ActivityChooserView style.</td></tr>
<tr><td><code>{@link #Theme_android_windowIsFloating android:windowIsFloating}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_buttonBarButtonStyle com.example.view:buttonBarButtonStyle}</code></td><td> A style that may be applied to Buttons placed within a
LinearLayout with the style buttonBarStyle to form a button bar.</td></tr>
<tr><td><code>{@link #Theme_buttonBarStyle com.example.view:buttonBarStyle}</code></td><td> A style that may be applied to horizontal LinearLayouts
to form a button bar.</td></tr>
<tr><td><code>{@link #Theme_colorAccent com.example.view:colorAccent}</code></td><td> Bright complement to the primary branding color.</td></tr>
<tr><td><code>{@link #Theme_colorButtonNormal com.example.view:colorButtonNormal}</code></td><td> The color applied to framework buttons in their normal state.</td></tr>
<tr><td><code>{@link #Theme_colorControlActivated com.example.view:colorControlActivated}</code></td><td> The color applied to framework controls in their activated (ex.</td></tr>
<tr><td><code>{@link #Theme_colorControlHighlight com.example.view:colorControlHighlight}</code></td><td> The color applied to framework control highlights (ex.</td></tr>
<tr><td><code>{@link #Theme_colorControlNormal com.example.view:colorControlNormal}</code></td><td> The color applied to framework controls in their normal state.</td></tr>
<tr><td><code>{@link #Theme_colorPrimary com.example.view:colorPrimary}</code></td><td> The primary branding color for the app.</td></tr>
<tr><td><code>{@link #Theme_colorPrimaryDark com.example.view:colorPrimaryDark}</code></td><td> Dark variant of the primary branding color.</td></tr>
<tr><td><code>{@link #Theme_colorSwitchThumbNormal com.example.view:colorSwitchThumbNormal}</code></td><td> The color applied to framework switch thumbs in their normal state.</td></tr>
<tr><td><code>{@link #Theme_dividerHorizontal com.example.view:dividerHorizontal}</code></td><td> A drawable that may be used as a horizontal divider between visual elements.</td></tr>
<tr><td><code>{@link #Theme_dividerVertical com.example.view:dividerVertical}</code></td><td> A drawable that may be used as a vertical divider between visual elements.</td></tr>
<tr><td><code>{@link #Theme_dropDownListViewStyle com.example.view:dropDownListViewStyle}</code></td><td> ListPopupWindow compatibility </td></tr>
<tr><td><code>{@link #Theme_dropdownListPreferredItemHeight com.example.view:dropdownListPreferredItemHeight}</code></td><td> The preferred item height for dropdown lists.</td></tr>
<tr><td><code>{@link #Theme_editTextBackground com.example.view:editTextBackground}</code></td><td> EditText background drawable.</td></tr>
<tr><td><code>{@link #Theme_editTextColor com.example.view:editTextColor}</code></td><td> EditText text foreground color.</td></tr>
<tr><td><code>{@link #Theme_homeAsUpIndicator com.example.view:homeAsUpIndicator}</code></td><td> Specifies a drawable to use for the 'home as up' indicator.</td></tr>
<tr><td><code>{@link #Theme_listChoiceBackgroundIndicator com.example.view:listChoiceBackgroundIndicator}</code></td><td> Drawable used as a background for selected list items.</td></tr>
<tr><td><code>{@link #Theme_listPopupWindowStyle com.example.view:listPopupWindowStyle}</code></td><td></td></tr>
<tr><td><code>{@link #Theme_listPreferredItemHeight com.example.view:listPreferredItemHeight}</code></td><td> The preferred list item height.</td></tr>
<tr><td><code>{@link #Theme_listPreferredItemHeightLarge com.example.view:listPreferredItemHeightLarge}</code></td><td> A larger, more robust list item height.</td></tr>
<tr><td><code>{@link #Theme_listPreferredItemHeightSmall com.example.view:listPreferredItemHeightSmall}</code></td><td> A smaller, sleeker list item height.</td></tr>
<tr><td><code>{@link #Theme_listPreferredItemPaddingLeft com.example.view:listPreferredItemPaddingLeft}</code></td><td> The preferred padding along the left edge of list items.</td></tr>
<tr><td><code>{@link #Theme_listPreferredItemPaddingRight com.example.view:listPreferredItemPaddingRight}</code></td><td> The preferred padding along the right edge of list items.</td></tr>
<tr><td><code>{@link #Theme_panelBackground com.example.view:panelBackground}</code></td><td> The background of a panel when it is inset from the left and right edges of the screen.</td></tr>
<tr><td><code>{@link #Theme_panelMenuListTheme com.example.view:panelMenuListTheme}</code></td><td> Default Panel Menu style.</td></tr>
<tr><td><code>{@link #Theme_panelMenuListWidth com.example.view:panelMenuListWidth}</code></td><td> Default Panel Menu width.</td></tr>
<tr><td><code>{@link #Theme_popupMenuStyle com.example.view:popupMenuStyle}</code></td><td> Default PopupMenu style.</td></tr>
<tr><td><code>{@link #Theme_popupWindowStyle com.example.view:popupWindowStyle}</code></td><td> Default PopupWindow style.</td></tr>
<tr><td><code>{@link #Theme_searchViewStyle com.example.view:searchViewStyle}</code></td><td> Style for the search query widget.</td></tr>
<tr><td><code>{@link #Theme_selectableItemBackground com.example.view:selectableItemBackground}</code></td><td> A style that may be applied to buttons or other selectable items
that should react to pressed and focus states, but that do not
have a clear visual border along the edges.</td></tr>
<tr><td><code>{@link #Theme_selectableItemBackgroundBorderless com.example.view:selectableItemBackgroundBorderless}</code></td><td> Background drawable for borderless standalone items that need focus/pressed states.</td></tr>
<tr><td><code>{@link #Theme_spinnerDropDownItemStyle com.example.view:spinnerDropDownItemStyle}</code></td><td> Default Spinner style.</td></tr>
<tr><td><code>{@link #Theme_spinnerStyle com.example.view:spinnerStyle}</code></td><td> Default Spinner style.</td></tr>
<tr><td><code>{@link #Theme_switchStyle com.example.view:switchStyle}</code></td><td> Default style for the Switch widget.</td></tr>
<tr><td><code>{@link #Theme_textAppearanceLargePopupMenu com.example.view:textAppearanceLargePopupMenu}</code></td><td> Text color, typeface, size, and style for the text inside of a popup menu.</td></tr>
<tr><td><code>{@link #Theme_textAppearanceListItem com.example.view:textAppearanceListItem}</code></td><td> The preferred TextAppearance for the primary text of list items.</td></tr>
<tr><td><code>{@link #Theme_textAppearanceListItemSmall com.example.view:textAppearanceListItemSmall}</code></td><td> The preferred TextAppearance for the primary text of small list items.</td></tr>
<tr><td><code>{@link #Theme_textAppearanceSearchResultSubtitle com.example.view:textAppearanceSearchResultSubtitle}</code></td><td> Text color, typeface, size, and style for system search result subtitle.</td></tr>
<tr><td><code>{@link #Theme_textAppearanceSearchResultTitle com.example.view:textAppearanceSearchResultTitle}</code></td><td> Text color, typeface, size, and style for system search result title.</td></tr>
<tr><td><code>{@link #Theme_textAppearanceSmallPopupMenu com.example.view:textAppearanceSmallPopupMenu}</code></td><td> Text color, typeface, size, and style for small text inside of a popup menu.</td></tr>
<tr><td><code>{@link #Theme_textColorSearchUrl com.example.view:textColorSearchUrl}</code></td><td> Text color for urls in search suggestions, used by things like global search </td></tr>
<tr><td><code>{@link #Theme_toolbarNavigationButtonStyle com.example.view:toolbarNavigationButtonStyle}</code></td><td> Default Toolar NavigationButtonStyle </td></tr>
<tr><td><code>{@link #Theme_toolbarStyle com.example.view:toolbarStyle}</code></td><td> Default Toolbar style.</td></tr>
<tr><td><code>{@link #Theme_windowActionBar com.example.view:windowActionBar}</code></td><td> Flag indicating whether this window should have an Action Bar
in place of the usual title bar.</td></tr>
<tr><td><code>{@link #Theme_windowActionBarOverlay com.example.view:windowActionBarOverlay}</code></td><td> Flag indicating whether this window's Action Bar should overlay
application content.</td></tr>
<tr><td><code>{@link #Theme_windowActionModeOverlay com.example.view:windowActionModeOverlay}</code></td><td> Flag indicating whether action modes should overlay window content
when there is not reserved space for their UI (such as an Action Bar).</td></tr>
<tr><td><code>{@link #Theme_windowFixedHeightMajor com.example.view:windowFixedHeightMajor}</code></td><td> A fixed height for the window along the major axis of the screen,
that is, when in portrait.</td></tr>
<tr><td><code>{@link #Theme_windowFixedHeightMinor com.example.view:windowFixedHeightMinor}</code></td><td> A fixed height for the window along the minor axis of the screen,
that is, when in landscape.</td></tr>
<tr><td><code>{@link #Theme_windowFixedWidthMajor com.example.view:windowFixedWidthMajor}</code></td><td> A fixed width for the window along the major axis of the screen,
that is, when in landscape.</td></tr>
<tr><td><code>{@link #Theme_windowFixedWidthMinor com.example.view:windowFixedWidthMinor}</code></td><td> A fixed width for the window along the minor axis of the screen,
that is, when in portrait.</td></tr>
</table>
@see #Theme_actionBarDivider
@see #Theme_actionBarItemBackground
@see #Theme_actionBarPopupTheme
@see #Theme_actionBarSize
@see #Theme_actionBarSplitStyle
@see #Theme_actionBarStyle
@see #Theme_actionBarTabBarStyle
@see #Theme_actionBarTabStyle
@see #Theme_actionBarTabTextStyle
@see #Theme_actionBarTheme
@see #Theme_actionBarWidgetTheme
@see #Theme_actionButtonStyle
@see #Theme_actionDropDownStyle
@see #Theme_actionMenuTextAppearance
@see #Theme_actionMenuTextColor
@see #Theme_actionModeBackground
@see #Theme_actionModeCloseButtonStyle
@see #Theme_actionModeCloseDrawable
@see #Theme_actionModeCopyDrawable
@see #Theme_actionModeCutDrawable
@see #Theme_actionModeFindDrawable
@see #Theme_actionModePasteDrawable
@see #Theme_actionModePopupWindowStyle
@see #Theme_actionModeSelectAllDrawable
@see #Theme_actionModeShareDrawable
@see #Theme_actionModeSplitBackground
@see #Theme_actionModeStyle
@see #Theme_actionModeWebSearchDrawable
@see #Theme_actionOverflowButtonStyle
@see #Theme_actionOverflowMenuStyle
@see #Theme_activityChooserViewStyle
@see #Theme_android_windowIsFloating
@see #Theme_buttonBarButtonStyle
@see #Theme_buttonBarStyle
@see #Theme_colorAccent
@see #Theme_colorButtonNormal
@see #Theme_colorControlActivated
@see #Theme_colorControlHighlight
@see #Theme_colorControlNormal
@see #Theme_colorPrimary
@see #Theme_colorPrimaryDark
@see #Theme_colorSwitchThumbNormal
@see #Theme_dividerHorizontal
@see #Theme_dividerVertical
@see #Theme_dropDownListViewStyle
@see #Theme_dropdownListPreferredItemHeight
@see #Theme_editTextBackground
@see #Theme_editTextColor
@see #Theme_homeAsUpIndicator
@see #Theme_listChoiceBackgroundIndicator
@see #Theme_listPopupWindowStyle
@see #Theme_listPreferredItemHeight
@see #Theme_listPreferredItemHeightLarge
@see #Theme_listPreferredItemHeightSmall
@see #Theme_listPreferredItemPaddingLeft
@see #Theme_listPreferredItemPaddingRight
@see #Theme_panelBackground
@see #Theme_panelMenuListTheme
@see #Theme_panelMenuListWidth
@see #Theme_popupMenuStyle
@see #Theme_popupWindowStyle
@see #Theme_searchViewStyle
@see #Theme_selectableItemBackground
@see #Theme_selectableItemBackgroundBorderless
@see #Theme_spinnerDropDownItemStyle
@see #Theme_spinnerStyle
@see #Theme_switchStyle
@see #Theme_textAppearanceLargePopupMenu
@see #Theme_textAppearanceListItem
@see #Theme_textAppearanceListItemSmall
@see #Theme_textAppearanceSearchResultSubtitle
@see #Theme_textAppearanceSearchResultTitle
@see #Theme_textAppearanceSmallPopupMenu
@see #Theme_textColorSearchUrl
@see #Theme_toolbarNavigationButtonStyle
@see #Theme_toolbarStyle
@see #Theme_windowActionBar
@see #Theme_windowActionBarOverlay
@see #Theme_windowActionModeOverlay
@see #Theme_windowFixedHeightMajor
@see #Theme_windowFixedHeightMinor
@see #Theme_windowFixedWidthMajor
@see #Theme_windowFixedWidthMinor
*/
public static final int[] Theme = {
0x01010057, 0x7f010003, 0x7f010004, 0x7f010005,
0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009,
0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d,
0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011,
0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015,
0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019,
0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d,
0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010021,
0x7f010022, 0x7f010023, 0x7f010024, 0x7f010025,
0x7f010026, 0x7f010027, 0x7f010028, 0x7f010029,
0x7f01002a, 0x7f01002b, 0x7f01002c, 0x7f01002d,
0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031,
0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035,
0x7f010036, 0x7f010037, 0x7f010038, 0x7f010039,
0x7f01003a, 0x7f01003b, 0x7f01003c, 0x7f01003d,
0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041,
0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045,
0x7f010046, 0x7f010047, 0x7f010048, 0x7f010049,
0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d,
0x7f01004e, 0x7f01004f, 0x7f010050, 0x7f010051,
0x7f010052, 0x7f010053, 0x7f010054
};
/**
<p>
@attr description
Custom divider drawable to use for elements in the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarDivider
*/
public static final int Theme_actionBarDivider = 19;
/**
<p>
@attr description
Custom item state list drawable background for action bar items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarItemBackground
*/
public static final int Theme_actionBarItemBackground = 20;
/**
<p>
@attr description
Reference to a theme that should be used to inflate popups
shown by widgets in the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarPopupTheme
*/
public static final int Theme_actionBarPopupTheme = 13;
/**
<p>
@attr description
Size of the Action Bar, including the contextual
bar used to present Action Modes.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>May be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>wrap_content</code></td><td>0</td><td></td></tr>
</table>
<p>This is a private symbol.
@attr name com.example.view:actionBarSize
*/
public static final int Theme_actionBarSize = 18;
/**
<p>
@attr description
Reference to a style for the split Action Bar. This style
controls the split component that holds the menu/action
buttons. actionBarStyle is still used for the primary
bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarSplitStyle
*/
public static final int Theme_actionBarSplitStyle = 15;
/**
<p>
@attr description
Reference to a style for the Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarStyle
*/
public static final int Theme_actionBarStyle = 14;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#actionBarTabBarStyle}
attribute's value can be found in the {@link #Theme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:actionBarTabBarStyle
*/
public static final int Theme_actionBarTabBarStyle = 9;
/**
<p>
@attr description
Default style for tabs within an action bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarTabStyle
*/
public static final int Theme_actionBarTabStyle = 8;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#actionBarTabTextStyle}
attribute's value can be found in the {@link #Theme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:actionBarTabTextStyle
*/
public static final int Theme_actionBarTabTextStyle = 10;
/**
<p>
@attr description
Reference to a theme that should be used to inflate the
action bar. This will be inherited by any widget inflated
into the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarTheme
*/
public static final int Theme_actionBarTheme = 16;
/**
<p>
@attr description
Reference to a theme that should be used to inflate widgets
and layouts destined for the action bar. Most of the time
this will be a reference to the current theme, but when
the action bar has a significantly different contrast
profile than the rest of the activity the difference
can become important. If this is set to @null the current
theme will be used.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionBarWidgetTheme
*/
public static final int Theme_actionBarWidgetTheme = 17;
/**
<p>
@attr description
Default action button style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionButtonStyle
*/
public static final int Theme_actionButtonStyle = 43;
/**
<p>
@attr description
Default ActionBar dropdown style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionDropDownStyle
*/
public static final int Theme_actionDropDownStyle = 38;
/**
<p>
@attr description
TextAppearance style that will be applied to text that
appears within action menu items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionMenuTextAppearance
*/
public static final int Theme_actionMenuTextAppearance = 21;
/**
<p>
@attr description
Color for text that appears within action menu items.
Color for text that appears within action menu items.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionMenuTextColor
*/
public static final int Theme_actionMenuTextColor = 22;
/**
<p>
@attr description
Background drawable to use for action mode UI
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeBackground
*/
public static final int Theme_actionModeBackground = 25;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#actionModeCloseButtonStyle}
attribute's value can be found in the {@link #Theme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:actionModeCloseButtonStyle
*/
public static final int Theme_actionModeCloseButtonStyle = 24;
/**
<p>
@attr description
Drawable to use for the close action mode button
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeCloseDrawable
*/
public static final int Theme_actionModeCloseDrawable = 27;
/**
<p>
@attr description
Drawable to use for the Copy action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeCopyDrawable
*/
public static final int Theme_actionModeCopyDrawable = 29;
/**
<p>
@attr description
Drawable to use for the Cut action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeCutDrawable
*/
public static final int Theme_actionModeCutDrawable = 28;
/**
<p>
@attr description
Drawable to use for the Find action button in WebView selection action modes
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeFindDrawable
*/
public static final int Theme_actionModeFindDrawable = 33;
/**
<p>
@attr description
Drawable to use for the Paste action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModePasteDrawable
*/
public static final int Theme_actionModePasteDrawable = 30;
/**
<p>
@attr description
PopupWindow style to use for action modes when showing as a window overlay.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModePopupWindowStyle
*/
public static final int Theme_actionModePopupWindowStyle = 35;
/**
<p>
@attr description
Drawable to use for the Select all action button in Contextual Action Bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeSelectAllDrawable
*/
public static final int Theme_actionModeSelectAllDrawable = 31;
/**
<p>
@attr description
Drawable to use for the Share action button in WebView selection action modes
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeShareDrawable
*/
public static final int Theme_actionModeShareDrawable = 32;
/**
<p>
@attr description
Background drawable to use for action mode UI in the lower split bar
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeSplitBackground
*/
public static final int Theme_actionModeSplitBackground = 26;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#actionModeStyle}
attribute's value can be found in the {@link #Theme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:actionModeStyle
*/
public static final int Theme_actionModeStyle = 23;
/**
<p>
@attr description
Drawable to use for the Web Search action button in WebView selection action modes
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:actionModeWebSearchDrawable
*/
public static final int Theme_actionModeWebSearchDrawable = 34;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#actionOverflowButtonStyle}
attribute's value can be found in the {@link #Theme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:actionOverflowButtonStyle
*/
public static final int Theme_actionOverflowButtonStyle = 11;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#actionOverflowMenuStyle}
attribute's value can be found in the {@link #Theme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:actionOverflowMenuStyle
*/
public static final int Theme_actionOverflowMenuStyle = 12;
/**
<p>
@attr description
Default ActivityChooserView style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:activityChooserViewStyle
*/
public static final int Theme_activityChooserViewStyle = 50;
/**
<p>This symbol is the offset where the {@link android.R.attr#windowIsFloating}
attribute's value can be found in the {@link #Theme} array.
@attr name android:windowIsFloating
*/
public static final int Theme_android_windowIsFloating = 0;
/**
<p>
@attr description
A style that may be applied to Buttons placed within a
LinearLayout with the style buttonBarStyle to form a button bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:buttonBarButtonStyle
*/
public static final int Theme_buttonBarButtonStyle = 45;
/**
<p>
@attr description
A style that may be applied to horizontal LinearLayouts
to form a button bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:buttonBarStyle
*/
public static final int Theme_buttonBarStyle = 44;
/**
<p>
@attr description
Bright complement to the primary branding color. By default, this is the color applied
to framework controls (via colorControlActivated).
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorAccent
*/
public static final int Theme_colorAccent = 77;
/**
<p>
@attr description
The color applied to framework buttons in their normal state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorButtonNormal
*/
public static final int Theme_colorButtonNormal = 81;
/**
<p>
@attr description
The color applied to framework controls in their activated (ex. checked) state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorControlActivated
*/
public static final int Theme_colorControlActivated = 79;
/**
<p>
@attr description
The color applied to framework control highlights (ex. ripples, list selectors).
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorControlHighlight
*/
public static final int Theme_colorControlHighlight = 80;
/**
<p>
@attr description
The color applied to framework controls in their normal state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorControlNormal
*/
public static final int Theme_colorControlNormal = 78;
/**
<p>
@attr description
The primary branding color for the app. By default, this is the color applied to the
action bar background.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorPrimary
*/
public static final int Theme_colorPrimary = 75;
/**
<p>
@attr description
Dark variant of the primary branding color. By default, this is the color applied to
the status bar (via statusBarColor) and navigation bar (via navigationBarColor).
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorPrimaryDark
*/
public static final int Theme_colorPrimaryDark = 76;
/**
<p>
@attr description
The color applied to framework switch thumbs in their normal state.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:colorSwitchThumbNormal
*/
public static final int Theme_colorSwitchThumbNormal = 82;
/**
<p>
@attr description
A drawable that may be used as a horizontal divider between visual elements.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:dividerHorizontal
*/
public static final int Theme_dividerHorizontal = 49;
/**
<p>
@attr description
A drawable that may be used as a vertical divider between visual elements.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:dividerVertical
*/
public static final int Theme_dividerVertical = 48;
/**
<p>
@attr description
ListPopupWindow compatibility
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:dropDownListViewStyle
*/
public static final int Theme_dropDownListViewStyle = 67;
/**
<p>
@attr description
The preferred item height for dropdown lists.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:dropdownListPreferredItemHeight
*/
public static final int Theme_dropdownListPreferredItemHeight = 39;
/**
<p>
@attr description
EditText background drawable.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:editTextBackground
*/
public static final int Theme_editTextBackground = 56;
/**
<p>
@attr description
EditText text foreground color.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.example.view:editTextColor
*/
public static final int Theme_editTextColor = 55;
/**
<p>
@attr description
Specifies a drawable to use for the 'home as up' indicator.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:homeAsUpIndicator
*/
public static final int Theme_homeAsUpIndicator = 42;
/**
<p>
@attr description
Drawable used as a background for selected list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:listChoiceBackgroundIndicator
*/
public static final int Theme_listChoiceBackgroundIndicator = 74;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#listPopupWindowStyle}
attribute's value can be found in the {@link #Theme} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:listPopupWindowStyle
*/
public static final int Theme_listPopupWindowStyle = 68;
/**
<p>
@attr description
The preferred list item height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:listPreferredItemHeight
*/
public static final int Theme_listPreferredItemHeight = 62;
/**
<p>
@attr description
A larger, more robust list item height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:listPreferredItemHeightLarge
*/
public static final int Theme_listPreferredItemHeightLarge = 64;
/**
<p>
@attr description
A smaller, sleeker list item height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:listPreferredItemHeightSmall
*/
public static final int Theme_listPreferredItemHeightSmall = 63;
/**
<p>
@attr description
The preferred padding along the left edge of list items.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:listPreferredItemPaddingLeft
*/
public static final int Theme_listPreferredItemPaddingLeft = 65;
/**
<p>
@attr description
The preferred padding along the right edge of list items.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:listPreferredItemPaddingRight
*/
public static final int Theme_listPreferredItemPaddingRight = 66;
/**
<p>
@attr description
The background of a panel when it is inset from the left and right edges of the screen.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:panelBackground
*/
public static final int Theme_panelBackground = 71;
/**
<p>
@attr description
Default Panel Menu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:panelMenuListTheme
*/
public static final int Theme_panelMenuListTheme = 73;
/**
<p>
@attr description
Default Panel Menu width.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:panelMenuListWidth
*/
public static final int Theme_panelMenuListWidth = 72;
/**
<p>
@attr description
Default PopupMenu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:popupMenuStyle
*/
public static final int Theme_popupMenuStyle = 53;
/**
<p>
@attr description
Default PopupWindow style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:popupWindowStyle
*/
public static final int Theme_popupWindowStyle = 54;
/**
<p>
@attr description
Style for the search query widget.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:searchViewStyle
*/
public static final int Theme_searchViewStyle = 61;
/**
<p>
@attr description
A style that may be applied to buttons or other selectable items
that should react to pressed and focus states, but that do not
have a clear visual border along the edges.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:selectableItemBackground
*/
public static final int Theme_selectableItemBackground = 46;
/**
<p>
@attr description
Background drawable for borderless standalone items that need focus/pressed states.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:selectableItemBackgroundBorderless
*/
public static final int Theme_selectableItemBackgroundBorderless = 47;
/**
<p>
@attr description
Default Spinner style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:spinnerDropDownItemStyle
*/
public static final int Theme_spinnerDropDownItemStyle = 41;
/**
<p>
@attr description
Default Spinner style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:spinnerStyle
*/
public static final int Theme_spinnerStyle = 40;
/**
<p>
@attr description
Default style for the Switch widget.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:switchStyle
*/
public static final int Theme_switchStyle = 57;
/**
<p>
@attr description
Text color, typeface, size, and style for the text inside of a popup menu.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:textAppearanceLargePopupMenu
*/
public static final int Theme_textAppearanceLargePopupMenu = 36;
/**
<p>
@attr description
The preferred TextAppearance for the primary text of list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:textAppearanceListItem
*/
public static final int Theme_textAppearanceListItem = 69;
/**
<p>
@attr description
The preferred TextAppearance for the primary text of small list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:textAppearanceListItemSmall
*/
public static final int Theme_textAppearanceListItemSmall = 70;
/**
<p>
@attr description
Text color, typeface, size, and style for system search result subtitle. Defaults to primary inverse text color.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:textAppearanceSearchResultSubtitle
*/
public static final int Theme_textAppearanceSearchResultSubtitle = 59;
/**
<p>
@attr description
Text color, typeface, size, and style for system search result title. Defaults to primary inverse text color.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:textAppearanceSearchResultTitle
*/
public static final int Theme_textAppearanceSearchResultTitle = 58;
/**
<p>
@attr description
Text color, typeface, size, and style for small text inside of a popup menu.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:textAppearanceSmallPopupMenu
*/
public static final int Theme_textAppearanceSmallPopupMenu = 37;
/**
<p>
@attr description
Text color for urls in search suggestions, used by things like global search
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.example.view:textColorSearchUrl
*/
public static final int Theme_textColorSearchUrl = 60;
/**
<p>
@attr description
Default Toolar NavigationButtonStyle
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:toolbarNavigationButtonStyle
*/
public static final int Theme_toolbarNavigationButtonStyle = 52;
/**
<p>
@attr description
Default Toolbar style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:toolbarStyle
*/
public static final int Theme_toolbarStyle = 51;
/**
<p>
@attr description
Flag indicating whether this window should have an Action Bar
in place of the usual title bar.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:windowActionBar
*/
public static final int Theme_windowActionBar = 1;
/**
<p>
@attr description
Flag indicating whether this window's Action Bar should overlay
application content. Does nothing if the window would not
have an Action Bar.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:windowActionBarOverlay
*/
public static final int Theme_windowActionBarOverlay = 2;
/**
<p>
@attr description
Flag indicating whether action modes should overlay window content
when there is not reserved space for their UI (such as an Action Bar).
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:windowActionModeOverlay
*/
public static final int Theme_windowActionModeOverlay = 3;
/**
<p>
@attr description
A fixed height for the window along the major axis of the screen,
that is, when in portrait. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:windowFixedHeightMajor
*/
public static final int Theme_windowFixedHeightMajor = 7;
/**
<p>
@attr description
A fixed height for the window along the minor axis of the screen,
that is, when in landscape. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:windowFixedHeightMinor
*/
public static final int Theme_windowFixedHeightMinor = 5;
/**
<p>
@attr description
A fixed width for the window along the major axis of the screen,
that is, when in landscape. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:windowFixedWidthMajor
*/
public static final int Theme_windowFixedWidthMajor = 4;
/**
<p>
@attr description
A fixed width for the window along the minor axis of the screen,
that is, when in portrait. Can be either an absolute dimension
or a fraction of the screen size in that dimension.
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>May be a fractional value, which is a floating point number appended with either % or %p, such as "<code>14.5%</code>".
The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to
some parent container.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:windowFixedWidthMinor
*/
public static final int Theme_windowFixedWidthMinor = 6;
/** Attributes that can be used with a Toolbar.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #Toolbar_android_gravity android:gravity}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_android_minHeight android:minHeight}</code></td><td> Allows us to read in the minHeight attr pre-v16 </td></tr>
<tr><td><code>{@link #Toolbar_collapseContentDescription com.example.view:collapseContentDescription}</code></td><td> Text to set as the content description for the collapse button.</td></tr>
<tr><td><code>{@link #Toolbar_collapseIcon com.example.view:collapseIcon}</code></td><td> Icon drawable to use for the collapse button.</td></tr>
<tr><td><code>{@link #Toolbar_contentInsetEnd com.example.view:contentInsetEnd}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #Toolbar_contentInsetLeft com.example.view:contentInsetLeft}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #Toolbar_contentInsetRight com.example.view:contentInsetRight}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #Toolbar_contentInsetStart com.example.view:contentInsetStart}</code></td><td> Minimum inset for content views within a bar.</td></tr>
<tr><td><code>{@link #Toolbar_maxButtonHeight com.example.view:maxButtonHeight}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_navigationContentDescription com.example.view:navigationContentDescription}</code></td><td> Text to set as the content description for the navigation button
located at the start of the toolbar.</td></tr>
<tr><td><code>{@link #Toolbar_navigationIcon com.example.view:navigationIcon}</code></td><td> Icon drawable to use for the navigation button located at
the start of the toolbar.</td></tr>
<tr><td><code>{@link #Toolbar_popupTheme com.example.view:popupTheme}</code></td><td> Reference to a theme that should be used to inflate popups
shown by widgets in the toolbar.</td></tr>
<tr><td><code>{@link #Toolbar_subtitle com.example.view:subtitle}</code></td><td> Specifies subtitle text used for navigationMode="normal" </td></tr>
<tr><td><code>{@link #Toolbar_subtitleTextAppearance com.example.view:subtitleTextAppearance}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_theme com.example.view:theme}</code></td><td> Specifies a theme override for a view.</td></tr>
<tr><td><code>{@link #Toolbar_title com.example.view:title}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_titleMarginBottom com.example.view:titleMarginBottom}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_titleMarginEnd com.example.view:titleMarginEnd}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_titleMarginStart com.example.view:titleMarginStart}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_titleMarginTop com.example.view:titleMarginTop}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_titleMargins com.example.view:titleMargins}</code></td><td></td></tr>
<tr><td><code>{@link #Toolbar_titleTextAppearance com.example.view:titleTextAppearance}</code></td><td></td></tr>
</table>
@see #Toolbar_android_gravity
@see #Toolbar_android_minHeight
@see #Toolbar_collapseContentDescription
@see #Toolbar_collapseIcon
@see #Toolbar_contentInsetEnd
@see #Toolbar_contentInsetLeft
@see #Toolbar_contentInsetRight
@see #Toolbar_contentInsetStart
@see #Toolbar_maxButtonHeight
@see #Toolbar_navigationContentDescription
@see #Toolbar_navigationIcon
@see #Toolbar_popupTheme
@see #Toolbar_subtitle
@see #Toolbar_subtitleTextAppearance
@see #Toolbar_theme
@see #Toolbar_title
@see #Toolbar_titleMarginBottom
@see #Toolbar_titleMarginEnd
@see #Toolbar_titleMarginStart
@see #Toolbar_titleMarginTop
@see #Toolbar_titleMargins
@see #Toolbar_titleTextAppearance
*/
public static final int[] Toolbar = {
0x010100af, 0x01010140, 0x7f010000, 0x7f010057,
0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a,
0x7f01006c, 0x7f01008a, 0x7f01008b, 0x7f01008c,
0x7f01008d, 0x7f01008e, 0x7f01008f, 0x7f010090,
0x7f010091, 0x7f010092, 0x7f010093, 0x7f010094,
0x7f010095, 0x7f010096
};
/**
<p>This symbol is the offset where the {@link android.R.attr#gravity}
attribute's value can be found in the {@link #Toolbar} array.
@attr name android:gravity
*/
public static final int Toolbar_android_gravity = 0;
/**
<p>
@attr description
Allows us to read in the minHeight attr pre-v16
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#minHeight}.
@attr name android:minHeight
*/
public static final int Toolbar_android_minHeight = 1;
/**
<p>
@attr description
Text to set as the content description for the collapse button.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:collapseContentDescription
*/
public static final int Toolbar_collapseContentDescription = 19;
/**
<p>
@attr description
Icon drawable to use for the collapse button.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:collapseIcon
*/
public static final int Toolbar_collapseIcon = 18;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetEnd
*/
public static final int Toolbar_contentInsetEnd = 5;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetLeft
*/
public static final int Toolbar_contentInsetLeft = 6;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetRight
*/
public static final int Toolbar_contentInsetRight = 7;
/**
<p>
@attr description
Minimum inset for content views within a bar. Navigation buttons and
menu views are excepted. Only valid for some themes and configurations.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:contentInsetStart
*/
public static final int Toolbar_contentInsetStart = 4;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#maxButtonHeight}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.example.view:maxButtonHeight
*/
public static final int Toolbar_maxButtonHeight = 16;
/**
<p>
@attr description
Text to set as the content description for the navigation button
located at the start of the toolbar.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:navigationContentDescription
*/
public static final int Toolbar_navigationContentDescription = 21;
/**
<p>
@attr description
Icon drawable to use for the navigation button located at
the start of the toolbar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:navigationIcon
*/
public static final int Toolbar_navigationIcon = 20;
/**
<p>
@attr description
Reference to a theme that should be used to inflate popups
shown by widgets in the toolbar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:popupTheme
*/
public static final int Toolbar_popupTheme = 8;
/**
<p>
@attr description
Specifies subtitle text used for navigationMode="normal"
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:subtitle
*/
public static final int Toolbar_subtitle = 3;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#subtitleTextAppearance}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:subtitleTextAppearance
*/
public static final int Toolbar_subtitleTextAppearance = 10;
/**
<p>
@attr description
Specifies a theme override for a view. When a theme override is set, the
view will be inflated using a {@link android.content.Context} themed with
the specified resource. During XML inflation, any child views under the
view with a theme override will inherit the themed context.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.example.view:theme
*/
public static final int Toolbar_theme = 17;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#title}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.example.view:title
*/
public static final int Toolbar_title = 2;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#titleMarginBottom}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.example.view:titleMarginBottom
*/
public static final int Toolbar_titleMarginBottom = 15;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#titleMarginEnd}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.example.view:titleMarginEnd
*/
public static final int Toolbar_titleMarginEnd = 13;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#titleMarginStart}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.example.view:titleMarginStart
*/
public static final int Toolbar_titleMarginStart = 12;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#titleMarginTop}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.example.view:titleMarginTop
*/
public static final int Toolbar_titleMarginTop = 14;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#titleMargins}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.example.view:titleMargins
*/
public static final int Toolbar_titleMargins = 11;
/**
<p>This symbol is the offset where the {@link com.example.view.R.attr#titleTextAppearance}
attribute's value can be found in the {@link #Toolbar} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.example.view:titleTextAppearance
*/
public static final int Toolbar_titleTextAppearance = 9;
/** Attributes that can be used with a View.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #View_android_focusable android:focusable}</code></td><td> Boolean that controls whether a view can take focus.</td></tr>
<tr><td><code>{@link #View_paddingEnd com.example.view:paddingEnd}</code></td><td> Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}.</td></tr>
<tr><td><code>{@link #View_paddingStart com.example.view:paddingStart}</code></td><td> Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}.</td></tr>
</table>
@see #View_android_focusable
@see #View_paddingEnd
@see #View_paddingStart
*/
public static final int[] View = {
0x010100da, 0x7f01006e, 0x7f01006f
};
/**
<p>
@attr description
Boolean that controls whether a view can take focus. By default the user can not
move focus to a view; by setting this attribute to true the view is
allowed to take focus. This value does not impact the behavior of
directly calling {@link android.view.View#requestFocus}, which will
always request focus regardless of this view. It only impacts where
focus navigation will try to move focus.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#focusable}.
@attr name android:focusable
*/
public static final int View_android_focusable = 0;
/**
<p>
@attr description
Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:paddingEnd
*/
public static final int View_paddingEnd = 2;
/**
<p>
@attr description
Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.example.view:paddingStart
*/
public static final int View_paddingStart = 1;
/** Attributes that can be used with a ViewStubCompat.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ViewStubCompat_android_id android:id}</code></td><td></td></tr>
<tr><td><code>{@link #ViewStubCompat_android_inflatedId android:inflatedId}</code></td><td> Overrides the id of the inflated View with this value.</td></tr>
<tr><td><code>{@link #ViewStubCompat_android_layout android:layout}</code></td><td> Supply an identifier for the layout resource to inflate when the ViewStub
becomes visible or when forced to do so.</td></tr>
</table>
@see #ViewStubCompat_android_id
@see #ViewStubCompat_android_inflatedId
@see #ViewStubCompat_android_layout
*/
public static final int[] ViewStubCompat = {
0x010100d0, 0x010100f2, 0x010100f3
};
/**
<p>This symbol is the offset where the {@link android.R.attr#id}
attribute's value can be found in the {@link #ViewStubCompat} array.
@attr name android:id
*/
public static final int ViewStubCompat_android_id = 0;
/**
<p>
@attr description
Overrides the id of the inflated View with this value.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#inflatedId}.
@attr name android:inflatedId
*/
public static final int ViewStubCompat_android_inflatedId = 2;
/**
<p>
@attr description
Supply an identifier for the layout resource to inflate when the ViewStub
becomes visible or when forced to do so. The layout resource must be a
valid reference to a layout.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#layout}.
@attr name android:layout
*/
public static final int ViewStubCompat_android_layout = 1;
};
}
| {
"content_hash": "585fe9a1be251479c432af898c0691ee",
"timestamp": "",
"source": "github",
"line_count": 6204,
"max_line_length": 250,
"avg_line_length": 55.864119922630564,
"alnum_prop": 0.6402370585808224,
"repo_name": "weijianfeng/Android_Structure",
"id": "53a575c74a6c7f4bc95e4e07aec1d19267a090e2",
"size": "346581",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "android_mvc/android_mvc/gen/com/example/view/R.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1522005"
}
],
"symlink_target": ""
} |
<div class="coffee-list">
<!-- coffee-type start -->
<div class="coffee-type container" ng-repeat="coffeeList in coffeelist.coffees">
<div class="row">
<h3>{{coffeeList.type}}</h3>
</div>
<div class="row">
<!-- coffee-module start-->
<div class="col-xs-12 col-sm-6 coffee-module" ng-repeat="coffeeData in coffeeList.data">
<a href="#/{{coffeeData.link}}"><img class="img-circle" ng-src="{{coffeeData.img}}" alt="{{coffeeData.name}}"></a>
<h4><a href="#/{{coffeeData.link}}" class="coffee-name">{{coffeeData.name}}</a></h4>
<a href="#/{{coffeeData.link}}">{{coffeeData.brief}}</a>
</div>
<!-- coffee-module end-->
</div>
</div>
<!-- coffee-type end -->
</div>
| {
"content_hash": "449070d773858298abb091a952979934",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 122,
"avg_line_length": 32.26086956521739,
"alnum_prop": 0.5714285714285714,
"repo_name": "Fifth-Patient/TG-website",
"id": "815256d5c7786f49d7240b77a85abee2b2dc9f90",
"size": "742",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/components/coffeelist/coffeelist.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9763"
},
{
"name": "HTML",
"bytes": "9338"
},
{
"name": "JavaScript",
"bytes": "43654"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html class="no-js">
<head>
<!--<base href="http://kudesnik.name/portfolio/altanetica/calendar.html">-->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700,400italic&subset=latin,cyrillic-ext' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<!--[if lt IE 9]>
<link rel="stylesheet" href="css/ie.css">
<![endif]-->
</head>
<body>
<div class="wrapper">
<header class="header">
<div class="logo"><a href=""><img src="img/logo.png" alt="" class="logo__img"></a></div>
<!-- <div class="logo"><span><img src="img/logo.png" alt="" class="logo__img"></span></div> -->
<nav class="header__menu">
<ul class="top-menu clearfix">
<li class="top-menu__item"><a href="" class="link link_type-wrapper link_top-menu"><img src="img/ico-user.png" alt="" class="ico"><span class="link__inner-span">[email protected]</span></a>
<ul class="top-menu__sub">
<li class="top-menu__sub-item">
<a href="" class="top-menu__sub-item-link">Title title</a>
</li>
<li class="top-menu__sub-item">
<a href="" class="top-menu__sub-item-link">Title title</a>
</li>
<li class="top-menu__sub-item">
<a href="" class="top-menu__sub-item-link">Title title</a>
</li>
</ul>
</li>
<li class="top-menu__item"><a href="" class="link link_type-wrapper link_top-menu">Days left: <b class="days">29</b></a></li>
<li class="top-menu__item"><a href="" class="link link_type-wrapper link_top-menu"><span class="link__inner-span">Logout</span><img src="img/ico-logout.png" alt="" class="ico ico_right"></a></li>
</ul>
</nav>
</header>
<aside class="left-sidebar">
<nav class="left-menu">
<a href="" class="left-menu__link">
<i class="left-menu__ico left-menu__ico_camera-list"></i>
<span class="link__inner-span">Camera list</span>
</a>
<a href="" class="left-menu__link">
<i class="left-menu__ico left-menu__ico_map-pins"></i>
<span class="link__inner-span">Map Pins</span>
</a>
<a href="" class="left-menu__link left-menu__link_current">
<i class="left-menu__ico left-menu__ico_calendar"></i>
<span class="link__inner-span">Calendar</span>
</a>
</nav>
</aside><!-- /.left-sidebar-->
<div class="content">
<div class="middle">
<div class="container">
<div class="container__inner">
<div class="calendar-list">
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-1.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">16:46:00 (4 min)</div>
<div class="calendar-list__alarm">Alarms: 24</div>
</div>
</div>
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-2.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">13:25:00 (10 min)</div>
<div class="calendar-list__alarm">Alarms: 18</div>
</div>
</div>
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-3.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">14:22:15 (24 min)</div>
<div class="calendar-list__alarm">Alarms: 10</div>
</div>
</div>
<!--<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-2.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">16:46:00 (4 min)</div>
<div class="calendar-list__alarm">Alarms: 24</div>
</div>
</div>
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-3.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">13:25:00 (10 min)</div>
<div class="calendar-list__alarm">Alarms: 18</div>
</div>
</div>
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-2.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">14:22:15 (24 min)</div>
<div class="calendar-list__alarm">Alarms: 10</div>
</div>
</div>
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-1.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">16:46:00 (4 min)</div>
<div class="calendar-list__alarm">Alarms: 24</div>
</div>
</div>
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-2.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">13:25:00 (10 min)</div>
<div class="calendar-list__alarm">Alarms: 18</div>
</div>
</div>
<div class="calendar-list__item">
<div class="calendar-list__img">
<a href="" class="calendar-list__link"><img src="uploads/calendar-3.jpg" alt=""></a>
<a href="" class="btn btn_calendar-list"><span class="link__inner-span">Download</span><i class="link__ico"></i></a>
</div>
<div class="calendar-list__info">
<div class="calendar-list__time">14:22:15 (24 min)</div>
<div class="calendar-list__alarm">Alarms: 10</div>
</div>
</div>-->
</div>
<div class="pagination">
<div class="pagination__control clearfix">
<a href="" class="link link_pagination link_prev"><i class="link__ico"></i><span class="link__inner-span">Previous 9 position </span></a><a href="" class="link link_pagination link_next"><span class="link__inner-span">Next 9 position </span><i class="link__ico"></i></a>
</div>
<ul class="clearfix">
<li><a href="">1</a></li>
<li><a href="">2</a></li>
<li><a href="">3</a></li>
<li class="pagination__current"><a href="">4</a></li>
<li><a href="">5</a></li>
<li><a href="">6</a></li>
<li><a href="">7</a></li>
</ul>
</div>
</div><!-- /.container__inner -->
</div><!-- /.container-->
<aside class="right-sidebar">
<!--<div id="datepicker"></div>-->
<div class="archive archive_border">
<div class="archive__title">Select camera:</div>
<form action="">
<select name="" id="" class="select">
<option value="">All cameras</option>
<option value="">Сamera №23</option>
<option value="">Сamera office work №21</option>
<option value="">Сamera home №1</option>
</select>
<div class="period clearfix">
<ul class="radio-list">
<li class="radio-list__item"><span class="radio-list__input-wrap"><input type="radio" name="period" id="" value="1" class="radio-list__input">Today</span></li>
<li class="radio-list__item"><span class="radio-list__input-wrap"><input type="radio" name="period" id="" value="2" class="radio-list__input">Week</span></li>
<li class="radio-list__item"><span class="radio-list__input-wrap"><input type="radio" name="period" id="" value="3" class="radio-list__input">Month</span></li>
</ul>
<div class="archive__title">Period:</div>
</div>
<div class="archive__row">
<input type="text" class="datepicker"><span class="archive__separator">–</span><input type="text" class="datepicker">
</div>
<div class="archive__row">
<input type="text" class="timepicker"><span class="archive__separator">–</span><input type="text" class="timepicker">
</div>
</form>
</div>
<div class="archive">
<div class="archive__row">
<div class="archive__data">Videos: <b>18</b></div><div class="archive__data">Alarms: <b>258</b></div>
</div>
<a href="" class="btn btn_big btn_download btn_center"><span class="link__inner-span">Get Archive</span><i class="link__ico"></i></a>
</div>
</aside><!-- /.right-sidebar -->
</div><!-- /.middle-->
</div>
</div>
<!-- /.wrapper -->
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
-->
<script src="js/vendor/jquery-1.10.1.min.js"></script>
<script src="js/vendor/jquery-ui-1.10.4.custom.min.js"></script>
<link rel="stylesheet" href="css/custom-theme/jquery-ui-1.10.4.custom.css">
<script src="js/hoverIntent.js"></script>
<script src="js/superfish.js"></script>
<script src="js/jquery.formstyler.min.js"></script>
<link rel="stylesheet" href="css/jquery.formstyler.css">
<script src="../../../jquery.timepicker.js"></script>
<link rel="stylesheet" href="../../../jquery.timepicker.css">
<script src="js/main.js"></script>
<script>
jQuery(document).ready(function(){
$( '#datepicker, .datepicker' ).datepicker({dateFormat: 'dd.mm.y'});
$('.select').styler();
$('input.timepicker').timepicker({ timeFormat: 'HH:00' });
$('.radio-list__input-wrap').mousedown(function(){
changeCheck($(this));
});
$('.radio-list__input-wrap').each(function(){
changeCheckStart($(this));
});
function changeCheck(el){
var el=el, input=el.find('input').eq(0);
if(!input.attr('checked')){
$('.radio-list__input-wrap').each(function(){
cInput = $(this).find('input').eq(0);
if(cInput.attr('name') == input.attr('name')){
$(this).removeClass('radio-list__item_active');
cInput.attr("checked", false);
}
});
el.addClass('radio-list__item_active');
input.attr("checked", true);
}
return true;
}
function changeCheckStart(el){
var el=el,input=el.find('input').eq(0);
if(input.attr('checked')){
el.addClass('active');
}
return true;
}
});
</script>
<!--[if lt IE 9]>
<script src="js/ie.js"></script>
<![endif]-->
<!--//<![CDATA[
//]]>-->
</body>
</html>
| {
"content_hash": "34912e76009004cfb9e9c9b381b0ff36",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 306,
"avg_line_length": 59.48135593220339,
"alnum_prop": 0.3961930814384225,
"repo_name": "dilawar/ncbs-minion",
"id": "bd5c81ea5ad59825359c0d52c926d749ae6594c1",
"size": "17556",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "node_modules/jquery-timepicker/test/visuals/i43/calendar.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "113"
},
{
"name": "Batchfile",
"bytes": "1786"
},
{
"name": "CSS",
"bytes": "455819"
},
{
"name": "HTML",
"bytes": "326318"
},
{
"name": "JavaScript",
"bytes": "3508573"
},
{
"name": "Makefile",
"bytes": "4307"
},
{
"name": "PHP",
"bytes": "244305"
},
{
"name": "PowerShell",
"bytes": "3311"
},
{
"name": "Python",
"bytes": "3406919"
},
{
"name": "Shell",
"bytes": "798"
}
],
"symlink_target": ""
} |
@class DBFILESSearchMatchFieldOptions;
@class DBFILESSearchOptions;
@class DBFILESSearchV2Arg;
NS_ASSUME_NONNULL_BEGIN
#pragma mark - API Object
///
/// The `SearchV2Arg` struct.
///
/// This class implements the `DBSerializable` protocol (serialize and
/// deserialize instance methods), which is required for all Obj-C SDK API route
/// objects.
///
@interface DBFILESSearchV2Arg : NSObject <DBSerializable, NSCopying>
#pragma mark - Instance fields
/// The string to search for. May match across multiple fields based on the
/// request arguments.
@property (nonatomic, readonly, copy) NSString *query;
/// Options for more targeted search results.
@property (nonatomic, readonly, nullable) DBFILESSearchOptions *options;
/// Options for search results match fields.
@property (nonatomic, readonly, nullable) DBFILESSearchMatchFieldOptions *matchFieldOptions;
/// Deprecated and moved this option to SearchMatchFieldOptions.
@property (nonatomic, readonly, nullable) NSNumber *includeHighlights;
#pragma mark - Constructors
///
/// Full constructor for the struct (exposes all instance variables).
///
/// @param query The string to search for. May match across multiple fields
/// based on the request arguments.
/// @param options Options for more targeted search results.
/// @param matchFieldOptions Options for search results match fields.
/// @param includeHighlights Deprecated and moved this option to
/// SearchMatchFieldOptions.
///
/// @return An initialized instance.
///
- (instancetype)initWithQuery:(NSString *)query
options:(nullable DBFILESSearchOptions *)options
matchFieldOptions:(nullable DBFILESSearchMatchFieldOptions *)matchFieldOptions
includeHighlights:(nullable NSNumber *)includeHighlights;
///
/// Convenience constructor (exposes only non-nullable instance variables with
/// no default value).
///
/// @param query The string to search for. May match across multiple fields
/// based on the request arguments.
///
/// @return An initialized instance.
///
- (instancetype)initWithQuery:(NSString *)query;
- (instancetype)init NS_UNAVAILABLE;
@end
#pragma mark - Serializer Object
///
/// The serialization class for the `SearchV2Arg` struct.
///
@interface DBFILESSearchV2ArgSerializer : NSObject
///
/// Serializes `DBFILESSearchV2Arg` instances.
///
/// @param instance An instance of the `DBFILESSearchV2Arg` API object.
///
/// @return A json-compatible dictionary representation of the
/// `DBFILESSearchV2Arg` API object.
///
+ (nullable NSDictionary<NSString *, id> *)serialize:(DBFILESSearchV2Arg *)instance;
///
/// Deserializes `DBFILESSearchV2Arg` instances.
///
/// @param dict A json-compatible dictionary representation of the
/// `DBFILESSearchV2Arg` API object.
///
/// @return An instantiation of the `DBFILESSearchV2Arg` object.
///
+ (DBFILESSearchV2Arg *)deserialize:(NSDictionary<NSString *, id> *)dict;
@end
NS_ASSUME_NONNULL_END
| {
"content_hash": "4a3e4eeeb33dc4da8e8862e1cde243bd",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 92,
"avg_line_length": 30.71875,
"alnum_prop": 0.7480501865038997,
"repo_name": "dropbox/dropbox-sdk-obj-c",
"id": "f23a0f1fe929dc6254acb848a7dcdbaa224c9d9d",
"size": "3135",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/ObjectiveDropboxOfficial/Shared/Generated/ApiObjects/Files/Headers/DBFILESSearchV2Arg.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1288"
},
{
"name": "CSS",
"bytes": "6608"
},
{
"name": "Objective-C",
"bytes": "18903013"
},
{
"name": "Python",
"bytes": "7087"
},
{
"name": "Ruby",
"bytes": "1819"
},
{
"name": "Shell",
"bytes": "4527"
}
],
"symlink_target": ""
} |
package com.example.plugintest.manymethods.b.d;
public class A1 {
public static void a0(String msg) { System.out.println("msg=" + msg + 0); }
public static void a1(String msg) { System.out.println("msg=" + msg + 1); }
public static void a2(String msg) { System.out.println("msg=" + msg + 2); }
public static void a3(String msg) { System.out.println("msg=" + msg + 3); }
public static void a4(String msg) { System.out.println("msg=" + msg + 4); }
public static void a5(String msg) { System.out.println("msg=" + msg + 5); }
public static void a6(String msg) { System.out.println("msg=" + msg + 6); }
public static void a7(String msg) { System.out.println("msg=" + msg + 7); }
public static void a8(String msg) { System.out.println("msg=" + msg + 8); }
public static void a9(String msg) { System.out.println("msg=" + msg + 9); }
public static void a10(String msg) { System.out.println("msg=" + msg + 10); }
public static void a11(String msg) { System.out.println("msg=" + msg + 11); }
public static void a12(String msg) { System.out.println("msg=" + msg + 12); }
public static void a13(String msg) { System.out.println("msg=" + msg + 13); }
public static void a14(String msg) { System.out.println("msg=" + msg + 14); }
public static void a15(String msg) { System.out.println("msg=" + msg + 15); }
public static void a16(String msg) { System.out.println("msg=" + msg + 16); }
public static void a17(String msg) { System.out.println("msg=" + msg + 17); }
public static void a18(String msg) { System.out.println("msg=" + msg + 18); }
public static void a19(String msg) { System.out.println("msg=" + msg + 19); }
public static void a20(String msg) { System.out.println("msg=" + msg + 20); }
public static void a21(String msg) { System.out.println("msg=" + msg + 21); }
public static void a22(String msg) { System.out.println("msg=" + msg + 22); }
public static void a23(String msg) { System.out.println("msg=" + msg + 23); }
public static void a24(String msg) { System.out.println("msg=" + msg + 24); }
public static void a25(String msg) { System.out.println("msg=" + msg + 25); }
public static void a26(String msg) { System.out.println("msg=" + msg + 26); }
public static void a27(String msg) { System.out.println("msg=" + msg + 27); }
public static void a28(String msg) { System.out.println("msg=" + msg + 28); }
public static void a29(String msg) { System.out.println("msg=" + msg + 29); }
public static void a30(String msg) { System.out.println("msg=" + msg + 30); }
public static void a31(String msg) { System.out.println("msg=" + msg + 31); }
public static void a32(String msg) { System.out.println("msg=" + msg + 32); }
public static void a33(String msg) { System.out.println("msg=" + msg + 33); }
public static void a34(String msg) { System.out.println("msg=" + msg + 34); }
public static void a35(String msg) { System.out.println("msg=" + msg + 35); }
public static void a36(String msg) { System.out.println("msg=" + msg + 36); }
public static void a37(String msg) { System.out.println("msg=" + msg + 37); }
public static void a38(String msg) { System.out.println("msg=" + msg + 38); }
public static void a39(String msg) { System.out.println("msg=" + msg + 39); }
public static void a40(String msg) { System.out.println("msg=" + msg + 40); }
public static void a41(String msg) { System.out.println("msg=" + msg + 41); }
public static void a42(String msg) { System.out.println("msg=" + msg + 42); }
public static void a43(String msg) { System.out.println("msg=" + msg + 43); }
public static void a44(String msg) { System.out.println("msg=" + msg + 44); }
public static void a45(String msg) { System.out.println("msg=" + msg + 45); }
public static void a46(String msg) { System.out.println("msg=" + msg + 46); }
public static void a47(String msg) { System.out.println("msg=" + msg + 47); }
public static void a48(String msg) { System.out.println("msg=" + msg + 48); }
public static void a49(String msg) { System.out.println("msg=" + msg + 49); }
public static void a50(String msg) { System.out.println("msg=" + msg + 50); }
public static void a51(String msg) { System.out.println("msg=" + msg + 51); }
public static void a52(String msg) { System.out.println("msg=" + msg + 52); }
public static void a53(String msg) { System.out.println("msg=" + msg + 53); }
public static void a54(String msg) { System.out.println("msg=" + msg + 54); }
public static void a55(String msg) { System.out.println("msg=" + msg + 55); }
public static void a56(String msg) { System.out.println("msg=" + msg + 56); }
public static void a57(String msg) { System.out.println("msg=" + msg + 57); }
public static void a58(String msg) { System.out.println("msg=" + msg + 58); }
public static void a59(String msg) { System.out.println("msg=" + msg + 59); }
public static void a60(String msg) { System.out.println("msg=" + msg + 60); }
public static void a61(String msg) { System.out.println("msg=" + msg + 61); }
public static void a62(String msg) { System.out.println("msg=" + msg + 62); }
public static void a63(String msg) { System.out.println("msg=" + msg + 63); }
public static void a64(String msg) { System.out.println("msg=" + msg + 64); }
public static void a65(String msg) { System.out.println("msg=" + msg + 65); }
public static void a66(String msg) { System.out.println("msg=" + msg + 66); }
public static void a67(String msg) { System.out.println("msg=" + msg + 67); }
public static void a68(String msg) { System.out.println("msg=" + msg + 68); }
public static void a69(String msg) { System.out.println("msg=" + msg + 69); }
public static void a70(String msg) { System.out.println("msg=" + msg + 70); }
public static void a71(String msg) { System.out.println("msg=" + msg + 71); }
public static void a72(String msg) { System.out.println("msg=" + msg + 72); }
public static void a73(String msg) { System.out.println("msg=" + msg + 73); }
public static void a74(String msg) { System.out.println("msg=" + msg + 74); }
public static void a75(String msg) { System.out.println("msg=" + msg + 75); }
public static void a76(String msg) { System.out.println("msg=" + msg + 76); }
public static void a77(String msg) { System.out.println("msg=" + msg + 77); }
public static void a78(String msg) { System.out.println("msg=" + msg + 78); }
public static void a79(String msg) { System.out.println("msg=" + msg + 79); }
public static void a80(String msg) { System.out.println("msg=" + msg + 80); }
public static void a81(String msg) { System.out.println("msg=" + msg + 81); }
public static void a82(String msg) { System.out.println("msg=" + msg + 82); }
public static void a83(String msg) { System.out.println("msg=" + msg + 83); }
public static void a84(String msg) { System.out.println("msg=" + msg + 84); }
public static void a85(String msg) { System.out.println("msg=" + msg + 85); }
public static void a86(String msg) { System.out.println("msg=" + msg + 86); }
public static void a87(String msg) { System.out.println("msg=" + msg + 87); }
public static void a88(String msg) { System.out.println("msg=" + msg + 88); }
public static void a89(String msg) { System.out.println("msg=" + msg + 89); }
public static void a90(String msg) { System.out.println("msg=" + msg + 90); }
public static void a91(String msg) { System.out.println("msg=" + msg + 91); }
public static void a92(String msg) { System.out.println("msg=" + msg + 92); }
public static void a93(String msg) { System.out.println("msg=" + msg + 93); }
public static void a94(String msg) { System.out.println("msg=" + msg + 94); }
public static void a95(String msg) { System.out.println("msg=" + msg + 95); }
public static void a96(String msg) { System.out.println("msg=" + msg + 96); }
public static void a97(String msg) { System.out.println("msg=" + msg + 97); }
public static void a98(String msg) { System.out.println("msg=" + msg + 98); }
public static void a99(String msg) { System.out.println("msg=" + msg + 99); }
}
| {
"content_hash": "4292b5403ef2ae2d8bff4d45d6a28b5c",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 81,
"avg_line_length": 79.3173076923077,
"alnum_prop": 0.6343799248393744,
"repo_name": "limpoxe/Android-Plugin-Framework",
"id": "bb5b5216a08a4b17dea5fd5c49047f2e9d2e9dc6",
"size": "8249",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Samples/PluginTest/src/main/java/com/example/plugintest/manymethods/b/d/A1.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "746511"
},
{
"name": "Shell",
"bytes": "693"
}
],
"symlink_target": ""
} |
namespace test {
class TestFramework {
public:
TestFramework();
void RunTests();
};
} // namespace test
| {
"content_hash": "4d5a251eecd5646e9e698171566e14be",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 21,
"avg_line_length": 12.666666666666666,
"alnum_prop": 0.6578947368421053,
"repo_name": "dawangjiaowolaixunshan/runtime",
"id": "9b7732b10d8a4c86e5d4d3ce22004fdc8bb143eb",
"size": "732",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "testcc/test-framework.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "29659"
},
{
"name": "C",
"bytes": "853"
},
{
"name": "C++",
"bytes": "2139966"
},
{
"name": "JavaScript",
"bytes": "508976"
},
{
"name": "Python",
"bytes": "6276"
},
{
"name": "Shell",
"bytes": "3888"
}
],
"symlink_target": ""
} |
package com.ov3rk1ll.kinocast.ui.helper.layout;
import android.content.Context;
import android.graphics.PointF;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import java.util.List;
/**
* A {@link android.support.v7.widget.RecyclerView.LayoutManager} implementation which provides
* similar functionality to {@link android.widget.ListView}.
*/
public abstract class BaseLayoutManager extends RecyclerView.LayoutManager {
private static final String TAG = "LinearLayoutManager";
protected static final boolean DEBUG = false;
public static final int HORIZONTAL = LinearLayout.HORIZONTAL;
public static final int VERTICAL = LinearLayout.VERTICAL;
public static final int INVALID_OFFSET = Integer.MIN_VALUE;
/**
* While trying to find next view to focus, LinearLayoutManager will not try to scroll more
* than
* this factor times the total space of the list. If layout is vertical, total space is the
* height minus padding, if layout is horizontal, total space is the width minus padding.
*/
private static final float MAX_SCROLL_FACTOR = 0.33f;
/**
* Current orientation. Either {@link #HORIZONTAL} or {@link #VERTICAL}
*/
protected int mOrientation;
/**
* Helper class that keeps temporary rendering state.
* It does not keep state after rendering is complete but we still keep a reference to re-use
* the same object.
*/
protected RenderState mRenderState;
/**
* Many calculations are made depending on orientation. To keep it clean, this interface
* helps {@link BaseLayoutManager} make those decisions.
* Based on {@link #mOrientation}, an implementation is lazily created in
* {@link #ensureRenderState} method.
*/
OrientationHelper mOrientationHelper;
/**
* We need to track this so that we can ignore current position when it changes.
*/
private boolean mLastStackFromEnd;
/**
* Defines if layout should be calculated from end to start.
*
* @see #mShouldReverseLayout
*/
private boolean mReverseLayout = false;
/**
* This keeps the final value for how LayoutManager shouls start laying out views.
* It is calculated by checking {@link #getReverseLayout()} and View's layout direction.
* {@link #onLayoutChildren(android.support.v7.widget.RecyclerView.Recycler, android.support.v7.widget.RecyclerView.State)} is run.
*/
protected boolean mShouldReverseLayout = false;
/**
* Works the same way as {@link android.widget.AbsListView#setStackFromBottom(boolean)} and
* it supports both orientations.
* see {@link android.widget.AbsListView#setStackFromBottom(boolean)}
*/
private boolean mStackFromEnd = false;
/**
* When LayoutManager needs to scroll to a position, it sets this variable and requests a
* layout which will check this variable and re-layout accordingly.
*/
private int mPendingScrollPosition = RecyclerView.NO_POSITION;
/**
* Used to keep the offset value when {@link #scrollToPositionWithOffset(int, int)} is
* called.
*/
private int mPendingScrollPositionOffset = INVALID_OFFSET;
private SavedState mPendingSavedState = null;
/**
* Creates a vertical LinearLayoutManager
*
* @param context Current context, will be used to access resources.
*/
public BaseLayoutManager(Context context) {
this(context, VERTICAL, false);
}
/**
* @param context Current context, will be used to access resources.
* @param orientation Layout orientation. Should be {@link #HORIZONTAL} or {@link
* #VERTICAL}.
* @param reverseLayout When set to true, renders the layout from end to start.
*/
public BaseLayoutManager(Context context, int orientation, boolean reverseLayout) {
setOrientation(orientation);
setReverseLayout(reverseLayout);
}
/**
* {@inheritDoc}
*/
@Override
public RecyclerView.LayoutParams generateDefaultLayoutParams() {
return new RecyclerView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
public Parcelable onSaveInstanceState() {
if (mPendingSavedState != null) {
return new SavedState(mPendingSavedState);
}
SavedState state = new SavedState();
if (getChildCount() > 0) {
boolean didLayoutFromEnd = mLastStackFromEnd ^ mShouldReverseLayout;
state.mAnchorLayoutFromEnd = didLayoutFromEnd;
if (didLayoutFromEnd) {
final View refChild = getChildClosestToEnd();
state.mAnchorOffset = mOrientationHelper.getEndAfterPadding() -
mOrientationHelper.getDecoratedEnd(refChild);
state.mAnchorPosition = getPosition(refChild);
} else {
final View refChild = getChildClosestToStart();
state.mAnchorPosition = getPosition(refChild);
state.mAnchorOffset = mOrientationHelper.getDecoratedStart(refChild) -
mOrientationHelper.getStartAfterPadding();
}
} else {
state.mAnchorPosition = 0;
state.mAnchorOffset = 0;
}
state.mStackFromEnd = mStackFromEnd;
state.mReverseLayout = mReverseLayout;
state.mOrientation = mOrientation;
return state;
}
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof SavedState) {
mPendingSavedState = (SavedState) state;
requestLayout();
if (DEBUG) {
Log.d(TAG, "loaded saved state");
}
} else if (DEBUG) {
Log.d(TAG, "invalid saved state class");
}
}
/**
* @return true if {@link #getOrientation()} is {@link #HORIZONTAL}
*/
@Override
public boolean canScrollHorizontally() {
return mOrientation == HORIZONTAL;
}
/**
* @return true if {@link #getOrientation()} is {@link #VERTICAL}
*/
@Override
public boolean canScrollVertically() {
return mOrientation == VERTICAL;
}
/**
* Compatibility support for {@link android.widget.AbsListView#setStackFromBottom(boolean)}
*/
public void setStackFromEnd(boolean stackFromEnd) {
if (mPendingSavedState != null && mPendingSavedState.mStackFromEnd != stackFromEnd) {
// override pending state
mPendingSavedState.mStackFromEnd = stackFromEnd;
}
if (mStackFromEnd == stackFromEnd) {
return;
}
mStackFromEnd = stackFromEnd;
requestLayout();
}
public boolean getStackFromEnd() {
return mStackFromEnd;
}
/**
* Returns the current orientaion of the layout.
*
* @return Current orientation.
* @see #mOrientation
* @see #setOrientation(int)
*/
public int getOrientation() {
return mOrientation;
}
/**
* Sets the orientation of the layout. {@link android.support.v7.widget.LinearLayoutManager}
* will do its best to keep scroll position.
*
* @param orientation {@link #HORIZONTAL} or {@link #VERTICAL}
*/
public void setOrientation(int orientation) {
if (orientation != HORIZONTAL && orientation != VERTICAL) {
throw new IllegalArgumentException("invalid orientation.");
}
if (mPendingSavedState != null && mPendingSavedState.mOrientation != orientation) {
// override pending state
mPendingSavedState.mOrientation = orientation;
}
if (orientation == mOrientation) {
return;
}
mOrientation = orientation;
mOrientationHelper = null;
requestLayout();
}
/**
* Calculates the view layout order. (e.g. from end to start or start to end)
* RTL layout support is applied automatically. So if layout is RTL and
* {@link #getReverseLayout()} is {@code true}, elements will be laid out starting from left.
*/
private void resolveShouldLayoutReverse() {
// A == B is the same result, but we rather keep it readable
if (mOrientation == VERTICAL || !isLayoutRTL()) {
mShouldReverseLayout = mReverseLayout;
} else {
mShouldReverseLayout = !mReverseLayout;
}
}
/**
* Returns if views are laid out from the opposite direction of the layout.
*
* @return If layout is reversed or not.
* @see {@link #setReverseLayout(boolean)}
*/
public boolean getReverseLayout() {
return mReverseLayout;
}
/**
* Used to reverse item traversal and layout order.
* This behaves similar to the layout change for RTL views. When set to true, first item is
* rendered at the end of the UI, second item is render before it etc.
* <p/>
* For horizontal layouts, it depends on the layout direction.
* When set to true, If {@link android.support.v7.widget.RecyclerView} is LTR, than it will
* render from RTL, if {@link android.support.v7.widget.RecyclerView}} is RTL, it will render
* from LTR.
* <p/>
* If you are looking for the exact same behavior of
* {@link android.widget.AbsListView#setStackFromBottom(boolean)}, use
* {@link #setStackFromEnd(boolean)}
*/
public void setReverseLayout(boolean reverseLayout) {
if (mPendingSavedState != null && mPendingSavedState.mReverseLayout != reverseLayout) {
// override pending state
mPendingSavedState.mReverseLayout = reverseLayout;
}
if (reverseLayout == mReverseLayout) {
return;
}
mReverseLayout = reverseLayout;
requestLayout();
}
/**
* {@inheritDoc}
*/
@Override
public View findViewByPosition(int position) {
final int childCount = getChildCount();
if (childCount == 0) {
return null;
}
final int firstChild = getPosition(getChildAt(0));
final int viewPosition = position - firstChild;
if (viewPosition >= 0 && viewPosition < childCount) {
return getChildAt(viewPosition);
}
return null;
}
/**
* <p>Returns the amount of extra space that should be rendered by LinearLayoutManager.
* By default, {@link android.support.v7.widget.LinearLayoutManager} lays out 1 extra page of
* items while smooth scrolling and 0 otherwise. You can override this method to implement your
* custom layout pre-cache logic.</p>
* <p>Laying out invisible elements will eventually come with performance cost. On the other
* hand, in places like smooth scrolling to an unknown location, this extra content helps
* LayoutManager to calculate a much smoother scrolling; which improves user experience.</p>
* <p>You can also use this if you are trying to pre-render your upcoming views.</p>
*
* @return The extra space that should be laid out (in pixels).
*/
protected int getExtraLayoutSpace(RecyclerView.State state) {
if (state.hasTargetScrollPosition()) {
return mOrientationHelper.getTotalSpace();
} else {
return 0;
}
}
@Override
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,
int position) {
LinearSmoothScroller linearSmoothScroller =
new LinearSmoothScroller(recyclerView.getContext()) {
@Override
public PointF computeScrollVectorForPosition(int targetPosition) {
return BaseLayoutManager.this
.computeScrollVectorForPosition(targetPosition);
}
};
linearSmoothScroller.setTargetPosition(position);
startSmoothScroll(linearSmoothScroller);
}
public PointF computeScrollVectorForPosition(int targetPosition) {
if (getChildCount() == 0) {
return null;
}
final int firstChildPos = getPosition(getChildAt(0));
final int direction = targetPosition < firstChildPos != mShouldReverseLayout ? -1 : 1;
if (mOrientation == HORIZONTAL) {
return new PointF(direction, 0);
} else {
return new PointF(0, direction);
}
}
/**
* {@inheritDoc}
*/
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
// layout algorithm:
// 1) by checking children and other variables, find an anchor coordinate and an anchor
// item position.
// 2) fill towards start, stacking from bottom
// 3) fill towards end, stacking from top
// 4) scroll to fulfill requirements like stack from bottom.
// create render state
if (DEBUG) {
Log.d(TAG, "is pre layout:" + state.isPreLayout());
}
if (mPendingSavedState != null) {
setOrientation(mPendingSavedState.mOrientation);
setReverseLayout(mPendingSavedState.mReverseLayout);
setStackFromEnd(mPendingSavedState.mStackFromEnd);
mPendingScrollPosition = mPendingSavedState.mAnchorPosition;
}
ensureRenderState();
// resolve layout direction
resolveShouldLayoutReverse();
// validate scroll position if exists
if (mPendingScrollPosition != RecyclerView.NO_POSITION) {
// validate it
if (mPendingScrollPosition < 0 || mPendingScrollPosition >= state.getItemCount()) {
mPendingScrollPosition = RecyclerView.NO_POSITION;
mPendingScrollPositionOffset = INVALID_OFFSET;
if (DEBUG) {
Log.e(TAG, "ignoring invalid scroll position " + mPendingScrollPosition);
}
}
}
// this value might be updated if there is a target scroll position without an offset
boolean layoutFromEnd = mShouldReverseLayout ^ mStackFromEnd;
final boolean stackFromEndChanged = mLastStackFromEnd != mStackFromEnd;
int anchorCoordinate, anchorItemPosition;
if (mPendingScrollPosition != RecyclerView.NO_POSITION) {
// if child is visible, try to make it a reference child and ensure it is fully visible.
// if child is not visible, align it depending on its virtual position.
anchorItemPosition = mPendingScrollPosition;
if (mPendingSavedState != null) {
// Anchor offset depends on how that child was laid out. Here, we update it
// according to our current view bounds
layoutFromEnd = mPendingSavedState.mAnchorLayoutFromEnd;
if (layoutFromEnd) {
anchorCoordinate = mOrientationHelper.getEndAfterPadding() -
mPendingSavedState.mAnchorOffset;
} else {
anchorCoordinate = mOrientationHelper.getStartAfterPadding() +
mPendingSavedState.mAnchorOffset;
}
} else if (mPendingScrollPositionOffset == INVALID_OFFSET) {
View child = findViewByPosition(mPendingScrollPosition);
if (child != null) {
final int startGap = mOrientationHelper.getDecoratedStart(child)
- mOrientationHelper.getStartAfterPadding();
final int endGap = mOrientationHelper.getEndAfterPadding() -
mOrientationHelper.getDecoratedEnd(child);
final int childSize = mOrientationHelper.getDecoratedMeasurement(child);
if (childSize > mOrientationHelper.getTotalSpace()) {
// item does not fit. fix depending on layout direction
anchorCoordinate = layoutFromEnd ? mOrientationHelper.getEndAfterPadding()
: mOrientationHelper.getStartAfterPadding();
} else if (startGap < 0) {
anchorCoordinate = mOrientationHelper.getStartAfterPadding();
layoutFromEnd = false;
} else if (endGap < 0) {
anchorCoordinate = mOrientationHelper.getEndAfterPadding();
layoutFromEnd = true;
} else {
anchorCoordinate = layoutFromEnd
? mOrientationHelper.getDecoratedEnd(child)
: mOrientationHelper.getDecoratedStart(child);
}
} else { // item is not visible.
if (getChildCount() > 0) {
// get position of any child, does not matter
int pos = getPosition(getChildAt(0));
if (mPendingScrollPosition < pos == mShouldReverseLayout) {
anchorCoordinate = mOrientationHelper.getEndAfterPadding();
layoutFromEnd = true;
} else {
anchorCoordinate = mOrientationHelper.getStartAfterPadding();
layoutFromEnd = false;
}
} else {
anchorCoordinate = layoutFromEnd ? mOrientationHelper.getEndAfterPadding()
: mOrientationHelper.getStartAfterPadding();
}
}
} else {
// override layout from end values for consistency
if (mShouldReverseLayout) {
anchorCoordinate = mOrientationHelper.getEndAfterPadding()
- mPendingScrollPositionOffset;
layoutFromEnd = true;
} else {
anchorCoordinate = mOrientationHelper.getStartAfterPadding()
+ mPendingScrollPositionOffset;
layoutFromEnd = false;
}
}
} else if (getChildCount() > 0 && !stackFromEndChanged) {
if (layoutFromEnd) {
View referenceChild = getChildClosestToEnd();
anchorCoordinate = mOrientationHelper.getDecoratedEnd(referenceChild);
anchorItemPosition = getPosition(referenceChild);
} else {
View referenceChild = getChildClosestToStart();
anchorCoordinate = mOrientationHelper.getDecoratedStart(referenceChild);
anchorItemPosition = getPosition(referenceChild);
}
} else {
anchorCoordinate = layoutFromEnd ? mOrientationHelper.getEndAfterPadding() :
mOrientationHelper.getStartAfterPadding();
anchorItemPosition = mStackFromEnd ? state.getItemCount() - 1 : 0;
}
detachAndScrapAttachedViews(recycler);
final int extraForStart;
final int extraForEnd;
final int extra = getExtraLayoutSpace(state);
boolean before = state.getTargetScrollPosition() < anchorItemPosition;
if (before == mShouldReverseLayout) {
extraForEnd = extra;
extraForStart = 0;
} else {
extraForStart = extra;
extraForEnd = 0;
}
// first fill towards start
updateRenderStateToFillStart(anchorItemPosition, anchorCoordinate);
mRenderState.mExtra = extraForStart;
if (!layoutFromEnd) {
mRenderState.mCurrentPosition += mRenderState.mItemDirection;
}
fill(recycler, mRenderState, state, false);
int startOffset = mRenderState.mOffset;
// fill towards end
updateRenderStateToFillEnd(anchorItemPosition, anchorCoordinate);
mRenderState.mExtra = extraForEnd;
if (layoutFromEnd) {
mRenderState.mCurrentPosition += mRenderState.mItemDirection;
}
fill(recycler, mRenderState, state, false);
int endOffset = mRenderState.mOffset;
// changes may cause gaps on the UI, try to fix them.
if (getChildCount() > 0) {
// because layout from end may be changed by scroll to position
// we re-calculate it.
// find which side we should check for gaps.
if (mShouldReverseLayout ^ mStackFromEnd) {
int fixOffset = fixLayoutEndGap(endOffset, recycler, state, true);
startOffset += fixOffset;
endOffset += fixOffset;
fixOffset = fixLayoutStartGap(startOffset, recycler, state, false);
startOffset += fixOffset;
endOffset += fixOffset;
} else {
int fixOffset = fixLayoutStartGap(startOffset, recycler, state, true);
startOffset += fixOffset;
endOffset += fixOffset;
fixOffset = fixLayoutEndGap(endOffset, recycler, state, false);
startOffset += fixOffset;
endOffset += fixOffset;
}
}
// If there are scrap children that we did not layout, we need to find where they did go
// and layout them accordingly so that animations can work as expected.
// This case may happen if new views are added or an existing view expands and pushes
// another view out of bounds.
if (getChildCount() > 0 && !state.isPreLayout() && supportsPredictiveItemAnimations()) {
// to make the logic simpler, we calculate the size of children and call fill.
int scrapExtraStart = 0, scrapExtraEnd = 0;
final List<RecyclerView.ViewHolder> scrapList = recycler.getScrapList();
final int scrapSize = scrapList.size();
final int firstChildPos = getPosition(getChildAt(0));
for (int i = 0; i < scrapSize; i++) {
RecyclerView.ViewHolder scrap = scrapList.get(i);
final int position = scrap.getPosition();
final int direction = position < firstChildPos != mShouldReverseLayout
? RenderState.LAYOUT_START : RenderState.LAYOUT_END;
if (direction == RenderState.LAYOUT_START) {
scrapExtraStart += mOrientationHelper.getDecoratedMeasurement(scrap.itemView);
} else {
scrapExtraEnd += mOrientationHelper.getDecoratedMeasurement(scrap.itemView);
}
}
if (DEBUG) {
Log.d(TAG, "for unused scrap, decided to add " + scrapExtraStart
+ " towards start and " + scrapExtraEnd + " towards end");
}
mRenderState.mScrapList = scrapList;
if (scrapExtraStart > 0) {
View anchor = getChildClosestToStart();
updateRenderStateToFillStart(getPosition(anchor), startOffset);
mRenderState.mExtra = scrapExtraStart;
mRenderState.mAvailable = 0;
mRenderState.mCurrentPosition += mShouldReverseLayout ? 1 : -1;
fill(recycler, mRenderState, state, false);
}
if (scrapExtraEnd > 0) {
View anchor = getChildClosestToEnd();
updateRenderStateToFillEnd(getPosition(anchor),
endOffset);
mRenderState.mExtra = scrapExtraEnd;
mRenderState.mAvailable = 0;
mRenderState.mCurrentPosition += mShouldReverseLayout ? -1 : 1;
fill(recycler, mRenderState, state, false);
}
mRenderState.mScrapList = null;
}
mPendingScrollPosition = RecyclerView.NO_POSITION;
mPendingScrollPositionOffset = INVALID_OFFSET;
mLastStackFromEnd = mStackFromEnd;
mPendingSavedState = null; // we don't need this anymore
if (DEBUG) {
validateChildOrder();
}
}
/**
* @return The final offset amount for children
*/
private int fixLayoutEndGap(int endOffset, RecyclerView.Recycler recycler,
RecyclerView.State state, boolean canOffsetChildren) {
int gap = mOrientationHelper.getEndAfterPadding() - endOffset;
int fixOffset = 0;
if (gap > 0) {
fixOffset = -scrollBy(-gap, recycler, state);
} else {
return 0; // nothing to fix
}
// move offset according to scroll amount
endOffset += fixOffset;
if (canOffsetChildren) {
// re-calculate gap, see if we could fix it
gap = mOrientationHelper.getEndAfterPadding() - endOffset;
if (gap > 0) {
mOrientationHelper.offsetChildren(gap);
return gap + fixOffset;
}
}
return fixOffset;
}
/**
* @return The final offset amount for children
*/
private int fixLayoutStartGap(int startOffset, RecyclerView.Recycler recycler,
RecyclerView.State state, boolean canOffsetChildren) {
int gap = startOffset - mOrientationHelper.getStartAfterPadding();
int fixOffset = 0;
if (gap > 0) {
// check if we should fix this gap.
fixOffset = -scrollBy(gap, recycler, state);
} else {
return 0; // nothing to fix
}
startOffset += fixOffset;
if (canOffsetChildren) {
// re-calculate gap, see if we could fix it
gap = startOffset - mOrientationHelper.getStartAfterPadding();
if (gap > 0) {
mOrientationHelper.offsetChildren(-gap);
return fixOffset - gap;
}
}
return fixOffset;
}
private void updateRenderStateToFillEnd(int itemPosition, int offset) {
mRenderState.mAvailable = mOrientationHelper.getEndAfterPadding() - offset;
mRenderState.mItemDirection = mShouldReverseLayout ? RenderState.ITEM_DIRECTION_HEAD :
RenderState.ITEM_DIRECTION_TAIL;
mRenderState.mCurrentPosition = itemPosition;
mRenderState.mLayoutDirection = RenderState.LAYOUT_END;
mRenderState.mOffset = offset;
mRenderState.mScrollingOffset = RenderState.SCOLLING_OFFSET_NaN;
}
private void updateRenderStateToFillStart(int itemPosition, int offset) {
mRenderState.mAvailable = offset - mOrientationHelper.getStartAfterPadding();
mRenderState.mCurrentPosition = itemPosition;
mRenderState.mItemDirection = mShouldReverseLayout ? RenderState.ITEM_DIRECTION_TAIL :
RenderState.ITEM_DIRECTION_HEAD;
mRenderState.mLayoutDirection = RenderState.LAYOUT_START;
mRenderState.mOffset = offset;
mRenderState.mScrollingOffset = RenderState.SCOLLING_OFFSET_NaN;
}
protected boolean isLayoutRTL() {
return getLayoutDirection() == ViewCompat.LAYOUT_DIRECTION_RTL;
}
void ensureRenderState() {
if (mRenderState == null) {
mRenderState = new RenderState();
}
if (mOrientationHelper == null) {
mOrientationHelper = mOrientation == HORIZONTAL ? createHorizontalOrientationHelper()
: createVerticalOrientationHelper();
}
}
/**
* <p>Scroll the RecyclerView to make the position visible.</p>
* <p/>
* <p>RecyclerView will scroll the minimum amount that is necessary to make the
* target position visible. If you are looking for a similar behavior to
* {@link android.widget.ListView#setSelection(int)} or
* {@link android.widget.ListView#setSelectionFromTop(int, int)}, use
* {@link #scrollToPositionWithOffset(int, int)}.</p>
* <p/>
* <p>Note that scroll position change will not be reflected until the next layout call.</p>
*
* @param position Scroll to this adapter position
* @see #scrollToPositionWithOffset(int, int)
*/
@Override
public void scrollToPosition(int position) {
mPendingScrollPosition = position;
mPendingScrollPositionOffset = INVALID_OFFSET;
requestLayout();
}
/**
* <p>Scroll to the specified adapter position with the given offset from layout start.</p>
* <p/>
* <p>Note that scroll position change will not be reflected until the next layout call.</p>
* <p/>
* <p>If you are just trying to make a position visible, use {@link
* #scrollToPosition(int)}.</p>
*
* @param position Index (starting at 0) of the reference item.
* @param offset The distance (in pixels) between the start edge of the item view and
* start edge of the RecyclerView.
* @see #setReverseLayout(boolean)
* @see #scrollToPosition(int)
*/
public void scrollToPositionWithOffset(int position, int offset) {
mPendingScrollPosition = position;
mPendingScrollPositionOffset = offset;
requestLayout();
}
/**
* {@inheritDoc}
*/
@Override
public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler,
RecyclerView.State state) {
if (mOrientation == VERTICAL) {
return 0;
}
return scrollBy(dx, recycler, state);
}
/**
* {@inheritDoc}
*/
@Override
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler,
RecyclerView.State state) {
if (mOrientation == HORIZONTAL) {
return 0;
}
return scrollBy(dy, recycler, state);
}
@Override
public int computeHorizontalScrollOffset(RecyclerView.State state) {
if (getChildCount() == 0) {
return 0;
}
final int topPosition = getPosition(getChildClosestToStart());
return mShouldReverseLayout ? state.getItemCount() - 1 - topPosition : topPosition;
}
@Override
public int computeVerticalScrollOffset(RecyclerView.State state) {
if (getChildCount() == 0) {
return 0;
}
final int topPosition = getPosition(getChildClosestToStart());
return mShouldReverseLayout ? state.getItemCount() - 1 - topPosition : topPosition;
}
@Override
public int computeHorizontalScrollExtent(RecyclerView.State state) {
return getChildCount();
}
@Override
public int computeVerticalScrollExtent(RecyclerView.State state) {
return getChildCount();
}
@Override
public int computeHorizontalScrollRange(RecyclerView.State state) {
return state.getItemCount();
}
@Override
public int computeVerticalScrollRange(RecyclerView.State state) {
return state.getItemCount();
}
private void updateRenderState(int layoutDirection, int requiredSpace,
boolean canUseExistingSpace, RecyclerView.State state) {
mRenderState.mExtra = getExtraLayoutSpace(state);
mRenderState.mLayoutDirection = layoutDirection;
int fastScrollSpace;
if (layoutDirection == RenderState.LAYOUT_END) {
// get the first child in the direction we are going
final View child = getChildClosestToEnd();
// the direction in which we are traversing children
mRenderState.mItemDirection = mShouldReverseLayout ? RenderState.ITEM_DIRECTION_HEAD
: RenderState.ITEM_DIRECTION_TAIL;
mRenderState.mCurrentPosition = getPosition(child) + mRenderState.mItemDirection;
mRenderState.mOffset = mOrientationHelper.getDecoratedEnd(child);
// calculate how much we can scroll without adding new children (independent of layout)
fastScrollSpace = mOrientationHelper.getDecoratedEnd(child)
- mOrientationHelper.getEndAfterPadding();
} else {
final View child = getChildClosestToStart();
mRenderState.mItemDirection = mShouldReverseLayout ? RenderState.ITEM_DIRECTION_TAIL
: RenderState.ITEM_DIRECTION_HEAD;
mRenderState.mCurrentPosition = getPosition(child) + mRenderState.mItemDirection;
mRenderState.mOffset = mOrientationHelper.getDecoratedStart(child);
fastScrollSpace = -mOrientationHelper.getDecoratedStart(child)
+ mOrientationHelper.getStartAfterPadding();
}
mRenderState.mAvailable = requiredSpace;
if (canUseExistingSpace) {
mRenderState.mAvailable -= fastScrollSpace;
}
mRenderState.mScrollingOffset = fastScrollSpace;
}
private int scrollBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) {
if (getChildCount() == 0 || dy == 0) {
return 0;
}
ensureRenderState();
final int layoutDirection = dy > 0 ? RenderState.LAYOUT_END : RenderState.LAYOUT_START;
final int absDy = Math.abs(dy);
updateRenderState(layoutDirection, absDy, true, state);
final int freeScroll = mRenderState.mScrollingOffset;
final int consumed = freeScroll + fill(recycler, mRenderState, state, false);
if (consumed < 0) {
if (DEBUG) {
Log.d(TAG, "Don't have any more elements to scroll");
}
return 0;
}
final int scrolled = absDy > consumed ? layoutDirection * consumed : dy;
mOrientationHelper.offsetChildren(-scrolled);
if (DEBUG) {
Log.d(TAG, "scroll req: " + dy + " scrolled: " + scrolled);
}
return scrolled;
}
/**
* Recycles children between given indices.
*
* @param startIndex inclusive
* @param endIndex exclusive
*/
private void recycleChildren(RecyclerView.Recycler recycler, int startIndex, int endIndex) {
if (startIndex == endIndex) {
return;
}
if (DEBUG) {
Log.d(TAG, "Recycling " + Math.abs(startIndex - endIndex) + " items");
}
if (endIndex > startIndex) {
for (int i = endIndex - 1; i >= startIndex; i--) {
removeAndRecycleViewAt(i, recycler);
}
} else {
for (int i = startIndex; i > endIndex; i--) {
removeAndRecycleViewAt(i, recycler);
}
}
}
/**
* Recycles views that went out of bounds after scrolling towards the end of the layout.
*
* @param recycler Recycler instance of {@link android.support.v7.widget.RecyclerView}
* @param dt This can be used to add additional padding to the visible area. This is used
* to
* detect children that will go out of bounds after scrolling, without actually
* moving them.
*/
private void recycleViewsFromStart(RecyclerView.Recycler recycler, int dt) {
if (dt < 0) {
if (DEBUG) {
Log.d(TAG, "Called recycle from start with a negative value. This might happen"
+ " during layout changes but may be sign of a bug");
}
return;
}
final int limit = mOrientationHelper.getStartAfterPadding() + dt;
final int childCount = getChildCount();
if (mShouldReverseLayout) {
for (int i = childCount - 1; i >= 0; i--) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedEnd(child) > limit) {// stop here
recycleChildren(recycler, childCount - 1, i);
return;
}
}
} else {
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedEnd(child) > limit) {// stop here
recycleChildren(recycler, 0, i);
return;
}
}
}
}
/**
* Recycles views that went out of bounds after scrolling towards the start of the layout.
*
* @param recycler Recycler instance of {@link android.support.v7.widget.RecyclerView}
* @param dt This can be used to add additional padding to the visible area. This is used
* to detect children that will go out of bounds after scrolling, without
* actually moving them.
*/
private void recycleViewsFromEnd(RecyclerView.Recycler recycler, int dt) {
final int childCount = getChildCount();
if (dt < 0) {
if (DEBUG) {
Log.d(TAG, "Called recycle from end with a negative value. This might happen"
+ " during layout changes but may be sign of a bug");
}
return;
}
final int limit = mOrientationHelper.getEndAfterPadding() - dt;
if (mShouldReverseLayout) {
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedStart(child) < limit) {// stop here
recycleChildren(recycler, 0, i);
return;
}
}
} else {
for (int i = childCount - 1; i >= 0; i--) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedStart(child) < limit) {// stop here
recycleChildren(recycler, childCount - 1, i);
return;
}
}
}
}
/**
* Helper method to call appropriate recycle method depending on current render layout
* direction
*
* @param recycler Current recycler that is attached to RecyclerView
* @param renderState Current render state. Right now, this object does not change but
* we may consider moving it out of this view so passing around as a
* parameter for now, rather than accessing {@link #mRenderState}
* @see #recycleViewsFromStart(android.support.v7.widget.RecyclerView.Recycler, int)
* @see #recycleViewsFromEnd(android.support.v7.widget.RecyclerView.Recycler, int)
* @see android.support.v7.widget.LinearLayoutManager.RenderState#mLayoutDirection
*/
protected void recycleByRenderState(RecyclerView.Recycler recycler, RenderState renderState) {
if (renderState.mLayoutDirection == RenderState.LAYOUT_START) {
recycleViewsFromEnd(recycler, renderState.mScrollingOffset);
} else {
recycleViewsFromStart(recycler, renderState.mScrollingOffset);
}
}
/**
* The magic functions :). Fills the given layout, defined by the renderState. This is fairly
* independent from the rest of the {@link android.support.v7.widget.LinearLayoutManager}
* and with little change, can be made publicly available as a helper class.
*
* @param recycler Current recycler that is attached to RecyclerView
* @param renderState Configuration on how we should fill out the available space.
* @param state Context passed by the RecyclerView to control scroll steps.
* @param stopOnFocusable If true, filling stops in the first focusable new child
* @return Number of pixels that it added. Useful for scoll functions.
*/
protected abstract int fill(RecyclerView.Recycler recycler, RenderState renderState,
RecyclerView.State state, boolean stopOnFocusable);
/**
* Converts a focusDirection to orientation.
*
* @param focusDirection One of {@link android.view.View#FOCUS_UP}, {@link android.view.View#FOCUS_DOWN},
* {@link android.view.View#FOCUS_LEFT}, {@link android.view.View#FOCUS_RIGHT},
* {@link android.view.View#FOCUS_BACKWARD}, {@link android.view.View#FOCUS_FORWARD}
* or 0 for not applicable
* @return {@link RenderState#LAYOUT_START} or {@link RenderState#LAYOUT_END} if focus direction
* is applicable to current state, {@link RenderState#INVALID_LAYOUT} otherwise.
*/
private int convertFocusDirectionToLayoutDirection(int focusDirection) {
switch (focusDirection) {
case View.FOCUS_BACKWARD:
return RenderState.LAYOUT_START;
case View.FOCUS_FORWARD:
return RenderState.LAYOUT_END;
case View.FOCUS_UP:
return mOrientation == VERTICAL ? RenderState.LAYOUT_START
: RenderState.INVALID_LAYOUT;
case View.FOCUS_DOWN:
return mOrientation == VERTICAL ? RenderState.LAYOUT_END
: RenderState.INVALID_LAYOUT;
case View.FOCUS_LEFT:
return mOrientation == HORIZONTAL ? RenderState.LAYOUT_START
: RenderState.INVALID_LAYOUT;
case View.FOCUS_RIGHT:
return mOrientation == HORIZONTAL ? RenderState.LAYOUT_END
: RenderState.INVALID_LAYOUT;
default:
if (DEBUG) {
Log.d(TAG, "Unknown focus request:" + focusDirection);
}
return RenderState.INVALID_LAYOUT;
}
}
/**
* Convenience method to find the child closes to start. Caller should check it has enough
* children.
*
* @return The child closes to start of the layout from user's perspective.
*/
private View getChildClosestToStart() {
return getChildAt(mShouldReverseLayout ? getChildCount() - 1 : 0);
}
/**
* Convenience method to find the child closes to end. Caller should check it has enough
* children.
*
* @return The child closes to end of the layout from user's perspective.
*/
private View getChildClosestToEnd() {
return getChildAt(mShouldReverseLayout ? 0 : getChildCount() - 1);
}
/**
* Returns the adapter position of the first visible view.
* <p/>
* Note that, this value is not affected by layout orientation or item order traversal.
* ({@link #setReverseLayout(boolean)}). Views are sorted by their positions in the adapter,
* not in the layout.
* <p/>
* If RecyclerView has item decorators, they will be considered in calculations as well.
* <p/>
* LinearLayoutManager may pre-cache some views that are not necessarily visible. Those views
* are ignored in this method.
*
* @return The adapter position of the first visible item or {@link android.support.v7.widget.RecyclerView#NO_POSITION} if
* there aren't any visible items.
* @see #findFirstCompletelyVisibleItemPosition()
* @see #findLastVisibleItemPosition()
*/
public int findFirstVisibleItemPosition() {
return findOneVisibleChild(0, getChildCount(), false);
}
/**
* Returns the adapter position of the first fully visible view.
* <p/>
* Note that bounds check is only performed in the current orientation. That means, if
* LinearLayoutManager is horizontal, it will only check the view's left and right edges.
*
* @return The adapter position of the first fully visible item or
* {@link android.support.v7.widget.RecyclerView#NO_POSITION} if there aren't any visible items.
* @see #findFirstVisibleItemPosition()
* @see #findLastCompletelyVisibleItemPosition()
*/
public int findFirstCompletelyVisibleItemPosition() {
return findOneVisibleChild(0, getChildCount(), true);
}
/**
* Returns the adapter position of the last visible view.
* <p/>
* Note that, this value is not affected by layout orientation or item order traversal.
* ({@link #setReverseLayout(boolean)}). Views are sorted by their positions in the adapter,
* not in the layout.
* <p/>
* If RecyclerView has item decorators, they will be considered in calculations as well.
* <p/>
* LinearLayoutManager may pre-cache some views that are not necessarily visible. Those views
* are ignored in this method.
*
* @return The adapter position of the last visible view or {@link android.support.v7.widget.RecyclerView#NO_POSITION} if
* there aren't any visible items.
* @see #findLastCompletelyVisibleItemPosition()
* @see #findFirstVisibleItemPosition()
*/
public int findLastVisibleItemPosition() {
return findOneVisibleChild(getChildCount() - 1, -1, false);
}
/**
* Returns the adapter position of the last fully visible view.
* <p/>
* Note that bounds check is only performed in the current orientation. That means, if
* LinearLayoutManager is horizontal, it will only check the view's left and right edges.
*
* @return The adapter position of the last fully visible view or
* {@link android.support.v7.widget.RecyclerView#NO_POSITION} if there aren't any visible items.
* @see #findLastVisibleItemPosition()
* @see #findFirstCompletelyVisibleItemPosition()
*/
public int findLastCompletelyVisibleItemPosition() {
return findOneVisibleChild(getChildCount() - 1, -1, true);
}
int findOneVisibleChild(int fromIndex, int toIndex, boolean completelyVisible) {
final int start = mOrientationHelper.getStartAfterPadding();
final int end = mOrientationHelper.getEndAfterPadding();
final int next = toIndex > fromIndex ? 1 : -1;
for (int i = fromIndex; i != toIndex; i += next) {
final View child = getChildAt(i);
final int childStart = mOrientationHelper.getDecoratedStart(child);
final int childEnd = mOrientationHelper.getDecoratedEnd(child);
if (childStart < end && childEnd > start) {
if (completelyVisible) {
if (childStart >= start && childEnd <= end) {
return getPosition(child);
}
} else {
return getPosition(child);
}
}
}
return RecyclerView.NO_POSITION;
}
@Override
public View onFocusSearchFailed(View focused, int focusDirection,
RecyclerView.Recycler recycler,
RecyclerView.State state) {
resolveShouldLayoutReverse();
if (getChildCount() == 0) {
return null;
}
final int layoutDir = convertFocusDirectionToLayoutDirection(focusDirection);
if (layoutDir == RenderState.INVALID_LAYOUT) {
return null;
}
final View referenceChild;
if (layoutDir == RenderState.LAYOUT_START) {
referenceChild = getChildClosestToStart();
} else {
referenceChild = getChildClosestToEnd();
}
ensureRenderState();
final int maxScroll = (int) (MAX_SCROLL_FACTOR * (mOrientationHelper.getEndAfterPadding() -
mOrientationHelper.getStartAfterPadding()));
updateRenderState(layoutDir, maxScroll, false, state);
mRenderState.mScrollingOffset = RenderState.SCOLLING_OFFSET_NaN;
fill(recycler, mRenderState, state, true);
final View nextFocus;
if (layoutDir == RenderState.LAYOUT_START) {
nextFocus = getChildClosestToStart();
} else {
nextFocus = getChildClosestToEnd();
}
if (nextFocus == referenceChild || !nextFocus.isFocusable()) {
return null;
}
return nextFocus;
}
/**
* Used for debugging.
* Logs the internal representation of children to default logger.
*/
private void logChildren() {
Log.d(TAG, "internal representation of views on the screen");
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
Log.d(TAG, "item " + getPosition(child) + ", coord:"
+ mOrientationHelper.getDecoratedStart(child));
}
Log.d(TAG, "==============");
}
/**
* Used for debugging.
* Validates that child views are laid out in correct order. This is important because rest of
* the algorithm relies on this constraint.
* <p/>
* In default layout, child 0 should be closest to screen position 0 and last child should be
* closest to position WIDTH or HEIGHT.
* In reverse layout, last child should be closes to screen position 0 and first child should
* be closest to position WIDTH or HEIGHT
*/
protected void validateChildOrder() {
Log.d(TAG, "validating child count " + getChildCount());
if (getChildCount() < 1) {
return;
}
int lastPos = getPosition(getChildAt(0));
int lastScreenLoc = mOrientationHelper.getDecoratedStart(getChildAt(0));
if (mShouldReverseLayout) {
for (int i = 1; i < getChildCount(); i++) {
View child = getChildAt(i);
int pos = getPosition(child);
int screenLoc = mOrientationHelper.getDecoratedStart(child);
if (pos < lastPos) {
logChildren();
throw new RuntimeException("detected invalid position. loc invalid? " +
(screenLoc < lastScreenLoc));
}
if (screenLoc > lastScreenLoc) {
logChildren();
throw new RuntimeException("detected invalid location");
}
}
} else {
for (int i = 1; i < getChildCount(); i++) {
View child = getChildAt(i);
int pos = getPosition(child);
int screenLoc = mOrientationHelper.getDecoratedStart(child);
if (pos < lastPos) {
logChildren();
throw new RuntimeException("detected invalid position. loc invalid? " +
(screenLoc < lastScreenLoc));
}
if (screenLoc < lastScreenLoc) {
logChildren();
throw new RuntimeException("detected invalid location");
}
}
}
}
@Override
public boolean supportsPredictiveItemAnimations() {
return true;
}
/**
* Helper class that keeps temporary state while {LayoutManager} is filling out the empty
* space.
*/
protected static class RenderState {
final static String TAG = "LinearLayoutManager#RenderState";
final static int LAYOUT_START = -1;
final static int LAYOUT_END = 1;
final static int INVALID_LAYOUT = Integer.MIN_VALUE;
final static int ITEM_DIRECTION_HEAD = -1;
final static int ITEM_DIRECTION_TAIL = 1;
final static int SCOLLING_OFFSET_NaN = Integer.MIN_VALUE;
/**
* Pixel offset where rendering should start
*/
int mOffset;
/**
* Number of pixels that we should fill, in the layout direction.
*/
int mAvailable;
/**
* Current position on the adapter to get the next item.
*/
int mCurrentPosition;
/**
* Defines the direction in which the data adapter is traversed.
* Should be {@link #ITEM_DIRECTION_HEAD} or {@link #ITEM_DIRECTION_TAIL}
*/
int mItemDirection;
/**
* Defines the direction in which the layout is filled.
* Should be {@link #LAYOUT_START} or {@link #LAYOUT_END}
*/
int mLayoutDirection;
/**
* Used when RenderState is constructed in a scrolling state.
* It should be set the amount of scrolling we can make without creating a new view.
* Settings this is required for efficient view recycling.
*/
int mScrollingOffset;
/**
* Used if you want to pre-layout items that are not yet visible.
* The difference with {@link #mAvailable} is that, when recycling, distance rendered for
* {@link #mExtra} is not considered to avoid recycling visible children.
*/
int mExtra = 0;
/**
* When LLM needs to layout particular views, it sets this list in which case, RenderState
* will only return views from this list and return null if it cannot find an item.
*/
List<RecyclerView.ViewHolder> mScrapList = null;
/**
* @return true if there are more items in the data adapter
*/
boolean hasMore(RecyclerView.State state) {
return mCurrentPosition >= 0 && mCurrentPosition < state.getItemCount();
}
/**
* Gets the view for the next element that we should render.
* Also updates current item index to the next item, based on {@link #mItemDirection}
*
* @return The next element that we should render.
*/
View next(RecyclerView.Recycler recycler) {
if (mScrapList != null) {
return nextFromLimitedList();
}
final View view = recycler.getViewForPosition(mCurrentPosition);
mCurrentPosition += mItemDirection;
return view;
}
/**
* Returns next item from limited list.
* <p/>
* Upon finding a valid VH, sets current item position to VH.itemPosition + mItemDirection
*
* @return View if an item in the current position or direction exists if not null.
*/
private View nextFromLimitedList() {
int size = mScrapList.size();
RecyclerView.ViewHolder closest = null;
int closestDistance = Integer.MAX_VALUE;
for (int i = 0; i < size; i++) {
RecyclerView.ViewHolder viewHolder = mScrapList.get(i);
final int distance = (viewHolder.getPosition() - mCurrentPosition) * mItemDirection;
if (distance < 0) {
continue; // item is not in current direction
}
if (distance < closestDistance) {
closest = viewHolder;
closestDistance = distance;
if (distance == 0) {
break;
}
}
}
if (DEBUG) {
Log.d(TAG, "layout from scrap. found view:?" + (closest != null));
}
if (closest != null) {
mCurrentPosition = closest.getPosition() + mItemDirection;
return closest.itemView;
}
return null;
}
void log() {
Log.d(TAG, "avail:" + mAvailable + ", ind:" + mCurrentPosition + ", dir:" +
mItemDirection + ", offset:" + mOffset + ", layoutDir:" + mLayoutDirection);
}
}
OrientationHelper createVerticalOrientationHelper() {
return new OrientationHelper() {
@Override
public int getEndAfterPadding() {
return getHeight() - getPaddingBottom();
}
@Override
public void offsetChildren(int amount) {
offsetChildrenVertical(amount);
}
@Override
public int getStartAfterPadding() {
return getPaddingTop();
}
@Override
public int getDecoratedMeasurement(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedMeasuredHeight(view) + params.topMargin + params.bottomMargin;
}
@Override
public int getDecoratedMeasurementInOther(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedMeasuredWidth(view) + params.leftMargin + params.rightMargin;
}
@Override
public int getDecoratedEnd(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedBottom(view) + params.bottomMargin;
}
@Override
public int getDecoratedStart(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedTop(view) - params.topMargin;
}
@Override
public int getTotalSpace() {
return getHeight() - getPaddingTop() - getPaddingBottom();
}
};
}
OrientationHelper createHorizontalOrientationHelper() {
return new OrientationHelper() {
@Override
public int getEndAfterPadding() {
return getWidth() - getPaddingRight();
}
@Override
public void offsetChildren(int amount) {
offsetChildrenHorizontal(amount);
}
@Override
public int getStartAfterPadding() {
return getPaddingLeft();
}
@Override
public int getDecoratedMeasurement(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedMeasuredWidth(view) + params.leftMargin + params.rightMargin;
}
@Override
public int getDecoratedMeasurementInOther(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedMeasuredHeight(view) + params.topMargin + params.bottomMargin;
}
@Override
public int getDecoratedEnd(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedRight(view) + params.rightMargin;
}
@Override
public int getDecoratedStart(View view) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
view.getLayoutParams();
return getDecoratedLeft(view) - params.leftMargin;
}
@Override
public int getTotalSpace() {
return getWidth() - getPaddingLeft() - getPaddingRight();
}
};
}
/**
* Helper interface to offload orientation based decisions
*/
static interface OrientationHelper {
/**
* @param view The view element to check
* @return The first pixel of the element
* @see #getDecoratedEnd(android.view.View)
*/
int getDecoratedStart(View view);
/**
* @param view The view element to check
* @return The last pixel of the element
* @see #getDecoratedStart(android.view.View)
*/
int getDecoratedEnd(View view);
/**
* @param view The view element to check
* @return Total space occupied by this view
*/
int getDecoratedMeasurement(View view);
/**
* @param view The view element to check
* @return Total space occupied by this view in the perpendicular orientation to current one
*/
int getDecoratedMeasurementInOther(View view);
/**
* @return The very first pixel we can draw.
*/
int getStartAfterPadding();
/**
* @return The last pixel we can draw
*/
int getEndAfterPadding();
/**
* Offsets all children's positions by the given amount
*
* @param amount Value to add to each child's layout parameters
*/
void offsetChildren(int amount);
/**
* Returns the total space to layout.
*
* @return Total space to layout children
*/
int getTotalSpace();
}
static class SavedState implements Parcelable {
int mOrientation;
int mAnchorPosition;
int mAnchorOffset;
boolean mReverseLayout;
boolean mStackFromEnd;
boolean mAnchorLayoutFromEnd;
public SavedState() {
}
SavedState(Parcel in) {
mOrientation = in.readInt();
mAnchorPosition = in.readInt();
mAnchorOffset = in.readInt();
mReverseLayout = in.readInt() == 1;
mStackFromEnd = in.readInt() == 1;
mAnchorLayoutFromEnd = in.readInt() == 1;
}
public SavedState(SavedState other) {
mOrientation = other.mOrientation;
mAnchorPosition = other.mAnchorPosition;
mAnchorOffset = other.mAnchorOffset;
mReverseLayout = other.mReverseLayout;
mStackFromEnd = other.mStackFromEnd;
mAnchorLayoutFromEnd = other.mAnchorLayoutFromEnd;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mOrientation);
dest.writeInt(mAnchorPosition);
dest.writeInt(mAnchorOffset);
dest.writeInt(mReverseLayout ? 1 : 0);
dest.writeInt(mStackFromEnd ? 1 : 0);
dest.writeInt(mAnchorLayoutFromEnd ? 1 : 0);
}
public static final Creator<SavedState> CREATOR
= new Creator<SavedState>() {
@Override
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
@Override
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
}
} | {
"content_hash": "073fd659776965f37b6f1ea359dfdf22",
"timestamp": "",
"source": "github",
"line_count": 1588,
"max_line_length": 135,
"avg_line_length": 39.585642317380355,
"alnum_prop": 0.5973402055295727,
"repo_name": "vincent-t/KinoCast",
"id": "4608b7677e891a9af946c9b091c97729d32810b2",
"size": "63482",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/ov3rk1ll/kinocast/ui/helper/layout/BaseLayoutManager.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "757771"
}
],
"symlink_target": ""
} |
Rails.application.routes.draw do
get '/oturum_ac', to: 'sessions#new', as: :login
delete '/oturumu_kapat', to: 'sessions#destroy', as: :logout
resource :session, only: :create
resources :forums, only: [:index, :show], path: 'forumlar' do
resources :uruns, only: [:new, :create],
path: 'urunler',
path_names: {new: 'yeni'}
end
resources :uruns, except: [:index, :new, :create],
path: 'urunler',
path_names: {edit: 'duzenle'} do
resources :comments, only: [:new, :create],
path: 'yorumlar',
path_names: {new: 'yeni'}
end
resources :comments, only: [:edit, :update, :destroy],
path: 'yorumlar',
path_names: {edit: 'duzenle'}
get '/users/new', to: redirect('/kaydol')
resources :users, except: :index
get '/kaydol', to: 'users#new', as: :register
get '/:id', to: 'users#show', as: :profile
get '/:id/edit', to: 'users#edit', as: :edit_profile
root 'forums#index'
#scope(path_names: {new: 'yeni', edit: 'güncelle'}) do
# resources :products, path: 'urunler'
#end
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'
# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Example resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Example resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Example resource route with more complex sub-resources:
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', on: :collection
# end
# end
# Example resource route with concerns:
# concern :toggleable do
# post 'toggle'
# end
# resources :posts, concerns: :toggleable
# resources :photos, concerns: :toggleable
# Example resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
end
| {
"content_hash": "e6fb55fb0c05d47280acc33d0f4a964a",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 84,
"avg_line_length": 28.4,
"alnum_prop": 0.6115641215715345,
"repo_name": "gdzkursad/Project",
"id": "7a5a4104dbee12c7a845badc7ded86cda59748b0",
"size": "2699",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/routes.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "52504"
},
{
"name": "CoffeeScript",
"bytes": "844"
},
{
"name": "JavaScript",
"bytes": "273"
},
{
"name": "Ruby",
"bytes": "51892"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/bg_swipe_todo_item_left"/>
<corners android:radius="2dp"/>
</shape> | {
"content_hash": "072b36171a7afb4d0a6c9f3acab5a11a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 66,
"avg_line_length": 42,
"alnum_prop": 0.6857142857142857,
"repo_name": "cempo/SimpleTodoList",
"id": "c352dcd21a208480c1c858ac89285bfa76304c69",
"size": "210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/drawable/bg_today_task_swipe_todo_item_left.xml",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2613"
},
{
"name": "Kotlin",
"bytes": "140625"
},
{
"name": "Ruby",
"bytes": "1821"
}
],
"symlink_target": ""
} |
package com.intellij.psi.formatter;
import com.intellij.formatting.Block;
import com.intellij.formatting.FormattingDocumentModel;
import com.intellij.formatting.FormattingModel;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.util.text.CharArrayUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author lesya
*/
public class DocumentBasedFormattingModel implements FormattingModel {
private final Block myRootBlock;
private final FormattingDocumentModel myDocumentModel;
private final Document myDocument;
private final Project myProject;
private final CodeStyleSettings mySettings;
private final FileType myFileType;
public DocumentBasedFormattingModel(final Block rootBlock,
final Document document,
final Project project,
final CodeStyleSettings settings,
final FileType fileType,
final PsiFile file) {
myRootBlock = rootBlock;
myDocument = document;
myProject = project;
mySettings = settings;
myFileType = fileType;
myDocumentModel = new FormattingDocumentModelImpl(document,file);
}
public DocumentBasedFormattingModel(final Block rootBlock,
final Project project,
final CodeStyleSettings settings,
final FileType fileType,
final PsiFile file) {
myRootBlock = rootBlock;
myProject = project;
mySettings = settings;
myFileType = fileType;
myDocumentModel = FormattingDocumentModelImpl.createOn(file);
myDocument = ((FormattingDocumentModelImpl)myDocumentModel).getDocument();
}
@NotNull
public Block getRootBlock() {
return myRootBlock;
}
@NotNull
public FormattingDocumentModel getDocumentModel() {
return myDocumentModel;
}
public TextRange replaceWhiteSpace(TextRange textRange, String whiteSpace) {
boolean removesStartMarker;
String marker;
// When processing injection in cdata / comment we need not remove start / end markers that present as whitespace during check in
// com.intellij.formatting.WhiteSpace and during building formatter model = blocks in e.g. com.intellij.psi.formatter.xml.XmlTagBlock
if ((removesStartMarker = (removesPattern(textRange, whiteSpace, marker = "<![CDATA[") ||
removesPattern(textRange, whiteSpace, marker ="<!--["))) ||
removesPattern(textRange, whiteSpace, marker = "]]>") ||
removesPattern(textRange, whiteSpace, marker = "]-->")
) {
String newWs = null;
if (removesStartMarker) {
int at = CharArrayUtil.indexOf(myDocument.getCharsSequence(), marker, textRange.getStartOffset(), textRange.getEndOffset() + 1);
String ws = myDocument.getCharsSequence().subSequence(textRange.getStartOffset(), textRange.getEndOffset()).toString();
newWs = mergeWsWithCdataMarker(whiteSpace, ws, at - textRange.getStartOffset());
}
if (newWs == null) return textRange;
whiteSpace = newWs;
}
myDocument.replaceString(textRange.getStartOffset(),
textRange.getEndOffset(),
whiteSpace);
return new TextRange(textRange.getStartOffset(), textRange.getStartOffset() + whiteSpace.length());
}
private boolean removesPattern(final TextRange textRange, final String whiteSpace, final String pattern) {
return CharArrayUtil.indexOf(myDocument.getCharsSequence(), pattern, textRange.getStartOffset(), textRange.getEndOffset() + 1) != -1 &&
CharArrayUtil.indexOf(whiteSpace, pattern, 0) == -1;
}
public TextRange shiftIndentInsideRange(TextRange range, int indent) {
final int newLength = shiftIndentInside(range, indent);
return new TextRange(range.getStartOffset(), range.getStartOffset() + newLength);
}
public void commitChanges() {
PsiDocumentManager.getInstance(myProject).commitDocument(myDocument);
}
private int shiftIndentInside(final TextRange elementRange, final int shift) {
final StringBuffer buffer = new StringBuffer();
StringBuffer afterWhiteSpace = new StringBuffer();
int whiteSpaceLength = 0;
boolean insideWhiteSpace = true;
int line = 0;
for (int i = elementRange.getStartOffset(); i < elementRange.getEndOffset(); i++) {
final char c = myDocument.getCharsSequence().charAt(i);
switch (c) {
case '\n':
if (line > 0) {
createWhiteSpace(whiteSpaceLength + shift, buffer);
}
buffer.append(afterWhiteSpace.toString());
insideWhiteSpace = true;
whiteSpaceLength = 0;
afterWhiteSpace = new StringBuffer();
buffer.append(c);
line++;
break;
case ' ':
if (insideWhiteSpace) {
whiteSpaceLength += 1;
}
else {
afterWhiteSpace.append(c);
}
break;
case '\t':
if (insideWhiteSpace) {
whiteSpaceLength += getIndentOptions().TAB_SIZE;
}
else {
afterWhiteSpace.append(c);
}
break;
default:
insideWhiteSpace = false;
afterWhiteSpace.append(c);
}
}
if (line > 0) {
createWhiteSpace(whiteSpaceLength + shift, buffer);
}
buffer.append(afterWhiteSpace.toString());
myDocument.replaceString(elementRange.getStartOffset(), elementRange.getEndOffset(), buffer.toString());
return buffer.length();
}
private void createWhiteSpace(final int whiteSpaceLength, StringBuffer buffer) {
final CodeStyleSettings.IndentOptions indentOptions = getIndentOptions();
if (indentOptions.USE_TAB_CHARACTER) {
int tabs = whiteSpaceLength / indentOptions.TAB_SIZE;
int spaces = whiteSpaceLength - tabs * indentOptions.TAB_SIZE;
StringUtil.repeatSymbol(buffer, '\t', tabs);
StringUtil.repeatSymbol(buffer, ' ', spaces);
}
else {
StringUtil.repeatSymbol(buffer, ' ', whiteSpaceLength);
}
}
private CodeStyleSettings.IndentOptions getIndentOptions() {
return mySettings.getIndentOptions(myFileType);
}
public Document getDocument() {
return myDocument;
}
public Project getProject() {
return myProject;
}
@Nullable
public static String mergeWsWithCdataMarker(String whiteSpace, final String s, final int cdataPos) {
final int firstCrInGeneratedWs = whiteSpace.indexOf('\n');
final int secondCrInGeneratedWs = firstCrInGeneratedWs != -1 ? whiteSpace.indexOf('\n', firstCrInGeneratedWs + 1) : -1;
final int firstCrInPreviousWs = s.indexOf('\n');
final int secondCrInPreviousWs = firstCrInPreviousWs != -1 ? s.indexOf('\n', firstCrInPreviousWs + 1) : -1;
boolean knowHowToModifyCData = false;
if (secondCrInPreviousWs != -1 && secondCrInGeneratedWs != -1 && cdataPos > firstCrInPreviousWs && cdataPos < secondCrInPreviousWs) {
whiteSpace = whiteSpace.substring(0, secondCrInGeneratedWs) +
s.substring(firstCrInPreviousWs + 1, secondCrInPreviousWs) +
whiteSpace.substring(secondCrInGeneratedWs);
knowHowToModifyCData = true;
}
if (!knowHowToModifyCData) whiteSpace = null;
return whiteSpace;
}
}
| {
"content_hash": "581680fddec39db39b18a7d8b36cf328",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 139,
"avg_line_length": 37.951219512195124,
"alnum_prop": 0.6703084832904884,
"repo_name": "jexp/idea2",
"id": "45c7f3f0b94de478357904fc50b7b2db1b103f27",
"size": "8380",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platform/lang-impl/src/com/intellij/psi/formatter/DocumentBasedFormattingModel.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "6350"
},
{
"name": "C#",
"bytes": "103"
},
{
"name": "C++",
"bytes": "30760"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Java",
"bytes": "72888555"
},
{
"name": "JavaScript",
"bytes": "910"
},
{
"name": "PHP",
"bytes": "133"
},
{
"name": "Perl",
"bytes": "6523"
},
{
"name": "Shell",
"bytes": "4068"
}
],
"symlink_target": ""
} |
package pl.java.scalatech.file;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Test;
import pl.java.scalatech.CommonCreateCamelContext;
public class FileXmlReader extends CommonCreateCamelContext {
@Test
public void shouldReadAndXmlFile() throws Exception {
createContextWithGivenRoute(new MyRouteBuilder(), 1200);
}
class MyRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("file://inbox?noop=true&fileName=person.xml").convertBodyTo(String.class).process(exchange -> {
log.info("{}", exchange.getIn().getBody());
}).to("log:myCamel?level=INFO&showBody=true&multiline=true");
}
}
}
| {
"content_hash": "999709dd8897ba0d14be0147e70cced0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 112,
"avg_line_length": 30.875,
"alnum_prop": 0.6882591093117408,
"repo_name": "przodownikR1/camelRest",
"id": "1b85320c297bf3a5fc92640bf7c79c7918a3b0a6",
"size": "741",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/pl/java/scalatech/file/FileXmlReader.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "44157"
},
{
"name": "HTML",
"bytes": "3625"
},
{
"name": "Java",
"bytes": "43953"
},
{
"name": "JavaScript",
"bytes": "93866"
}
],
"symlink_target": ""
} |
<?php
require_once 'Sitengine/View.php';
abstract class Sitengine_Blog_Frontend_Blogs_Posts_QuoteView extends Sitengine_View {
protected $_controller = null;
protected $_queries = array();
protected $_settings = array();
protected $_sections = array();
protected $_inputMode = null;
public function __construct(array $config)
{
if(isset($config['controller']) && $config['controller'] instanceof Sitengine_Blog_Frontend_Blogs_Posts_Controller)
{
$this->_controller = $config['controller'];
}
else {
require_once 'Sitengine/Exception.php';
throw new Sitengine_Exception('construct error');
}
}
public function setInputMode($inputMode)
{
$this->_inputMode = $inputMode;
}
public function build()
{
try {
$this->_controller->getViewHelper()->build();
$this->_queries = $this->_controller->getViewHelper()->getQueries();
$this->_settings = $this->_controller->getViewHelper()->getSettings();
$this->_sections = $this->_controller->getViewHelper()->getSections();
$this->setSection('POST', $this->_getMainSection());
$this->setSection(
'COMMENTS',
$this->_controller->getViewHelper()->getComments(
$this->_controller->getEntity()->getId()
)
);
$this->setSection(
'COMMENTACTIONS',
$this->_controller->getViewHelper()->getCommentActions(
$this->_controller->getEntity()->getId()
)
);
return $this;
}
catch (Exception $exception) {
require_once 'Sitengine/Blog/Frontend/Blogs/Posts/Exception.php';
throw new Sitengine_Blog_Frontend_Blogs_Posts_Exception('build page error', $exception);
}
}
public function getData()
{
try {
return array(
'QUERIES' => $this->_queries,
'SECTIONS' => $this->_sections,
'SETTINGS' => $this->_settings,
#'ENV' => $this->_controller->getEnv()->getData(),
#'Env' => $this->_controller->getEnv(),
#'STATUS' => $this->_controller->getStatus()->getData(),
#'ORGANIZATION' => $this->_controller->getPermiso()->getOrganization()->getData(),
#'USER' => $this->_controller->getPermiso()->getAuth()->getData(),
#'Auth' => $this->_controller->getPermiso()->getAuth(),
#'DICTIONARY' => $this->_controller->getTranslate()->translateGroup('data')->toArray()
);
}
catch (Exception $exception) {
require_once 'Sitengine/Blog/Frontend/Blogs/Posts/Exception.php';
throw new Sitengine_Blog_Frontend_Blogs_Posts_Exception('build page error', $exception);
}
}
public function setSection($name, array $data)
{
$this->_sections[$name] = $data;
}
protected function _getMainSection()
{
try {
$table = $this->_controller->getFrontController()->getBlogPackage()->getPostsTable();
$table->setTranscript($this->_controller->getPreferences()->getTranscript());
$data = $table->complementRow($this->_controller->getEntity()->getRow());
#$data['cdate'] = $this->_controller->getViewHelper()->formatDate($data['cdate']);
#$data['mdate'] = $this->_controller->getViewHelper()->formatDate($data['mdate']);
$data = array_merge($data, $this->_controller->getViewHelper()->fetchAuthor($data['uid']));
return $data;
}
catch (Exception $exception) {
require_once 'Sitengine/Blog/Frontend/Blogs/Posts/Exception.php';
throw new Sitengine_Blog_Frontend_Blogs_Posts_Exception('form page error', $exception);
}
}
}
?> | {
"content_hash": "381a75a6a3744069c24f45cf8c549ad6",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 120,
"avg_line_length": 31.07377049180328,
"alnum_prop": 0.5816407280400949,
"repo_name": "sitengine/sitengine",
"id": "db94b0f5b94e1db6c5b58767a05c24ccb1c11a25",
"size": "4195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_Includes/Sitengine/Blog/Frontend/Blogs/Posts/QuoteView.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "636344"
},
{
"name": "PHP",
"bytes": "25952146"
}
],
"symlink_target": ""
} |
/**
* LineItemCreativeAssociationStats.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.axis.v201403;
/**
* Contains statistics such as impressions, clicks delivered and cost
* for {@link LineItemCreativeAssociation} objects.
*/
public class LineItemCreativeAssociationStats implements java.io.Serializable {
/* A {@link Stats} object that holds delivered impressions and
* clicks
* statistics. */
private com.google.api.ads.dfp.axis.v201403.Stats stats;
/* A map containing {@link Stats} objects for each creative belonging
* to
* a creative set, {@code null} for non creative set
* associations. */
private com.google.api.ads.dfp.axis.v201403.Long_StatsMapEntry[] creativeSetStats;
/* The revenue generated thus far by the creative from its association
* with
* the particular line item in the publisher's currency. */
private com.google.api.ads.dfp.axis.v201403.Money costInOrderCurrency;
public LineItemCreativeAssociationStats() {
}
public LineItemCreativeAssociationStats(
com.google.api.ads.dfp.axis.v201403.Stats stats,
com.google.api.ads.dfp.axis.v201403.Long_StatsMapEntry[] creativeSetStats,
com.google.api.ads.dfp.axis.v201403.Money costInOrderCurrency) {
this.stats = stats;
this.creativeSetStats = creativeSetStats;
this.costInOrderCurrency = costInOrderCurrency;
}
/**
* Gets the stats value for this LineItemCreativeAssociationStats.
*
* @return stats * A {@link Stats} object that holds delivered impressions and
* clicks
* statistics.
*/
public com.google.api.ads.dfp.axis.v201403.Stats getStats() {
return stats;
}
/**
* Sets the stats value for this LineItemCreativeAssociationStats.
*
* @param stats * A {@link Stats} object that holds delivered impressions and
* clicks
* statistics.
*/
public void setStats(com.google.api.ads.dfp.axis.v201403.Stats stats) {
this.stats = stats;
}
/**
* Gets the creativeSetStats value for this LineItemCreativeAssociationStats.
*
* @return creativeSetStats * A map containing {@link Stats} objects for each creative belonging
* to
* a creative set, {@code null} for non creative set
* associations.
*/
public com.google.api.ads.dfp.axis.v201403.Long_StatsMapEntry[] getCreativeSetStats() {
return creativeSetStats;
}
/**
* Sets the creativeSetStats value for this LineItemCreativeAssociationStats.
*
* @param creativeSetStats * A map containing {@link Stats} objects for each creative belonging
* to
* a creative set, {@code null} for non creative set
* associations.
*/
public void setCreativeSetStats(com.google.api.ads.dfp.axis.v201403.Long_StatsMapEntry[] creativeSetStats) {
this.creativeSetStats = creativeSetStats;
}
public com.google.api.ads.dfp.axis.v201403.Long_StatsMapEntry getCreativeSetStats(int i) {
return this.creativeSetStats[i];
}
public void setCreativeSetStats(int i, com.google.api.ads.dfp.axis.v201403.Long_StatsMapEntry _value) {
this.creativeSetStats[i] = _value;
}
/**
* Gets the costInOrderCurrency value for this LineItemCreativeAssociationStats.
*
* @return costInOrderCurrency * The revenue generated thus far by the creative from its association
* with
* the particular line item in the publisher's currency.
*/
public com.google.api.ads.dfp.axis.v201403.Money getCostInOrderCurrency() {
return costInOrderCurrency;
}
/**
* Sets the costInOrderCurrency value for this LineItemCreativeAssociationStats.
*
* @param costInOrderCurrency * The revenue generated thus far by the creative from its association
* with
* the particular line item in the publisher's currency.
*/
public void setCostInOrderCurrency(com.google.api.ads.dfp.axis.v201403.Money costInOrderCurrency) {
this.costInOrderCurrency = costInOrderCurrency;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof LineItemCreativeAssociationStats)) return false;
LineItemCreativeAssociationStats other = (LineItemCreativeAssociationStats) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.stats==null && other.getStats()==null) ||
(this.stats!=null &&
this.stats.equals(other.getStats()))) &&
((this.creativeSetStats==null && other.getCreativeSetStats()==null) ||
(this.creativeSetStats!=null &&
java.util.Arrays.equals(this.creativeSetStats, other.getCreativeSetStats()))) &&
((this.costInOrderCurrency==null && other.getCostInOrderCurrency()==null) ||
(this.costInOrderCurrency!=null &&
this.costInOrderCurrency.equals(other.getCostInOrderCurrency())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getStats() != null) {
_hashCode += getStats().hashCode();
}
if (getCreativeSetStats() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getCreativeSetStats());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getCreativeSetStats(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (getCostInOrderCurrency() != null) {
_hashCode += getCostInOrderCurrency().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(LineItemCreativeAssociationStats.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201403", "LineItemCreativeAssociationStats"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("stats");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201403", "stats"));
elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201403", "Stats"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("creativeSetStats");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201403", "creativeSetStats"));
elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201403", "Long_StatsMapEntry"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("costInOrderCurrency");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201403", "costInOrderCurrency"));
elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201403", "Money"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| {
"content_hash": "63378e02b7ae23bde7a1575aa3a5c34f",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 148,
"avg_line_length": 38.75833333333333,
"alnum_prop": 0.6408299290475167,
"repo_name": "nafae/developer",
"id": "c325576d81c02927a59f64efdc925941df5ae500",
"size": "9302",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/v201403/LineItemCreativeAssociationStats.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "127846798"
},
{
"name": "Perl",
"bytes": "28418"
}
],
"symlink_target": ""
} |
// TODO: InputComponentControl shouldn't inherit from ComponentControl (in its
// form) - there's functionality in ComponentControl that we don't need
// here. ComponentControl needs to decomposed into an abstract control
// and a concrete 'general' component class (which would contain the
// functionality InputComponentControl doesn't use).
using System;
using System.Drawing;
using System.Windows.Forms;
using Beaufort;
using Beaufort.Input;
namespace FritzTheDog
{
internal class InputComponentControl : ComponentControl
{
//-------------------------------------------------------------------------
private Panel _buttonsPanel;
//-------------------------------------------------------------------------
public InputComponentControl(IComponent targetComponent,
IComponentContainer componentContainerInfo)
:
base(targetComponent, componentContainerInfo)
{
}
//-------------------------------------------------------------------------
public override void DoUpdate()
{
try
{
UpdateButtonColours();
}
catch (Exception ex)
{
MainForm.ErrorMsg(ex);
}
}
//-------------------------------------------------------------------------
protected override void Component_Load(object sender, EventArgs e)
{
base.Component_Load(sender, e);
BackColor = Color.Green;
}
//-------------------------------------------------------------------------
protected override void CreateOutputsUi(Panel panel)
{
try
{
_buttonsPanel = panel;
// TODO: Support other iputs.
var input = TargetComponent as DiscreteInput;
if (input == null)
{
return;
}
foreach (var state in input.GetStates())
{
byte value = state.Key;
string name = state.Value;
AddOutputValueButton(name, value, panel);
}
}
catch (Exception ex)
{
MainForm.ErrorMsg(ex);
}
}
//-------------------------------------------------------------------------
void AddOutputValueButton(string stateName,
object stateValue,
Panel panel)
{
var button = new Button
{
Text = stateName,
Tag = stateValue
};
button.Click += (object sender, EventArgs args) =>
{
var component = TargetComponent as IInput;
if (component == null)
{
return;
}
component.UpdateValue(button.Tag);
};
panel.Controls.Add(button);
}
//-------------------------------------------------------------------------
void UpdateButtonColours()
{
if (TargetComponent is DiscreteInput == false)
{
return;
}
foreach (Control c in _buttonsPanel.Controls)
{
var button = c as Button;
if (button == null)
{
continue;
}
c.BackColor =
(byte)c.Tag == ((DiscreteInput)TargetComponent).Value
? Color.Green
: Color.Transparent;
}
}
//-------------------------------------------------------------------------
}
} | {
"content_hash": "32ddba336fd033298f490a978fdd1dac",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 79,
"avg_line_length": 24.21167883211679,
"alnum_prop": 0.4564365390413024,
"repo_name": "grae22/Beaufort",
"id": "ecc45f7d6a79db9334dd5cc1a7af1d387746e519",
"size": "3319",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FritzTheDog/InputComponentControl.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "4164"
},
{
"name": "C#",
"bytes": "77003"
}
],
"symlink_target": ""
} |
<?php
namespace garethp\ews\API\Type;
/**
* Class representing SearchExpression
*/
class SearchExpression extends SearchExpressionType
{
}
| {
"content_hash": "177af272591098156497389819fe1ff1",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 51,
"avg_line_length": 12.083333333333334,
"alnum_prop": 0.7586206896551724,
"repo_name": "Garethp/php-ews",
"id": "5f08d0989c59857c7c164d2fdd3293cb675669f7",
"size": "145",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/API/Type/SearchExpression.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "1046851"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "b99db3d857f1088d13f44a37835aede6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "e497c094935e8b5ba76b7c461edec198024bb1e5",
"size": "176",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Acanthaceae/Habracanthus/Habracanthus corei/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.elasticsearch.index;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.index.MergePolicy;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.node.Node;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Function;
/**
* This class encapsulates all index level settings and handles settings updates.
* It's created per index and available to all index level classes and allows them to retrieve
* the latest updated settings instance. Classes that need to listen to settings updates can register
* a settings consumer at index creation via {@link IndexModule#addSettingsUpdateConsumer(Setting, Consumer)} that will
* be called for each settings update.
*/
public final class IndexSettings {
public static final Setting<List<String>> DEFAULT_FIELD_SETTING =
Setting.listSetting("index.query.default_field", Collections.singletonList("*"),
Function.identity(), Property.IndexScope, Property.Dynamic);
public static final Setting<Boolean> QUERY_STRING_LENIENT_SETTING =
Setting.boolSetting("index.query_string.lenient", false, Property.IndexScope);
public static final Setting<Boolean> QUERY_STRING_ANALYZE_WILDCARD =
Setting.boolSetting("indices.query.query_string.analyze_wildcard", false, Property.NodeScope);
public static final Setting<Boolean> QUERY_STRING_ALLOW_LEADING_WILDCARD =
Setting.boolSetting("indices.query.query_string.allowLeadingWildcard", true, Property.NodeScope);
public static final Setting<Boolean> ALLOW_UNMAPPED =
Setting.boolSetting("index.query.parse.allow_unmapped_fields", true, Property.IndexScope);
public static final Setting<TimeValue> INDEX_TRANSLOG_SYNC_INTERVAL_SETTING =
Setting.timeSetting("index.translog.sync_interval", TimeValue.timeValueSeconds(5), TimeValue.timeValueMillis(100),
Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_IDLE_AFTER =
Setting.timeSetting("index.search.idle.after", TimeValue.timeValueSeconds(30),
TimeValue.timeValueMinutes(0), Property.IndexScope, Property.Dynamic);
public static final Setting<Translog.Durability> INDEX_TRANSLOG_DURABILITY_SETTING =
new Setting<>("index.translog.durability", Translog.Durability.REQUEST.name(),
(value) -> Translog.Durability.valueOf(value.toUpperCase(Locale.ROOT)), Property.Dynamic, Property.IndexScope);
public static final Setting<Boolean> INDEX_WARMER_ENABLED_SETTING =
Setting.boolSetting("index.warmer.enabled", true, Property.Dynamic, Property.IndexScope);
public static final Setting<Boolean> INDEX_TTL_DISABLE_PURGE_SETTING =
Setting.boolSetting("index.ttl.disable_purge", false, Property.Dynamic, Property.IndexScope);
public static final Setting<String> INDEX_CHECK_ON_STARTUP = new Setting<>("index.shard.check_on_startup", "false", (s) -> {
switch(s) {
case "false":
case "true":
case "fix":
case "checksum":
return s;
default:
throw new IllegalArgumentException("unknown value for [index.shard.check_on_startup] must be one of [true, false, fix, checksum] but was: " + s);
}
}, Property.IndexScope);
/**
* Index setting describing the maximum value of from + size on a query.
* The Default maximum value of from + size on a query is 10,000. This was chosen as
* a conservative default as it is sure to not cause trouble. Users can
* certainly profile their cluster and decide to set it to 100,000
* safely. 1,000,000 is probably way to high for any cluster to set
* safely.
*/
public static final Setting<Integer> MAX_RESULT_WINDOW_SETTING =
Setting.intSetting("index.max_result_window", 10000, 1, Property.Dynamic, Property.IndexScope);
/**
* Index setting describing the maximum value of from + size on an individual inner hit definition or
* top hits aggregation. The default maximum of 100 is defensive for the reason that the number of inner hit responses
* and number of top hits buckets returned is unbounded. Profile your cluster when increasing this setting.
*/
public static final Setting<Integer> MAX_INNER_RESULT_WINDOW_SETTING =
Setting.intSetting("index.max_inner_result_window", 100, 1, Property.Dynamic, Property.IndexScope);
/**
* Index setting describing the maximum value of allowed `script_fields`that can be retrieved
* per search request. The default maximum of 32 is defensive for the reason that retrieving
* script fields is a costly operation.
*/
public static final Setting<Integer> MAX_SCRIPT_FIELDS_SETTING =
Setting.intSetting("index.max_script_fields", 32, 0, Property.Dynamic, Property.IndexScope);
/**
* A setting describing the maximum number of tokens that can be
* produced using _analyze API. The default maximum of 10000 is defensive
* to prevent generating too many token objects.
*/
public static final Setting<Integer> MAX_TOKEN_COUNT_SETTING =
Setting.intSetting("index.analyze.max_token_count", 10000, 1, Property.Dynamic, Property.IndexScope);
/**
* Index setting describing for NGramTokenizer and NGramTokenFilter
* the maximum difference between
* max_gram (maximum length of characters in a gram) and
* min_gram (minimum length of characters in a gram).
* The default value is 1 as this is default difference in NGramTokenizer,
* and is defensive as it prevents generating too many index terms.
*/
public static final Setting<Integer> MAX_NGRAM_DIFF_SETTING =
Setting.intSetting("index.max_ngram_diff", 1, 0, Property.Dynamic, Property.IndexScope);
/**
* Index setting describing for ShingleTokenFilter
* the maximum difference between
* max_shingle_size and min_shingle_size.
* The default value is 3 is defensive as it prevents generating too many tokens.
*/
public static final Setting<Integer> MAX_SHINGLE_DIFF_SETTING =
Setting.intSetting("index.max_shingle_diff", 3, 0, Property.Dynamic, Property.IndexScope);
/**
* Index setting describing the maximum value of allowed `docvalue_fields`that can be retrieved
* per search request. The default maximum of 100 is defensive for the reason that retrieving
* doc values might incur a per-field per-document seek.
*/
public static final Setting<Integer> MAX_DOCVALUE_FIELDS_SEARCH_SETTING =
Setting.intSetting("index.max_docvalue_fields_search", 100, 0, Property.Dynamic, Property.IndexScope);
/**
* Index setting describing the maximum size of the rescore window. Defaults to {@link #MAX_RESULT_WINDOW_SETTING}
* because they both do the same thing: control the size of the heap of hits.
*/
public static final Setting<Integer> MAX_RESCORE_WINDOW_SETTING =
Setting.intSetting("index.max_rescore_window", MAX_RESULT_WINDOW_SETTING, 1, Property.Dynamic, Property.IndexScope);
/**
* Index setting describing the maximum number of filters clauses that can be used
* in an adjacency_matrix aggregation. The max number of buckets produced by
* N filters is (N*N)/2 so a limit of 100 filters is imposed by default.
*/
public static final Setting<Integer> MAX_ADJACENCY_MATRIX_FILTERS_SETTING =
Setting.intSetting("index.max_adjacency_matrix_filters", 100, 2, Property.Dynamic, Property.IndexScope);
public static final TimeValue DEFAULT_REFRESH_INTERVAL = new TimeValue(1, TimeUnit.SECONDS);
public static final Setting<TimeValue> INDEX_REFRESH_INTERVAL_SETTING =
Setting.timeSetting("index.refresh_interval", DEFAULT_REFRESH_INTERVAL, new TimeValue(-1, TimeUnit.MILLISECONDS),
Property.Dynamic, Property.IndexScope);
public static final Setting<ByteSizeValue> INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING =
Setting.byteSizeSetting("index.translog.flush_threshold_size", new ByteSizeValue(512, ByteSizeUnit.MB), Property.Dynamic,
Property.IndexScope);
/**
* Controls how long translog files that are no longer needed for persistence reasons
* will be kept around before being deleted. A longer retention policy is useful to increase
* the chance of ops based recoveries.
**/
public static final Setting<TimeValue> INDEX_TRANSLOG_RETENTION_AGE_SETTING =
Setting.timeSetting("index.translog.retention.age", TimeValue.timeValueHours(12), TimeValue.timeValueMillis(-1), Property.Dynamic,
Property.IndexScope);
/**
* Controls how many translog files that are no longer needed for persistence reasons
* will be kept around before being deleted. Keeping more files is useful to increase
* the chance of ops based recoveries.
**/
public static final Setting<ByteSizeValue> INDEX_TRANSLOG_RETENTION_SIZE_SETTING =
Setting.byteSizeSetting("index.translog.retention.size", new ByteSizeValue(512, ByteSizeUnit.MB), Property.Dynamic,
Property.IndexScope);
/**
* The maximum size of a translog generation. This is independent of the maximum size of
* translog operations that have not been flushed.
*/
public static final Setting<ByteSizeValue> INDEX_TRANSLOG_GENERATION_THRESHOLD_SIZE_SETTING =
Setting.byteSizeSetting(
"index.translog.generation_threshold_size",
new ByteSizeValue(64, ByteSizeUnit.MB),
/*
* An empty translog occupies 43 bytes on disk. If the generation threshold is
* below this, the flush thread can get stuck in an infinite loop repeatedly
* rolling the generation as every new generation will already exceed the
* generation threshold. However, small thresholds are useful for testing so we
* do not add a large lower bound here.
*/
new ByteSizeValue(64, ByteSizeUnit.BYTES),
new ByteSizeValue(Long.MAX_VALUE, ByteSizeUnit.BYTES),
new Property[]{Property.Dynamic, Property.IndexScope});
/**
* Index setting to enable / disable deletes garbage collection.
* This setting is realtime updateable
*/
public static final TimeValue DEFAULT_GC_DELETES = TimeValue.timeValueSeconds(60);
public static final Setting<TimeValue> INDEX_GC_DELETES_SETTING =
Setting.timeSetting("index.gc_deletes", DEFAULT_GC_DELETES, new TimeValue(-1, TimeUnit.MILLISECONDS), Property.Dynamic,
Property.IndexScope);
/**
* The maximum number of refresh listeners allows on this shard.
*/
public static final Setting<Integer> MAX_REFRESH_LISTENERS_PER_SHARD = Setting.intSetting("index.max_refresh_listeners", 1000, 0,
Property.Dynamic, Property.IndexScope);
/**
* The maximum number of slices allowed in a scroll request
*/
public static final Setting<Integer> MAX_SLICES_PER_SCROLL = Setting.intSetting("index.max_slices_per_scroll",
1024, 1, Property.Dynamic, Property.IndexScope);
public static final String INDEX_MAPPING_SINGLE_TYPE_SETTING_KEY = "index.mapping.single_type";
private static final Setting<Boolean> INDEX_MAPPING_SINGLE_TYPE_SETTING; // private - should not be registered
static {
Function<Settings, String> defValue = settings -> {
boolean singleType = true;
if (settings.getAsVersion(IndexMetaData.SETTING_VERSION_CREATED, null) != null) {
singleType = Version.indexCreated(settings).onOrAfter(Version.V_6_0_0_alpha1);
}
return Boolean.valueOf(singleType).toString();
};
INDEX_MAPPING_SINGLE_TYPE_SETTING = Setting.boolSetting(INDEX_MAPPING_SINGLE_TYPE_SETTING_KEY, defValue, Property.IndexScope,
Property.Final);
}
private final Index index;
private final Version version;
private final Logger logger;
private final String nodeName;
private final Settings nodeSettings;
private final int numberOfShards;
// volatile fields are updated via #updateIndexMetaData(IndexMetaData) under lock
private volatile Settings settings;
private volatile IndexMetaData indexMetaData;
private volatile List<String> defaultFields;
private final boolean queryStringLenient;
private final boolean queryStringAnalyzeWildcard;
private final boolean queryStringAllowLeadingWildcard;
private final boolean defaultAllowUnmappedFields;
private volatile Translog.Durability durability;
private final TimeValue syncInterval;
private volatile TimeValue refreshInterval;
private volatile ByteSizeValue flushThresholdSize;
private volatile TimeValue translogRetentionAge;
private volatile ByteSizeValue translogRetentionSize;
private volatile ByteSizeValue generationThresholdSize;
private final MergeSchedulerConfig mergeSchedulerConfig;
private final MergePolicyConfig mergePolicyConfig;
private final IndexSortConfig indexSortConfig;
private final IndexScopedSettings scopedSettings;
private long gcDeletesInMillis = DEFAULT_GC_DELETES.millis();
private volatile boolean warmerEnabled;
private volatile int maxResultWindow;
private volatile int maxInnerResultWindow;
private volatile int maxAdjacencyMatrixFilters;
private volatile int maxRescoreWindow;
private volatile int maxDocvalueFields;
private volatile int maxScriptFields;
private volatile int maxTokenCount;
private volatile int maxNgramDiff;
private volatile int maxShingleDiff;
private volatile boolean TTLPurgeDisabled;
private volatile TimeValue searchIdleAfter;
/**
* The maximum number of refresh listeners allows on this shard.
*/
private volatile int maxRefreshListeners;
/**
* The maximum number of slices allowed in a scroll request.
*/
private volatile int maxSlicesPerScroll;
/**
* Whether the index is required to have at most one type.
*/
private final boolean singleType;
/**
* Returns the default search fields for this index.
*/
public List<String> getDefaultFields() {
return defaultFields;
}
private void setDefaultFields(List<String> defaultFields) {
this.defaultFields = defaultFields;
}
/**
* Returns <code>true</code> if query string parsing should be lenient. The default is <code>false</code>
*/
public boolean isQueryStringLenient() {
return queryStringLenient;
}
/**
* Returns <code>true</code> if the query string should analyze wildcards. The default is <code>false</code>
*/
public boolean isQueryStringAnalyzeWildcard() {
return queryStringAnalyzeWildcard;
}
/**
* Returns <code>true</code> if the query string parser should allow leading wildcards. The default is <code>true</code>
*/
public boolean isQueryStringAllowLeadingWildcard() {
return queryStringAllowLeadingWildcard;
}
/**
* Returns <code>true</code> if queries should be lenient about unmapped fields. The default is <code>true</code>
*/
public boolean isDefaultAllowUnmappedFields() {
return defaultAllowUnmappedFields;
}
/**
* Creates a new {@link IndexSettings} instance. The given node settings will be merged with the settings in the metadata
* while index level settings will overwrite node settings.
*
* @param indexMetaData the index metadata this settings object is associated with
* @param nodeSettings the nodes settings this index is allocated on.
*/
public IndexSettings(final IndexMetaData indexMetaData, final Settings nodeSettings) {
this(indexMetaData, nodeSettings, IndexScopedSettings.DEFAULT_SCOPED_SETTINGS);
}
/**
* Creates a new {@link IndexSettings} instance. The given node settings will be merged with the settings in the metadata
* while index level settings will overwrite node settings.
*
* @param indexMetaData the index metadata this settings object is associated with
* @param nodeSettings the nodes settings this index is allocated on.
*/
public IndexSettings(final IndexMetaData indexMetaData, final Settings nodeSettings, IndexScopedSettings indexScopedSettings) {
scopedSettings = indexScopedSettings.copy(nodeSettings, indexMetaData);
this.nodeSettings = nodeSettings;
this.settings = Settings.builder().put(nodeSettings).put(indexMetaData.getSettings()).build();
this.index = indexMetaData.getIndex();
version = Version.indexCreated(settings);
logger = Loggers.getLogger(getClass(), settings, index);
nodeName = Node.NODE_NAME_SETTING.get(settings);
this.indexMetaData = indexMetaData;
numberOfShards = settings.getAsInt(IndexMetaData.SETTING_NUMBER_OF_SHARDS, null);
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings);
this.queryStringAnalyzeWildcard = QUERY_STRING_ANALYZE_WILDCARD.get(nodeSettings);
this.queryStringAllowLeadingWildcard = QUERY_STRING_ALLOW_LEADING_WILDCARD.get(nodeSettings);
this.defaultAllowUnmappedFields = scopedSettings.get(ALLOW_UNMAPPED);
this.durability = scopedSettings.get(INDEX_TRANSLOG_DURABILITY_SETTING);
defaultFields = scopedSettings.get(DEFAULT_FIELD_SETTING);
syncInterval = INDEX_TRANSLOG_SYNC_INTERVAL_SETTING.get(settings);
refreshInterval = scopedSettings.get(INDEX_REFRESH_INTERVAL_SETTING);
flushThresholdSize = scopedSettings.get(INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING);
translogRetentionAge = scopedSettings.get(INDEX_TRANSLOG_RETENTION_AGE_SETTING);
translogRetentionSize = scopedSettings.get(INDEX_TRANSLOG_RETENTION_SIZE_SETTING);
generationThresholdSize = scopedSettings.get(INDEX_TRANSLOG_GENERATION_THRESHOLD_SIZE_SETTING);
mergeSchedulerConfig = new MergeSchedulerConfig(this);
gcDeletesInMillis = scopedSettings.get(INDEX_GC_DELETES_SETTING).getMillis();
warmerEnabled = scopedSettings.get(INDEX_WARMER_ENABLED_SETTING);
maxResultWindow = scopedSettings.get(MAX_RESULT_WINDOW_SETTING);
maxInnerResultWindow = scopedSettings.get(MAX_INNER_RESULT_WINDOW_SETTING);
maxAdjacencyMatrixFilters = scopedSettings.get(MAX_ADJACENCY_MATRIX_FILTERS_SETTING);
maxRescoreWindow = scopedSettings.get(MAX_RESCORE_WINDOW_SETTING);
maxDocvalueFields = scopedSettings.get(MAX_DOCVALUE_FIELDS_SEARCH_SETTING);
maxScriptFields = scopedSettings.get(MAX_SCRIPT_FIELDS_SETTING);
maxTokenCount = scopedSettings.get(MAX_TOKEN_COUNT_SETTING);
maxNgramDiff = scopedSettings.get(MAX_NGRAM_DIFF_SETTING);
maxShingleDiff = scopedSettings.get(MAX_SHINGLE_DIFF_SETTING);
TTLPurgeDisabled = scopedSettings.get(INDEX_TTL_DISABLE_PURGE_SETTING);
maxRefreshListeners = scopedSettings.get(MAX_REFRESH_LISTENERS_PER_SHARD);
maxSlicesPerScroll = scopedSettings.get(MAX_SLICES_PER_SCROLL);
this.mergePolicyConfig = new MergePolicyConfig(logger, this);
this.indexSortConfig = new IndexSortConfig(this);
searchIdleAfter = scopedSettings.get(INDEX_SEARCH_IDLE_AFTER);
singleType = INDEX_MAPPING_SINGLE_TYPE_SETTING.get(indexMetaData.getSettings()); // get this from metadata - it's not registered
if ((singleType || version.before(Version.V_6_0_0_alpha1)) == false) {
throw new AssertionError(index.toString() + "multiple types are only allowed on pre 6.x indices but version is: ["
+ version + "]");
}
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_COMPOUND_FORMAT_SETTING, mergePolicyConfig::setNoCFSRatio);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_EXPUNGE_DELETES_ALLOWED_SETTING, mergePolicyConfig::setExpungeDeletesAllowed);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_FLOOR_SEGMENT_SETTING, mergePolicyConfig::setFloorSegmentSetting);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING, mergePolicyConfig::setMaxMergesAtOnce);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING, mergePolicyConfig::setMaxMergesAtOnceExplicit);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING, mergePolicyConfig::setMaxMergedSegment);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING, mergePolicyConfig::setSegmentsPerTier);
scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING, mergePolicyConfig::setReclaimDeletesWeight);
scopedSettings.addSettingsUpdateConsumer(MergeSchedulerConfig.MAX_THREAD_COUNT_SETTING, MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING,
mergeSchedulerConfig::setMaxThreadAndMergeCount);
scopedSettings.addSettingsUpdateConsumer(MergeSchedulerConfig.AUTO_THROTTLE_SETTING, mergeSchedulerConfig::setAutoThrottle);
scopedSettings.addSettingsUpdateConsumer(INDEX_TRANSLOG_DURABILITY_SETTING, this::setTranslogDurability);
scopedSettings.addSettingsUpdateConsumer(INDEX_TTL_DISABLE_PURGE_SETTING, this::setTTLPurgeDisabled);
scopedSettings.addSettingsUpdateConsumer(MAX_RESULT_WINDOW_SETTING, this::setMaxResultWindow);
scopedSettings.addSettingsUpdateConsumer(MAX_INNER_RESULT_WINDOW_SETTING, this::setMaxInnerResultWindow);
scopedSettings.addSettingsUpdateConsumer(MAX_ADJACENCY_MATRIX_FILTERS_SETTING, this::setMaxAdjacencyMatrixFilters);
scopedSettings.addSettingsUpdateConsumer(MAX_RESCORE_WINDOW_SETTING, this::setMaxRescoreWindow);
scopedSettings.addSettingsUpdateConsumer(MAX_DOCVALUE_FIELDS_SEARCH_SETTING, this::setMaxDocvalueFields);
scopedSettings.addSettingsUpdateConsumer(MAX_SCRIPT_FIELDS_SETTING, this::setMaxScriptFields);
scopedSettings.addSettingsUpdateConsumer(MAX_TOKEN_COUNT_SETTING, this::setMaxTokenCount);
scopedSettings.addSettingsUpdateConsumer(MAX_NGRAM_DIFF_SETTING, this::setMaxNgramDiff);
scopedSettings.addSettingsUpdateConsumer(MAX_SHINGLE_DIFF_SETTING, this::setMaxShingleDiff);
scopedSettings.addSettingsUpdateConsumer(INDEX_WARMER_ENABLED_SETTING, this::setEnableWarmer);
scopedSettings.addSettingsUpdateConsumer(INDEX_GC_DELETES_SETTING, this::setGCDeletes);
scopedSettings.addSettingsUpdateConsumer(INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING, this::setTranslogFlushThresholdSize);
scopedSettings.addSettingsUpdateConsumer(
INDEX_TRANSLOG_GENERATION_THRESHOLD_SIZE_SETTING,
this::setGenerationThresholdSize);
scopedSettings.addSettingsUpdateConsumer(INDEX_TRANSLOG_RETENTION_AGE_SETTING, this::setTranslogRetentionAge);
scopedSettings.addSettingsUpdateConsumer(INDEX_TRANSLOG_RETENTION_SIZE_SETTING, this::setTranslogRetentionSize);
scopedSettings.addSettingsUpdateConsumer(INDEX_REFRESH_INTERVAL_SETTING, this::setRefreshInterval);
scopedSettings.addSettingsUpdateConsumer(MAX_REFRESH_LISTENERS_PER_SHARD, this::setMaxRefreshListeners);
scopedSettings.addSettingsUpdateConsumer(MAX_SLICES_PER_SCROLL, this::setMaxSlicesPerScroll);
scopedSettings.addSettingsUpdateConsumer(DEFAULT_FIELD_SETTING, this::setDefaultFields);
scopedSettings.addSettingsUpdateConsumer(INDEX_SEARCH_IDLE_AFTER, this::setSearchIdleAfter);
}
private void setSearchIdleAfter(TimeValue searchIdleAfter) { this.searchIdleAfter = searchIdleAfter; }
private void setTranslogFlushThresholdSize(ByteSizeValue byteSizeValue) {
this.flushThresholdSize = byteSizeValue;
}
private void setTranslogRetentionSize(ByteSizeValue byteSizeValue) {
this.translogRetentionSize = byteSizeValue;
}
private void setTranslogRetentionAge(TimeValue age) {
this.translogRetentionAge = age;
}
private void setGenerationThresholdSize(final ByteSizeValue generationThresholdSize) {
this.generationThresholdSize = generationThresholdSize;
}
private void setGCDeletes(TimeValue timeValue) {
this.gcDeletesInMillis = timeValue.getMillis();
}
private void setRefreshInterval(TimeValue timeValue) {
this.refreshInterval = timeValue;
}
/**
* Returns the settings for this index. These settings contain the node and index level settings where
* settings that are specified on both index and node level are overwritten by the index settings.
*/
public Settings getSettings() { return settings; }
/**
* Returns the index this settings object belongs to
*/
public Index getIndex() {
return index;
}
/**
* Returns the indexes UUID
*/
public String getUUID() {
return getIndex().getUUID();
}
/**
* Returns <code>true</code> if the index has a custom data path
*/
public boolean hasCustomDataPath() {
return customDataPath() != null;
}
/**
* Returns the customDataPath for this index, if configured. <code>null</code> o.w.
*/
public String customDataPath() {
return settings.get(IndexMetaData.SETTING_DATA_PATH);
}
/**
* Returns the version the index was created on.
* @see Version#indexCreated(Settings)
*/
public Version getIndexVersionCreated() {
return version;
}
/**
* Returns the current node name
*/
public String getNodeName() {
return nodeName;
}
/**
* Returns the current IndexMetaData for this index
*/
public IndexMetaData getIndexMetaData() {
return indexMetaData;
}
/**
* Returns the number of shards this index has.
*/
public int getNumberOfShards() { return numberOfShards; }
/**
* Returns the number of replicas this index has.
*/
public int getNumberOfReplicas() { return settings.getAsInt(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, null); }
/**
* Returns whether the index enforces at most one type.
*/
public boolean isSingleType() { return singleType; }
/**
* Returns the node settings. The settings returned from {@link #getSettings()} are a merged version of the
* index settings and the node settings where node settings are overwritten by index settings.
*/
public Settings getNodeSettings() {
return nodeSettings;
}
/**
* Updates the settings and index metadata and notifies all registered settings consumers with the new settings iff at least one setting has changed.
*
* @return <code>true</code> iff any setting has been updated otherwise <code>false</code>.
*/
public synchronized boolean updateIndexMetaData(IndexMetaData indexMetaData) {
final Settings newSettings = indexMetaData.getSettings();
if (version.equals(Version.indexCreated(newSettings)) == false) {
throw new IllegalArgumentException("version mismatch on settings update expected: " + version + " but was: " + Version.indexCreated(newSettings));
}
final String newUUID = newSettings.get(IndexMetaData.SETTING_INDEX_UUID, IndexMetaData.INDEX_UUID_NA_VALUE);
if (newUUID.equals(getUUID()) == false) {
throw new IllegalArgumentException("uuid mismatch on settings update expected: " + getUUID() + " but was: " + newUUID);
}
this.indexMetaData = indexMetaData;
final Settings existingSettings = this.settings;
if (existingSettings.filter(IndexScopedSettings.INDEX_SETTINGS_KEY_PREDICATE)
.equals(newSettings.filter(IndexScopedSettings.INDEX_SETTINGS_KEY_PREDICATE))) {
// nothing to update, same settings
return false;
}
scopedSettings.applySettings(newSettings);
this.settings = Settings.builder().put(nodeSettings).put(newSettings).build();
return true;
}
/**
* Returns the translog durability for this index.
*/
public Translog.Durability getTranslogDurability() {
return durability;
}
private void setTranslogDurability(Translog.Durability durability) {
this.durability = durability;
}
/**
* Returns true if index warmers are enabled, otherwise <code>false</code>
*/
public boolean isWarmerEnabled() {
return warmerEnabled;
}
private void setEnableWarmer(boolean enableWarmer) {
this.warmerEnabled = enableWarmer;
}
/**
* Returns the translog sync interval. This is the interval in which the transaction log is asynchronously fsynced unless
* the transaction log is fsyncing on every operations
*/
public TimeValue getTranslogSyncInterval() {
return syncInterval;
}
/**
* Returns this interval in which the shards of this index are asynchronously refreshed. <tt>-1</tt> means async refresh is disabled.
*/
public TimeValue getRefreshInterval() {
return refreshInterval;
}
/**
* Returns the transaction log threshold size when to forcefully flush the index and clear the transaction log.
*/
public ByteSizeValue getFlushThresholdSize() { return flushThresholdSize; }
/**
* Returns the transaction log retention size which controls how much of the translog is kept around to allow for ops based recoveries
*/
public ByteSizeValue getTranslogRetentionSize() { return translogRetentionSize; }
/**
* Returns the transaction log retention age which controls the maximum age (time from creation) that translog files will be kept around
*/
public TimeValue getTranslogRetentionAge() { return translogRetentionAge; }
/**
* Returns the generation threshold size. As sequence numbers can cause multiple generations to
* be preserved for rollback purposes, we want to keep the size of individual generations from
* growing too large to avoid excessive disk space consumption. Therefore, the translog is
* automatically rolled to a new generation when the current generation exceeds this generation
* threshold size.
*
* @return the generation threshold size
*/
public ByteSizeValue getGenerationThresholdSize() {
return generationThresholdSize;
}
/**
* Returns the {@link MergeSchedulerConfig}
*/
public MergeSchedulerConfig getMergeSchedulerConfig() { return mergeSchedulerConfig; }
/**
* Returns the max result window for search requests, describing the maximum value of from + size on a query.
*/
public int getMaxResultWindow() {
return this.maxResultWindow;
}
private void setMaxResultWindow(int maxResultWindow) {
this.maxResultWindow = maxResultWindow;
}
/**
* Returns the max result window for an individual inner hit definition or top hits aggregation.
*/
public int getMaxInnerResultWindow() {
return maxInnerResultWindow;
}
private void setMaxInnerResultWindow(int maxInnerResultWindow) {
this.maxInnerResultWindow = maxInnerResultWindow;
}
/**
* Returns the max number of filters in adjacency_matrix aggregation search requests
*/
public int getMaxAdjacencyMatrixFilters() {
return this.maxAdjacencyMatrixFilters;
}
private void setMaxAdjacencyMatrixFilters(int maxAdjacencyFilters) {
this.maxAdjacencyMatrixFilters = maxAdjacencyFilters;
}
/**
* Returns the maximum rescore window for search requests.
*/
public int getMaxRescoreWindow() {
return maxRescoreWindow;
}
private void setMaxRescoreWindow(int maxRescoreWindow) {
this.maxRescoreWindow = maxRescoreWindow;
}
/**
* Returns the maximum number of allowed docvalue_fields to retrieve in a search request
*/
public int getMaxDocvalueFields() {
return this.maxDocvalueFields;
}
private void setMaxDocvalueFields(int maxDocvalueFields) {
this.maxDocvalueFields = maxDocvalueFields;
}
/**
* Returns the maximum number of tokens that can be produced
*/
public int getMaxTokenCount() {
return maxTokenCount;
}
private void setMaxTokenCount(int maxTokenCount) {
this.maxTokenCount = maxTokenCount;
}
/**
* Returns the maximum allowed difference between max and min length of ngram
*/
public int getMaxNgramDiff() { return this.maxNgramDiff; }
private void setMaxNgramDiff(int maxNgramDiff) { this.maxNgramDiff = maxNgramDiff; }
/**
* Returns the maximum allowed difference between max and min shingle_size
*/
public int getMaxShingleDiff() { return this.maxShingleDiff; }
private void setMaxShingleDiff(int maxShingleDiff) { this.maxShingleDiff = maxShingleDiff; }
/**
* Returns the maximum number of allowed script_fields to retrieve in a search request
*/
public int getMaxScriptFields() {
return this.maxScriptFields;
}
private void setMaxScriptFields(int maxScriptFields) {
this.maxScriptFields = maxScriptFields;
}
/**
* Returns the GC deletes cycle in milliseconds.
*/
public long getGcDeletesInMillis() {
return gcDeletesInMillis;
}
/**
* Returns the merge policy that should be used for this index.
*/
public MergePolicy getMergePolicy() {
return mergePolicyConfig.getMergePolicy();
}
/**
* Returns <code>true</code> if the TTL purge is disabled for this index. Default is <code>false</code>
*/
public boolean isTTLPurgeDisabled() {
return TTLPurgeDisabled;
}
private void setTTLPurgeDisabled(boolean ttlPurgeDisabled) {
this.TTLPurgeDisabled = ttlPurgeDisabled;
}
public <T> T getValue(Setting<T> setting) {
return scopedSettings.get(setting);
}
/**
* The maximum number of refresh listeners allows on this shard.
*/
public int getMaxRefreshListeners() {
return maxRefreshListeners;
}
private void setMaxRefreshListeners(int maxRefreshListeners) {
this.maxRefreshListeners = maxRefreshListeners;
}
/**
* The maximum number of slices allowed in a scroll request.
*/
public int getMaxSlicesPerScroll() {
return maxSlicesPerScroll;
}
private void setMaxSlicesPerScroll(int value) {
this.maxSlicesPerScroll = value;
}
/**
* Returns the index sort config that should be used for this index.
*/
public IndexSortConfig getIndexSortConfig() {
return indexSortConfig;
}
public IndexScopedSettings getScopedSettings() { return scopedSettings;}
/**
* Returns true iff the refresh setting exists or in other words is explicitly set.
*/
public boolean isExplicitRefresh() {
return INDEX_REFRESH_INTERVAL_SETTING.exists(settings);
}
/**
* Returns the time that an index shard becomes search idle unless it's accessed in between
*/
public TimeValue getSearchIdleAfter() { return searchIdleAfter; }
}
| {
"content_hash": "ce674248fa94a4d1235e3e7bf793922d",
"timestamp": "",
"source": "github",
"line_count": 782,
"max_line_length": 169,
"avg_line_length": 46.28772378516624,
"alnum_prop": 0.7182363179269,
"repo_name": "wenpos/elasticsearch",
"id": "286bc4490f725710367b656ef050aadf30f2cf09",
"size": "36985",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "core/src/main/java/org/elasticsearch/index/IndexSettings.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "11082"
},
{
"name": "Batchfile",
"bytes": "10828"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "331141"
},
{
"name": "HTML",
"bytes": "2186"
},
{
"name": "Java",
"bytes": "42731789"
},
{
"name": "Perl",
"bytes": "11756"
},
{
"name": "Python",
"bytes": "54395"
},
{
"name": "Shell",
"bytes": "98698"
}
],
"symlink_target": ""
} |
package alec_wam.CrystalMod.tiles.pipes.estorage.security;
import alec_wam.CrystalMod.util.ItemStackTools;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.SlotItemHandler;
public class ContainerSecurityController extends Container {
public ContainerSecurityController(EntityPlayer player, TileSecurityController controller){
for (int i = 0; i < controller.getCards().getSlots(); ++i) {
if(i >= 8){
addSlotToContainer(new SlotItemHandler(controller.getCards(), i, ((i-8) * 18)+17, 40));
}else
addSlotToContainer(new SlotItemHandler(controller.getCards(), i, (i * 18)+17, 22));
}
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 9; j++)
{
addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (int i = 0; i < 9; i++)
{
addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack stack = ItemStackTools.getEmptyStack();
Slot slot = getSlot(index);
if (slot != null && slot.getHasStack()) {
stack = slot.getStack().copy();
if (index < 16) {
if (!mergeItemStack(stack, 16, inventorySlots.size(), true)) {
return ItemStackTools.getEmptyStack();
}
} else if (!mergeItemStack(stack, 0, 16, false)) {
return ItemStackTools.getEmptyStack();
}
if (ItemStackTools.isEmpty(stack)) {
slot.putStack(ItemStackTools.getEmptyStack());
} else {
slot.onSlotChanged();
}
}
return stack;
}
@Override
public boolean canInteractWith(EntityPlayer playerIn) {
return true;
}
}
| {
"content_hash": "ce9879ade448076a7069ff0267ece6d5",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 103,
"avg_line_length": 31.924242424242426,
"alnum_prop": 0.5728523967726625,
"repo_name": "Alec-WAM/CrystalMod",
"id": "934d8c0c0e435fb0dc84d045e605ddcc0a2534da",
"size": "2107",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/alec_wam/CrystalMod/tiles/pipes/estorage/security/ContainerSecurityController.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "36"
},
{
"name": "Java",
"bytes": "6735638"
}
],
"symlink_target": ""
} |
<div id="body">
<div class="wrapper">
<div class="row-fluid">
<div class="span3">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis cumque distinctio esse labore maxime sequi voluptatibus. Aut delectus eum ex excepturi in, nemo quae quisquam reiciendis soluta voluptatibus! Cumque, doloremque.</p>
</div>
<div class="span3">
<?php if($this->session->flashdata('error')):?>
<div class="alert alert-error"><?php echo $this->session->flashdata('error');?></div>
<?php endif;?>
<?php echo form_open('login',array('class'=>'form-horizontal'));?>
<div class="control-group">
<label class="control-label">Email : </label>
<div class="controls">
<input type="text" name="email" placeholder="Email" value="<?php echo set_value('email');?>">
</div>
</div>
<div class="control-group">
<label for="mdp" class="control-label">Mot de passse: </label>
<div class="controls">
<input type="password" id="mdp" name="mdp"/>
</div>
</div>
<button type="submit" class="btn">Connexion</button>
<?php echo form_close();?>
</div>
<div class="span3">
<?php if($this->session->flashdata('success')):?>
<div class="alert alert-success"><?php echo $this->session->flashdata('success');?></div>
<?php endif;?>
<?php if(validation_errors()):?>
<div class="alert alert-error"><?php echo validation_errors('<p>','</p>');?></div>
<?php endif;?>
<?php echo form_open('login',array('class'=>'form-horizontal'));?>
<div class="control-group">
<label class="control-label">Civilité : </label>
<label class="checkbox inline" for="m">
<input type="checkbox" id="m" value="m" name="civilite" > M.
</label>
<label class="checkbox inline" for="mme">
<input type="checkbox" id="mme" value="mme" name="civilite" > Mme
</label>
<label class="checkbox inline" for="mlle">
<input type="checkbox" id="mlle" value="mlle" name="civilite">Mlle
</label>
</div>
<div class="control-group">
<label class="control-label">Nom : </label>
<div class="controls">
<input type="text" name="lastname" placeholder="Nom" value="<?php echo set_value('lastname');?>">
</div>
</div>
<div class="control-group">
<label class="control-label">Prénom : </label>
<div class="controls">
<input type="text" name="firstname" placeholder="Prénom" value="<?php echo set_value('firstname');?>">
</div>
</div>
<div class="control-group">
<label for="mdp" class="control-label">Mot de passse: </label>
<div class="controls">
<input type="password" id="mdp" name="mdp"/>
</div>
</div>
<div class="control-group">
<label class="control-label">Email : </label>
<div class="controls">
<input type="text" name="email" placeholder="Email" value="<?php echo set_value('email');?>">
</div>
</div>
<div class="control-group">
<label class="control-label">Téléphone : </label>
<div class="controls">
<input type="text" name="phone" placeholder="Téléphone" value="<?php echo set_value('phone');?>">
</div>
</div>
<button type="submit" class="btn">Poursuivre ma commande</button>
<?php echo form_close();?>
</div>
</div>
</div>
</div> | {
"content_hash": "c788777a6c16d1b808f783c71cae46da",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 253,
"avg_line_length": 37.736363636363635,
"alnum_prop": 0.4839797639123103,
"repo_name": "juju921/pizza-anna",
"id": "682f2200102046a48594ffc179c196ec0c3b58e2",
"size": "4158",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/views/article/login.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "15982"
},
{
"name": "ApacheConf",
"bytes": "240"
},
{
"name": "CSS",
"bytes": "145448"
},
{
"name": "HTML",
"bytes": "8100476"
},
{
"name": "JavaScript",
"bytes": "927653"
},
{
"name": "PHP",
"bytes": "6141582"
},
{
"name": "Shell",
"bytes": "87"
}
],
"symlink_target": ""
} |
namespace Dropbox.Api.TeamLog
{
using sys = System;
using col = System.Collections.Generic;
using re = System.Text.RegularExpressions;
using enc = Dropbox.Api.Stone;
/// <summary>
/// <para>Added users and/or groups to shared file/folder.</para>
/// </summary>
public class SharedContentAddMemberDetails
{
#pragma warning disable 108
/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<SharedContentAddMemberDetails> Encoder = new SharedContentAddMemberDetailsEncoder();
/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<SharedContentAddMemberDetails> Decoder = new SharedContentAddMemberDetailsDecoder();
/// <summary>
/// <para>Initializes a new instance of the <see cref="SharedContentAddMemberDetails"
/// /> class.</para>
/// </summary>
/// <param name="sharedContentAccessLevel">Shared content access level.</param>
public SharedContentAddMemberDetails(global::Dropbox.Api.Sharing.AccessLevel sharedContentAccessLevel)
{
if (sharedContentAccessLevel == null)
{
throw new sys.ArgumentNullException("sharedContentAccessLevel");
}
this.SharedContentAccessLevel = sharedContentAccessLevel;
}
/// <summary>
/// <para>Initializes a new instance of the <see cref="SharedContentAddMemberDetails"
/// /> class.</para>
/// </summary>
/// <remarks>This is to construct an instance of the object when
/// deserializing.</remarks>
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
public SharedContentAddMemberDetails()
{
}
/// <summary>
/// <para>Shared content access level.</para>
/// </summary>
public global::Dropbox.Api.Sharing.AccessLevel SharedContentAccessLevel { get; protected set; }
#region Encoder class
/// <summary>
/// <para>Encoder for <see cref="SharedContentAddMemberDetails" />.</para>
/// </summary>
private class SharedContentAddMemberDetailsEncoder : enc.StructEncoder<SharedContentAddMemberDetails>
{
/// <summary>
/// <para>Encode fields of given value.</para>
/// </summary>
/// <param name="value">The value.</param>
/// <param name="writer">The writer.</param>
public override void EncodeFields(SharedContentAddMemberDetails value, enc.IJsonWriter writer)
{
WriteProperty("shared_content_access_level", value.SharedContentAccessLevel, writer, global::Dropbox.Api.Sharing.AccessLevel.Encoder);
}
}
#endregion
#region Decoder class
/// <summary>
/// <para>Decoder for <see cref="SharedContentAddMemberDetails" />.</para>
/// </summary>
private class SharedContentAddMemberDetailsDecoder : enc.StructDecoder<SharedContentAddMemberDetails>
{
/// <summary>
/// <para>Create a new instance of type <see cref="SharedContentAddMemberDetails"
/// />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override SharedContentAddMemberDetails Create()
{
return new SharedContentAddMemberDetails();
}
/// <summary>
/// <para>Set given field.</para>
/// </summary>
/// <param name="value">The field value.</param>
/// <param name="fieldName">The field name.</param>
/// <param name="reader">The json reader.</param>
protected override void SetField(SharedContentAddMemberDetails value, string fieldName, enc.IJsonReader reader)
{
switch (fieldName)
{
case "shared_content_access_level":
value.SharedContentAccessLevel = global::Dropbox.Api.Sharing.AccessLevel.Decoder.Decode(reader);
break;
default:
reader.Skip();
break;
}
}
}
#endregion
}
}
| {
"content_hash": "cd130f4e16879588976c904932f93b31",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 150,
"avg_line_length": 37.82905982905983,
"alnum_prop": 0.5840488025305016,
"repo_name": "dropbox/dropbox-sdk-dotnet",
"id": "15c9797aec2365d8534b51bee5913895b6d9d151",
"size": "4514",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/SharedContentAddMemberDetails.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "213"
},
{
"name": "C#",
"bytes": "24848994"
},
{
"name": "CSS",
"bytes": "9865"
},
{
"name": "HTML",
"bytes": "25924"
},
{
"name": "JavaScript",
"bytes": "80470"
},
{
"name": "PowerShell",
"bytes": "258"
},
{
"name": "Python",
"bytes": "93795"
},
{
"name": "Shell",
"bytes": "756"
}
],
"symlink_target": ""
} |
describe("Ext.tree.plugin.TreeViewDragDrop", function() {
var TreeItem = Ext.define(null, {
extend: 'Ext.data.TreeModel',
fields: ['id', 'text', 'secondaryId'],
proxy: {
type: 'memory'
}
}),
testNodes = [{
id: 'A',
text: 'A',
secondaryId: 'AA',
children: [{
id: 'B',
text: 'B',
secondaryId: 'BB',
children: [{
id: 'C',
text: 'C',
secondaryId: 'C',
leaf: true
}, {
id: 'D',
text: 'D',
secondaryId: 'D',
leaf: true
}]
}, {
id: 'E',
text: 'E',
secondaryId: 'EE',
leaf: true
}, {
id: 'F',
text: 'F',
secondaryId: 'FF',
children: [{
id: 'G',
text: 'G',
secondaryId: 'GG',
children: [{
id: 'H',
text: 'H',
secondaryId: 'HH',
leaf: true
}]
}]
}]
}, {
id: 'I',
text: 'I',
secondaryId: 'II',
children: [{
id: 'J',
text: 'J',
secondaryId: 'JJ',
children: [{
id: 'K',
text: 'K',
secondaryId: 'KK',
leaf: true
}]
}, {
id: 'L',
text: 'L',
secondaryId: 'LL',
leaf: true
}]
}, {
id: 'M',
text: 'M',
secondaryId: 'MM',
children: [{
id: 'N',
text: 'N',
secondaryId: 'NN',
leaf: true
}]
}],
tree, view, store, rootNode, colRef, plugin, dragZone;
function makeTree(nodes, cfg, storeCfg, rootCfg) {
cfg = cfg || {};
Ext.applyIf(cfg, {
animate: false,
renderTo: Ext.getBody(),
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',
dragZone: {
animRepair: false
}
},
loadMask: false
},
store: store = new Ext.data.TreeStore(Ext.apply({
model: TreeItem,
root: Ext.apply({
secondaryId: 'root',
id: 'root',
text: 'Root',
expanded: true,
children: nodes || testNodes
}, rootCfg)
}, storeCfg))
});
tree = new Ext.tree.Panel(cfg);
view = tree.view;
rootNode = tree.getRootNode();
store = tree.getStore();
colRef = tree.getColumnManager().getColumns();
plugin = view.findPlugin('treeviewdragdrop');
dragZone = plugin.dragZone;
}
function getWidget(index, col) {
col = col || colRef[1];
return col.getWidget(store.getAt(index));
}
afterEach(function() {
tree.destroy();
tree = view = rootNode = store = colRef = plugin = dragZone = null;
});
describe("basic functionality", function() {
it("should be able to drag", function() {
var cell, rec;
makeTree();
rec = store.getById('A');
cell = view.getCell(rec, tree.down('treecolumn'));
// Disable fx to avoid animation errors while destroying the treepanel
Ext.enableFx = false;
jasmine.fireMouseEvent(cell, 'mousedown');
jasmine.fireMouseEvent(cell, 'mousemove', 5, 20);
expect(Ext.fly(dragZone.dragData.item).contains(cell)).toBe(true);
jasmine.fireMouseEvent(cell, 'mouseup');
Ext.enableFx = true;
});
});
describe("with widget columns", function() {
beforeEach(function() {
makeTree(null,{
columns: [{
xtype: 'treecolumn',
dataIndex: 'text'
},{
xtype : 'widgetcolumn',
dataIndex: 'secondaryId',
widget : {
xtype : 'textfield'
}
}]
});
});
it("should be able to focus the widget with a mouse click", function() {
jasmine.fireMouseEvent(getWidget(0).el.dom, 'click');
expect(getWidget(0).hasFocus).toBe(true);
});
});
}); | {
"content_hash": "32846b3215cfb3deae84da58df0a50b6",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 82,
"avg_line_length": 28.22289156626506,
"alnum_prop": 0.39573105656350055,
"repo_name": "carto-tragsatec/visorCatastroColombia",
"id": "d4e131453da4ede165f1f4336594bbc6eccb4074",
"size": "4685",
"binary": false,
"copies": "16",
"ref": "refs/heads/master",
"path": "WebContent/visorcatastrocol/lib/extjs/v6.2.0/classic/classic/test/specs/tree/plugin/TreeViewDragDrop.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "376209"
},
{
"name": "HTML",
"bytes": "19957"
},
{
"name": "Java",
"bytes": "10943"
},
{
"name": "JavaScript",
"bytes": "370944"
}
],
"symlink_target": ""
} |
package com.bdqn.qqmusic.pojo;
import java.util.HashSet;
import java.util.Set;
/**
* User entity. @author MyEclipse Persistence Tools
*/
public class User implements java.io.Serializable {
// Fields
private Integer uid;
private String uname;
private Integer upwd;
private String uemail;
private Set songListManages = new HashSet(0);
// Constructors
/** default constructor */
public User() {
}
/** minimal constructor */
public User(String uname, Integer upwd, String uemail) {
this.uname = uname;
this.upwd = upwd;
this.uemail = uemail;
}
/** full constructor */
public User(String uname, Integer upwd, String uemail, Set songListManages) {
this.uname = uname;
this.upwd = upwd;
this.uemail = uemail;
this.songListManages = songListManages;
}
// Property accessors
public Integer getUid() {
return this.uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public String getUname() {
return this.uname;
}
public void setUname(String uname) {
this.uname = uname;
}
public Integer getUpwd() {
return this.upwd;
}
public void setUpwd(Integer upwd) {
this.upwd = upwd;
}
public String getUemail() {
return this.uemail;
}
public void setUemail(String uemail) {
this.uemail = uemail;
}
public Set getSongListManages() {
return this.songListManages;
}
public void setSongListManages(Set songListManages) {
this.songListManages = songListManages;
}
} | {
"content_hash": "ee1caaf6db1daf43e9985d75d4b586ff",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 78,
"avg_line_length": 17.373493975903614,
"alnum_prop": 0.7011095700416089,
"repo_name": "k4kentchow/qqmusic",
"id": "7aba908e2c3dbe6de139a6200f3d91de99df79bd",
"size": "1442",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/bdqn/qqmusic/pojo/User.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "199340"
},
{
"name": "HTML",
"bytes": "9102"
},
{
"name": "Java",
"bytes": "927595"
},
{
"name": "JavaScript",
"bytes": "6052"
}
],
"symlink_target": ""
} |
This tutorial covers how to use es6 modules in the browser.
### Intro
Although browsers like Chrome and Webkit are almost 100% percent compatible with es6, the one little bit that has not been implemented yet is es6 modules (aka import and export). One of the easiest tools for dealing with this problem is browserify, its approach is to concat all the files in a single bundle that can be included in the web page. In combination with babel can translate features from es7 that hasn't been shipped yet.
### Step 0
You must already have installed nodejs.
### Step 1: create folders
```bash
mkdir src
mkdir dist
```
In the *src* folder create a file *main.js* with this content:
```javascript
import { sum, mult } from './math-utils';
var res = sum(2, 3);
console.log('res= ' + res);
res = mult(2, 6);
console.log('res= ' + res);
```
and a file named *math-utils.js* with:
```javascript
export function sum(x, y) {
return x + y;
}
export function mult(x, y) {
return x * y;
}
```
### Step 1: Create an empty package.json file
Initialize an npm project using this line:
```bash
npm init -y
```
### Step 2: Install the development dependencies
Install *babel*, *browserify* and *babelify* and the es2015 preset:
```bash
npm install --save-dev babel-core babel-preset-es2015 browserify babelify
```
the --save-dev flag saves the development dependencies section of the package.json file
### Step 3: Test and save the setup
To use browserify you must specify an entry point, a transformation and an output destination, you can test the setup using:
```bash
node_modules/.bin/browserify src/main.js -t [ babelify --presets [ es2015 ] ] --outfile dist/bundle.js
```
In this case the entry is *main.js*, the transformation is *babelify* and the destination is *bundle.js*, note the presets section, from babel version 6 and up you must specify which plugins you will use, the es2015 preset contains all the plugins necessary to use es6 or es2015, if you use features from es7 or above you must specify the plugins in a .babelrc file. If the command work you should see a file bundle.js in the dist folder containing the all the function definitions and their invocations.
To avoid the retyping you can save the command to the scripts section of package.json like this:
```javascript
...
"scripts": {
"build": "browserify src/main.js -t [ babelify --presets [ es2015 ] ] --outfile dist/bundle.js",
}
...
```
To run the above script you simply type:
```bash
npm run build
```
| {
"content_hash": "ceb8a42900012b43175560185c28c5b3",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 504,
"avg_line_length": 38.38461538461539,
"alnum_prop": 0.7306613226452906,
"repo_name": "nestoralonso/basic-babel-setup",
"id": "e34b3be447971e58105912aa643d5af29c39cbc2",
"size": "2515",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1249"
}
],
"symlink_target": ""
} |
package com.jd.risktest.beanannotation;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class TestAnnotation {
private static ApplicationContext ctx = new ClassPathXmlApplicationContext("TestAnnotation.xml");
/**
* ÓоßÌå±äÁ¿µÄÃû³Æ»á×Ô¶¯×°Å䣬ûÓоßÌåµÄÃû³Æ»áÆ¥Åä±äÁ¿ÀàÐÍ£¬Æ¥Åäµ½Ò»¸ö£¬Ôò×Ô¶¯×°Å䣬ƥÅäµ½¶à¸ö»á±¨´í
*/
@Test
public void testAutowiredForConstructor() {
TestAnnotationBean testBean11 = ctx.getBean("testBean11", TestAnnotationBean.class);
System.out.println(testBean11.getMessage());
Assert.assertEquals("hello", testBean11.getMessage());
}
@Test
public void testAutowiredForField() {
TestAnnotationBean testBean11 = ctx.getBean("testBean11", TestAnnotationBean.class);
System.out.println(testBean11.getName());
Assert.assertEquals("Hellofromproperties:My Name is CoCo", testBean11.getName());
}
@Test
public void testBeanAnnotation() {
BeanAnnotation ba = ctx.getBean("beanAnnotation",BeanAnnotation.class );
ba.sayHello("hello....");
}
}
| {
"content_hash": "c777547a4978db504dd3e17e3476acfa",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 102,
"avg_line_length": 30.54054054054054,
"alnum_prop": 0.7628318584070797,
"repo_name": "haorui658/SpringDrill",
"id": "d098ecfd37e9e2245715112ff932ee79250abb18",
"size": "1130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chapter2/src/test/java/com/jd/risktest/beanannotation/TestAnnotation.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "11584"
}
],
"symlink_target": ""
} |
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
PhotosView *photosView = [[PhotosView alloc] initWithFrame:CGRectMake(20, 20, 200, 200)];
[self.view addSubview:photosView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
| {
"content_hash": "24f2706d58314d65bcf7909b63829a0f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 93,
"avg_line_length": 19.047619047619047,
"alnum_prop": 0.695,
"repo_name": "tangguoan/code",
"id": "619e770be329b59049aedebffee222b77552626e",
"size": "581",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PhotosView/微博发图/ViewController.m",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "20628"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tavakkolian.wtfwsf"
android:versionCode="2"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.tavakkolian.wtfwsf.TicketChecker"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/FullscreenTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
| {
"content_hash": "3c59dee40943bc22f990dad6ed691399",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 76,
"avg_line_length": 35.06666666666667,
"alnum_prop": 0.629277566539924,
"repo_name": "9nut/wtfwsf",
"id": "af0e62b3b9f5ea493e15424555cbcfe9b37918c6",
"size": "1052",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/AndroidManifest.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "3582"
}
],
"symlink_target": ""
} |
import re
from reportlab import platypus
from facturapdf import flowables, helper
def element(item):
elements = {
'framebreak': {'class': platypus.FrameBreak},
'simpleline': {'class': flowables.SimpleLine, 'cast': {0: float, 1: float}},
'paragraph': {'class': flowables.Paragraph},
'image': {'class': helper.get_image, 'cast': {1: float}},
'spacer': {'class': platypus.Spacer, 'cast': {0: float, 1: float}}
}
if isinstance(item, str):
match = re.search('(?P<name>\w+)(\[(?P<args>.+)\])?', item)
if match and match.group('name') in elements:
flowable = elements[match.group('name')]
args = [] if not match.group('args') else match.group('args').split('|')
if 'cast' in flowable:
for index, cls in iter(flowable['cast'].items()):
args[index] = cls(args[index])
return flowable['class'](*args)
return item
def chapter(*args):
return [element(item) for item in args] | {
"content_hash": "5d5ad535ca159687f98c9e05c5c66302",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 84,
"avg_line_length": 32.53125,
"alnum_prop": 0.56388088376561,
"repo_name": "initios/factura-pdf",
"id": "fe7889e7ca8545bc28c5f41c3a73643d2fc70a2c",
"size": "1041",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "facturapdf/generators.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "23357"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__int64_t_rand_multiply_81a.cpp
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-81a.tmpl.cpp
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: rand Set data to result of rand()
* GoodSource: Set data to a small, non-zero number (two)
* Sinks: multiply
* GoodSink: Ensure there will not be an overflow before multiplying data by 2
* BadSink : If data is positive, multiply by 2, which can cause an overflow
* Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
*
* */
#include "std_testcase.h"
#include "CWE190_Integer_Overflow__int64_t_rand_multiply_81.h"
namespace CWE190_Integer_Overflow__int64_t_rand_multiply_81
{
#ifndef OMITBAD
void bad()
{
int64_t data;
data = 0LL;
/* POTENTIAL FLAW: Use a random value */
data = (int64_t)RAND64();
const CWE190_Integer_Overflow__int64_t_rand_multiply_81_base& baseObject = CWE190_Integer_Overflow__int64_t_rand_multiply_81_bad();
baseObject.action(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
static void goodG2B()
{
int64_t data;
data = 0LL;
/* FIX: Use a small, non-zero value that will not cause an overflow in the sinks */
data = 2;
const CWE190_Integer_Overflow__int64_t_rand_multiply_81_base& baseObject = CWE190_Integer_Overflow__int64_t_rand_multiply_81_goodG2B();
baseObject.action(data);
}
/* goodB2G uses the BadSource with the GoodSink */
static void goodB2G()
{
int64_t data;
data = 0LL;
/* POTENTIAL FLAW: Use a random value */
data = (int64_t)RAND64();
const CWE190_Integer_Overflow__int64_t_rand_multiply_81_base& baseObject = CWE190_Integer_Overflow__int64_t_rand_multiply_81_goodB2G();
baseObject.action(data);
}
void good()
{
goodG2B();
goodB2G();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
using namespace CWE190_Integer_Overflow__int64_t_rand_multiply_81; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| {
"content_hash": "b1f51b096af72d0782e9186fd8ba3085",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 139,
"avg_line_length": 29.214285714285715,
"alnum_prop": 0.6692280824310164,
"repo_name": "JianpingZeng/xcc",
"id": "a2377b4c9e1cc3ea9693455cd2979d985a7a0ad7",
"size": "2863",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "xcc/test/juliet/testcases/CWE190_Integer_Overflow/s02/CWE190_Integer_Overflow__int64_t_rand_multiply_81a.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FindAndConnect")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Franson")]
[assembly: AssemblyProduct("FindAndConnect")]
[assembly: AssemblyCopyright("Copyright © Franson 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("86ea207d-35b2-4a89-9e5b-44f3d5d20a4d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "7fe4005ad548395d0e4a320cdf0aa3f1",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 84,
"avg_line_length": 39,
"alnum_prop": 0.7350427350427351,
"repo_name": "johanlantz/headsetpresenter",
"id": "28551ba96ce173acbdb543d164742025a09758ba",
"size": "1290",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "HeadsetPresenter_Bluetools/HeadsetPresenter/Bluetools/BlueTools SDK v1.2/dotNet200/C#/FindAndConnect/AssemblyInfo.cs",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "7004"
},
{
"name": "Batchfile",
"bytes": "2489"
},
{
"name": "C",
"bytes": "16452971"
},
{
"name": "C#",
"bytes": "1393901"
},
{
"name": "C++",
"bytes": "19851472"
},
{
"name": "Clarion",
"bytes": "4450"
},
{
"name": "HTML",
"bytes": "50191"
},
{
"name": "Makefile",
"bytes": "51937"
},
{
"name": "NSIS",
"bytes": "68365"
},
{
"name": "Objective-C",
"bytes": "1800430"
},
{
"name": "PHP",
"bytes": "10905"
},
{
"name": "Visual Basic",
"bytes": "823951"
}
],
"symlink_target": ""
} |
package org.apache.commons.imaging.formats.tiff;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.imaging.formats.tiff.constants.AdobePageMaker6TagConstants;
import org.apache.commons.imaging.formats.tiff.constants.AdobePhotoshopTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.AliasSketchbookProTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.DcfTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.DngTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.GdalLibraryTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.GeoTiffTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.HylaFaxTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.MicrosoftHdPhotoTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.MicrosoftTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.MolecularDynamicsGelTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.OceScanjobTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.Rfc2301TagConstants;
import org.apache.commons.imaging.formats.tiff.constants.Tiff4TagConstants;
import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
import org.apache.commons.imaging.formats.tiff.constants.TiffEpTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.TiffTagConstants;
import org.apache.commons.imaging.formats.tiff.constants.WangTagConstants;
import org.apache.commons.imaging.formats.tiff.taginfos.TagInfo;
final class TiffTags {
private TiffTags() {
}
private static final List<TagInfo> ALL_TAGS = makeMergedTagList();
private static final Map<Integer, List<TagInfo>> ALL_TAG_MAP = makeTagMap(TiffTags.ALL_TAGS);
private static final Map<Integer, Integer> TAG_COUNTS = countTags(TiffTags.ALL_TAGS);
private static List<TagInfo> makeMergedTagList() {
final ArrayList<TagInfo> result = new ArrayList<TagInfo>();
result.addAll(AdobePageMaker6TagConstants.ALL_ADOBE_PAGEMAKER_6_TAGS);
result.addAll(AdobePhotoshopTagConstants.ALL_ADOBE_PHOTOSHOP_TAGS);
result.addAll(AliasSketchbookProTagConstants.ALL_ALIAS_SKETCHBOOK_PRO_TAGS);
result.addAll(DcfTagConstants.ALL_DCF_TAGS);
result.addAll(DngTagConstants.ALL_DNG_TAGS);
result.addAll(ExifTagConstants.ALL_EXIF_TAGS);
result.addAll(GeoTiffTagConstants.ALL_GEO_TIFF_TAGS);
result.addAll(GdalLibraryTagConstants.ALL_GDAL_LIBRARY_TAGS);
result.addAll(GpsTagConstants.ALL_GPS_TAGS);
result.addAll(HylaFaxTagConstants.ALL_HYLAFAX_TAGS);
result.addAll(MicrosoftTagConstants.ALL_MICROSOFT_TAGS);
result.addAll(MicrosoftHdPhotoTagConstants.ALL_MICROSOFT_HD_PHOTO_TAGS);
result.addAll(MolecularDynamicsGelTagConstants.ALL_MOLECULAR_DYNAMICS_GEL_TAGS);
result.addAll(OceScanjobTagConstants.ALL_OCE_SCANJOB_TAGS);
result.addAll(Rfc2301TagConstants.ALL_RFC_2301_TAGS);
result.addAll(Tiff4TagConstants.ALL_TIFF_4_TAGS);
result.addAll(TiffEpTagConstants.ALL_TIFF_EP_TAGS);
result.addAll(TiffTagConstants.ALL_TIFF_TAGS);
result.addAll(WangTagConstants.ALL_WANG_TAGS);
return Collections.unmodifiableList(result);
}
private static Map<Integer, List<TagInfo>> makeTagMap(
final List<TagInfo> tags) {
// make sure to use the thread-safe version; this is shared state.
final Map<Integer, List<TagInfo>> map = new HashMap<Integer, List<TagInfo>>();
for (TagInfo tag : tags) {
List<TagInfo> tagList = map.get(tag.tag);
if (tagList == null) {
tagList = new ArrayList<TagInfo>();
map.put(tag.tag, tagList);
}
tagList.add(tag);
}
return map;
}
private static Map<Integer, Integer> countTags(final List<TagInfo> tags) {
final Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for (TagInfo tag : tags) {
final Integer count = map.get(tag.tag);
if (count == null) {
map.put(tag.tag, 1);
} else {
map.put(tag.tag, count + 1);
}
}
return map;
}
static Integer getTagCount(int tag) {
return TAG_COUNTS.get(tag);
}
static TagInfo getTag(final int directoryType, final int tag) {
final List<TagInfo> possibleMatches = ALL_TAG_MAP.get(tag);
if (null == possibleMatches) {
return TiffTagConstants.TIFF_TAG_UNKNOWN;
}
return getTag(directoryType, possibleMatches);
}
private static TagInfo getTag(final int directoryType, final List<TagInfo> possibleMatches) {
// Please keep this method in sync with TiffImageMetadata's findField()
if (possibleMatches.size() < 1) {
return null;
}
// first search for exact match.
for (TagInfo tagInfo : possibleMatches) {
if (tagInfo.directoryType == TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN) {
// pass
continue;
} else if (directoryType == tagInfo.directoryType.directoryType) {
return tagInfo;
}
}
// accept an inexact match.
for (TagInfo tagInfo : possibleMatches) {
if (tagInfo.directoryType == TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN) {
// pass
continue;
} else if (directoryType >= 0
&& tagInfo.directoryType.isImageDirectory()) {
return tagInfo;
} else if (directoryType < 0
&& !tagInfo.directoryType.isImageDirectory()) {
return tagInfo;
}
}
// accept a wildcard match.
for (TagInfo tagInfo : possibleMatches) {
if (tagInfo.directoryType == TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN) {
return tagInfo;
}
}
return TiffTagConstants.TIFF_TAG_UNKNOWN;
}
}
| {
"content_hash": "57ef036330e34d600a697da0fdf3c136",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 97,
"avg_line_length": 41.810457516339866,
"alnum_prop": 0.6873534469282476,
"repo_name": "mohanaraosv/commons-imaging",
"id": "6034878c7e7b3cfab0e79823c9103ea4a181e97a",
"size": "7199",
"binary": false,
"copies": "3",
"ref": "refs/heads/trunk",
"path": "src/main/java/org/apache/commons/imaging/formats/tiff/TiffTags.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "16316"
},
{
"name": "Java",
"bytes": "2283963"
},
{
"name": "Shell",
"bytes": "314"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "0d7c5dc84a718e94d6c6f4084574d189",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "c646fadfb1491449474b92f309217deb9a922407",
"size": "191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Thymelaeaceae/Daphnopsis/Daphnopsis peruviensis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
export { default } from 'ember-bootstrap/components/bs-accordion/item';
| {
"content_hash": "d445a592e85d88d1779c68a588705bf8",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 71,
"avg_line_length": 36.5,
"alnum_prop": 0.7671232876712328,
"repo_name": "jelhan/ember-bootstrap",
"id": "06d3857d08436937f0f7580fabb3f51ee952753f",
"size": "73",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "app/components/bs-accordion/item.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3426"
},
{
"name": "HTML",
"bytes": "115462"
},
{
"name": "JavaScript",
"bytes": "643727"
}
],
"symlink_target": ""
} |
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>StringMustWrapperForVerb - ScalaTest 2.1.0 - org.scalatest.words.MustVerb.StringMustWrapperForVerb</title>
<meta name="description" content="StringMustWrapperForVerb - ScalaTest 2.1.0 - org.scalatest.words.MustVerb.StringMustWrapperForVerb" />
<meta name="keywords" content="StringMustWrapperForVerb ScalaTest 2.1.0 org.scalatest.words.MustVerb.StringMustWrapperForVerb" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../lib/jquery.js" id="jquery-js"></script>
<script type="text/javascript" src="../../../lib/jquery-ui.js"></script>
<script type="text/javascript" src="../../../lib/template.js"></script>
<script type="text/javascript" src="../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
if(top === self) {
var url = '../../../index.html';
var hash = 'org.scalatest.words.MustVerb$StringMustWrapperForVerb';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
<!-- gtag [javascript] -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-71294502-1"></script>
<script defer>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-71294502-1');
</script>
</head>
<body class="type">
<!-- Top of doc.scalatest.org [javascript] -->
<script type="text/javascript">
var rnd = window.rnd || Math.floor(Math.random()*10e6);
var pid204546 = window.pid204546 || rnd;
var plc204546 = window.plc204546 || 0;
var abkw = window.abkw || '';
var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER';
document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>');
</script>
<div id="definition">
<img src="../../../lib/trait_big.png" />
<p id="owner"><a href="../../package.html" class="extype" name="org">org</a>.<a href="../package.html" class="extype" name="org.scalatest">scalatest</a>.<a href="package.html" class="extype" name="org.scalatest.words">words</a>.<a href="MustVerb.html" class="extype" name="org.scalatest.words.MustVerb">MustVerb</a></p>
<h1>StringMustWrapperForVerb</h1>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">trait</span>
</span>
<span class="symbol">
<span class="name">StringMustWrapperForVerb</span><span class="result"> extends <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>This class supports the syntax of <code>FlatSpec</code>, <code>WordSpec</code>, <code>fixture.FlatSpec</code>,
and <code>fixture.WordSpec</code>.</p><p>This class is used in conjunction with an implicit conversion to enable <code>must</code> methods to
be invoked on <code>String</code>s.</p></div><dl class="attributes block"> <dt>Source</dt><dd><a href="https://github.com/scalatest/scalatest/tree/release-2.1.0-for-scala-2.10/src/main/scala/org/scalatest/words/MustVerb.scala" target="_blank">MustVerb.scala</a></dd></dl><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div><div class="toggleContainer block">
<span class="toggle">Known Subclasses</span>
<div class="subClasses hiddenContent"><a href="../MustMatchers$StringMustWrapper.html" class="extype" name="org.scalatest.MustMatchers.StringMustWrapper">StringMustWrapper</a></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="org.scalatest.words.MustVerb.StringMustWrapperForVerb"><span>StringMustWrapperForVerb</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show all</span></li>
</ol>
<a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="values" class="values members">
<h3>Abstract Value Members</h3>
<ol><li name="org.scalatest.words.MustVerb.StringMustWrapperForVerb#leftSideString" visbl="pub" data-isabs="true" fullComment="no" group="Ungrouped">
<a id="leftSideString:String"></a>
<a id="leftSideString:String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">abstract </span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">leftSideString</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4>
</li></ol>
</div>
<div id="values" class="values members">
<h3>Concrete Value Members</h3>
<ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:AnyRef):Boolean"></a>
<a id="!=(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Any#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a>
<a id="!=(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<a id="##():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:AnyRef):Boolean"></a>
<a id="==(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Any#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a>
<a id="==(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<a id="asInstanceOf[T0]:T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a>
<a id="clone():AnyRef"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">java.lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a>
<a id="eq(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(x$1:Any):Boolean"></a>
<a id="equals(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<a id="finalize():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">java.lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<a id="getClass():Class[_]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="hashCode():Int"></a>
<a id="hashCode():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<a id="isInstanceOf[T0]:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="org.scalatest.words.MustVerb.StringMustWrapperForVerb#must" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="must(resultOfAfterWordApplication:org.scalatest.words.ResultOfAfterWordApplication)(implicitfun:(String,String,org.scalatest.words.ResultOfAfterWordApplication)=>Unit):Unit"></a>
<a id="must(ResultOfAfterWordApplication)((String,String,ResultOfAfterWordApplication)⇒Unit):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">must</span><span class="params">(<span name="resultOfAfterWordApplication">resultOfAfterWordApplication: <a href="ResultOfAfterWordApplication.html" class="extype" name="org.scalatest.words.ResultOfAfterWordApplication">ResultOfAfterWordApplication</a></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="fun">fun: (<span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Predef.String">String</span>, <a href="ResultOfAfterWordApplication.html" class="extype" name="org.scalatest.words.ResultOfAfterWordApplication">ResultOfAfterWordApplication</a>) ⇒ <span class="extype" name="scala.Unit">Unit</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">Supports the registration of subject descriptions with after words
in <code>WordSpec</code> and <code>fixture.WordSpec</code>.</p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of subject descriptions with after words
in <code>WordSpec</code> and <code>fixture.WordSpec</code>.</p><p>For example, this method enables syntax such as the following in <code>WordSpec</code>
and <code>fixture.WordSpec</code>:</p><p><pre class="stHighlighted">
<span class="stReserved">def</span> provide = afterWord(<span class="stQuotedString">"provide"</span>)
<br /><span class="stQuotedString">"The ScalaTest Matchers DSL"</span> must provide {
^
</pre></p><p><code>WordSpec</code> passes in a function via the implicit parameter that takes
two strings and a <code>ResultOfAfterWordApplication</code> and results in <code>Unit</code>. This method
simply invokes this function, passing in leftSideString, the verb string
<code>"must"</code>, and the <code>ResultOfAfterWordApplication</code> passed to <code>must</code>.</p></div></div>
</li><li name="org.scalatest.words.MustVerb.StringMustWrapperForVerb#must" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="must(right:=>Unit)(implicitfun:org.scalatest.words.StringVerbBlockRegistration):Unit"></a>
<a id="must(⇒Unit)(StringVerbBlockRegistration):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">must</span><span class="params">(<span name="right">right: ⇒ <span class="extype" name="scala.Unit">Unit</span></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="fun">fun: <a href="StringVerbBlockRegistration.html" class="extype" name="org.scalatest.words.StringVerbBlockRegistration">StringVerbBlockRegistration</a></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">Supports the registration of subject descriptions in <code>WordSpec</code>
and <code>fixture.WordSpec</code>.</p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of subject descriptions in <code>WordSpec</code>
and <code>fixture.WordSpec</code>.</p><p>For example, this method enables syntax such as the following in <code>WordSpec</code>
and <code>fixture.WordSpec</code>:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"A Stack (when empty)"</span> must { ...
^
</pre></p><p><code>WordSpec</code> passes in a function via the implicit parameter of type <code>StringVerbBlockRegistration</code>,
a function that takes two strings and a no-arg function and results in <code>Unit</code>. This method
simply invokes this function, passing in leftSideString, the verb string
<code>"must"</code>, and the right by-name parameter transformed into a
no-arg function.</p></div></div>
</li><li name="org.scalatest.words.MustVerb.StringMustWrapperForVerb#must" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="must(right:org.scalatest.words.BehaveWord)(implicitfun:String=>org.scalatest.words.BehaveWord):org.scalatest.words.BehaveWord"></a>
<a id="must(BehaveWord)((String)⇒BehaveWord):BehaveWord"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">must</span><span class="params">(<span name="right">right: <a href="BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="fun">fun: (<span class="extype" name="scala.Predef.String">String</span>) ⇒ <a href="BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span>)</span><span class="result">: <a href="BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span>
</span>
</h4>
<p class="shortcomment cmt">Supports shared test registration in <code>FlatSpec</code> and <code>fixture.FlatSpec</code>.</p><div class="fullcomment"><div class="comment cmt"><p>Supports shared test registration in <code>FlatSpec</code> and <code>fixture.FlatSpec</code>.</p><p>For example, this method enables syntax such as the following in <code>FlatSpec</code>
and <code>fixture.FlatSpec</code>:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"A Stack (with one item)"</span> must behave like nonEmptyStack(stackWithOneItem, lastValuePushed)
^
</pre></p><p><code>FlatSpec</code> and <code>fixture.FlatSpec</code> passes in a function via the implicit parameter that takes
a string and results in a <code>BehaveWord</code>. This method
simply invokes this function, passing in leftSideString, and returns the result.</p></div></div>
</li><li name="org.scalatest.words.MustVerb.StringMustWrapperForVerb#must" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="must(right:String)(implicitfun:(String,String,String)=>org.scalatest.words.ResultOfStringPassedToVerb):org.scalatest.words.ResultOfStringPassedToVerb"></a>
<a id="must(String)((String,String,String)⇒ResultOfStringPassedToVerb):ResultOfStringPassedToVerb"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">must</span><span class="params">(<span name="right">right: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="fun">fun: (<span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Predef.String">String</span>) ⇒ <a href="ResultOfStringPassedToVerb.html" class="extype" name="org.scalatest.words.ResultOfStringPassedToVerb">ResultOfStringPassedToVerb</a></span>)</span><span class="result">: <a href="ResultOfStringPassedToVerb.html" class="extype" name="org.scalatest.words.ResultOfStringPassedToVerb">ResultOfStringPassedToVerb</a></span>
</span>
</h4>
<p class="shortcomment cmt">Supports test registration in <code>FlatSpec</code> and <code>fixture.FlatSpec</code>.</p><div class="fullcomment"><div class="comment cmt"><p>Supports test registration in <code>FlatSpec</code> and <code>fixture.FlatSpec</code>.</p><p>For example, this method enables syntax such as the following in <code>FlatSpec</code>
and <code>fixture.FlatSpec</code>:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"A Stack (when empty)"</span> must <span class="stQuotedString">"be empty"</span> in { ... }
^
</pre></p><p><code>FlatSpec</code> passes in a function via the implicit parameter that takes
three strings and results in a <code>ResultOfStringPassedToVerb</code>. This method
simply invokes this function, passing in leftSideString, the verb string
<code>"must"</code>, and right, and returns the result.</p></div></div>
</li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a>
<a id="ne(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<a id="notify():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<a id="notifyAll():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a>
<a id="synchronized[T0](⇒T0):T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString():String"></a>
<a id="toString():String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<a id="wait():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a>
<a id="wait(Long,Int):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a>
<a id="wait(Long):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</html> | {
"content_hash": "71b4b23867a06e735870dd82784d9282",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 800,
"avg_line_length": 59.131768953068594,
"alnum_prop": 0.6244696114044995,
"repo_name": "scalatest/scalatest-website",
"id": "76190332a68e8ac97b44639d30979e2b6703248b",
"size": "32789",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/scaladoc/2.1.0/org/scalatest/words/MustVerb$StringMustWrapperForVerb.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "8401192"
},
{
"name": "HTML",
"bytes": "4508833233"
},
{
"name": "JavaScript",
"bytes": "12256885"
},
{
"name": "Procfile",
"bytes": "62"
},
{
"name": "Scala",
"bytes": "136544"
}
],
"symlink_target": ""
} |
LIBS=ffmpeg-$FFMPEG_VERSION-win32-shared/bin/*.dll
7z x ffmpeg-$FFMPEG_VERSION-win32-shared.7z $LIBS
mkdir -p com/googlecode/javacv/cpp/windows-x86/
cp $LIBS com/googlecode/javacv/cpp/windows-x86/
jar cvf ffmpeg-$FFMPEG_VERSION-windows-x86.jar com/
rm -Rf com/
| {
"content_hash": "2d907df0595f1f66f71c914c62475793",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 51,
"avg_line_length": 43.5,
"alnum_prop": 0.7777777777777778,
"repo_name": "nragot/super-lama-video-editor",
"id": "1e7240b173505945169429982a4c6cfef84b62e8",
"size": "261",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "librairies/javacv-cppjars/build_ffmpeg-windows-x86.sh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "183386"
},
{
"name": "Shell",
"bytes": "13391"
}
],
"symlink_target": ""
} |
<div class="row">
<div class="col-sm-22 col-sm-offset-1">
<h1>Categorias <span ng-bind="filteredCategories.length"></span></h1>
<form class="form-inline text-right">
<div class="form-group">
<label for="categoryQuery">Buscar categorias</label>
<input class="form-control input-xs" id="categoryQuery" name="categoryQuery" ng-model="categoryQuery" type="text" placeholder="Buscar categorias">
</div>
<div class="form-group">
<label for="order">Ordem</label>
<select class="form-control" id="order" ng-model="selectedOrder">
<option value="name" selected>Nome</option>
<option value="updated">Data</option>
</select>
</div>
<a class="btn btn-default" href="/category">+</a>
</form>
<br>
<table class="table table-condensed table-stripped table-hover">
<thead>
<tr>
<td>nome</td>
<td>Ultima modificação</td>
<td>Ações</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="category in filteredCategories = (categories | filter: categoryQuery | orderBy: selectedOrder)">
<td><a href="/category/{{category._id}}" ng-bind="category.name || '???'"></a></td>
<td ng-bind="category.updated"></td>
<td><a href="javascript:void(0)" ng-click="dropCategory(category)">x</a></td>
</tr>
</tbody>
</table>
</div>
</div> | {
"content_hash": "25c40f92f8f33e221ce9960c2318a2af",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 156,
"avg_line_length": 42.53846153846154,
"alnum_prop": 0.5003013863773358,
"repo_name": "organicos/organicos.github.io",
"id": "7143dcfdb23890140c0891a07207b2e194d6e33d",
"size": "1663",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "partials/categories/categories.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6934"
},
{
"name": "HTML",
"bytes": "489702"
},
{
"name": "JavaScript",
"bytes": "131398"
}
],
"symlink_target": ""
} |
<a class="anchor" name="temporal">
<h2 class="section-header">
<span class="glyphicon glyphicon-time"></span>
Temporal Extents
</h2>
</a>
<div class="subform">
<div ng-include="partialsPrefix + 'partials/form/temporalExtent.html'"></div>
<div ng-include="partialsPrefix + 'partials/form/update.html'"></div>
</div>
| {
"content_hash": "0d5323445dbdaadf1187165a4f4c4bda",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 79,
"avg_line_length": 28.25,
"alnum_prop": 0.6637168141592921,
"repo_name": "northwest-knowledge-network/mdedit",
"id": "d9ea506e658a6728c36c52a12adf5095abe13d6c",
"size": "339",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/partials/form/isoTemporalExtent.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "23490"
},
{
"name": "HTML",
"bytes": "138041"
},
{
"name": "JavaScript",
"bytes": "315192"
},
{
"name": "Python",
"bytes": "71546"
},
{
"name": "XSLT",
"bytes": "154888"
},
{
"name": "nesC",
"bytes": "17"
}
],
"symlink_target": ""
} |
package ca.uhn.fhir.testmodel;
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.dstu.composite.PeriodDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.resource.Organization;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
/**
* HAPI/FHIR <b>Identifier</b> Datatype
* (An identifier intended for computation)
*
* <p>
* <b>Definition:</b>
* A technical identifier - identifies some entity uniquely and unambiguously
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to be able to identify things with confidence and be sure that the identification is not subject to misinterpretation
* </p>
*/
@DatatypeDef(name="Identifier")
public class IdentifierDt
extends BaseIdentifiableElement implements ICompositeDatatype , IQueryParameterType {
/**
* Creates a new identifier
*/
public IdentifierDt() {
// nothing
}
/**
* Creates a new identifier with the given system and value
*/
public IdentifierDt(String theSystem, String theValue) {
setSystem(theSystem);
setValue(theValue);
}
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="usual | official | temp | secondary (If known)",
formalDefinition="The purpose of this identifier"
)
private BoundCodeDt<IdentifierUseEnum> myUse;
@Child(name="label", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Description of identifier",
formalDefinition="A text string for the identifier that can be displayed to a human so they can recognize the identifier"
)
private StringDt myLabel;
@Child(name="system", type=UriDt.class, order=2, min=0, max=1)
@Description(
shortDefinition="The namespace for the identifier",
formalDefinition="Establishes the namespace in which set of possible id values is unique."
)
private UriDt mySystem;
@Child(name="value", type=StringDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="The value that is unique",
formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system."
)
private StringDt myValue;
@Child(name="period", type=PeriodDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="Time period when id is/was valid for use",
formalDefinition="Time period during which identifier is/was valid for use"
)
private PeriodDt myPeriod;
@Child(name="assigner", order=5, min=0, max=1, type={
Organization.class,
})
@Description(
shortDefinition="Organization that issued id (may be just text)",
formalDefinition="Organization that issued/manages the identifier"
)
private ResourceReferenceDt myAssigner;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myLabel, mySystem, myValue, myPeriod, myAssigner);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myLabel, mySystem, myValue, myPeriod, myAssigner );
}
/**
* Gets the value(s) for <b>use</b> (usual | official | temp | secondary (If known)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public BoundCodeDt<IdentifierUseEnum> getUse() {
if (myUse == null) {
myUse = new BoundCodeDt<IdentifierUseEnum>(IdentifierUseEnum.VALUESET_BINDER);
}
return myUse;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known))
*
* <p>
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public void setUse(BoundCodeDt<IdentifierUseEnum> theValue) {
myUse = theValue;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known))
*
* <p>
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public void setUse(IdentifierUseEnum theValue) {
getUse().setValueAsEnum(theValue);
}
/**
* Gets the value(s) for <b>label</b> (Description of identifier).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public StringDt getLabel() {
if (myLabel == null) {
myLabel = new StringDt();
}
return myLabel;
}
/**
* Sets the value(s) for <b>label</b> (Description of identifier)
*
* <p>
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public void setLabel(StringDt theValue) {
myLabel = theValue;
}
/**
* Sets the value for <b>label</b> (Description of identifier)
*
* <p>
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public void setLabel( String theString) {
myLabel = new StringDt(theString);
}
/**
* Gets the value(s) for <b>system</b> (The namespace for the identifier).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public UriDt getSystem() {
if (mySystem == null) {
mySystem = new UriDt();
}
return mySystem;
}
/**
* Sets the value(s) for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public void setSystem(UriDt theValue) {
mySystem = theValue;
}
/**
* Sets the value for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>value</b> (The value that is unique).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public StringDt getValue() {
if (myValue == null) {
myValue = new StringDt();
}
return myValue;
}
/**
* Sets the value(s) for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public void setValue(StringDt theValue) {
myValue = theValue;
}
/**
* Sets the value for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public void setValue( String theString) {
myValue = new StringDt(theString);
}
/**
* Gets the value(s) for <b>period</b> (Time period when id is/was valid for use).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Time period during which identifier is/was valid for use
* </p>
*/
public PeriodDt getPeriod() {
if (myPeriod == null) {
myPeriod = new PeriodDt();
}
return myPeriod;
}
/**
* Sets the value(s) for <b>period</b> (Time period when id is/was valid for use)
*
* <p>
* <b>Definition:</b>
* Time period during which identifier is/was valid for use
* </p>
*/
public void setPeriod(PeriodDt theValue) {
myPeriod = theValue;
}
/**
* Gets the value(s) for <b>assigner</b> (Organization that issued id (may be just text)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Organization that issued/manages the identifier
* </p>
*/
public ResourceReferenceDt getAssigner() {
if (myAssigner == null) {
myAssigner = new ResourceReferenceDt();
}
return myAssigner;
}
/**
* Sets the value(s) for <b>assigner</b> (Organization that issued id (may be just text))
*
* <p>
* <b>Definition:</b>
* Organization that issued/manages the identifier
* </p>
*/
public void setAssigner(ResourceReferenceDt theValue) {
myAssigner = theValue;
}
/**
* Returns true if <code>this</code> identifier has the same {@link IdentifierDt#getValue() value}
* and {@link IdentifierDt#getSystem() system} (as compared by simple equals comparison).
* Does not compare other values (e.g. {@link IdentifierDt#getUse() use}) or any extensions.
*/
public boolean matchesSystemAndValue(IdentifierDt theIdentifier) {
if (theIdentifier == null) {
return false;
}
return getValue().equals(theIdentifier.getValue()) && getSystem().equals(theIdentifier.getSystem());
}
/**
* {@inheritDoc}
*/
@Override
public String getValueAsQueryToken() {
if (org.apache.commons.lang3.StringUtils.isNotBlank(getSystem().getValueAsString())) {
return getSystem().getValueAsString() + '|' + getValue().getValueAsString();
} else {
return getValue().getValueAsString();
}
}
/**
* {@inheritDoc}
*/
@Override
public void setValueAsQueryToken(String theQualifier, String theValue) {
int barIndex = theValue.indexOf('|');
if (barIndex != -1) {
setSystem(new UriDt(theValue.substring(0, barIndex)));
setValue(theValue.substring(barIndex + 1));
} else {
setValue(theValue);
}
}
@Override
public String getQueryParameterQualifier() {
return null;
}
} | {
"content_hash": "d2f79723e3f06a99c5acf055a14965c3",
"timestamp": "",
"source": "github",
"line_count": 406,
"max_line_length": 137,
"avg_line_length": 25.864532019704434,
"alnum_prop": 0.665269974288163,
"repo_name": "gajen0981/FHIR-Server",
"id": "766fe8141e3e9fa1bff6bb27be89aed39d0d3e20",
"size": "10501",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/testmodel/IdentifierDt.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "227739"
},
{
"name": "Eagle",
"bytes": "4789404"
},
{
"name": "HTML",
"bytes": "149834"
},
{
"name": "Java",
"bytes": "11943289"
},
{
"name": "JavaScript",
"bytes": "24773"
},
{
"name": "KiCad",
"bytes": "12030"
},
{
"name": "Ruby",
"bytes": "208400"
},
{
"name": "Shell",
"bytes": "2096"
}
],
"symlink_target": ""
} |
DLL_EXPORT void *VoidFnPtrLookup_Tier0(const char *libname, const char *fn, void *fallback);
template < class FunctionType >
class CDynamicFunction
{
public:
// Construct with a NULL function pointer. You must manually call
// Lookup() before you can call a dynamic function through this interface.
CDynamicFunction() : m_pFn(NULL) {}
// Construct and do a lookup right away. You will need to make sure that
// the lookup actually succeeded, as (libname) might have failed to load
// or (fn) might not exist in it.
CDynamicFunction(const char *libname, const char *fn, FunctionType fallback=NULL) : m_pFn(NULL)
{
Lookup(libname, fn, fallback);
}
// Construct and do a lookup right away. See comments in Lookup() about what (okay) does.
CDynamicFunction(const char *libname, const char *fn, bool &okay, FunctionType fallback=NULL) : m_pFn(NULL)
{
Lookup(libname, fn, okay, fallback);
}
// Load library if necessary, look up symbol. Returns true and sets
// m_pFn on successful lookup, returns false otherwise. If the
// function pointer is already looked up, this return true immediately.
// Use Reset() first if you want to look up the symbol again.
// This function will return false immediately unless (okay) is true.
// This allows you to chain lookups like this:
// bool okay = true;
// x.Lookup(lib, "x", okay);
// y.Lookup(lib, "y", okay);
// z.Lookup(lib, "z", okay);
// if (okay) { printf("All functions were loaded successfully!\n"); }
// If you supply a fallback, it'll be used if the lookup fails (and if
// non-NULL, means this will always return (okay)).
bool Lookup(const char *libname, const char *fn, bool &okay, FunctionType fallback=NULL)
{
if (!okay)
return false;
else if (m_pFn == NULL)
m_pFn = (FunctionType) VoidFnPtrLookup_Tier0(libname, fn, (void *) fallback);
okay = m_pFn != NULL;
return okay;
}
// Load library if necessary, look up symbol. Returns true and sets
// m_pFn on successful lookup, returns false otherwise. If the
// function pointer is already looked up, this return true immediately.
// Use Reset() first if you want to look up the symbol again.
// This function will return false immediately unless (okay) is true.
// If you supply a fallback, it'll be used if the lookup fails (and if
// non-NULL, means this will always return true).
bool Lookup(const char *libname, const char *fn, FunctionType fallback=NULL)
{
bool okay = true;
return Lookup(libname, fn, okay, fallback);
}
// Invalidates the current lookup. Makes the function pointer NULL. You
// will need to call Lookup() before you can call a dynamic function
// through this interface again.
void Reset() { m_pFn = NULL; }
// Force this to be a specific function pointer.
void Force(FunctionType ptr) { m_pFn = ptr; }
// Retrieve the actual function pointer.
FunctionType Pointer() const { return m_pFn; }
operator FunctionType() const { return m_pFn; }
// Can be used to verify that we have an actual function looked up and
// ready to call: if (!MyDynFunc) { printf("Function not found!\n"); }
operator bool () const { return m_pFn != NULL; }
bool operator !() const { return m_pFn == NULL; }
protected:
FunctionType m_pFn;
};
// This is the same as CDynamicFunction, but we made the default constructor
// private, forcing you to do loading/lookup during construction.
// The usage pattern is to have a list of dynamic functions that are
// constructed en masse as part of another class's constructor, with the
// possibility of human error removed (the compiler will complain if you
// forget to initialize one).
template < class FunctionType >
class CDynamicFunctionMustInit : public CDynamicFunction < FunctionType >
{
private: // forbid default constructor.
CDynamicFunctionMustInit() {}
public:
CDynamicFunctionMustInit(const char *libname, const char *fn, FunctionType fallback=NULL)
: CDynamicFunction< FunctionType >(libname, fn, fallback)
{
}
CDynamicFunctionMustInit(const char *libname, const char *fn, bool &okay, FunctionType fallback=NULL)
: CDynamicFunction< FunctionType >(libname, fn, okay, fallback)
{
}
};
#endif // DYNFUNCTION_H
| {
"content_hash": "b56e611889153ad5ded23d60c2154039",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 108,
"avg_line_length": 38.93518518518518,
"alnum_prop": 0.7129607609988109,
"repo_name": "BerntA/tfo-code",
"id": "bd976b7353c2b2e32500f0d0e2c716a23060b863",
"size": "5086",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "public/tier0/dynfunction.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "238"
},
{
"name": "Batchfile",
"bytes": "9897"
},
{
"name": "C",
"bytes": "1255315"
},
{
"name": "C++",
"bytes": "39642849"
},
{
"name": "GLSL",
"bytes": "126492"
},
{
"name": "Makefile",
"bytes": "28908"
},
{
"name": "Objective-C",
"bytes": "72895"
},
{
"name": "Objective-C++",
"bytes": "369"
},
{
"name": "Perl",
"bytes": "93035"
},
{
"name": "Perl 6",
"bytes": "1820"
},
{
"name": "Shell",
"bytes": "1362"
}
],
"symlink_target": ""
} |
<?php
global $themeple_config;
$themeple_config['multi_entry_page'] = true;
$themeple_config['current_sidebar'] = themeple_get_option('blog_sidebar_position');
$spancontent = 12;
if($themeple_config['current_sidebar'] == 'fullsize')
$spancontent = 12;
else
$spancontent = 9;
$themeple_config['current_view'] = 'blog';
get_header();
$id = themeple_get_option('blogpage');
?>
<!-- Page Head -->
<?php if(themeple_post_meta($id, 'page_header_bool') == 'yes'):
$extra_class = '';
$extra_style = '';
if(themeple_post_meta($id, 'header_type') == 'image'){
$extra_style .= 'background-image:url('.themeple_post_meta($id, 'background_image').');background-repeat: no-repeat;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover; ';
$extra_class .= ' background_image';
}else if(themeple_post_meta($id, 'header_type') == 'color'){
$extra_class .= ' colored_bg';
$extra_style .= ' background:'.themeple_post_meta($id, 'color_pick').';';
}
if(themeple_post_meta($id, 'page_header_animated') == 'yes'){
$extra_class .= ' animated_header';
}
?>
<div class="header_page <?php echo $extra_class ?>" style="<?php echo $extra_style ?>">
<div class="animated_part"></div>
<div class="container">
<div class="row-fluid">
<div class="span6">
<h2><?php echo __('Archive', 'themeple'); ?></h2>
</div>
<div class="breadcrumbss">
<ul class="page_parents pull-right">
<li><a href="<?php echo home_url() ?>"><?php echo __('Home', 'themeple'); ?></a></li>
<li class="active"><a href="<?php echo get_permalink() ?>"><?php echo __('Search', 'themeple'); ?></a></li>
</ul>
</div>
</div>
</div>
</div>
<?php endif; ?>
<!-- End Page Head -->
<section id="content">
<div class="container" id="blog">
<div class="row">
<?php if($themeple_config['current_sidebar'] == 'sidebar_left') get_sidebar() ?>
<div class="span<?php echo $spancontent ?>">
<?php
if(have_posts()){
if(( $themeple_config['current_sidebar'] == 'fullsize' && !isset($_COOKIE['themeple_blog'])) || (isset($_COOKIE['themeple_blog']) && $_COOKIE['themeple_blog'] == 'fullwidth' )){
get_template_part( 'template_inc/loop', 'blog-fullwidth' );
}else
get_template_part( 'template_inc/loop', 'index' );
}else{
?>
<h3 style="font-weight:normal;"><?php _e('Your search did not match any entries', 'themeple') ?></h3>
<p></p>
<p><?php _e('Suggestions', 'themeple') ?>:</p>
<ul style="margin-left:40px">
<li><?php _e('Make sure all words are spelled correctly', 'themeple') ?>.</li>
<li><?php _e('Try different keywords', 'themeple') ?>.</li>
<li><?php _e('Try more general keywords', 'themeple') ?>.</li>
</ul>
<?php } ?>
</div>
<?php
wp_reset_query();
if($themeple_config['current_sidebar'] == 'sidebar_right') get_sidebar();
?>
</div>
</div>
</section>
<?php
get_footer();
?> | {
"content_hash": "afce04a78d9139ecae04c78273eff3cd",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 243,
"avg_line_length": 34.91428571428571,
"alnum_prop": 0.4795417348608838,
"repo_name": "brianmontecillo/wordpress",
"id": "a3660f819385131573d7a800d7f7da96348672b6",
"size": "3666",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wp-content/themes/fortis7/search.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2988281"
},
{
"name": "JavaScript",
"bytes": "5540422"
},
{
"name": "LiveScript",
"bytes": "6103"
},
{
"name": "PHP",
"bytes": "21748126"
}
],
"symlink_target": ""
} |
* **orgpolicy:** rewrite signatures in terms of new location ([3c4b2b3](https://github.com/googleapis/google-cloud-go/commit/3c4b2b34565795537aac1661e6af2442437e34ad))
## [1.4.0](https://github.com/googleapis/google-cloud-go/compare/orgpolicy/v1.3.0...orgpolicy/v1.4.0) (2022-10-25)
### Features
* **orgpolicy:** start generating stubs dir ([de2d180](https://github.com/googleapis/google-cloud-go/commit/de2d18066dc613b72f6f8db93ca60146dabcfdcc))
## [1.3.0](https://github.com/googleapis/google-cloud-go/compare/orgpolicy/v1.2.0...orgpolicy/v1.3.0) (2022-02-23)
### Features
* **orgpolicy:** set versionClient to module version ([55f0d92](https://github.com/googleapis/google-cloud-go/commit/55f0d92bf112f14b024b4ab0076c9875a17423c9))
## [1.2.0](https://github.com/googleapis/google-cloud-go/compare/orgpolicy/v1.1.0...orgpolicy/v1.2.0) (2022-02-22)
### Features
* **orgpolicy:** Deprecates AlternativePolicySpec ([f9fe0f2](https://github.com/googleapis/google-cloud-go/commit/f9fe0f2bf152c3855d3c6a2c54f9b7adba54f626))
## [1.1.0](https://github.com/googleapis/google-cloud-go/compare/orgpolicy/v1.0.0...orgpolicy/v1.1.0) (2022-02-14)
### Features
* **orgpolicy:** add file for tracking version ([17b36ea](https://github.com/googleapis/google-cloud-go/commit/17b36ead42a96b1a01105122074e65164357519e))
## 1.0.0
Stabilize GA surface.
## v0.1.0
This is the first tag to carve out orgpolicy as its own module. See
[Add a module to a multi-module repository](https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository).
| {
"content_hash": "9f013d60b7b4e6cbf4dfda85968796ee",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 167,
"avg_line_length": 41.55263157894737,
"alnum_prop": 0.7542748575047499,
"repo_name": "googleapis/google-cloud-go",
"id": "b43c2feca46bbb343e4a046b55fb5b3d52a72526",
"size": "1721",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "orgpolicy/CHANGES.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "10349"
},
{
"name": "C",
"bytes": "74"
},
{
"name": "Dockerfile",
"bytes": "1841"
},
{
"name": "Go",
"bytes": "7626642"
},
{
"name": "M4",
"bytes": "43723"
},
{
"name": "Makefile",
"bytes": "1455"
},
{
"name": "Python",
"bytes": "718"
},
{
"name": "Shell",
"bytes": "27309"
}
],
"symlink_target": ""
} |
'use strict';
const processor = require('./legacy-processors/foo');
const harness = require('../index')();
harness.runProcessorSpecs(processor);
| {
"content_hash": "df54c118a713244ac05d3a5ddaf2021c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 53,
"avg_line_length": 24.5,
"alnum_prop": 0.7210884353741497,
"repo_name": "jsnoble/teraslice",
"id": "8d182ad4d4a90657a289101d1e92c076997cfc36",
"size": "147",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "packages/teraslice-op-test-harness/test/common-spec.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2401"
},
{
"name": "HTML",
"bytes": "5268"
},
{
"name": "JavaScript",
"bytes": "1119357"
},
{
"name": "Python",
"bytes": "1278"
},
{
"name": "Shell",
"bytes": "7506"
},
{
"name": "TypeScript",
"bytes": "685903"
}
],
"symlink_target": ""
} |
(function(streetsweeper) {
streetsweeper.version = '0.0.5';
var functions = {};
// Basic cleaning functions
functions.removeExtraSpaces = function(address) {
return address.replace(/ +/g, ' ');
};
functions.removeCommas = function(address) {
return address.replace(',','');
};
functions.removeTrailingAndLeadingSpaces = function(address) {
return address.trim();
};
functions.removeHyphenSpaces = function(address) {
return address.replace(/(\d) - (\d)/, '$1-$2');
};
functions.removeLettersNextToNumber = function(address) {
return address.replace(/(\d+)([A-Q,T-Z,a-q,t-z])/, '$1'); // that regex string isn't going to fly for long
};
// Street direction functions
functions.abbreviateStreetDirection = function(address) {
var directionMap = {
'NORTH': 'N',
'SOUTH': 'S',
'EAST': 'E',
'WEST': 'W'
};
address = address.replace(/\bNORTH\b|\bSOUTH\b|\bEAST\b|\bWEST\b/gi, function(matched){
matched = matched.toUpperCase();
return directionMap[matched];
});
return address;
};
functions.expandStreetDirection = function(address) {
var directionMap = {
'N': 'NORTH',
'S': 'SOUTH',
'E': 'EAST',
'W': 'WEST'
};
address = address.replace(/\bN\b|\bS\b|\bE\b|\bW\b/gi, function(matched){
matched = matched.toUpperCase();
return directionMap[matched];
});
return address;
};
// Street type functions
functions.abbreviateStreetType = function(address) {
var suffixMap = {
'AVENUE': 'AVE',
'STREET': 'ST',
'BOULEVARD': 'BLVD',
'PARKWAY': 'PKWY',
'ROAD': 'RD'
};
address = address.replace(/\bAVENUE\b|\bSTREET\b|\bBOULEVARD\b|\bPARKWAY\b|\bROAD\b/gi, function(matched){
matched = matched.toUpperCase();
return suffixMap[matched];
});
return address;
};
functions.expandStreetType = function(address) {
var suffixMap = {
'AVE': 'AVENUE',
'ST': 'STREET',
'BLVD': 'BOULEVARD',
'PKWY': 'PARKWAY',
'RD': 'ROAD'
};
address = address.replace(/\bAVE\b|\bST\b|\bBLVD\b|\bPKWY\b|\bRD\b/gi, function(matched){
matched = matched.toUpperCase();
return suffixMap[matched];
});
return address;
};
// Casing functions
functions.toUpperCase = function(address) {
return address.toUpperCase();
};
functions.toLowerCase = function(address) {
return address.toLowerCase();
};
functions.toTitleCase = function(address) {
// from http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript
// probably going to need some work to clean edge cases
return address.replace(/\w\S*/g, function(txt){
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
};
streetsweeper.functionMap = {
direction: {
abbreviated: functions.abbreviateStreetDirection,
full: functions.expandStreetDirection
},
streetType: {
abbreviated: functions.abbreviateStreetType,
full: functions.expandStreetType
},
casing: {
upper: functions.toUpperCase,
lower: functions.toLowerCase,
title: functions.toTitleCase,
}
};
functions.generateFunctionList = function(options) {
// We always run addresses through these basic cleaning functions
var functionList = [
functions.removeExtraSpaces,
functions.removeTrailingAndLeadingSpaces,
functions.removeCommas,
functions.removeHyphenSpaces,
functions.removeLettersNextToNumber
];
// And then we add functions to the cleaning list depending on what
// the user specified
for(var option in options) {
if (options.hasOwnProperty(option)) {
functionList.push(streetsweeper.functionMap[option][options[option]]);
}
}
return functionList;
};
// The main (and one and only public) function.
streetsweeper.sweep = function(addresses, options, callback) {
// If only a single address was passed in, make it the first element of array of addresses
if(typeof addresses === 'string') { addresses = [addresses]; }
// List of functions to apply to each address
var functionList = functions.generateFunctionList(options);
// Apply each function in functionList to each address
for(var i=0; i < addresses.length; i++) {
for(var x=0; x < functionList.length; x++) {
addresses[i] = functionList[x](addresses[i]);
}
}
// If we only have one address, convert it back to a string
if(addresses.length === 1) { addresses = addresses[0]; }
// Call the callback or just return the cleaned addresses
if (callback && typeof callback === 'function') {
callback(addresses);
} else {
return addresses;
}
};
}(typeof module == 'object' ? module.exports : window.streetsweeper = {})); | {
"content_hash": "ce95862cfbfbaa6367a4e6248ed347e5",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 110,
"avg_line_length": 27.994285714285713,
"alnum_prop": 0.6364564196774852,
"repo_name": "caseypt/streetsweeper",
"id": "f0131ce43ccfd57646a54c965310ef04d0839f0d",
"size": "4899",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "streetsweeper.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "10346"
},
{
"name": "PHP",
"bytes": "1448"
}
],
"symlink_target": ""
} |
package UI::Parameter;
#
# Copyright 2015 Comcast Cable Communications Management, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
#
# JvD Note: you always want to put Utils as the first use. Sh*t don't work if it's after the Mojo lines.
use UI::Utils;
use Mojo::Base 'Mojolicious::Controller';
use Data::Dumper;
#Table View
sub index {
my $self = shift;
my $filter = $self->param('filter');
my $value = $self->param('byvalue');
my $filter_title = "Cachegroup/Profile name";
if ( defined($filter) ) {
$self->stash(
filter => $filter,
value => $value
);
$filter_title = $filter . " name";
$filter_title =~ s/(^\w)/\U$1/x;
}
$self->stash( filter_title => $filter_title );
&navbarpage($self);
}
sub view {
my $self = shift;
my $mode = $self->param('mode');
my $id = $self->param('id');
my $rs_param = $self->db->resultset('Parameter')->search( { id => $id } );
my $data = $rs_param->single;
$self->stash( parameter => $data );
&stash_role($self);
my %assigned_profiles = $self->get_assigned_profiles();
my %assigned_cachegroups = $self->get_assigned_cachegroups();
$self->stash(
assigned_profiles => \%assigned_profiles,
assigned_cachegroups => \%assigned_cachegroups,
fbox_layout => 1,
);
}
sub get_assigned_profiles {
my $self = shift;
my $id = $self->param('id');
my @profile_ids = $self->db->resultset('ProfileParameter')->search( { parameter => $id } )->get_column('profile')->all;
my %assigned_profiles;
foreach my $p_id (@profile_ids) {
my $profile = $self->db->resultset('Profile')->search( { id => $p_id } )->single;
$assigned_profiles{$p_id} = {
desc => $profile->description,
name => $profile->name
};
}
return %assigned_profiles;
}
sub get_assigned_cachegroups {
my $self = shift;
my $id = $self->param('id');
my @cg_ids = $self->db->resultset('CachegroupParameter')->search( { parameter => $id } )->get_column('cachegroup')->all;
my %assigned_cachegroups;
foreach my $l_id (@cg_ids) {
my $cachegroup = $self->db->resultset('Cachegroup')->search( { id => $l_id } )->single;
$assigned_cachegroups{$l_id} = {
short_name => $cachegroup->short_name,
name => $cachegroup->name
};
}
return %assigned_cachegroups;
}
# Read
sub readparameter {
my $self = shift;
my @data;
my $orderby = "name";
$orderby = $self->param('orderby') if ( defined $self->param('orderby') );
my $rs_data = $self->db->resultset("Parameter")->search( undef, { order_by => $orderby } );
while ( my $row = $rs_data->next ) {
push(
@data, {
"id" => $row->id,
"name" => $row->name,
"config_file" => $row->config_file,
"value" => $row->value,
"last_updated" => $row->last_updated,
}
);
}
$self->render( json => \@data );
}
sub readparameter_for_profile {
my $self = shift;
my $profile_name = $self->param('profile_name');
my $rs_data = $self->db->resultset("ProfileParameter")->search( { 'profile.name' => $profile_name }, { prefetch => [ 'parameter', 'profile' ] } );
my @data = ();
while ( my $row = $rs_data->next ) {
push(
@data, {
"name" => $row->parameter->name,
"config_file" => $row->parameter->config_file,
"value" => $row->parameter->value,
"last_updated" => $row->parameter->last_updated,
}
);
}
$self->render( json => \@data );
}
# Delete
sub delete {
my $self = shift;
my $id = $self->param('id');
if ( !&is_oper($self) ) {
$self->flash( alertmsg => "No can do. Get more privs." );
}
else {
my $p_name = $self->db->resultset('Parameter')->search( { id => $id } )->get_column('name')->single();
my $delete = $self->db->resultset('Parameter')->search( { id => $id } );
$delete->delete();
&log( $self, "Delete parameter " . $p_name, "UICHANGE" );
}
return $self->redirect_to('/close_fancybox.html');
}
# Update
sub update {
my $self = shift;
my $id = $self->param('id');
if ( $self->is_valid() ) {
my $update = $self->db->resultset('Parameter')->find( { id => $self->param('id') } );
$update->name( $self->param('parameter.name') );
$update->config_file( $self->param('parameter.config_file') );
$update->value( $self->param('parameter.value') );
$update->update();
# if the update has failed, we don't even get here, we go to the exception page.
&log( $self, "Update parameter with name: " . $self->param('parameter.name'), "UICHANGE" );
$self->flash( message => "Parameter updated successfully." );
return $self->redirect_to( '/parameter/' . $self->param('id') );
}
else {
&stash_role($self);
my $rs_param = $self->db->resultset('Parameter')->search( { id => $id } );
my $data = $rs_param->single;
my %assigned_profiles = &get_assigned_profiles($self);
my %assigned_cachegroups = &get_assigned_cachegroups($self);
$self->stash(
assigned_profiles => \%assigned_profiles,
assigned_cachegroups => \%assigned_cachegroups,
parameter => $data,
fbox_layout => 1
);
$self->render('/parameter/view');
}
}
sub is_valid {
my $self = shift;
my $mode = shift;
my $name = $self->param('parameter.name');
my $config_file = $self->param('parameter.config_file');
my $value = $self->param('parameter.value');
#Check permissions
if ( !&is_oper($self) ) {
$self->field('parameter.name')->is_equal( "", "You do not have the permissions to perform this operation!" );
}
#Check required fields
$self->field('parameter.name')->is_required;
$self->field('parameter.config_file')->is_required;
$self->field('parameter.value')->is_required;
#Make sure the same Parameter doesn't already exist
my $existing_param =
$self->db->resultset('Parameter')->search( { name => $name, value => $value, config_file => $config_file } )->get_column('id')->single();
if ($existing_param) {
$self->field('parameter.name')
->is_equal( "", "A parameter with the name \"$name\", config_file \"$config_file\", and value \"$value\" already exists." );
}
return $self->valid;
}
# Create
sub create {
my $self = shift;
my $new_id = -1;
if ( $self->is_valid() ) {
my $insert = $self->db->resultset('Parameter')->create(
{
name => $self->param('parameter.name'),
config_file => $self->param('parameter.config_file'),
value => $self->param('parameter.value'),
}
);
$insert->insert();
# if the insert has failed, we don't even get here, we go to the exception page.
&log( $self, "Create parameter with name " . $self->param('parameter.name') . " and value " . $self->param('parameter.value'), "UICHANGE" );
$new_id = $insert->id();
if ( $new_id == -1 ) {
my $referer = $self->req->headers->header('referer');
return $self->redirect_to($referer);
}
else {
$self->flash( message => "Parameter added successfully! Please associate to profiles or cache groups now." );
return $self->redirect_to( '/parameter/' . $new_id );
}
}
else {
&stash_role($self);
$self->stash( parameter => {}, fbox_layout => 1 );
$self->render('parameter/add');
}
}
# add parameter view
sub add {
my $self = shift;
$self->stash( fbox_layout => 1, parameter => {} );
}
1;
| {
"content_hash": "4596903d0edbae6521c3831e6a69ed41",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 147,
"avg_line_length": 30.125,
"alnum_prop": 0.608661825726141,
"repo_name": "PSUdaemon/traffic_control",
"id": "7bbfbdea40a4dc18d2adb70d31f6133df6eda0a0",
"size": "7712",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "traffic_ops/app/lib/UI/Parameter.pm",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "23899"
},
{
"name": "CSS",
"bytes": "165765"
},
{
"name": "Go",
"bytes": "482131"
},
{
"name": "HTML",
"bytes": "62335"
},
{
"name": "Java",
"bytes": "818494"
},
{
"name": "JavaScript",
"bytes": "941615"
},
{
"name": "Perl",
"bytes": "2088120"
},
{
"name": "Perl6",
"bytes": "617313"
},
{
"name": "Python",
"bytes": "11116"
},
{
"name": "Ruby",
"bytes": "3539"
},
{
"name": "Shell",
"bytes": "41733"
}
],
"symlink_target": ""
} |
/*! Built with http://stenciljs.com */
const { h } = window.trustyle;
const classMap = {};
export { classMap };
| {
"content_hash": "5adb1c98f1616b83cd0e41aca90e333e",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 19,
"alnum_prop": 0.631578947368421,
"repo_name": "tabki/tabki",
"id": "efcdd05e0842ded57680907925367101652be3c8",
"size": "114",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "packages/craft-ui/build/trustyle/chunk5.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "118282"
},
{
"name": "HTML",
"bytes": "3928"
},
{
"name": "JavaScript",
"bytes": "435016"
},
{
"name": "TypeScript",
"bytes": "34000"
}
],
"symlink_target": ""
} |
Ganeti customisation using hooks
================================
Documents Ganeti version 2.17
.. contents::
Introduction
------------
In order to allow customisation of operations, Ganeti runs scripts in
sub-directories of ``@SYSCONFDIR@/ganeti/hooks`` (that is usually
``/etc/ganeti/hooks``). These sub-directories
are named ``$hook-$phase.d``, where ``$phase`` is either ``pre`` or
``post`` and ``$hook`` matches the directory name given for a hook (e.g.
``cluster-verify-post.d`` or ``node-add-pre.d``).
This is similar to the ``/etc/network/`` structure present in Debian
for network interface handling.
Note that Ganeti does not create its ``hooks`` directory by default.
If you want to use hooks scripts, create it on all nodes. This applies
also to all sub directories such as ``node-add-pre.d``.
.. _hooks-organization:
Organisation
------------
For every operation, two sets of scripts are run:
- pre phase (for authorization/checking)
- post phase (for logging)
Also, for each operation, the scripts are run on one or more nodes,
depending on the operation type.
Note that, even though we call them scripts, we are actually talking
about any executable.
The filenames of the scripts need to match the regular expression
``^[a-zA-Z0-9_-]+$``. This means in particular, that scripts having
a filename extension (such as ``myhook.sh``) are silently ignored
by Ganeti.
*pre* scripts
~~~~~~~~~~~~~
The *pre* scripts have a definite target: to check that the operation
is allowed given the site-specific constraints. You could have, for
example, a rule that says every new instance is required to exists in
a database; to implement this, you could write a script that checks
the new instance parameters against your database.
The objective of these scripts should be their return code (zero or
non-zero for success and failure). However, if they modify the
environment in any way, they should be idempotent, as failed
executions could be restarted and thus the script(s) run again with
exactly the same parameters.
Note that if a node is unreachable at the time a hooks is run, this
will not be interpreted as a deny for the execution. In other words,
only an actual error returned from a script will cause abort, and not
an unreachable node.
Therefore, if you want to guarantee that a hook script is run and
denies an action, it's best to put it on the master node.
*post* scripts
~~~~~~~~~~~~~~
These scripts should do whatever you need as a reaction to the
completion of an operation. Their return code is not checked (but
logged), and they should not depend on the fact that the *pre* scripts
have been run.
Naming
~~~~~~
The allowed names for the scripts consist of (similar to *run-parts*)
upper and lower case, digits, underscores and hyphens. In other words,
the regexp ``^[a-zA-Z0-9_-]+$``. Also, non-executable scripts will be
ignored.
Order of execution
~~~~~~~~~~~~~~~~~~
On a single node, the scripts in a directory are run in lexicographic
order (more exactly, the python string comparison order). It is
advisable to implement the usual *NN-name* convention where *NN* is a
two digit number.
For an operation whose hooks are run on multiple nodes, there is no
specific ordering of nodes with regard to hooks execution; you should
assume that the scripts are run in parallel on the target nodes
(keeping on each node the above specified ordering). If you need any
kind of inter-node synchronisation, you have to implement it yourself
in the scripts.
Execution environment
~~~~~~~~~~~~~~~~~~~~~
The scripts will be run as follows:
- no command line arguments
- no controlling *tty*
- stdin is actually */dev/null*
- stdout and stderr are directed to files
- PATH is reset to :pyeval:`constants.HOOKS_PATH`
- the environment is cleared, and only ganeti-specific variables will
be left
All information about the cluster is passed using environment
variables. Different operations will have sligthly different
environments, but most of the variables are common.
Operation list
--------------
.. _opcode-params:
Node operations
~~~~~~~~~~~~~~~
OP_NODE_ADD
+++++++++++
Adds a node to the cluster.
:directory: node-add
:env. vars: NODE_NAME, NODE_PIP, NODE_SIP, MASTER_CAPABLE, VM_CAPABLE
:pre-execution: all existing nodes
:post-execution: all nodes plus the new node
OP_NODE_REMOVE
++++++++++++++
Removes a node from the cluster. On the removed node the hooks are
called during the execution of the operation and not after its
completion.
:directory: node-remove
:env. vars: NODE_NAME
:pre-execution: all existing nodes except the removed node
:post-execution: all existing nodes
OP_NODE_SET_PARAMS
++++++++++++++++++
Changes a node's parameters.
:directory: node-modify
:env. vars: MASTER_CANDIDATE, OFFLINE, DRAINED, MASTER_CAPABLE, VM_CAPABLE
:pre-execution: master node, the target node
:post-execution: master node, the target node
OP_NODE_MIGRATE
++++++++++++++++
Relocate secondary instances from a node.
:directory: node-migrate
:env. vars: NODE_NAME
:pre-execution: master node
:post-execution: master node
Node group operations
~~~~~~~~~~~~~~~~~~~~~
OP_GROUP_ADD
++++++++++++
Adds a node group to the cluster.
:directory: group-add
:env. vars: GROUP_NAME
:pre-execution: master node
:post-execution: master node
OP_GROUP_SET_PARAMS
+++++++++++++++++++
Changes a node group's parameters.
:directory: group-modify
:env. vars: GROUP_NAME, NEW_ALLOC_POLICY
:pre-execution: master node
:post-execution: master node
OP_GROUP_REMOVE
+++++++++++++++
Removes a node group from the cluster. Since the node group must be
empty for removal to succeed, the concept of "nodes in the group" does
not exist, and the hook is only executed in the master node.
:directory: group-remove
:env. vars: GROUP_NAME
:pre-execution: master node
:post-execution: master node
OP_GROUP_RENAME
+++++++++++++++
Renames a node group.
:directory: group-rename
:env. vars: OLD_NAME, NEW_NAME
:pre-execution: master node and all nodes in the group
:post-execution: master node and all nodes in the group
OP_GROUP_EVACUATE
+++++++++++++++++
Evacuates a node group.
:directory: group-evacuate
:env. vars: GROUP_NAME, TARGET_GROUPS
:pre-execution: master node and all nodes in the group
:post-execution: master node and all nodes in the group
Network operations
~~~~~~~~~~~~~~~~~~
OP_NETWORK_ADD
++++++++++++++
Adds a network to the cluster.
:directory: network-add
:env. vars: NETWORK_NAME, NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
NETWORK_GATEWAY6, NETWORK_MAC_PREFIX, NETWORK_TAGS
:pre-execution: master node
:post-execution: master node
OP_NETWORK_REMOVE
+++++++++++++++++
Removes a network from the cluster.
:directory: network-remove
:env. vars: NETWORK_NAME
:pre-execution: master node
:post-execution: master node
OP_NETWORK_CONNECT
++++++++++++++++++
Connects a network to a nodegroup.
:directory: network-connect
:env. vars: GROUP_NAME, NETWORK_NAME,
GROUP_NETWORK_MODE, GROUP_NETWORK_LINK, GROUP_NETWORK_VLAN,
NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
NETWORK_GATEWAY6, NETWORK_MAC_PREFIX, NETWORK_TAGS
:pre-execution: nodegroup nodes
:post-execution: nodegroup nodes
OP_NETWORK_DISCONNECT
+++++++++++++++++++++
Disconnects a network from a nodegroup.
:directory: network-disconnect
:env. vars: GROUP_NAME, NETWORK_NAME,
GROUP_NETWORK_MODE, GROUP_NETWORK_LINK, GROUP_NETWORK_VLAN,
NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
NETWORK_GATEWAY6, NETWORK_MAC_PREFIX, NETWORK_TAGS
:pre-execution: nodegroup nodes
:post-execution: nodegroup nodes
OP_NETWORK_SET_PARAMS
+++++++++++++++++++++
Modifies a network.
:directory: network-modify
:env. vars: NETWORK_NAME, NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
NETWORK_GATEWAY6, NETWORK_MAC_PREFIX, NETWORK_TAGS
:pre-execution: master node
:post-execution: master node
Instance operations
~~~~~~~~~~~~~~~~~~~
All instance operations take at least the following variables:
INSTANCE_NAME, INSTANCE_PRIMARY, INSTANCE_SECONDARY,
INSTANCE_OS_TYPE, INSTANCE_DISK_TEMPLATE, INSTANCE_MEMORY,
INSTANCE_DISK_SIZES, INSTANCE_VCPUS, INSTANCE_NIC_COUNT,
INSTANCE_NICn_IP, INSTANCE_NICn_BRIDGE, INSTANCE_NICn_MAC,
INSTANCE_NICn_NETWORK,
INSTANCE_NICn_NETWORK_UUID, INSTANCE_NICn_NETWORK_SUBNET,
INSTANCE_NICn_NETWORK_GATEWAY, INSTANCE_NICn_NETWORK_SUBNET6,
INSTANCE_NICn_NETWORK_GATEWAY6, INSTANCE_NICn_NETWORK_MAC_PREFIX,
INSTANCE_DISK_COUNT, INSTANCE_DISKn_SIZE, INSTANCE_DISKn_MODE,
INSTANCE_DISKn_NAME, INSTANCE_DISKn_UUID, INSTANCE_DISKn_DEV_TYPE.
The INSTANCE_NICn_* and INSTANCE_DISKn_* variables represent the
properties of the *n* -th NIC and disk, and are zero-indexed.
Depending on the disk template, Ganeti exports some info related to
the logical id of the disk, that is basically its driver and id.
The INSTANCE_NICn_NETWORK_* variables are only passed if a NIC's network
parameter is set (that is if the NIC is associated to a network defined
via ``gnt-network``)
OP_INSTANCE_CREATE
++++++++++++++++++
Creates a new instance.
:directory: instance-add
:env. vars: ADD_MODE, SRC_NODE, SRC_PATH, SRC_IMAGES
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_REINSTALL
+++++++++++++++++++++
Reinstalls an instance.
:directory: instance-reinstall
:env. vars: only the standard instance vars
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_BACKUP_EXPORT
++++++++++++++++
Exports the instance.
:directory: instance-export
:env. vars: EXPORT_MODE, EXPORT_NODE, EXPORT_DO_SHUTDOWN, REMOVE_INSTANCE
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_STARTUP
+++++++++++++++++++
Starts an instance.
:directory: instance-start
:env. vars: FORCE
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_SHUTDOWN
++++++++++++++++++++
Stops an instance.
:directory: instance-stop
:env. vars: TIMEOUT
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_REBOOT
++++++++++++++++++
Reboots an instance.
:directory: instance-reboot
:env. vars: IGNORE_SECONDARIES, REBOOT_TYPE, SHUTDOWN_TIMEOUT
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_SET_PARAMS
++++++++++++++++++++++
Modifies the instance parameters.
:directory: instance-modify
:env. vars: NEW_DISK_TEMPLATE, RUNTIME_MEMORY
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_FAILOVER
++++++++++++++++++++
Failovers an instance. In the post phase INSTANCE_PRIMARY and
INSTANCE_SECONDARY refer to the nodes that were repectively primary
and secondary before failover.
:directory: instance-failover
:env. vars: IGNORE_CONSISTENCY, SHUTDOWN_TIMEOUT, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY
:pre-execution: master node, secondary (target) node
:post-execution: master node, primary (source) and secondary (target) nodes
OP_INSTANCE_MIGRATE
++++++++++++++++++++
Migrates an instance. In the post phase INSTANCE_PRIMARY and
INSTANCE_SECONDARY refer to the nodes that were repectively primary
and secondary before migration.
:directory: instance-migrate
:env. vars: MIGRATE_LIVE, MIGRATE_CLEANUP, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY
:pre-execution: master node, primary (source) and secondary (target) nodes
:post-execution: master node, primary (source) and secondary (target) nodes
OP_INSTANCE_REMOVE
++++++++++++++++++
Remove an instance.
:directory: instance-remove
:env. vars: SHUTDOWN_TIMEOUT
:pre-execution: master node
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_GROW_DISK
+++++++++++++++++++++
Grows the disk of an instance.
:directory: disk-grow
:env. vars: DISK, AMOUNT
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_RENAME
++++++++++++++++++
Renames an instance.
:directory: instance-rename
:env. vars: INSTANCE_NEW_NAME
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_MOVE
++++++++++++++++
Move an instance by data-copying.
:directory: instance-move
:env. vars: TARGET_NODE, SHUTDOWN_TIMEOUT
:pre-execution: master node, primary and target nodes
:post-execution: master node, primary and target nodes
OP_INSTANCE_RECREATE_DISKS
++++++++++++++++++++++++++
Recreate an instance's missing disks.
:directory: instance-recreate-disks
:env. vars: only the standard instance vars
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_REPLACE_DISKS
+++++++++++++++++++++++++
Replace the disks of an instance.
:directory: mirrors-replace
:env. vars: MODE, NEW_SECONDARY, OLD_SECONDARY
:pre-execution: master node, primary and new secondary nodes
:post-execution: master node, primary and new secondary nodes
OP_INSTANCE_CHANGE_GROUP
++++++++++++++++++++++++
Moves an instance to another group.
:directory: instance-change-group
:env. vars: TARGET_GROUPS
:pre-execution: master node
:post-execution: master node
Cluster operations
~~~~~~~~~~~~~~~~~~
OP_CLUSTER_POST_INIT
++++++++++++++++++++
This hook is called via a special "empty" LU right after cluster
initialization.
:directory: cluster-init
:env. vars: none
:pre-execution: none
:post-execution: master node
OP_CLUSTER_DESTROY
++++++++++++++++++
The post phase of this hook is called during the execution of destroy
operation and not after its completion.
:directory: cluster-destroy
:env. vars: none
:pre-execution: none
:post-execution: master node
OP_CLUSTER_VERIFY_GROUP
+++++++++++++++++++++++
Verifies all nodes in a group. This is a special LU with regard to
hooks, as the result of the opcode will be combined with the result of
post-execution hooks, in order to allow administrators to enhance the
cluster verification procedure.
:directory: cluster-verify
:env. vars: CLUSTER, MASTER, CLUSTER_TAGS, NODE_TAGS_<name>
:pre-execution: none
:post-execution: all nodes in a group
OP_CLUSTER_RENAME
+++++++++++++++++
Renames the cluster.
:directory: cluster-rename
:env. vars: NEW_NAME
:pre-execution: master-node
:post-execution: master-node
OP_CLUSTER_SET_PARAMS
+++++++++++++++++++++
Modifies the cluster parameters.
:directory: cluster-modify
:env. vars: NEW_VG_NAME
:pre-execution: master node
:post-execution: master node
Virtual operation :pyeval:`constants.FAKE_OP_MASTER_TURNUP`
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This doesn't correspond to an actual op-code, but it is called when the
master IP is activated.
:directory: master-ip-turnup
:env. vars: MASTER_NETDEV, MASTER_IP, MASTER_NETMASK, CLUSTER_IP_VERSION
:pre-execution: master node
:post-execution: master node
Virtual operation :pyeval:`constants.FAKE_OP_MASTER_TURNDOWN`
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This doesn't correspond to an actual op-code, but it is called when the
master IP is deactivated.
:directory: master-ip-turndown
:env. vars: MASTER_NETDEV, MASTER_IP, MASTER_NETMASK, CLUSTER_IP_VERSION
:pre-execution: master node
:post-execution: master node
Obsolete operations
~~~~~~~~~~~~~~~~~~~
The following operations are no longer present or don't execute hooks
anymore in Ganeti 2.0:
- OP_INIT_CLUSTER
- OP_MASTER_FAILOVER
- OP_INSTANCE_ADD_MDDRBD
- OP_INSTANCE_REMOVE_MDDRBD
Environment variables
---------------------
Note that all variables listed here are actually prefixed with *GANETI_*
in order to provide a clear namespace. In addition, post-execution
scripts receive another set of variables, prefixed with *GANETI_POST_*,
representing the status after the opcode executed.
.. _common-variables:
Common variables
~~~~~~~~~~~~~~~~
This is the list of environment variables supported by all operations:
HOOKS_VERSION
Documents the hooks interface version. In case this doesnt match
what the script expects, it should not run. The documents conforms
to the version 2.
HOOKS_PHASE
One of *PRE* or *POST* denoting which phase are we in.
CLUSTER
The cluster name.
MASTER
The master node.
OP_CODE
One of the *OP_* values from the list of operations.
OBJECT_TYPE
One of ``INSTANCE``, ``NODE``, ``CLUSTER``.
DATA_DIR
The path to the Ganeti configuration directory (to read, for
example, the *ssconf* files).
.. _specialized-variables:
Specialised variables
~~~~~~~~~~~~~~~~~~~~~
This is the list of variables which are specific to one or more
operations.
CLUSTER_IP_VERSION
IP version of the master IP (4 or 6)
INSTANCE_NAME
The name of the instance which is the target of the operation.
INSTANCE_BE_x,y,z,...
Instance BE params. There is one variable per BE param. For instance, GANETI_INSTANCE_BE_auto_balance
INSTANCE_DISK_TEMPLATE
The disk type for the instance.
NEW_DISK_TEMPLATE
The new disk type for the instance.
INSTANCE_DISK_COUNT
The number of disks for the instance.
INSTANCE_DISKn_SIZE
The size of disk *n* for the instance.
INSTANCE_DISKn_MODE
Either *rw* for a read-write disk or *ro* for a read-only one.
INSTANCE_HV_x,y,z,...
Instance hypervisor options. There is one variable per option. For instance, GANETI_INSTANCE_HV_use_bootloader
INSTANCE_HYPERVISOR
The instance hypervisor.
INSTANCE_NIC_COUNT
The number of NICs for the instance.
INSTANCE_NICn_BRIDGE
The bridge to which the *n* -th NIC of the instance is attached.
INSTANCE_NICn_IP
The IP (if any) of the *n* -th NIC of the instance.
INSTANCE_NICn_MAC
The MAC address of the *n* -th NIC of the instance.
INSTANCE_NICn_MODE
The mode of the *n* -th NIC of the instance.
INSTANCE_OS_TYPE
The name of the instance OS.
INSTANCE_PRIMARY
The name of the node which is the primary for the instance. Note that
for migrations/failovers, you shouldn't rely on this variable since
the nodes change during the exectution, but on the
OLD_PRIMARY/NEW_PRIMARY values.
INSTANCE_SECONDARY
Space-separated list of secondary nodes for the instance. Note that
for migrations/failovers, you shouldn't rely on this variable since
the nodes change during the exectution, but on the
OLD_SECONDARY/NEW_SECONDARY values.
INSTANCE_MEMORY
The memory size (in MiBs) of the instance.
INSTANCE_VCPUS
The number of virtual CPUs for the instance.
INSTANCE_STATUS
The run status of the instance.
MASTER_CAPABLE
Whether a node is capable of being promoted to master.
VM_CAPABLE
Whether the node can host instances.
MASTER_NETDEV
Network device of the master IP
MASTER_IP
The master IP
MASTER_NETMASK
Netmask of the master IP
INSTANCE_TAGS
A space-delimited list of the instance's tags.
NODE_NAME
The target node of this operation (not the node on which the hook
runs).
NODE_PIP
The primary IP of the target node (the one over which inter-node
communication is done).
NODE_SIP
The secondary IP of the target node (the one over which drbd
replication is done). This can be equal to the primary ip, in case
the cluster is not dual-homed.
FORCE
This is provided by some operations when the user gave this flag.
IGNORE_CONSISTENCY
The user has specified this flag. It is used when failing over
instances in case the primary node is down.
ADD_MODE
The mode of the instance create: either *create* for create from
scratch or *import* for restoring from an exported image.
SRC_NODE, SRC_PATH, SRC_IMAGE
In case the instance has been added by import, these variables are
defined and point to the source node, source path (the directory
containing the image and the config file) and the source disk image
file.
NEW_SECONDARY
The name of the node on which the new mirror component is being
added (for replace disk). This can be the name of the current
secondary, if the new mirror is on the same secondary. For
migrations/failovers, this is the old primary node.
OLD_SECONDARY
The name of the old secondary in the replace-disks command. Note that
this can be equal to the new secondary if the secondary node hasn't
actually changed. For migrations/failovers, this is the new primary
node.
OLD_PRIMARY, NEW_PRIMARY
For migrations/failovers, the old and respectively new primary
nodes. These two mirror the NEW_SECONDARY/OLD_SECONDARY variables
EXPORT_MODE
The instance export mode. Either "remote" or "local".
EXPORT_NODE
The node on which the exported image of the instance was done.
EXPORT_DO_SHUTDOWN
This variable tells if the instance has been shutdown or not while
doing the export. In the "was shutdown" case, it's likely that the
filesystem is consistent, whereas in the "did not shutdown" case,
the filesystem would need a check (journal replay or full fsck) in
order to guarantee consistency.
REMOVE_INSTANCE
Whether the instance was removed from the node.
SHUTDOWN_TIMEOUT
Amount of time to wait for the instance to shutdown.
TIMEOUT
Amount of time to wait before aborting the op.
OLD_NAME, NEW_NAME
Old/new name of the node group.
GROUP_NAME
The name of the node group.
NEW_ALLOC_POLICY
The new allocation policy for the node group.
CLUSTER_TAGS
The list of cluster tags, space separated.
NODE_TAGS_<name>
The list of tags for node *<name>*, space separated.
Examples
--------
The startup of an instance will pass this environment to the hook
script::
GANETI_CLUSTER=cluster1.example.com
GANETI_DATA_DIR=/var/lib/ganeti
GANETI_FORCE=False
GANETI_HOOKS_PATH=instance-start
GANETI_HOOKS_PHASE=post
GANETI_HOOKS_VERSION=2
GANETI_INSTANCE_DISK0_MODE=rw
GANETI_INSTANCE_DISK0_SIZE=128
GANETI_INSTANCE_DISK_COUNT=1
GANETI_INSTANCE_DISK_TEMPLATE=drbd
GANETI_INSTANCE_MEMORY=128
GANETI_INSTANCE_NAME=instance2.example.com
GANETI_INSTANCE_NIC0_BRIDGE=xen-br0
GANETI_INSTANCE_NIC0_IP=
GANETI_INSTANCE_NIC0_MAC=aa:00:00:a5:91:58
GANETI_INSTANCE_NIC_COUNT=1
GANETI_INSTANCE_OS_TYPE=debootstrap
GANETI_INSTANCE_PRIMARY=node3.example.com
GANETI_INSTANCE_SECONDARY=node5.example.com
GANETI_INSTANCE_STATUS=down
GANETI_INSTANCE_VCPUS=1
GANETI_MASTER=node1.example.com
GANETI_OBJECT_TYPE=INSTANCE
GANETI_OP_CODE=OP_INSTANCE_STARTUP
GANETI_OP_TARGET=instance2.example.com
.. vim: set textwidth=72 :
.. Local Variables:
.. mode: rst
.. fill-column: 72
.. End:
| {
"content_hash": "56819d0bfee3f20ae2325070d3df3b89",
"timestamp": "",
"source": "github",
"line_count": 832,
"max_line_length": 112,
"avg_line_length": 27.219951923076923,
"alnum_prop": 0.7329447608954829,
"repo_name": "leshchevds/ganeti",
"id": "6d2b0718995ee5deab15e7b58930c24bb98096be",
"size": "22647",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "doc/hooks.rst",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Haskell",
"bytes": "2664853"
},
{
"name": "JavaScript",
"bytes": "8855"
},
{
"name": "M4",
"bytes": "32087"
},
{
"name": "Makefile",
"bytes": "97737"
},
{
"name": "Python",
"bytes": "6099533"
},
{
"name": "Shell",
"bytes": "122593"
}
],
"symlink_target": ""
} |
'use strict';
function main(filename, endpointId, project, location = 'us-central1') {
// [START aiplatform_predict_image_classification_sample]
/**
* TODO(developer): Uncomment these variables before running the sample.\
* (Not necessary if passing values as arguments)
*/
// const filename = "YOUR_PREDICTION_FILE_NAME";
// const endpointId = "YOUR_ENDPOINT_ID";
// const project = 'YOUR_PROJECT_ID';
// const location = 'YOUR_PROJECT_LOCATION';
const aiplatform = require('@google-cloud/aiplatform');
const {instance, params, prediction} =
aiplatform.protos.google.cloud.aiplatform.v1.schema.predict;
// Imports the Google Cloud Prediction Service Client library
const {PredictionServiceClient} = aiplatform.v1;
// Specifies the location of the api endpoint
const clientOptions = {
apiEndpoint: 'us-central1-aiplatform.googleapis.com',
};
// Instantiates a client
const predictionServiceClient = new PredictionServiceClient(clientOptions);
async function predictImageClassification() {
// Configure the endpoint resource
const endpoint = `projects/${project}/locations/${location}/endpoints/${endpointId}`;
const parametersObj = new params.ImageClassificationPredictionParams({
confidenceThreshold: 0.5,
maxPredictions: 5,
});
const parameters = parametersObj.toValue();
const fs = require('fs');
const image = fs.readFileSync(filename, 'base64');
const instanceObj = new instance.ImageClassificationPredictionInstance({
content: image,
});
const instanceValue = instanceObj.toValue();
const instances = [instanceValue];
const request = {
endpoint,
instances,
parameters,
};
// Predict request
const [response] = await predictionServiceClient.predict(request);
console.log('Predict image classification response');
console.log(`\tDeployed model id : ${response.deployedModelId}`);
const predictions = response.predictions;
console.log('\tPredictions :');
for (const predictionValue of predictions) {
const predictionResultObj =
prediction.ClassificationPredictionResult.fromValue(predictionValue);
for (const [i, label] of predictionResultObj.displayNames.entries()) {
console.log(`\tDisplay name: ${label}`);
console.log(`\tConfidences: ${predictionResultObj.confidences[i]}`);
console.log(`\tIDs: ${predictionResultObj.ids[i]}\n\n`);
}
}
}
predictImageClassification();
// [END aiplatform_predict_image_classification_sample]
}
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
| {
"content_hash": "3bc095a48f6d204e338ba88da03bd415",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 89,
"avg_line_length": 33.39506172839506,
"alnum_prop": 0.7020332717190388,
"repo_name": "googleapis/nodejs-ai-platform",
"id": "6be6685757e8f62b2815dc115762d9b2b193d9ff",
"size": "3299",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "samples/predict-image-classification.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "6842"
},
{
"name": "Python",
"bytes": "1337"
},
{
"name": "TypeScript",
"bytes": "13722727"
}
],
"symlink_target": ""
} |
<section class="bg-primary" id="about">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 text-center">
<h1 class="section-heading">Why China?</h1>
<p class="text-faded">Because brands not addressing China are quite possibly foregoing their largest organic growth opportunity.</p>
<a href="#knowledge" class="btn btn-default btn-xl page-scroll">Learn More!</a>
</div>
</div>
</div>
</section>
| {
"content_hash": "95549265d2f642c0d4e43469b89ad82a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 148,
"avg_line_length": 43.25,
"alnum_prop": 0.5857418111753372,
"repo_name": "Jlaventall/Jlaventall.github.io",
"id": "665b8d338f4193b4b971d6facdd475f4d2679472",
"size": "519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/call-to-action.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "216976"
},
{
"name": "HTML",
"bytes": "36976"
},
{
"name": "JavaScript",
"bytes": "10110"
},
{
"name": "Ruby",
"bytes": "12922"
}
],
"symlink_target": ""
} |
body,html{
background-color:#fff;
color:000;
font-size:12px;
font-family:Arial,serif;
} | {
"content_hash": "ab73991b1865d106302203f83e1e2e26",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 26,
"avg_line_length": 15.833333333333334,
"alnum_prop": 0.6947368421052632,
"repo_name": "Techtribe/grunt-static-handlebars",
"id": "37c156f1a6a12ba28767d217c779bb5f9c0b978c",
"size": "95",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/assets/css/base.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1343"
},
{
"name": "JavaScript",
"bytes": "315993"
}
],
"symlink_target": ""
} |
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
public class ArrayOfGuestProcessInfo {
public GuestProcessInfo[] GuestProcessInfo;
public GuestProcessInfo[] getGuestProcessInfo() {
return this.GuestProcessInfo;
}
public GuestProcessInfo getGuestProcessInfo(int i) {
return this.GuestProcessInfo[i];
}
public void setGuestProcessInfo(GuestProcessInfo[] GuestProcessInfo) {
this.GuestProcessInfo=GuestProcessInfo;
}
} | {
"content_hash": "a1d66e849ca08325527abea1b672d53d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 72,
"avg_line_length": 20.708333333333332,
"alnum_prop": 0.7505030181086519,
"repo_name": "stephenc/vijava",
"id": "55486ed15065630da3e8602effb2d3cc2698572b",
"size": "2148",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/vmware/vim25/ArrayOfGuestProcessInfo.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "8381437"
}
],
"symlink_target": ""
} |
function foo(bar:{a:number;}):string;
function foo(bar:{a:boolean;}):number;
function foo(bar:{a:any;}):any{ return bar }
var x = foo();
//// [functionOverloads34.js]
function foo(bar) {
return bar;
}
var x = foo();
| {
"content_hash": "e4237592357acf6bc87712c3eafb670b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 44,
"avg_line_length": 20.818181818181817,
"alnum_prop": 0.6244541484716157,
"repo_name": "DickvdBrink/TypeScript",
"id": "48ac2b5fc59c43dc5183ca53eec24d796961b5da",
"size": "260",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "tests/baselines/reference/functionOverloads34.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "5118748"
},
{
"name": "Shell",
"bytes": "232"
},
{
"name": "TypeScript",
"bytes": "4384606"
}
],
"symlink_target": ""
} |
package ca.evanjones.cache;
import java.util.Objects;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.function.Supplier;
/** Only useful to estimate the cost of counting calls to get() in a ThreadLocal. */
public class PooledCache<T> implements Cache<T> {
private final Supplier<T> supplier;
private final ConcurrentLinkedDeque<T> cache = new ConcurrentLinkedDeque<>();
public PooledCache(Supplier<T> supplier) {
this.supplier = Objects.requireNonNull(supplier);
}
@Override
public T get() {
T obj = cache.pollLast();
if (obj != null) {
return obj;
}
return supplier.get();
}
public void put(T obj) {
cache.addLast(obj);
}
}
| {
"content_hash": "bcc78f91d0b74b29291dc917dbde0099",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 84,
"avg_line_length": 25.75862068965517,
"alnum_prop": 0.6532797858099063,
"repo_name": "evanj/expire-threadlocal",
"id": "9edd14f079b55d106525e3f7f3927459cc0360a3",
"size": "747",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/ca/evanjones/cache/PooledCache.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
import angular from 'angular';
describe('authors service', () => {
let authorsService, filterService, $httpBackend;
beforeEach(() => {
angular.mock.module('app.common');
angular.mock.inject((_$httpBackend_, _AuthorsService_, _FilterService_) => {
authorsService = _AuthorsService_;
$httpBackend = _$httpBackend_;
filterService = _FilterService_;
spyOn(filterService, 'filterList');
});
});
afterEach(() => {
$httpBackend.verifyNoOutstandingExpectation();
$httpBackend.verifyNoOutstandingRequest();
});
describe('addAuthor', () => {
const author = {
name: 'Dummy',
books: [],
birthYear: 1500
};
it('should call the backend with the given author', () => {
$httpBackend.expectPOST(authorsService.baseUrl, JSON.stringify(author)).respond(200);
authorsService.addAuthor(author);
$httpBackend.flush();
});
it('should add the backend reply to the data array', () => {
$httpBackend.whenPOST(authorsService.baseUrl).respond(200, author);
authorsService.addAuthor(author);
$httpBackend.flush();
expect(authorsService.data).toEqual([author]);
});
});
describe('deleteAuthor', () => {
const author = {
name: 'Dummy',
books: [],
birthYear: 1500,
_id: 1
};
it('should call the backend with the given id', () => {
authorsService.data.push(author);
$httpBackend.expectDELETE(`${authorsService.baseUrl}${author._id}`).respond(200);
authorsService.deleteAuthor(author._id);
$httpBackend.flush();
});
it('should add the backend reply to the data array', () => {
authorsService.data.push(author);
$httpBackend.whenDELETE(`${authorsService.baseUrl}${author._id}`).respond(200);
authorsService.deleteAuthor(author._id);
$httpBackend.flush();
expect(authorsService.data).toEqual([]);
});
});
describe('getAuthors', () => {
const authors = [{
name: 'Dummy',
books: [],
birthYear: 1500,
_id: 1
}];
it('should call the backend and add the returned data to the data array', () => {
$httpBackend.whenGET(authorsService.baseUrl).respond(200, authors);
authorsService.getAuthors();
$httpBackend.flush();
expect(authorsService.data).toEqual(authors);
});
});
describe('getAuthor', () => {
const author = {
name: 'Dummy',
books: [],
birthYear: 1500,
_id: 1
};
it('should return the author with the given id if we have data', () => {
authorsService.data = [author];
authorsService.getAuthor(author._id).then((auth) => {
expect(auth).toEqual(author);
});
});
it('should call the server to get the authors and return the author with the given id', () => {
$httpBackend.whenGET(authorsService.baseUrl).respond(200, [author]);
authorsService.data = [];
authorsService.getAuthor(author._id).then((auth) => {
expect(auth).toEqual(author);
});
$httpBackend.flush();
});
});
describe('updateAuthor', () => {
const author = {
name: 'Dummy',
books: [],
birthYear: 1500,
_id: 1
};
const authorToUpdate = {
name: 'not a dummy',
books: [],
birthYear: 1400,
_id: 1
};
it('should call the backend with the given author', () => {
authorsService.data = [author];
$httpBackend.expectPUT(`${authorsService.baseUrl}${authorToUpdate._id}`, JSON.stringify(authorToUpdate)).respond(200);
authorsService.updateAuthor(authorToUpdate);
$httpBackend.flush();
});
it('should update the author in the data array', () => {
authorsService.data = [author];
$httpBackend.whenPUT(`${authorsService.baseUrl}${authorToUpdate._id}`).respond(200);
authorsService.updateAuthor(authorToUpdate);
$httpBackend.flush();
expect(authorsService.data).toEqual([authorToUpdate]);
});
});
describe('filter', () => {
it('should call the filter service with the current list and the given search term', () => {
const data = ['a', 'b'];
const searchTerm = 'abc';
authorsService.data = data;
authorsService.filter(searchTerm);
expect(filterService.filterList).toHaveBeenCalledWith(data, searchTerm);
});
});
});
| {
"content_hash": "3d213a094011e2c89121784914943244",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 124,
"avg_line_length": 29.835616438356166,
"alnum_prop": 0.6076675849403123,
"repo_name": "jsperts/workshop_unterlagen",
"id": "73854be256e6bf4ded1b1da73b9c7aa4b370a0dc",
"size": "4356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "angularjs/exercises/teil_4_loesung/app/common/authors.service.spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "135561"
},
{
"name": "HTML",
"bytes": "263573"
},
{
"name": "JavaScript",
"bytes": "698971"
},
{
"name": "TypeScript",
"bytes": "463740"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- 自动扫描的包名 -->
<context:component-scan base-package="com.zuoan"/>
<!-- 引入配置文件 -->
<context:property-placeholder location="classpath:jdbc.properties"/>
<!-- 默认的注解映射的支持,自动注册DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter -->
<!--<mvc:annotation-driven />-->
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes" value="text/html;charset=UTF-8"/>
<property name="features">
<array>
<value>WriteMapNullValue</value>
<value>WriteNullStringAsEmpty</value>
</array>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="${jdbc.initialSize}"/>
<property name="minIdle" value="${jdbc.minIdle}"/>
<property name="maxActive" value="${jdbc.maxActive}"/>
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="${jdbc.maxWait}"/>
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="${jdbc.timeBetweenEvictionRunsMillis}"/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="${jdbc.minEvictableIdleTimeMillis}"/>
<property name="validationQuery" value="${jdbc.validationQuery}"/>
<property name="testWhileIdle" value="${jdbc.testWhileIdle}"/>
<property name="testOnBorrow" value="${jdbc.testOnBorrow}"/>
<property name="testOnReturn" value="${jdbc.testOnReturn}"/>
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true"/>
<property name="maxPoolPreparedStatementPerConnectionSize" value="20"/>
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property name="filters" value="stat"/>
</bean>
<!-- ========================================分隔线========================================= -->
<!-- ========================================针对myBatis的配置项============================== -->
<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="dataSource"/>
<!-- 自动扫描com/zuoan/account/dao目录下的所有SQL映射的xml文件, 省掉Configuration.xml里的手工配置
value="classpath:com/zuoan/account/dao/*.xml"指的是classpath(类路径)下com.zuoan.account.dao包中的所有xml文件
-->
<property name="mapperLocations" value="classpath*:com/zuoan/account/dao/*.xml"/>
</bean>
<!-- 配置扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 扫描me.gacl.dao这个包以及它的子包下的所有映射接口类 -->
<property name="basePackage" value="com.zuoan.account.dao"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>
<!-- ========================================分隔线========================================= -->
<!-- 配置Spring的事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 注解方式配置事物 -->
<!-- <tx:annotation-driven transaction-manager="transactionManager" /> -->
<!-- 拦截器方式配置事物 -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="modify*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="remove*" propagation="REQUIRED"/>
<tx:method name="get*" propagation="SUPPORTS"/>
<tx:method name="find*" propagation="SUPPORTS"/>
<tx:method name="query*" propagation="SUPPORTS"/>
<tx:method name="search*" propagation="SUPPORTS"/>
<tx:method name="*" propagation="SUPPORTS"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="transactionPointcut" expression="execution(* com.zuoan.account.service..*Impl.*(..))"/>
<aop:advisor pointcut-ref="transactionPointcut" advice-ref="transactionAdvice"/>
</aop:config>
<!-- json转换器 -->
<!--<bean id="jsonConverter"
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes" value="application/json;charset=UTF-8"/>
<property name="features">
<array value-type="com.alibaba.fastjson.serializer.SerializerFeature">
<value>DisableCircularReferenceDetect</value>
</array>
</property>
</bean>
<bean id="DisableCircularReferenceDetect"
class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
<property name="staticField"
value="com.alibaba.fastjson.serializer.SerializerFeature.DisableCircularReferenceDetect"></property>
</bean>-->
</beans> | {
"content_hash": "2f36a28aea17b7c61086d7443ed232a3",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 118,
"avg_line_length": 50.14074074074074,
"alnum_prop": 0.6207711626532723,
"repo_name": "cugskyline/fitment",
"id": "a83795e9d9e235583325f88cb5223e96002aa6ca",
"size": "7323",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "facade/src/main/resources/spring-servlet.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "11079"
}
],
"symlink_target": ""
} |
"""Support for IP Cameras."""
from __future__ import annotations
import asyncio
from contextlib import closing
import logging
import aiohttp
import async_timeout
import requests
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import (
CONF_AUTHENTICATION,
CONF_NAME,
CONF_PASSWORD,
CONF_USERNAME,
CONF_VERIFY_SSL,
HTTP_BASIC_AUTHENTICATION,
HTTP_DIGEST_AUTHENTICATION,
)
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import (
async_aiohttp_proxy_web,
async_get_clientsession,
)
_LOGGER = logging.getLogger(__name__)
CONF_MJPEG_URL = "mjpeg_url"
CONF_STILL_IMAGE_URL = "still_image_url"
CONTENT_TYPE_HEADER = "Content-Type"
DEFAULT_NAME = "Mjpeg Camera"
DEFAULT_VERIFY_SSL = True
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
vol.Required(CONF_MJPEG_URL): cv.url,
vol.Optional(CONF_STILL_IMAGE_URL): cv.url,
vol.Optional(CONF_AUTHENTICATION, default=HTTP_BASIC_AUTHENTICATION): vol.In(
[HTTP_BASIC_AUTHENTICATION, HTTP_DIGEST_AUTHENTICATION]
),
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_PASSWORD): cv.string,
vol.Optional(CONF_USERNAME): cv.string,
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
}
)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up a MJPEG IP Camera."""
filter_urllib3_logging()
if discovery_info:
config = PLATFORM_SCHEMA(discovery_info)
async_add_entities([MjpegCamera(config)])
def filter_urllib3_logging():
"""Filter header errors from urllib3 due to a urllib3 bug."""
urllib3_logger = logging.getLogger("urllib3.connectionpool")
if not any(isinstance(x, NoHeaderErrorFilter) for x in urllib3_logger.filters):
urllib3_logger.addFilter(NoHeaderErrorFilter())
def extract_image_from_mjpeg(stream):
"""Take in a MJPEG stream object, return the jpg from it."""
data = b""
for chunk in stream:
data += chunk
jpg_end = data.find(b"\xff\xd9")
if jpg_end == -1:
continue
jpg_start = data.find(b"\xff\xd8")
if jpg_start == -1:
continue
return data[jpg_start : jpg_end + 2]
class MjpegCamera(Camera):
"""An implementation of an IP camera that is reachable over a URL."""
def __init__(self, device_info):
"""Initialize a MJPEG camera."""
super().__init__()
self._name = device_info.get(CONF_NAME)
self._authentication = device_info.get(CONF_AUTHENTICATION)
self._username = device_info.get(CONF_USERNAME)
self._password = device_info.get(CONF_PASSWORD)
self._mjpeg_url = device_info[CONF_MJPEG_URL]
self._still_image_url = device_info.get(CONF_STILL_IMAGE_URL)
self._auth = None
if (
self._username
and self._password
and self._authentication == HTTP_BASIC_AUTHENTICATION
):
self._auth = aiohttp.BasicAuth(self._username, password=self._password)
self._verify_ssl = device_info.get(CONF_VERIFY_SSL)
async def async_camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
"""Return a still image response from the camera."""
# DigestAuth is not supported
if (
self._authentication == HTTP_DIGEST_AUTHENTICATION
or self._still_image_url is None
):
image = await self.hass.async_add_executor_job(self.camera_image)
return image
websession = async_get_clientsession(self.hass, verify_ssl=self._verify_ssl)
try:
with async_timeout.timeout(10):
response = await websession.get(self._still_image_url, auth=self._auth)
image = await response.read()
return image
except asyncio.TimeoutError:
_LOGGER.error("Timeout getting camera image from %s", self._name)
except aiohttp.ClientError as err:
_LOGGER.error("Error getting new camera image from %s: %s", self._name, err)
return None
def camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
"""Return a still image response from the camera."""
if self._username and self._password:
if self._authentication == HTTP_DIGEST_AUTHENTICATION:
auth: HTTPDigestAuth | HTTPBasicAuth = HTTPDigestAuth(
self._username, self._password
)
else:
auth = HTTPBasicAuth(self._username, self._password)
req = requests.get(
self._mjpeg_url,
auth=auth,
stream=True,
timeout=10,
verify=self._verify_ssl,
)
else:
req = requests.get(self._mjpeg_url, stream=True, timeout=10)
with closing(req) as response:
return extract_image_from_mjpeg(response.iter_content(102400))
async def handle_async_mjpeg_stream(self, request):
"""Generate an HTTP MJPEG stream from the camera."""
# aiohttp don't support DigestAuth -> Fallback
if self._authentication == HTTP_DIGEST_AUTHENTICATION:
return await super().handle_async_mjpeg_stream(request)
# connect to stream
websession = async_get_clientsession(self.hass, verify_ssl=self._verify_ssl)
stream_coro = websession.get(self._mjpeg_url, auth=self._auth)
return await async_aiohttp_proxy_web(self.hass, request, stream_coro)
@property
def name(self):
"""Return the name of this camera."""
return self._name
class NoHeaderErrorFilter(logging.Filter):
"""Filter out urllib3 Header Parsing Errors due to a urllib3 bug."""
def filter(self, record):
"""Filter out Header Parsing Errors."""
return "Failed to parse headers" not in record.getMessage()
| {
"content_hash": "d6b0b959090c428044f55c88e20694fa",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 88,
"avg_line_length": 33.38172043010753,
"alnum_prop": 0.6329521662103398,
"repo_name": "aronsky/home-assistant",
"id": "d486f78d334f55255b06093de6cb2263b3b6ebd6",
"size": "6209",
"binary": false,
"copies": "5",
"ref": "refs/heads/dev",
"path": "homeassistant/components/mjpeg/camera.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2443"
},
{
"name": "Python",
"bytes": "38448521"
},
{
"name": "Shell",
"bytes": "4910"
}
],
"symlink_target": ""
} |
using AspectInjector.Broker;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Text.Json;
namespace Aspects.Cache
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
[Injection(typeof(CacheAspect), Inherited = true)]
public abstract class CacheAttribute : Attribute
{
/// <summary>
/// Cache with highest priority is checked first. 0 - Highest, 255 - Lowest. Default 127
/// </summary>
public byte Priority { get; set; } = 127;
public virtual object Get(string key, Type type, object instance)
{
key = instance != null && IsPerInstance() ? FormatInstanceKey(key, instance) : key;
return GetCacheItem(key, type);
}
public virtual void Set(string key, object value, Type type, object instance)
{
key = instance != null && IsPerInstance() ? FormatInstanceKey(key, instance) : key;
SetCacheItem(key, value, type);
}
public virtual string FormatInstanceKey(string key, object instance)
{
return instance != null && IsPerInstance() ? $"{instance.GetHashCode()}-{key}" : key;
}
protected abstract object GetCacheItem(string key, Type type);
protected abstract void SetCacheItem(string key, object value, Type type);
protected abstract bool IsPerInstance();
}
public abstract class MemoryCacheBaseAttribute : CacheAttribute
{
protected override object GetCacheItem(string key, Type type)
{
return Cache.Get(key);
}
protected override void SetCacheItem(string key, object value, Type type)
{
Cache.Set(key, value, Policy);
}
protected override bool IsPerInstance()
{
return PerInstanceCache;
}
public abstract IMemoryCache Cache { get; }
public abstract MemoryCacheEntryOptions Policy { get; }
/// <summary>
/// Data is cached PerInstance vs PerType. Default PerInstanceCache = true
/// </summary>
public bool PerInstanceCache { get; set; }
}
public abstract class DistributedCacheBaseAttribute : CacheAttribute
{
protected override object GetCacheItem(string key, Type type)
{
return Deserialize(Cache.Get(key), type);
}
protected override void SetCacheItem(string key, object value, Type type)
{
Cache.Set(key, Serialize(value, type), Policy);
}
protected override bool IsPerInstance()
{
return PerInstanceCache;
}
protected virtual byte[] Serialize(object value, Type type)
{
return JsonSerializer.SerializeToUtf8Bytes(value, type);
}
protected virtual object Deserialize(byte[] data, Type type)
{
if (data == null || data.Length == 0) return null;
return JsonSerializer.Deserialize(data, type);
}
public abstract IDistributedCache Cache { get; }
public abstract DistributedCacheEntryOptions Policy { get; }
/// <summary>
/// Data is cached PerInstance vs PerType. Default PerInstanceCache = true
/// </summary>
public bool PerInstanceCache { get; set; }
}
}
| {
"content_hash": "920fc00edcbe9ecdb274659788f8a688",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 97,
"avg_line_length": 34.02884615384615,
"alnum_prop": 0.5964961853630969,
"repo_name": "pamidur/aspect-injector",
"id": "45c56475658f5d5badcaf86704fd779b5b44fa3c",
"size": "3541",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "samples/src/Cache/AbstractAttributes.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "461246"
},
{
"name": "PowerShell",
"bytes": "3303"
},
{
"name": "Visual Basic .NET",
"bytes": "1157"
}
],
"symlink_target": ""
} |
package org.apache.geode.internal.admin.remote;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.logging.log4j.Logger;
import org.apache.geode.DataSerializer;
import org.apache.geode.cache.ExpirationAction;
import org.apache.geode.cache.Region;
import org.apache.geode.distributed.internal.ClusterDistributionManager;
import org.apache.geode.internal.serialization.DeserializationContext;
import org.apache.geode.internal.serialization.SerializationContext;
import org.apache.geode.logging.internal.log4j.api.LogService;
/**
* A message that is sent to a particular distribution manager to let it know that the sender is an
* administation console that just connected.
*/
public class DestroyEntryMessage extends RegionAdminMessage {
private static final Logger logger = LogService.getLogger();
private Object key;
private ExpirationAction action;
public static DestroyEntryMessage create(Object key, ExpirationAction action) {
DestroyEntryMessage m = new DestroyEntryMessage();
m.action = action;
m.key = key;
return m;
}
@Override
public void process(ClusterDistributionManager dm) {
Region r = getRegion(dm.getSystem());
if (r != null) {
try {
if (action == ExpirationAction.LOCAL_DESTROY) {
r.localDestroy(key);
} else if (action == ExpirationAction.DESTROY) {
r.destroy(key);
} else if (action == ExpirationAction.INVALIDATE) {
r.invalidate(key);
} else if (action == ExpirationAction.LOCAL_INVALIDATE) {
r.localInvalidate(key);
}
} catch (Exception e) {
logger.warn("Failed attempt to destroy or invalidate entry {} {} from console at {}",
new Object[] {r.getFullPath(), key, getSender()});
}
}
}
@Override
public int getDSFID() {
return DESTROY_ENTRY_MESSAGE;
}
@Override
public void toData(DataOutput out,
SerializationContext context) throws IOException {
super.toData(out, context);
DataSerializer.writeObject(action, out);
DataSerializer.writeObject(key, out);
}
@Override
public void fromData(DataInput in,
DeserializationContext context) throws IOException, ClassNotFoundException {
super.fromData(in, context);
action = DataSerializer.readObject(in);
key = DataSerializer.readObject(in);
}
@Override
public String toString() {
return String.format("DestroyEntryMessage from %s",
getSender());
}
}
| {
"content_hash": "650204d371f1741c88eef0847b162710",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 99,
"avg_line_length": 29.952380952380953,
"alnum_prop": 0.7090620031796503,
"repo_name": "smgoller/geode",
"id": "7c8b53ddff13a032b6018ba8f7160536a3e43729",
"size": "3305",
"binary": false,
"copies": "4",
"ref": "refs/heads/develop",
"path": "geode-core/src/main/java/org/apache/geode/internal/admin/remote/DestroyEntryMessage.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "104031"
},
{
"name": "Dockerfile",
"bytes": "15956"
},
{
"name": "Go",
"bytes": "40709"
},
{
"name": "Groovy",
"bytes": "41926"
},
{
"name": "HTML",
"bytes": "4037528"
},
{
"name": "Java",
"bytes": "33124128"
},
{
"name": "JavaScript",
"bytes": "1780821"
},
{
"name": "Python",
"bytes": "29801"
},
{
"name": "Ruby",
"bytes": "1801"
},
{
"name": "SCSS",
"bytes": "2677"
},
{
"name": "Shell",
"bytes": "274196"
}
],
"symlink_target": ""
} |
/* tslint:disable */
import { ReaderFragment } from "relay-runtime";
export type CommerceOrderModeEnum = "BUY" | "OFFER" | "%future added value";
export type CommerceOrderParticipantEnum = "BUYER" | "SELLER" | "%future added value";
import { FragmentRefs } from "relay-runtime";
export type TransactionDetailsSummaryItem_order = {
readonly __typename: string;
readonly mode: CommerceOrderModeEnum | null;
readonly shippingTotal: string | null;
readonly shippingTotalCents: number | null;
readonly taxTotal: string | null;
readonly taxTotalCents: number | null;
readonly itemsTotal: string | null;
readonly totalListPrice: string | null;
readonly buyerTotal: string | null;
readonly lastOffer?: {
readonly internalID: string;
readonly amount: string | null;
readonly amountCents: number;
readonly shippingTotal: string | null;
readonly shippingTotalCents: number | null;
readonly taxTotal: string | null;
readonly taxTotalCents: number | null;
readonly buyerTotal: string | null;
readonly buyerTotalCents: number | null;
readonly fromParticipant: CommerceOrderParticipantEnum | null;
readonly note: string | null;
} | null;
readonly myLastOffer?: {
readonly internalID: string;
readonly amount: string | null;
readonly amountCents: number;
readonly shippingTotal: string | null;
readonly shippingTotalCents: number | null;
readonly taxTotal: string | null;
readonly taxTotalCents: number | null;
readonly buyerTotal: string | null;
readonly buyerTotalCents: number | null;
readonly fromParticipant: CommerceOrderParticipantEnum | null;
readonly note: string | null;
} | null;
readonly " $refType": "TransactionDetailsSummaryItem_order";
};
export type TransactionDetailsSummaryItem_order$data = TransactionDetailsSummaryItem_order;
export type TransactionDetailsSummaryItem_order$key = {
readonly " $data"?: TransactionDetailsSummaryItem_order$data;
readonly " $fragmentRefs": FragmentRefs<"TransactionDetailsSummaryItem_order">;
};
const node: ReaderFragment = (function(){
var v0 = [
{
"kind": "Literal",
"name": "precision",
"value": 2
}
],
v1 = {
"kind": "ScalarField",
"alias": null,
"name": "shippingTotal",
"args": (v0/*: any*/),
"storageKey": "shippingTotal(precision:2)"
},
v2 = {
"kind": "ScalarField",
"alias": null,
"name": "shippingTotalCents",
"args": null,
"storageKey": null
},
v3 = {
"kind": "ScalarField",
"alias": null,
"name": "taxTotal",
"args": (v0/*: any*/),
"storageKey": "taxTotal(precision:2)"
},
v4 = {
"kind": "ScalarField",
"alias": null,
"name": "taxTotalCents",
"args": null,
"storageKey": null
},
v5 = {
"kind": "ScalarField",
"alias": null,
"name": "buyerTotal",
"args": (v0/*: any*/),
"storageKey": "buyerTotal(precision:2)"
},
v6 = [
{
"kind": "ScalarField",
"alias": null,
"name": "internalID",
"args": null,
"storageKey": null
},
{
"kind": "ScalarField",
"alias": null,
"name": "amount",
"args": (v0/*: any*/),
"storageKey": "amount(precision:2)"
},
{
"kind": "ScalarField",
"alias": null,
"name": "amountCents",
"args": null,
"storageKey": null
},
(v1/*: any*/),
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
{
"kind": "ScalarField",
"alias": null,
"name": "buyerTotalCents",
"args": null,
"storageKey": null
},
{
"kind": "ScalarField",
"alias": null,
"name": "fromParticipant",
"args": null,
"storageKey": null
},
{
"kind": "ScalarField",
"alias": null,
"name": "note",
"args": null,
"storageKey": null
}
];
return {
"kind": "Fragment",
"name": "TransactionDetailsSummaryItem_order",
"type": "CommerceOrder",
"metadata": null,
"argumentDefinitions": [],
"selections": [
{
"kind": "ScalarField",
"alias": null,
"name": "__typename",
"args": null,
"storageKey": null
},
{
"kind": "ScalarField",
"alias": null,
"name": "mode",
"args": null,
"storageKey": null
},
(v1/*: any*/),
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
{
"kind": "ScalarField",
"alias": null,
"name": "itemsTotal",
"args": (v0/*: any*/),
"storageKey": "itemsTotal(precision:2)"
},
{
"kind": "ScalarField",
"alias": null,
"name": "totalListPrice",
"args": (v0/*: any*/),
"storageKey": "totalListPrice(precision:2)"
},
(v5/*: any*/),
{
"kind": "InlineFragment",
"type": "CommerceOfferOrder",
"selections": [
{
"kind": "LinkedField",
"alias": null,
"name": "lastOffer",
"storageKey": null,
"args": null,
"concreteType": "CommerceOffer",
"plural": false,
"selections": (v6/*: any*/)
},
{
"kind": "LinkedField",
"alias": null,
"name": "myLastOffer",
"storageKey": null,
"args": null,
"concreteType": "CommerceOffer",
"plural": false,
"selections": (v6/*: any*/)
}
]
}
]
};
})();
(node as any).hash = 'e207bab0483d25f4386054ee2b0365c6';
export default node;
| {
"content_hash": "f8bf7e7e87c6737bdee9708b2c4aa29c",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 91,
"avg_line_length": 25.325581395348838,
"alnum_prop": 0.571900826446281,
"repo_name": "anandaroop/force",
"id": "8e047c4145b12fcbfa879b7d4edd24ef61787cb0",
"size": "5445",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/v2/__generated__/TransactionDetailsSummaryItem_order.graphql.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "599372"
},
{
"name": "CoffeeScript",
"bytes": "2730372"
},
{
"name": "Dockerfile",
"bytes": "722"
},
{
"name": "HTML",
"bytes": "542902"
},
{
"name": "JavaScript",
"bytes": "736235"
},
{
"name": "Shell",
"bytes": "9863"
},
{
"name": "TypeScript",
"bytes": "272518"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.yarn.client.cli;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.argThat;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ha.HAServiceProtocol;
import org.apache.hadoop.ha.HAServiceStatus;
import org.apache.hadoop.ha.HAServiceTarget;
import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState;
import org.apache.hadoop.service.Service.STATE;
import org.apache.hadoop.yarn.api.records.DecommissionType;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.api.records.ResourceInformation;
import org.apache.hadoop.yarn.api.records.ResourceOption;
import org.apache.hadoop.yarn.conf.HAUtil;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.exceptions.YarnException;
import org.apache.hadoop.yarn.nodelabels.CommonNodeLabelsManager;
import org.apache.hadoop.yarn.nodelabels.DummyCommonNodeLabelsManager;
import org.apache.hadoop.yarn.server.api.ResourceManagerAdministrationProtocol;
import org.apache.hadoop.yarn.server.api.protocolrecords.AddToClusterNodeLabelsRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.AddToClusterNodeLabelsResponse;
import org.apache.hadoop.yarn.server.api.protocolrecords.CheckForDecommissioningNodesRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.CheckForDecommissioningNodesResponse;
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshClusterMaxPriorityRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshNodesRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshServiceAclsRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshSuperUserGroupsConfigurationRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshUserToGroupsMappingsRequest;
import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest;
import org.apache.hadoop.yarn.util.Records;
import org.apache.hadoop.yarn.util.resource.ResourceUtils;
import org.apache.hadoop.yarn.util.resource.Resources;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatcher;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableSet;
public class TestRMAdminCLI {
private ResourceManagerAdministrationProtocol admin;
private HAServiceProtocol haadmin;
private RMAdminCLI rmAdminCLI;
private RMAdminCLI rmAdminCLIWithHAEnabled;
private CommonNodeLabelsManager dummyNodeLabelsManager;
private boolean remoteAdminServiceAccessed = false;
private static final String HOST_A = "1.2.3.1";
private static final String HOST_B = "1.2.3.2";
private static File dest;
@Before
public void setup() throws Exception {
ResourceUtils.resetResourceTypes();
Configuration yarnConf = new YarnConfiguration();
String resourceTypesFile = "resource-types-4.xml";
InputStream source =
yarnConf.getClassLoader().getResourceAsStream(resourceTypesFile);
dest = new File(yarnConf.getClassLoader().
getResource(".").getPath(), "resource-types.xml");
FileUtils.copyInputStreamToFile(source, dest);
ResourceUtils.getResourceTypes();
}
@After
public void teardown() {
if (dest.exists()) {
dest.delete();
}
}
@SuppressWarnings("static-access")
@Before
public void configure() throws IOException, YarnException {
remoteAdminServiceAccessed = false;
admin = mock(ResourceManagerAdministrationProtocol.class);
when(admin.addToClusterNodeLabels(any(AddToClusterNodeLabelsRequest.class)))
.thenAnswer(new Answer<AddToClusterNodeLabelsResponse>() {
@Override
public AddToClusterNodeLabelsResponse answer(
InvocationOnMock invocation) throws Throwable {
remoteAdminServiceAccessed = true;
return AddToClusterNodeLabelsResponse.newInstance();
}
});
haadmin = mock(HAServiceProtocol.class);
when(haadmin.getServiceStatus()).thenReturn(new HAServiceStatus(
HAServiceProtocol.HAServiceState.INITIALIZING));
final HAServiceTarget haServiceTarget = mock(HAServiceTarget.class);
when(haServiceTarget.getProxy(any(Configuration.class), anyInt()))
.thenReturn(haadmin);
rmAdminCLI = new RMAdminCLI(new Configuration()) {
@Override
protected ResourceManagerAdministrationProtocol createAdminProtocol()
throws IOException {
return admin;
}
@Override
protected HAServiceTarget resolveTarget(String rmId) {
return haServiceTarget;
}
};
initDummyNodeLabelsManager();
rmAdminCLI.localNodeLabelsManager = dummyNodeLabelsManager;
YarnConfiguration conf = new YarnConfiguration();
conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
conf.set(YarnConfiguration.RM_HA_IDS, "rm1,rm2");
conf.set(HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, "rm1"), HOST_A
+ ":12345");
conf.set(HAUtil.addSuffix(YarnConfiguration.RM_ADMIN_ADDRESS, "rm1"),
HOST_A + ":12346");
conf.set(HAUtil.addSuffix(YarnConfiguration.RM_ADDRESS, "rm2"), HOST_B
+ ":12345");
conf.set(HAUtil.addSuffix(YarnConfiguration.RM_ADMIN_ADDRESS, "rm2"),
HOST_B + ":12346");
rmAdminCLIWithHAEnabled = new RMAdminCLI(conf) {
@Override
protected ResourceManagerAdministrationProtocol createAdminProtocol()
throws IOException {
return admin;
}
@Override
protected HAServiceTarget resolveTarget(String rmId) {
HAServiceTarget target = super.resolveTarget(rmId);
HAServiceTarget spy = Mockito.spy(target);
// Override the target to return our mock protocol
try {
Mockito.doReturn(haadmin).when(spy)
.getProxy(Mockito.<Configuration> any(), Mockito.anyInt());
Mockito.doReturn(false).when(spy).isAutoFailoverEnabled();
} catch (IOException e) {
throw new AssertionError(e); // mock setup doesn't really throw
}
return spy;
}
};
}
private void initDummyNodeLabelsManager() {
Configuration conf = new YarnConfiguration();
conf.setBoolean(YarnConfiguration.NODE_LABELS_ENABLED, true);
dummyNodeLabelsManager = new DummyCommonNodeLabelsManager() {
@Override
public void replaceLabelsOnNode(
Map<NodeId, Set<String>> replaceLabelsToNode) throws IOException {
Iterator<NodeId> iterator = replaceLabelsToNode.keySet().iterator();
while(iterator.hasNext()) {
NodeId nodeId=iterator.next();
if(nodeId.getHost().endsWith("=")){
throw new IOException("Parsing of Input String failed");
}
}
super.replaceLabelsOnNode(replaceLabelsToNode);
}
};
dummyNodeLabelsManager.init(conf);
}
@Test
public void testRefreshQueues() throws Exception {
String[] args = { "-refreshQueues" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshQueues(any(RefreshQueuesRequest.class));
}
@Test
public void testRefreshUserToGroupsMappings() throws Exception {
String[] args = { "-refreshUserToGroupsMappings" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshUserToGroupsMappings(
any(RefreshUserToGroupsMappingsRequest.class));
}
@Test
public void testRefreshSuperUserGroupsConfiguration() throws Exception {
String[] args = { "-refreshSuperUserGroupsConfiguration" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshSuperUserGroupsConfiguration(
any(RefreshSuperUserGroupsConfigurationRequest.class));
}
@Test
public void testRefreshAdminAcls() throws Exception {
String[] args = { "-refreshAdminAcls" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshAdminAcls(any(RefreshAdminAclsRequest.class));
}
@Test
public void testRefreshClusterMaxPriority() throws Exception {
String[] args = { "-refreshClusterMaxPriority" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshClusterMaxPriority(
any(RefreshClusterMaxPriorityRequest.class));
}
@Test
public void testRefreshServiceAcl() throws Exception {
String[] args = { "-refreshServiceAcl" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshServiceAcls(any(RefreshServiceAclsRequest.class));
}
@Test
public void testUpdateNodeResource() throws Exception {
String nodeIdStr = "0.0.0.0:0";
int memSize = 2048;
int cores = 2;
String[] args = { "-updateNodeResource", nodeIdStr,
Integer.toString(memSize), Integer.toString(cores) };
assertEquals(0, rmAdminCLI.run(args));
ArgumentCaptor<UpdateNodeResourceRequest> argument =
ArgumentCaptor.forClass(UpdateNodeResourceRequest.class);
verify(admin).updateNodeResource(argument.capture());
UpdateNodeResourceRequest request = argument.getValue();
Map<NodeId, ResourceOption> resourceMap = request.getNodeResourceMap();
NodeId nodeId = NodeId.fromString(nodeIdStr);
Resource expectedResource = Resources.createResource(memSize, cores);
ResourceOption resource = resourceMap.get(nodeId);
assertNotNull("resource for " + nodeIdStr + " shouldn't be null.",
resource);
assertEquals("resource value for " + nodeIdStr + " is not as expected.",
ResourceOption.newInstance(expectedResource,
ResourceOption.OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT),
resource);
}
@Test
public void testUpdateNodeResourceWithOverCommitTimeout() throws Exception {
String nodeIdStr = "0.0.0.0:0";
int memSize = 2048;
int cores = 2;
int timeout = 1000;
String[] args = {"-updateNodeResource", nodeIdStr,
Integer.toString(memSize), Integer.toString(cores),
Integer.toString(timeout)};
assertEquals(0, rmAdminCLI.run(args));
ArgumentCaptor<UpdateNodeResourceRequest> argument =
ArgumentCaptor.forClass(UpdateNodeResourceRequest.class);
verify(admin).updateNodeResource(argument.capture());
UpdateNodeResourceRequest request = argument.getValue();
Map<NodeId, ResourceOption> resourceMap = request.getNodeResourceMap();
NodeId nodeId = NodeId.fromString(nodeIdStr);
Resource expectedResource = Resources.createResource(memSize, cores);
ResourceOption resource = resourceMap.get(nodeId);
assertNotNull("resource for " + nodeIdStr + " shouldn't be null.",
resource);
assertEquals("resource value for " + nodeIdStr + " is not as expected.",
ResourceOption.newInstance(expectedResource, timeout), resource);
}
@Test
public void testUpdateNodeResourceWithInvalidValue() throws Exception {
String nodeIdStr = "0.0.0.0:0";
int memSize = -2048;
int cores = 2;
String[] args = {"-updateNodeResource", nodeIdStr,
Integer.toString(memSize), Integer.toString(cores)};
// execution of command line is expected to be failed
assertEquals(-1, rmAdminCLI.run(args));
// verify admin protocol never calls.
verify(admin, times(0)).updateNodeResource(
any(UpdateNodeResourceRequest.class));
}
@Test
public void testUpdateNodeResourceTypes() throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes =
"memory-mb=1024Mi,vcores=1,resource1=3Gi,resource2=2m";
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes};
assertEquals(0, rmAdminCLI.run(args));
ArgumentCaptor<UpdateNodeResourceRequest> argument =
ArgumentCaptor.forClass(UpdateNodeResourceRequest.class);
verify(admin).updateNodeResource(argument.capture());
UpdateNodeResourceRequest request = argument.getValue();
Map<NodeId, ResourceOption> resourceMap = request.getNodeResourceMap();
NodeId nodeId = NodeId.fromString(nodeIdStr);
Resource expectedResource = Resource.newInstance(1024, 1);
expectedResource.setResourceInformation("resource1",
ResourceInformation.newInstance("resource1", "Gi", 3));
expectedResource.setResourceInformation("resource2",
ResourceInformation.newInstance("resource2", "m", 2));
ResourceOption resource = resourceMap.get(nodeId);
assertNotNull("resource for " + nodeIdStr + " shouldn't be null.",
resource);
assertEquals("resource value for " + nodeIdStr + " is not as expected.",
ResourceOption.newInstance(expectedResource,
ResourceOption.OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT), resource);
}
@Test
public void testUpdateNodeResourceTypesWithOverCommitTimeout()
throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes =
"memory-mb=1024Mi,vcores=1,resource1=3Gi,resource2=2m";
int timeout = 1000;
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes,
Integer.toString(timeout)};
assertEquals(0, rmAdminCLI.run(args));
ArgumentCaptor<UpdateNodeResourceRequest> argument =
ArgumentCaptor.forClass(UpdateNodeResourceRequest.class);
verify(admin).updateNodeResource(argument.capture());
UpdateNodeResourceRequest request = argument.getValue();
Map<NodeId, ResourceOption> resourceMap = request.getNodeResourceMap();
NodeId nodeId = NodeId.fromString(nodeIdStr);
Resource expectedResource = Resource.newInstance(1024, 1);
expectedResource.setResourceInformation("resource1",
ResourceInformation.newInstance("resource1", "Gi", 3));
expectedResource.setResourceInformation("resource2",
ResourceInformation.newInstance("resource2", "m", 2));
ResourceOption resource = resourceMap.get(nodeId);
assertNotNull("resource for " + nodeIdStr + " shouldn't be null.",
resource);
assertEquals("resource value for " + nodeIdStr + " is not as expected.",
ResourceOption.newInstance(expectedResource, timeout), resource);
}
@Test
public void testUpdateNodeResourceTypesWithoutMandatoryResources()
throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes = "resource1=3Gi,resource2=2m";
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes};
assertEquals(-1, rmAdminCLI.run(args));
// verify admin protocol never calls.
verify(admin, times(0)).updateNodeResource(
any(UpdateNodeResourceRequest.class));
}
@Test
public void testUpdateNodeResourceTypesWithInvalidResource()
throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes =
"memory-mb=1024Mi,vcores=1,resource1=3Gi,resource3=2m";
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes};
// execution of command line is expected to be failed
assertEquals(-1, rmAdminCLI.run(args));
// verify admin protocol never calls.
verify(admin, times(0)).updateNodeResource(
any(UpdateNodeResourceRequest.class));
}
@Test
public void testUpdateNodeResourceTypesWithInvalidResourceValue()
throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes =
"memory-mb=1024Mi,vcores=1,resource1=ABDC,resource2=2m";
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes};
// execution of command line is expected to be failed
assertEquals(-1, rmAdminCLI.run(args));
// verify admin protocol never calls.
verify(admin, times(0)).updateNodeResource(
any(UpdateNodeResourceRequest.class));
}
@Test
public void testUpdateNodeResourceTypesWithInvalidResourceUnit()
throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes =
"memory-mb=1024Mi,vcores=1,resource1=2XYZ,resource2=2m";
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes};
// execution of command line is expected to be failed
assertEquals(-1, rmAdminCLI.run(args));
// verify admin protocol never calls.
verify(admin, times(0)).updateNodeResource(
any(UpdateNodeResourceRequest.class));
}
@Test
public void testUpdateNodeResourceTypesWithNonAlphaResourceUnit()
throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes =
"memory-mb=1024M i,vcores=1,resource1=2G,resource2=2m";
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes};
// execution of command line is expected to be failed
assertEquals(-1, rmAdminCLI.run(args));
// verify admin protocol never calls.
verify(admin, times(0)).updateNodeResource(
any(UpdateNodeResourceRequest.class));
}
@Test
public void testUpdateNodeResourceTypesWithInvalidResourceFormat()
throws Exception {
String nodeIdStr = "0.0.0.0:0";
String resourceTypes = "memory-mb=1024Mi,vcores=1,resource2";
String[] args = {"-updateNodeResource", nodeIdStr, resourceTypes};
// execution of command line is expected to be failed
assertEquals(-1, rmAdminCLI.run(args));
// verify admin protocol never calls.
verify(admin, times(0)).updateNodeResource(
any(UpdateNodeResourceRequest.class));
}
@Test
public void testRefreshNodes() throws Exception {
String[] args = { "-refreshNodes" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshNodes(any(RefreshNodesRequest.class));
}
@Test
public void testRefreshNodesGracefulBeforeTimeout() throws Exception {
// graceful decommission before timeout
String[] args = {"-refreshNodes", "-g", "1", "-client"};
CheckForDecommissioningNodesResponse response = Records
.newRecord(CheckForDecommissioningNodesResponse.class);
HashSet<NodeId> decomNodes = new HashSet<NodeId>();
response.setDecommissioningNodes(decomNodes);
when(admin.checkForDecommissioningNodes(any(
CheckForDecommissioningNodesRequest.class))).thenReturn(response);
assertEquals(0, rmAdminCLI.run(args));
verify(admin).refreshNodes(
RefreshNodesRequest.newInstance(DecommissionType.GRACEFUL, 1));
verify(admin, never()).refreshNodes(
RefreshNodesRequest.newInstance(DecommissionType.FORCEFUL));
}
@Test
public void testRefreshNodesGracefulHitTimeout() throws Exception {
// Forceful decommission when timeout occurs
String[] forcefulDecomArgs = {"-refreshNodes", "-g", "1", "-client"};
HashSet<NodeId> decomNodes = new HashSet<NodeId>();
CheckForDecommissioningNodesResponse response = Records
.newRecord(CheckForDecommissioningNodesResponse.class);
response.setDecommissioningNodes(decomNodes);
decomNodes.add(NodeId.newInstance("node1", 100));
response.setDecommissioningNodes(decomNodes);
when(admin.checkForDecommissioningNodes(any(
CheckForDecommissioningNodesRequest.class))).thenReturn(response);
assertEquals(0, rmAdminCLI.run(forcefulDecomArgs));
verify(admin).refreshNodes(
RefreshNodesRequest.newInstance(DecommissionType.FORCEFUL));
}
@Test
public void testRefreshNodesGracefulInfiniteTimeout() throws Exception {
String[] infiniteTimeoutArgs = {"-refreshNodes", "-g", "-1", "-client"};
testRefreshNodesGracefulInfiniteTimeout(infiniteTimeoutArgs);
}
@Test
public void testRefreshNodesGracefulNoTimeout() throws Exception {
// no timeout (infinite timeout)
String[] noTimeoutArgs = {"-refreshNodes", "-g", "-client"};
testRefreshNodesGracefulInfiniteTimeout(noTimeoutArgs);
}
private void testRefreshNodesGracefulInfiniteTimeout(String[] args)
throws Exception {
when(admin.checkForDecommissioningNodes(any(
CheckForDecommissioningNodesRequest.class))).thenAnswer(
new Answer<CheckForDecommissioningNodesResponse>() {
private int count = 5;
@Override
public CheckForDecommissioningNodesResponse answer(
InvocationOnMock invocationOnMock) throws Throwable {
CheckForDecommissioningNodesResponse response = Records
.newRecord(CheckForDecommissioningNodesResponse.class);
HashSet<NodeId> decomNodes = new HashSet<NodeId>();
count--;
if (count <= 0) {
response.setDecommissioningNodes(decomNodes);
return response;
} else {
decomNodes.add(NodeId.newInstance("node1", 100));
response.setDecommissioningNodes(decomNodes);
return response;
}
}
});
assertEquals(0, rmAdminCLI.run(args));
verify(admin, atLeastOnce()).refreshNodes(
RefreshNodesRequest.newInstance(DecommissionType.GRACEFUL, -1));
verify(admin, never()).refreshNodes(
RefreshNodesRequest.newInstance(DecommissionType.FORCEFUL));
}
@Test
public void testRefreshNodesGracefulInvalidArgs() throws Exception {
// invalid graceful timeout parameter
String[] invalidArgs = {"-refreshNodes", "-ginvalid", "invalid", "-client"};
assertEquals(-1, rmAdminCLI.run(invalidArgs));
// invalid timeout
String[] invalidTimeoutArgs = {"-refreshNodes", "-g", "invalid", "-client"};
assertEquals(-1, rmAdminCLI.run(invalidTimeoutArgs));
// negative timeout
String[] negativeTimeoutArgs = {"-refreshNodes", "-g", "-1000", "-client"};
assertEquals(-1, rmAdminCLI.run(negativeTimeoutArgs));
// invalid tracking mode
String[] invalidTrackingArgs = {"-refreshNodes", "-g", "1", "-foo"};
assertEquals(-1, rmAdminCLI.run(invalidTrackingArgs));
}
@Test
public void testGetGroups() throws Exception {
when(admin.getGroupsForUser(eq("admin"))).thenReturn(
new String[] {"group1", "group2"});
PrintStream origOut = System.out;
PrintStream out = mock(PrintStream.class);
System.setOut(out);
try {
String[] args = { "-getGroups", "admin" };
assertEquals(0, rmAdminCLI.run(args));
verify(admin).getGroupsForUser(eq("admin"));
verify(out).println(argThat(new ArgumentMatcher<StringBuilder>() {
@Override
public boolean matches(Object argument) {
return ("" + argument).equals("admin : group1 group2");
}
}));
} finally {
System.setOut(origOut);
}
}
@Test
public void testTransitionToActive() throws Exception {
String[] args = {"-transitionToActive", "rm1"};
// RM HA is disabled.
// transitionToActive should not be executed
assertEquals(-1, rmAdminCLI.run(args));
verify(haadmin, never()).transitionToActive(
any(HAServiceProtocol.StateChangeRequestInfo.class));
// Now RM HA is enabled.
// transitionToActive should be executed
assertEquals(0, rmAdminCLIWithHAEnabled.run(args));
verify(haadmin).transitionToActive(
any(HAServiceProtocol.StateChangeRequestInfo.class));
// HAAdmin#isOtherTargetNodeActive should check state of non-target node.
verify(haadmin, times(1)).getServiceStatus();
}
@Test
public void testTransitionToStandby() throws Exception {
String[] args = {"-transitionToStandby", "rm1"};
// RM HA is disabled.
// transitionToStandby should not be executed
assertEquals(-1, rmAdminCLI.run(args));
verify(haadmin, never()).transitionToStandby(
any(HAServiceProtocol.StateChangeRequestInfo.class));
// Now RM HA is enabled.
// transitionToActive should be executed
assertEquals(0, rmAdminCLIWithHAEnabled.run(args));
verify(haadmin).transitionToStandby(
any(HAServiceProtocol.StateChangeRequestInfo.class));
}
@Test
public void testGetServiceState() throws Exception {
String[] args = {"-getServiceState", "rm1"};
// RM HA is disabled.
// getServiceState should not be executed
assertEquals(-1, rmAdminCLI.run(args));
verify(haadmin, never()).getServiceStatus();
// Now RM HA is enabled.
// getServiceState should be executed
assertEquals(0, rmAdminCLIWithHAEnabled.run(args));
verify(haadmin).getServiceStatus();
}
@Test
public void testGetAllServiceState() throws Exception {
HAServiceStatus standbyStatus = new HAServiceStatus(
HAServiceState.STANDBY).setReadyToBecomeActive();
Mockito.doReturn(standbyStatus).when(haadmin).getServiceStatus();
ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
rmAdminCLIWithHAEnabled.setOut(new PrintStream(dataOut));
String[] args = {"-getAllServiceState"};
assertEquals(0, rmAdminCLIWithHAEnabled.run(args));
assertTrue(dataOut.toString().contains(
String.format("%-50s %-10s", (HOST_A + ":" + 12346),
standbyStatus.getState())));
assertTrue(dataOut.toString().contains(
String.format("%-50s %-10s", (HOST_B + ":" + 12346),
standbyStatus.getState())));
rmAdminCLIWithHAEnabled.setOut(System.out);
}
@Test
public void testCheckHealth() throws Exception {
String[] args = {"-checkHealth", "rm1"};
// RM HA is disabled.
// getServiceState should not be executed
assertEquals(-1, rmAdminCLI.run(args));
verify(haadmin, never()).monitorHealth();
// Now RM HA is enabled.
// getServiceState should be executed
assertEquals(0, rmAdminCLIWithHAEnabled.run(args));
verify(haadmin).monitorHealth();
}
/**
* Test printing of help messages
*/
@Test
public void testHelp() throws Exception {
PrintStream oldOutPrintStream = System.out;
PrintStream oldErrPrintStream = System.err;
ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
ByteArrayOutputStream dataErr = new ByteArrayOutputStream();
System.setOut(new PrintStream(dataOut));
System.setErr(new PrintStream(dataErr));
try {
String[] args = { "-help" };
assertEquals(0, rmAdminCLI.run(args));
oldOutPrintStream.println(dataOut);
assertTrue(dataOut
.toString()
.contains(
"rmadmin is the command to execute YARN administrative commands."));
assertTrue(dataOut
.toString()
.contains(
"yarn rmadmin [-refreshQueues] [-refreshNodes "+
"[-g|graceful [timeout in seconds] -client|server]] " +
"[-refreshNodesResources] [-refresh" +
"SuperUserGroupsConfiguration] [-refreshUserToGroupsMappings] " +
"[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup " +
"[username]] [-addToClusterNodeLabels " +
"<\"label1(exclusive=true),label2(exclusive=false),label3\">] " +
"[-removeFromClusterNodeLabels <label1,label2,label3>] " +
"[-replaceLabelsOnNode " +
"<\"node1[:port]=label1,label2 node2[:port]=label1\"> " +
"[-failOnUnknownNodes]] " +
"[-directlyAccessNodeLabelStore] [-refreshClusterMaxPriority] " +
"[-updateNodeResource [NodeID] [MemSize] [vCores] "
+ "([OvercommitTimeout]) or -updateNodeResource "
+ "[NodeID] [ResourceTypes] ([OvercommitTimeout])] "
+ "[-help [cmd]]"));
assertTrue(dataOut
.toString()
.contains(
"-refreshQueues: Reload the queues' acls, states and scheduler " +
"specific properties."));
assertTrue(dataOut
.toString()
.contains(
"-refreshNodes [-g|graceful [timeout in seconds]" +
" -client|server]: " +
"Refresh the hosts information at the ResourceManager."));
assertTrue(dataOut
.toString()
.contains(
"-refreshNodesResources: Refresh resources of NodeManagers at the " +
"ResourceManager."));
assertTrue(dataOut.toString().contains(
"-refreshUserToGroupsMappings: Refresh user-to-groups mappings"));
assertTrue(dataOut
.toString()
.contains(
"-refreshSuperUserGroupsConfiguration: Refresh superuser proxy" +
" groups mappings"));
assertTrue(dataOut
.toString()
.contains(
"-refreshAdminAcls: Refresh acls for administration of " +
"ResourceManager"));
assertTrue(dataOut
.toString()
.contains(
"-refreshServiceAcl: Reload the service-level authorization" +
" policy file"));
assertTrue(dataOut
.toString()
.contains(
"-help [cmd]: Displays help for the given command or all " +
"commands if none"));
testError(new String[] { "-help", "-refreshQueues" },
"Usage: yarn rmadmin [-refreshQueues]", dataErr, 0);
testError(new String[] { "-help", "-refreshNodes" },
"Usage: yarn rmadmin [-refreshNodes [-g|graceful " +
"[timeout in seconds] -client|server]]", dataErr, 0);
testError(new String[] { "-help", "-refreshNodesResources" },
"Usage: yarn rmadmin [-refreshNodesResources]", dataErr, 0);
testError(new String[] { "-help", "-refreshUserToGroupsMappings" },
"Usage: yarn rmadmin [-refreshUserToGroupsMappings]", dataErr, 0);
testError(
new String[] { "-help", "-refreshSuperUserGroupsConfiguration" },
"Usage: yarn rmadmin [-refreshSuperUserGroupsConfiguration]",
dataErr, 0);
testError(new String[] { "-help", "-refreshAdminAcls" },
"Usage: yarn rmadmin [-refreshAdminAcls]", dataErr, 0);
testError(new String[] { "-help", "-refreshServiceAcl" },
"Usage: yarn rmadmin [-refreshServiceAcl]", dataErr, 0);
testError(new String[] { "-help", "-getGroups" },
"Usage: yarn rmadmin [-getGroups [username]]", dataErr, 0);
testError(new String[] { "-help", "-transitionToActive" },
"Usage: yarn rmadmin [-transitionToActive [--forceactive]" +
" <serviceId>]", dataErr, 0);
testError(new String[] { "-help", "-transitionToStandby" },
"Usage: yarn rmadmin [-transitionToStandby <serviceId>]", dataErr, 0);
testError(new String[] { "-help", "-getServiceState" },
"Usage: yarn rmadmin [-getServiceState <serviceId>]", dataErr, 0);
testError(new String[] { "-help", "-checkHealth" },
"Usage: yarn rmadmin [-checkHealth <serviceId>]", dataErr, 0);
testError(new String[] { "-help", "-failover" },
"Usage: yarn rmadmin " +
"[-failover [--forcefence] [--forceactive] " +
"<serviceId> <serviceId>]",
dataErr, 0);
testError(new String[] { "-help", "-badParameter" },
"Usage: yarn rmadmin", dataErr, 0);
testError(new String[] { "-badParameter" },
"badParameter: Unknown command", dataErr, -1);
// Test -help when RM HA is enabled
assertEquals(0, rmAdminCLIWithHAEnabled.run(args));
oldOutPrintStream.println(dataOut);
String expectedHelpMsg =
"yarn rmadmin [-refreshQueues] [-refreshNodes [-g|graceful "
+ "[timeout in seconds] -client|server]] "
+ "[-refreshNodesResources] [-refreshSuperUserGroupsConfiguration] "
+ "[-refreshUserToGroupsMappings] "
+ "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup"
+ " [username]] [-addToClusterNodeLabels <\"label1(exclusive=true),"
+ "label2(exclusive=false),label3\">]"
+ " [-removeFromClusterNodeLabels <label1,label2,label3>] [-replaceLabelsOnNode "
+ "<\"node1[:port]=label1,label2 node2[:port]=label1\"> "
+ "[-failOnUnknownNodes]] [-directlyAccessNodeLabelStore] "
+ "[-refreshClusterMaxPriority] "
+ "[-updateNodeResource [NodeID] [MemSize] [vCores] "
+ "([OvercommitTimeout]) "
+ "or -updateNodeResource [NodeID] [ResourceTypes] "
+ "([OvercommitTimeout])] "
+ "[-transitionToActive [--forceactive] <serviceId>] "
+ "[-transitionToStandby <serviceId>] "
+ "[-getServiceState <serviceId>] [-getAllServiceState] "
+ "[-checkHealth <serviceId>] [-help [cmd]]";
String actualHelpMsg = dataOut.toString();
assertTrue(String.format("Help messages: %n " + actualHelpMsg + " %n doesn't include expected " +
"messages: %n" + expectedHelpMsg), actualHelpMsg.contains(expectedHelpMsg
));
} finally {
System.setOut(oldOutPrintStream);
System.setErr(oldErrPrintStream);
}
}
@Test
public void testException() throws Exception {
PrintStream oldErrPrintStream = System.err;
ByteArrayOutputStream dataErr = new ByteArrayOutputStream();
System.setErr(new PrintStream(dataErr));
try {
when(admin.refreshQueues(any(RefreshQueuesRequest.class)))
.thenThrow(new IOException("test exception"));
String[] args = { "-refreshQueues" };
assertEquals(-1, rmAdminCLI.run(args));
verify(admin).refreshQueues(any(RefreshQueuesRequest.class));
assertTrue(dataErr.toString().contains("refreshQueues: test exception"));
} finally {
System.setErr(oldErrPrintStream);
}
}
@Test
public void testAccessLocalNodeLabelManager() throws Exception {
assertFalse(dummyNodeLabelsManager.getServiceState() == STATE.STOPPED);
String[] args =
{ "-addToClusterNodeLabels", "x,y", "-directlyAccessNodeLabelStore" };
assertEquals(0, rmAdminCLI.run(args));
assertTrue(dummyNodeLabelsManager.getClusterNodeLabelNames().containsAll(
ImmutableSet.of("x", "y")));
// reset localNodeLabelsManager
dummyNodeLabelsManager.removeFromClusterNodeLabels(ImmutableSet.of("x", "y"));
// change the sequence of "-directlyAccessNodeLabelStore" and labels,
// should fail
args =
new String[] { "-addToClusterNodeLabels",
"-directlyAccessNodeLabelStore", "x,y" };
assertEquals(-1, rmAdminCLI.run(args));
// local node labels manager will be close after running
assertTrue(dummyNodeLabelsManager.getServiceState() == STATE.STOPPED);
}
@Test
public void testAccessRemoteNodeLabelManager() throws Exception {
String[] args =
{ "-addToClusterNodeLabels", "x,y" };
assertEquals(0, rmAdminCLI.run(args));
// localNodeLabelsManager shouldn't accessed
assertTrue(dummyNodeLabelsManager.getClusterNodeLabelNames().isEmpty());
// remote node labels manager accessed
assertTrue(remoteAdminServiceAccessed);
}
@Test
public void testAddToClusterNodeLabels() throws Exception {
// successfully add labels
String[] args =
{ "-addToClusterNodeLabels", "x", "-directlyAccessNodeLabelStore" };
assertEquals(0, rmAdminCLI.run(args));
assertTrue(dummyNodeLabelsManager.getClusterNodeLabelNames().containsAll(
ImmutableSet.of("x")));
// no labels, should fail
args = new String[] { "-addToClusterNodeLabels" };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail
args =
new String[] { "-addToClusterNodeLabels",
"-directlyAccessNodeLabelStore" };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail at client validation
args = new String[] { "-addToClusterNodeLabels", " " };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail at client validation
args = new String[] { "-addToClusterNodeLabels", " , " };
assertTrue(0 != rmAdminCLI.run(args));
// successfully add labels
args =
new String[] { "-addToClusterNodeLabels", ",x,,",
"-directlyAccessNodeLabelStore" };
assertEquals(0, rmAdminCLI.run(args));
assertTrue(dummyNodeLabelsManager.getClusterNodeLabelNames().containsAll(
ImmutableSet.of("x")));
}
@Test
public void testAddToClusterNodeLabelsWithExclusivitySetting()
throws Exception {
// Parenthese not match
String[] args = new String[] { "-addToClusterNodeLabels", "x(" };
assertTrue(0 != rmAdminCLI.run(args));
args = new String[] { "-addToClusterNodeLabels", "x)" };
assertTrue(0 != rmAdminCLI.run(args));
// Not expected key=value specifying inner parentese
args = new String[] { "-addToClusterNodeLabels", "x(key=value)" };
assertTrue(0 != rmAdminCLI.run(args));
// Not key is expected, but value not
args = new String[] { "-addToClusterNodeLabels", "x(exclusive=)" };
assertTrue(0 != rmAdminCLI.run(args));
// key=value both set
args =
new String[] { "-addToClusterNodeLabels",
"w,x(exclusive=true), y(exclusive=false),z()",
"-directlyAccessNodeLabelStore" };
assertTrue(0 == rmAdminCLI.run(args));
assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("w"));
assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("x"));
assertFalse(dummyNodeLabelsManager.isExclusiveNodeLabel("y"));
assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("z"));
// key=value both set, and some spaces need to be handled
args =
new String[] { "-addToClusterNodeLabels",
"a (exclusive= true) , b( exclusive =false),c ",
"-directlyAccessNodeLabelStore" };
assertTrue(0 == rmAdminCLI.run(args));
assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("a"));
assertFalse(dummyNodeLabelsManager.isExclusiveNodeLabel("b"));
assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("c"));
}
@Test
public void testRemoveFromClusterNodeLabels() throws Exception {
// Successfully remove labels
dummyNodeLabelsManager.addToCluserNodeLabelsWithDefaultExclusivity(ImmutableSet.of("x", "y"));
String[] args =
{ "-removeFromClusterNodeLabels", "x,,y",
"-directlyAccessNodeLabelStore" };
assertEquals(0, rmAdminCLI.run(args));
assertTrue(dummyNodeLabelsManager.getClusterNodeLabelNames().isEmpty());
// no labels, should fail
args = new String[] { "-removeFromClusterNodeLabels" };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail
args =
new String[] { "-removeFromClusterNodeLabels",
"-directlyAccessNodeLabelStore" };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail at client validation
args = new String[] { "-removeFromClusterNodeLabels", " " };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail at client validation
args = new String[] { "-removeFromClusterNodeLabels", ", " };
assertTrue(0 != rmAdminCLI.run(args));
}
@Test
public void testReplaceLabelsOnNode() throws Exception {
// Successfully replace labels
dummyNodeLabelsManager
.addToCluserNodeLabelsWithDefaultExclusivity(ImmutableSet.of("x", "y", "Y"));
String[] args =
{ "-replaceLabelsOnNode",
"node1:8000,x node2:8000=y node3,x node4=Y",
"-directlyAccessNodeLabelStore" };
assertEquals(0, rmAdminCLI.run(args));
assertTrue(dummyNodeLabelsManager.getNodeLabels().containsKey(
NodeId.newInstance("node1", 8000)));
assertTrue(dummyNodeLabelsManager.getNodeLabels().containsKey(
NodeId.newInstance("node2", 8000)));
assertTrue(dummyNodeLabelsManager.getNodeLabels().containsKey(
NodeId.newInstance("node3", 0)));
assertTrue(dummyNodeLabelsManager.getNodeLabels().containsKey(
NodeId.newInstance("node4", 0)));
// no labels, should fail
args = new String[] { "-replaceLabelsOnNode" };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail
args = new String[] { "-replaceLabelsOnNode", "-failOnUnknownNodes" };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail
args =
new String[] { "-replaceLabelsOnNode", "-directlyAccessNodeLabelStore" };
assertTrue(0 != rmAdminCLI.run(args));
// no labels, should fail
args = new String[] { "-replaceLabelsOnNode", " " };
assertTrue(0 != rmAdminCLI.run(args));
args = new String[] { "-replaceLabelsOnNode", ", " };
assertTrue(0 != rmAdminCLI.run(args));
}
@Test
public void testReplaceMultipleLabelsOnSingleNode() throws Exception {
// Successfully replace labels
dummyNodeLabelsManager.addToCluserNodeLabelsWithDefaultExclusivity(ImmutableSet.of("x", "y"));
String[] args =
{ "-replaceLabelsOnNode", "node1,x,y",
"-directlyAccessNodeLabelStore" };
assertTrue(0 != rmAdminCLI.run(args));
}
@Test
public void testRemoveLabelsOnNodes() throws Exception {
// Successfully replace labels
dummyNodeLabelsManager
.addToCluserNodeLabelsWithDefaultExclusivity(ImmutableSet.of("x", "y"));
String[] args = { "-replaceLabelsOnNode", "node1=x node2=y",
"-directlyAccessNodeLabelStore" };
assertTrue(0 == rmAdminCLI.run(args));
args = new String[] { "-replaceLabelsOnNode", "node1= node2=",
"-directlyAccessNodeLabelStore" };
assertTrue("Labels should get replaced even '=' is used ",
0 == rmAdminCLI.run(args));
}
private void testError(String[] args, String template,
ByteArrayOutputStream data, int resultCode) throws Exception {
int actualResultCode = rmAdminCLI.run(args);
assertEquals("Expected result code: " + resultCode +
", actual result code is: " + actualResultCode, resultCode, actualResultCode);
assertTrue(String.format("Expected error message: %n" + template +
" is not included in messages: %n" + data.toString()),
data.toString().contains(template));
data.reset();
}
@Test
public void testRMHAErrorUsage() throws Exception {
ByteArrayOutputStream errOutBytes = new ByteArrayOutputStream();
rmAdminCLIWithHAEnabled.setErrOut(new PrintStream(errOutBytes));
try {
String[] args = { "-failover" };
assertEquals(-1, rmAdminCLIWithHAEnabled.run(args));
String errOut = new String(errOutBytes.toByteArray(), Charsets.UTF_8);
errOutBytes.reset();
assertTrue(errOut.contains("Usage: rmadmin"));
} finally {
rmAdminCLIWithHAEnabled.setErrOut(System.err);
}
}
}
| {
"content_hash": "b2f965315756b929184f6dd5e715deec",
"timestamp": "",
"source": "github",
"line_count": 1059,
"max_line_length": 103,
"avg_line_length": 40.73465533522191,
"alnum_prop": 0.6867726830172933,
"repo_name": "szegedim/hadoop",
"id": "1f4b493f45714308cf6c55eefc9dbd318c76817e",
"size": "43944",
"binary": false,
"copies": "5",
"ref": "refs/heads/trunk",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRMAdminCLI.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "77936"
},
{
"name": "C",
"bytes": "1649193"
},
{
"name": "C++",
"bytes": "2793224"
},
{
"name": "CMake",
"bytes": "108030"
},
{
"name": "CSS",
"bytes": "87680"
},
{
"name": "HTML",
"bytes": "365471"
},
{
"name": "Java",
"bytes": "84086482"
},
{
"name": "JavaScript",
"bytes": "1135014"
},
{
"name": "Python",
"bytes": "23553"
},
{
"name": "RobotFramework",
"bytes": "12810"
},
{
"name": "Shell",
"bytes": "458748"
},
{
"name": "TLA",
"bytes": "14993"
},
{
"name": "TeX",
"bytes": "19322"
},
{
"name": "XSLT",
"bytes": "18026"
}
],
"symlink_target": ""
} |
<?php
use Illuminate\Database\Migrations\Migration;
class CreateSteamidsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('steamids', function ($table)
{
$table->increments('id');
$table->string('steamid', 32)
->unique();
$table->boolean('vac_banned')
->default(0);
$table->boolean('changed')
->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('steamids');
}
}
| {
"content_hash": "6051533701d40bacc97aadceb5dba8c3",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 46,
"avg_line_length": 14.175,
"alnum_prop": 0.5961199294532628,
"repo_name": "Supericy/steam-website",
"id": "05e65420683c9e0195e419112368c4ac0345da84",
"size": "567",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/database/migrations/2014_08_28_093854_create_steamids_table.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19831"
},
{
"name": "JavaScript",
"bytes": "62526"
},
{
"name": "PHP",
"bytes": "249144"
}
],
"symlink_target": ""
} |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Text;
using Microsoft.CodeAnalysis.Editor.UnitTests;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.VisualStudio.Composition;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Test.Utilities;
namespace Roslyn.Test.EditorUtilities
{
public static class EditorFactory
{
public static ITextBuffer CreateBuffer(
ExportProvider exportProvider,
params string[] lines)
{
return CreateBuffer("text", exportProvider, lines);
}
public static ITextBuffer CreateBuffer(
string contentType,
ExportProvider exportProvider,
params string[] lines)
{
var text = LinesToFullText(lines);
var intContentType = exportProvider.GetExportedValue<IContentTypeRegistryService>().GetContentType(contentType);
var buffer = exportProvider.GetExportedValue<ITextBufferFactoryService>().CreateTextBuffer(intContentType);
buffer.Replace(new Span(0, 0), text);
return buffer;
}
public static DisposableTextView CreateView(
ExportProvider exportProvider,
params string[] lines)
{
return CreateView("text", exportProvider, lines);
}
public static DisposableTextView CreateView(
string contentType,
ExportProvider exportProvider,
params string[] lines)
{
TestWorkspace.ResetThreadAffinity();
WpfTestRunner.RequireWpfFact($"Creates an {nameof(IWpfTextView)} through {nameof(EditorFactory)}.{nameof(CreateView)}");
var buffer = CreateBuffer(contentType, exportProvider, lines);
return exportProvider.GetExportedValue<ITextEditorFactoryService>().CreateDisposableTextView(buffer);
}
public static string LinesToFullText(params string[] lines)
{
var builder = new StringBuilder();
var isFirst = true;
foreach (var line in lines)
{
if (!isFirst)
{
builder.AppendLine();
}
isFirst = false;
builder.Append(line);
}
return builder.ToString();
}
}
}
| {
"content_hash": "f50be50ee536902a2ae40407a35fa08f",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 161,
"avg_line_length": 35.44444444444444,
"alnum_prop": 0.6332288401253918,
"repo_name": "paulvanbrenk/roslyn",
"id": "1ded042709113ac25e1557f6e02878239a6cddef",
"size": "2554",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/EditorFeatures/TestUtilities/EditorFactory.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "1C Enterprise",
"bytes": "289100"
},
{
"name": "Batchfile",
"bytes": "9670"
},
{
"name": "C#",
"bytes": "99891629"
},
{
"name": "C++",
"bytes": "5392"
},
{
"name": "F#",
"bytes": "3632"
},
{
"name": "Groovy",
"bytes": "11102"
},
{
"name": "PowerShell",
"bytes": "126888"
},
{
"name": "Shell",
"bytes": "13912"
},
{
"name": "Visual Basic",
"bytes": "75516438"
}
],
"symlink_target": ""
} |
#include "precompiled.hpp"
#include "decoder_allocators.hpp"
#include <cmath>
#include "msg.hpp"
zmq::shared_message_memory_allocator::shared_message_memory_allocator (std::size_t bufsize_) :
buf(NULL),
bufsize(0),
max_size(bufsize_),
msg_content(NULL),
maxCounters (static_cast <size_t> (std::ceil (static_cast <double> (max_size) / static_cast <double> (msg_t::max_vsm_size))))
{
}
zmq::shared_message_memory_allocator::shared_message_memory_allocator (std::size_t bufsize_, std::size_t maxMessages) :
buf(NULL),
bufsize(0),
max_size(bufsize_),
msg_content(NULL),
maxCounters(maxMessages)
{
}
zmq::shared_message_memory_allocator::~shared_message_memory_allocator ()
{
deallocate();
}
unsigned char* zmq::shared_message_memory_allocator::allocate ()
{
if (buf) {
// release reference count to couple lifetime to messages
zmq::atomic_counter_t* c = reinterpret_cast<zmq::atomic_counter_t* >(buf);
// if refcnt drops to 0, there are no message using the buffer
// because either all messages have been closed or only vsm-messages
// were created
if (c->sub (1)) {
// buffer is still in use as message data. "Release" it and create a new one
// release pointer because we are going to create a new buffer
release ();
}
}
// if buf != NULL it is not used by any message so we can re-use it for the next run
if (!buf) {
// allocate memory for reference counters together with reception buffer
std::size_t const allocationsize =
max_size + sizeof (zmq::atomic_counter_t) +
maxCounters * sizeof (zmq::msg_t::content_t);
buf = static_cast <unsigned char *> (std::malloc (allocationsize));
alloc_assert (buf);
new (buf) atomic_counter_t (1);
} else {
// release reference count to couple lifetime to messages
zmq::atomic_counter_t *c = reinterpret_cast <zmq::atomic_counter_t *> (buf);
c->set (1);
}
bufsize = max_size;
msg_content = reinterpret_cast <zmq::msg_t::content_t*> (buf + sizeof (atomic_counter_t) + max_size);
return buf + sizeof (zmq::atomic_counter_t);
}
void zmq::shared_message_memory_allocator::deallocate ()
{
zmq::atomic_counter_t* c = reinterpret_cast<zmq::atomic_counter_t* >(buf);
if (buf && !c->sub(1)) {
std::free(buf);
}
release();
}
unsigned char* zmq::shared_message_memory_allocator::release ()
{
unsigned char* b = buf;
buf = NULL;
bufsize = 0;
msg_content = NULL;
return b;
}
void zmq::shared_message_memory_allocator::inc_ref ()
{
(reinterpret_cast <zmq::atomic_counter_t*> (buf))->add (1);
}
void zmq::shared_message_memory_allocator::call_dec_ref(void*, void* hint)
{
zmq_assert (hint);
unsigned char* buf = static_cast <unsigned char*> (hint);
zmq::atomic_counter_t* c = reinterpret_cast <zmq::atomic_counter_t*> (buf);
if (!c->sub (1)) {
c->~atomic_counter_t ();
std::free (buf);
buf = NULL;
}
}
std::size_t zmq::shared_message_memory_allocator::size () const
{
return bufsize;
}
unsigned char* zmq::shared_message_memory_allocator::data ()
{
return buf + sizeof (zmq::atomic_counter_t);
}
| {
"content_hash": "2c8153cf26ed3a316f2a8478b23de33e",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 129,
"avg_line_length": 28.23931623931624,
"alnum_prop": 0.6243946731234867,
"repo_name": "Nep-gear/nep-bio",
"id": "c49e2696e18d4a78871bc884cc1402648deaa04b",
"size": "4722",
"binary": false,
"copies": "28",
"ref": "refs/heads/master",
"path": "old/zeromq_test/libzmq/libzmq/src/decoder_allocators.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1112"
},
{
"name": "C",
"bytes": "131247"
},
{
"name": "C++",
"bytes": "4162170"
},
{
"name": "CMake",
"bytes": "102712"
},
{
"name": "M4",
"bytes": "216994"
},
{
"name": "Makefile",
"bytes": "65592"
},
{
"name": "Matlab",
"bytes": "10551"
},
{
"name": "Python",
"bytes": "90666"
},
{
"name": "Shell",
"bytes": "78408"
}
],
"symlink_target": ""
} |
let DescriptorFormatType = require('../../descriptor/widgets/descriptorformattype');
let Marionette = require('backbone.marionette');
let MediaCollection = function() {
DescriptorFormatType.call(this);
this.name = "media_collection";
this.group = "media";
};
_.extend(MediaCollection.prototype, DescriptorFormatType.prototype, {
create: function(format, parent, options) {
options || (options = {
readOnly: false,
history: false
});
if (options.readOnly) {
let input = this._createStdInput(parent, "fa-check-square-o", options.history);
this.parent = parent;
this.readOnly = true;
this.el = input;
} else {
/* @todo */
if (options.history) {
// @todo
}
this.parent = parent;
this.el = select;
}
},
destroy: function() {
if (this.el && this.parent) {
if (this.readOnly) {
this.el.parent().remove();
} else {
/*this.el.remove(); @todo */
}
}
},
cancel: function() {
/* @todo */
},
enable: function() {
if (this.el) {
this.el.prop("disabled", false).selectpicker('refresh');
}
},
disable: function() {
if (this.el) {
this.el.prop("disabled", true).selectpicker('refresh');
}
},
set: function (format, definesValues, defaultValues, options) {
if (!this.el || !this.parent) {
return;
}
definesValues = this.isValueDefined(definesValues, defaultValues);
if (this.readOnly) {
if (definesValues) {
this.values = defaultValues;
/* @todo */
}
} else {
if (definesValues) {
this.initials = this.values = defaultValues;
/* @todo */
}
}
},
values: function() {
if (this.el && this.parent) {
if (this.readOnly) {
return [this.el.attr("value")];
} else {
return [this.el.val()];
}
}
return [];
},
compare: function(a, b) {
if (!Array.isArray(a) || !Array.isArray(b)) {
return false;
}
if (a.length !== b.length) {
return false;
}
let found = false;
for (let i = 0; i < a.length; ++i) {
found = false;
for (let j = 0; j < b.length; ++j) {
if (a[i] === b[j]) {
found = true;
break;
}
}
if (!found) {
return false;
}
}
},
checkCondition: function(condition, values) {
switch (condition) {
case 0:
return this.values === null || this.values.length === 0;
case 1:
return this.values !== null && this.values.length > 0;
case 2:
return this.compare(this.values, values);
case 3:
return !this.compare(this.values, values);
default:
return false;
}
},
bindConditionListener: function(listeners, condition, values) {
if (this.el && this.parent && !this.readOnly) {
if (!this.bound) {
/* @todo */
this.bound = true;
}
this.conditionType = condition;
this.conditionValues = values;
this.listeners = listeners || [];
}
},
onValueChanged: function(e) {
let display = this.checkCondition(this.conditionType, this.conditionValues);
// show or hide the parent element
if (display) {
for (let i = 0; i < this.listeners.length; ++i) {
this.listeners[i].parent.parent().show(true);
}
} else {
for (let i = 0; i < this.listeners.length; ++i) {
this.listeners[i].parent.parent().hide(true);
}
}
}
});
MediaCollection.DescriptorTypeDetailsView = Marionette.View.extend({
className: 'descriptor-type-details-format',
template: require('../templates/widgets/mediacollection.html'),
ui: {
format_media_types: '#format_media_types',
format_max_items: '#format_max_items',
format_media_inline: '#format_media_inline'
},
initialize: function() {
this.listenTo(this.model, 'change', this.render, this);
},
onRender: function() {
this.ui.format_media_types.selectpicker({
style: 'btn-default',
container: 'body'
});
this.ui.format_media_inline.selectpicker({style: 'btn-default'});
let format = this.model.get('format');
if (format.media_types != undefined) {
this.ui.format_media_types.selectpicker('val', format.media_types);
}
if (format.max_items != undefined) {
this.ui.format_max_items.val(format.max_items);
} else {
this.ui.format_max_items.val(2);
}
if (format.media_inline != undefined) {
this.ui.format_media_inline.selectpicker('val', format.media_inline ? "true" : "false");
} else {
this.ui.format_media_inline.selectpicker('val', "false");
}
},
getFormat: function() {
return {
'media_types': this.ui.format_media_types.val(),
'max_items': parseInt(this.ui.format_max_items.val()),
'media_inline': this.ui.format_media_inline.val() === "true"
}
}
});
module.exports = MediaCollection;
| {
"content_hash": "9db3781e89491d41778424c88211f244",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 100,
"avg_line_length": 26.774193548387096,
"alnum_prop": 0.48984509466437176,
"repo_name": "coll-gate/collgate",
"id": "33fbad339f9d85f25e41f7011fbedd6fb0e7c8f6",
"size": "6083",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/apps/medialibrary/widgets/mediacollection.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20334"
},
{
"name": "HTML",
"bytes": "245334"
},
{
"name": "JavaScript",
"bytes": "5131841"
},
{
"name": "Python",
"bytes": "1291968"
},
{
"name": "Shell",
"bytes": "126"
}
],
"symlink_target": ""
} |
package dm
import (
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync/atomic"
"github.com/docker/machine/libmachine/cert"
"github.com/docker/machine/libmachine/mcnutils"
"github.com/tsuru/tsuru/cmd"
"github.com/tsuru/tsuru/iaas/dockermachine"
)
var storeBasePath = cmd.JoinWithUserDir(".tsuru", "installs")
type DockerMachine struct {
name string
storePath string
certsPath string
API dockermachine.DockerMachineAPI
machinesCount uint64
config DockerMachineConfig
}
type DockerMachineConfig struct {
CAPath string `yaml:"ca-path,omitempty"`
DriverOpts *DriverOpts `yaml:"driver,omitempty"`
DockerHubMirror string `yaml:"docker-hub-mirror,omitempty"`
DockerFlags []string `yaml:"docker-flags,omitempty"`
DockerStorageDriver string `yaml:"docker-storage-driver,omitempty"`
DockerInstallURL string `yaml:"docker-install-url,omitempty"`
}
type DriverOpts struct {
Name string
Options map[string]interface{} `yaml:",omitempty"`
}
type MachineProvisioner interface {
ProvisionMachine(map[string]interface{}) (*dockermachine.Machine, error)
}
func NewDockerMachine(config DockerMachineConfig, name string) (*DockerMachine, error) {
storePath := filepath.Join(storeBasePath, name)
certsPath := filepath.Join(storePath, "certs")
dm, err := dockermachine.NewDockerMachine(dockermachine.DockerMachineConfig{
CaPath: config.CAPath,
OutWriter: os.Stdout,
ErrWriter: os.Stderr,
StorePath: storePath,
})
if err != nil {
return nil, err
}
return &DockerMachine{
API: dm,
name: name,
certsPath: certsPath,
storePath: storePath,
config: config,
}, nil
}
func (d *DockerMachine) ProvisionMachine(driverOpts map[string]interface{}) (*dockermachine.Machine, error) {
m, err := d.CreateMachine(driverOpts)
if err != nil {
return nil, fmt.Errorf("error creating machine %s", err)
}
err = d.uploadRegistryCertificate(GetPrivateIP(m), m.Host.Driver.GetSSHUsername(), m.Host)
if err != nil {
return nil, fmt.Errorf("error uploading registry certificates to %s: %s", m.Base.Address, err)
}
return m, nil
}
func (d *DockerMachine) CreateMachine(driverOpts map[string]interface{}) (*dockermachine.Machine, error) {
driverOpts["swarm-master"] = false
driverOpts["swarm-host"] = ""
driverOpts["engine-install-url"] = ""
driverOpts["swarm-discovery"] = ""
mergedOpts := make(map[string]interface{})
for k, v := range d.config.DriverOpts.Options {
mergedOpts[k] = v
}
for k, v := range driverOpts {
mergedOpts[k] = v
}
m, err := d.API.CreateMachine(dockermachine.CreateMachineOpts{
Name: d.generateMachineName(),
DriverName: d.config.DriverOpts.Name,
Params: mergedOpts,
RegistryMirror: d.config.DockerHubMirror,
ArbitraryFlags: d.config.DockerFlags,
DockerEngineStorageDriver: d.config.DockerStorageDriver,
DockerEngineInstallURL: d.config.DockerInstallURL,
})
if err != nil {
return nil, err
}
if m.Host.AuthOptions() != nil {
m.Host.AuthOptions().ServerCertSANs = append(m.Host.AuthOptions().ServerCertSANs, GetPrivateIP(m))
err = m.Host.ConfigureAuth()
if err != nil {
return nil, err
}
}
return m, nil
}
func (d *DockerMachine) generateMachineName() string {
atomic.AddUint64(&d.machinesCount, 1)
return fmt.Sprintf("%s-%d", d.name, atomic.LoadUint64(&d.machinesCount))
}
func nixPathJoin(elem ...string) string {
return strings.Join(elem, "/")
}
func (d *DockerMachine) uploadRegistryCertificate(ip, user string, target sshTarget) error {
registryCertPath := filepath.Join(d.certsPath, "registry-cert.pem")
registryKeyPath := filepath.Join(d.certsPath, "registry-key.pem")
var registryIP string
if _, errReg := os.Stat(registryCertPath); os.IsNotExist(errReg) {
errCreate := d.createRegistryCertificate(ip)
if errCreate != nil {
return errCreate
}
registryIP = ip
} else {
certData, errRead := ioutil.ReadFile(registryCertPath)
if errRead != nil {
return fmt.Errorf("failed to read registry-cert.pem: %s", errRead)
}
block, _ := pem.Decode(certData)
cert, errRead := x509.ParseCertificate(block.Bytes)
if errRead != nil {
return fmt.Errorf("failed to parse registry certificate: %s", errRead)
}
registryIP = cert.IPAddresses[0].String()
}
fmt.Printf("Uploading registry certificate...\n")
certsBasePath := fmt.Sprintf("/home/%s/certs/%s:5000", user, registryIP)
if _, err := target.RunSSHCommand(fmt.Sprintf("mkdir -p %s", certsBasePath)); err != nil {
return err
}
dockerCertsPath := "/etc/docker/certs.d"
if _, err := target.RunSSHCommand(fmt.Sprintf("sudo mkdir -p %s", dockerCertsPath)); err != nil {
return err
}
fileCopies := map[string]string{
registryCertPath: nixPathJoin(certsBasePath, "registry-cert.pem"),
registryKeyPath: nixPathJoin(certsBasePath, "registry-key.pem"),
filepath.Join(d.certsPath, "ca-key.pem"): nixPathJoin(dockerCertsPath, "ca-key.pem"),
filepath.Join(d.certsPath, "ca.pem"): nixPathJoin(dockerCertsPath, "ca.pem"),
filepath.Join(d.certsPath, "cert.pem"): nixPathJoin(dockerCertsPath, "cert.pem"),
filepath.Join(d.certsPath, "key.pem"): nixPathJoin(dockerCertsPath, "key.pem"),
}
for src, dst := range fileCopies {
errWrite := writeRemoteFile(target, src, dst)
if errWrite != nil {
return errWrite
}
}
if _, err := target.RunSSHCommand(fmt.Sprintf("sudo cp -r /home/%s/certs/* %s/", user, dockerCertsPath)); err != nil {
return err
}
if _, err := target.RunSSHCommand(fmt.Sprintf("sudo cat %s/ca.pem | sudo tee -a /etc/ssl/certs/ca-certificates.crt", dockerCertsPath)); err != nil {
return err
}
_, err := target.RunSSHCommand("sudo mkdir -p /var/lib/registry/")
return err
}
func (d *DockerMachine) createRegistryCertificate(hosts ...string) error {
fmt.Printf("Creating registry certificate...\n")
caOrg := mcnutils.GetUsername()
org := caOrg + ".<bootstrap>"
generator := &cert.X509CertGenerator{}
certOpts := &cert.Options{
Hosts: hosts,
CertFile: filepath.Join(d.certsPath, "registry-cert.pem"),
KeyFile: filepath.Join(d.certsPath, "registry-key.pem"),
CAFile: filepath.Join(d.certsPath, "ca.pem"),
CAKeyFile: filepath.Join(d.certsPath, "ca-key.pem"),
Org: org,
Bits: 2048,
SwarmMaster: false,
}
return generator.GenerateCert(certOpts)
}
func (d *DockerMachine) DeleteAll() error {
return d.API.DeleteAll()
}
func (d *DockerMachine) Close() error {
return d.API.Close()
}
| {
"content_hash": "9e810c96c40c2d7cc8e108538b47e1a3",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 149,
"avg_line_length": 32.72906403940887,
"alnum_prop": 0.6894942805538832,
"repo_name": "ArxdSilva/tsuru-client",
"id": "4a4e6b2f945fa218a0232e34d5db8d65afb65c03",
"size": "6810",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tsuru/installer/dm/dockermachine.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Go",
"bytes": "816077"
},
{
"name": "Makefile",
"bytes": "1723"
},
{
"name": "Ruby",
"bytes": "1665"
},
{
"name": "Shell",
"bytes": "2744"
}
],
"symlink_target": ""
} |
URI Signing Plugin
==================
This remap plugin implements the draft URI Signing protocol documented here:
https://tools.ietf.org/html/draft-ietf-cdni-uri-signing-12 .
It takes a single argument: the name of a config file that contains key information.
**Nota bene:** Take care in ordering the plugins. In general, this plugin
should be first on the remap line. This is for two reasons. First, if no valid
token is present, it is probably not useful to continue processing the request
in future plugins. Second, and more importantly, the signature should be
verified _before_ any other plugins modify the request. If another plugin drops
or modifies the query string, the token might be missing entirely by the time
this plugin gets the URI.
Config
------
The config file should be a JSON object that maps issuer names to JWK-sets.
Exactly one of these JWK-sets must have an additional member indicating the
renewal key.
{
"Kabletown URI Authority": {
"renewal_kid": "Second Key",
"keys": [
{
"alg": "HS256",
"kid": "First Key",
"kty": "oct",
"k": "Kh_RkUMj-fzbD37qBnDf_3e_RvQ3RP9PaSmVEpE24AM"
},
{
"alg": "HS256",
"kid": "Second Key",
"kty": "oct",
"k": "fZBpDBNbk2GqhwoB_DGBAsBxqQZVix04rIoLJ7p_RlE"
}
]
}
}
If there is not precisely one renewal key, the plugin will not load.
Although the `kid` and `alg` parameters are optional in JWKs generally, both
members must be present in keys used for URI signing.
Usage
-----
The URI signing plugin will block all requests that do not bear a valid JWT, as
defined by the URI Signing protocol. Clients that do not present a valid JWT
will receive a 403 Forbidden response, instead of receiving content.
Tokens will be found in either of these places:
- A query parameter named `URISigningPackage`. The value must be the JWT.
- A cookie named `URISigningPackage`. The value of the cookie must be the JWT.
Path parameters will not be searched for JWTs.
### Supported Claims
The following claims are understood:
- `iss`: Must be present. The issuer is used to locate the key for verification.
- `sub`: Validated last, after key verification. **Only `uri-regex` is supported!**
- `exp`: Expired tokens are not valid.
- `iat`: May be present, but is not validated.
- `cdniv`: Must be missing or 1.
- `cdnistt`: If present, must be 1.
- `cdniets`: If cdnistt is 1, this must be present and non-zero.
### Unsupported Claims
These claims are not supported. If they are present, the token will not validate:
- `aud`
- `nbf`
- `jti`
In addition, the `sub` containers of `uri`, `uri-pattern`, and `uri-hash` are
**not supported**.
### Token Renewal
If the `cdnistt` and `cdniets` claims are present, the token will be renewed.
The new token will be returned via a `Set-Cookie` header as a session cookie.
However, instead of setting the expiration to be `cdniets` seconds from the
expiration of the previous cookie, it is set to `cdniets` seconds from the time
it was validated. This is to prevent a crafty client from repeatedly renewing
tokens in quick succession to create a super-token that lasts long into the
future, thereby circumventing the intent of the `exp` claim.
### JOSE Header
The JOSE header of the JWT should contain a `kid` parameter. This is used to
quickly select the key that was used to sign the token. If it is provided, only
the key with a matching `kid` will be used for validation. Otherwise, all
possible keys for that issuer must be tried, which is considerably more
expensive.
Building
--------
To build from source, you will need these libraries installed:
- [cjose](https://github.com/cisco/cjose)
- [jansson](https://github.com/akheron/jansson)
- pcre
- OpenSSL
… as well as compiler toolchain.
This builds in-tree with the rest of the ATS plugins. Of special note, however,
are the first two libraries: cjose and jansson. These libraries are not
currently used anywhere else, so they may not be installed.
As of this writing, both libraries install a dynamic library and a static
archive. However, by default, the static archive is not compiled with Position
Independent Code. The build script will detect this and build a dynamic
dependency on these libraries, so they will have to be distributed with the
plugin.
If you would like to statically link them, you will need to ensure that they are
compiled with the `-fPIC` flag in their CFLAGs. If the archives have PIC, the
build scripts will automatically statically link them.
| {
"content_hash": "cb4358da4c571f3598f3f127582eb3ca",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 85,
"avg_line_length": 36.031007751937985,
"alnum_prop": 0.7183734939759037,
"repo_name": "reveller/trafficserver",
"id": "7a90bfd765b7c57178deb18522025ad2e13a2006",
"size": "4650",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "plugins/experimental/uri_signing/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "13053"
},
{
"name": "C",
"bytes": "3417648"
},
{
"name": "C++",
"bytes": "11241509"
},
{
"name": "CSS",
"bytes": "8089"
},
{
"name": "HTML",
"bytes": "238770"
},
{
"name": "Java",
"bytes": "9881"
},
{
"name": "JavaScript",
"bytes": "1609"
},
{
"name": "Lex",
"bytes": "4029"
},
{
"name": "Lua",
"bytes": "380105"
},
{
"name": "M4",
"bytes": "273002"
},
{
"name": "Makefile",
"bytes": "200049"
},
{
"name": "Objective-C",
"bytes": "11203"
},
{
"name": "Perl",
"bytes": "67341"
},
{
"name": "Perl 6",
"bytes": "1329"
},
{
"name": "Python",
"bytes": "428815"
},
{
"name": "Roff",
"bytes": "2339"
},
{
"name": "Shell",
"bytes": "87510"
},
{
"name": "Vim script",
"bytes": "192"
},
{
"name": "Yacc",
"bytes": "3251"
}
],
"symlink_target": ""
} |
package rx.lang.scala
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.concurrent.{Future, Await}
import scala.concurrent.duration.Duration
import scala.concurrent.ExecutionContext.Implicits.global
import org.junit.Assert._
import org.junit.{ Ignore, Test }
import org.scalatestplus.junit.JUnitSuite
import scala.concurrent.duration._
import rx.lang.scala.schedulers.TestScheduler
class ObservableTests extends JUnitSuite {
// Tests which needn't be run:
@Ignore
def testCovariance = {
//println("hey, you shouldn't run this test")
val o1: Observable[Nothing] = Observable.empty
val o2: Observable[Int] = o1
val o3: Observable[App] = o1
val o4: Observable[Any] = o2
val o5: Observable[Any] = o3
}
// Tests which have to be run:
@Test
def testDematerialize(): Unit = {
val o = List(1, 2, 3).toObservable
val mat = o.materialize
val demat = mat.dematerialize
//correctly rejected:
//val wrongDemat = Observable("hello").dematerialize
assertEquals(demat.toBlocking.toIterable.toList, List(1, 2, 3))
}
@Test def TestScan(): Unit = {
val xs = Observable.just(0,1,2,3)
val ys = xs.scan(0)(_+_)
assertEquals(List(0,0,1,3,6), ys.toBlocking.toList)
val zs = xs.scan((x: Int, y:Int) => x*y)
assertEquals(List(0, 0, 0, 0), zs.toBlocking.toList)
}
// Test that Java's firstOrDefault propagates errors.
// If this changes (i.e. it suppresses errors and returns default) then Scala's firstOrElse
// should be changed accordingly.
@Test def testJavaFirstOrDefault(): Unit = {
assertEquals(1, rx.Observable.just(1, 2).firstOrDefault(10).toBlocking().single)
assertEquals(10, rx.Observable.empty().firstOrDefault(10).toBlocking().single)
val msg = "msg6251"
var receivedMsg = "none"
try {
rx.Observable.error(new Exception(msg)).firstOrDefault(10).toBlocking().single
} catch {
case e: Exception => receivedMsg = e.getCause().getMessage()
}
assertEquals(receivedMsg, msg)
}
@Test def testFirstOrElse(): Unit = {
def mustNotBeCalled: String = sys.error("this method should not be called")
def mustBeCalled: String = "this is the default value"
assertEquals("hello", Observable.just("hello").firstOrElse(mustNotBeCalled).toBlocking.single)
assertEquals("this is the default value", Observable.empty.firstOrElse(mustBeCalled).toBlocking.single)
}
@Test def testTestWithError(): Unit = {
val msg = "msg6251"
var receivedMsg = "none"
try {
Observable.error(new Exception(msg)).firstOrElse(10).toBlocking.single
} catch {
case e: Exception => receivedMsg = e.getCause().getMessage()
}
assertEquals(receivedMsg, msg)
}
@Test def testFromFuture(): Unit = {
val o = Observable from Future { 5 }
assertEquals(5, o.toBlocking.single)
}
@Test def testFromFutureWithDelay(): Unit = {
val o = Observable from Future { Thread.sleep(200); 42 }
assertEquals(42, o.toBlocking.single)
}
@Test def testFromFutureWithError(): Unit = {
val err = new Exception("ooops42")
val o: Observable[Int] = Observable from Future { Thread.sleep(200); throw err }
assertEquals(List(Notification.OnError(err)), o.materialize.toBlocking.toList)
}
@Test def testFromFutureWithSubscribeOnlyAfterCompletion(): Unit = {
val f = Future { Thread.sleep(200); 6 }
val o = Observable from f
val res = Await.result(f, Duration.Inf)
assertEquals(6, res)
assertEquals(6, o.toBlocking.single)
}
@Test def testJoin(): Unit = {
val xs = Observable.just(1,2,3)
val ys = Observable.just("a")
val zs = xs.join(ys)(_ => Observable.never, _ => Observable.never, (x, y) => y + x)
assertEquals(List("a1", "a2", "a3"),zs.toBlocking.toList)
}
@Test def testTimestampWithScheduler(): Unit = {
val c = 10
val s = TestScheduler()
val o1 = Observable interval (1.milliseconds, s) map (_ + 1)
val o2 = o1 timestamp s
val l = ListBuffer[(Long, Long)]()
o2.subscribe (
onNext = (l += _)
)
s advanceTimeTo c.milliseconds
val (l1, l2) = l.toList.unzip
assertTrue(l1.size == c)
assertEquals(l2, l1)
}
@Test def testHead(): Unit = {
val o: Observable[String] = List("alice", "bob", "carol").toObservable.head
assertEquals(List("alice"), o.toBlocking.toList)
}
@Test(expected = classOf[NoSuchElementException])
def testHeadWithEmptyObservable(): Unit = {
val o: Observable[String] = List[String]().toObservable.head
o.toBlocking.toList
}
@Test def testTail(): Unit = {
val o: Observable[String] = List("alice", "bob", "carol").toObservable.tail
assertEquals(List("bob", "carol"), o.toBlocking.toList)
assertEquals(List("bob", "carol"), o.toBlocking.toList)
}
@Test(expected = classOf[UnsupportedOperationException])
def testTailWithEmptyObservable(): Unit = {
val o: Observable[String] = List[String]().toObservable.tail
o.toBlocking.toList
}
@Test
def testZipWithIndex(): Unit = {
val o = List("alice", "bob", "carol").toObservable.zipWithIndex.map(_._2)
assertEquals(List(0, 1, 2), o.toBlocking.toList)
assertEquals(List(0, 1, 2), o.toBlocking.toList)
}
@Test
def testSingleOrElse(): Unit = {
val o = Observable.just(1).singleOrElse(2)
assertEquals(1, o.toBlocking.single)
}
@Test
def testSingleOrElseWithEmptyObservable(): Unit = {
val o: Observable[Int] = Observable.empty.singleOrElse(1)
assertEquals(1, o.toBlocking.single)
}
@Test(expected = classOf[IllegalArgumentException])
def testSingleOrElseWithTooManyItems(): Unit = {
Observable.just(1, 2).singleOrElse(1).toBlocking.single
}
@Test
def testSingleOrElseWithCallByName(): Unit = {
var called = false
val o: Observable[Int] = Observable.empty.singleOrElse {
called = true
1
}
assertFalse(called)
o.subscribe()
assertTrue(called)
}
@Test
def testSingleOrElseWithCallByName2(): Unit = {
var called = false
val o = Observable.just(1).singleOrElse {
called = true
2
}
assertFalse(called)
o.subscribe()
assertFalse(called)
}
@Test
def testOrElse(): Unit = {
val o = Observable.just(1, 2, 3).orElse(4)
assertEquals(List(1, 2, 3), o.toBlocking.toList)
}
@Test
def testOrElseWithEmpty(): Unit = {
val o = Observable.empty.orElse(-1)
assertEquals(List(-1), o.toBlocking.toList)
}
@Test
def testToMultiMap(): Unit = {
val o = Observable.just("a", "b", "cc", "dd").toMultiMap(_.length)
val expected = Map(1 -> Set("a", "b"), 2 -> Set("cc", "dd"))
assertEquals(expected, o.toBlocking.single)
}
@Test
def testToMultiMapWithValueSelector(): Unit = {
val o = Observable.just("a", "b", "cc", "dd").toMultiMap(_.length, s => s + s)
val expected = Map(1 -> Set("aa", "bb"), 2 -> Set("cccc", "dddd"))
assertEquals(expected, o.toBlocking.single)
}
@Test
def testToMultiMapWithMapFactory(): Unit = {
val m = new mutable.LinkedHashMap[Int, mutable.Set[String]] with mutable.MultiMap[Int, String]
val o = Observable.just("a", "b", "cc", "dd").toMultiMap(_.length, s => s, m)
val expected = Map(1 -> Set("a", "b"), 2 -> Set("cc", "dd"))
val r = o.toBlocking.single
// r should be the same instance created by the `multiMapFactory`
assertTrue(m eq r)
assertEquals(expected, r)
}
@Test
def testToTraversable(): Unit = {
val o = Observable.just(1, 2, 3).toTraversable
assertEquals(Seq(1, 2, 3), o.toBlocking.single)
}
@Test
def testToList(): Unit = {
val o = Observable.just(1, 2, 3).toList
assertEquals(Seq(1, 2, 3), o.toBlocking.single)
}
@Test
def testToIterable(): Unit = {
val o = Observable.just(1, 2, 3).toIterable
assertEquals(Seq(1, 2, 3), o.toBlocking.single)
}
@Test
def testToIterator(): Unit = {
val o = Observable.just(1, 2, 3).toIterator
assertEquals(Seq(1, 2, 3), o.toBlocking.single.toSeq)
}
@Test
def testToStream(): Unit = {
val o = Observable.just(1, 2, 3).toStream
assertEquals(Seq(1, 2, 3), o.toBlocking.single)
}
@Test
def testToIndexedSeq(): Unit = {
val o = Observable.just(1, 2, 3).toIndexedSeq
assertEquals(Seq(1, 2, 3), o.toBlocking.single)
}
@Test
def testToBuffer(): Unit = {
val o = Observable.just(1, 2, 3).toBuffer
assertEquals(Seq(1, 2, 3), o.toBlocking.single)
}
@Test
def testToSet(): Unit = {
val o = Observable.just(1, 2, 2).toSet
assertEquals(Set(1, 2), o.toBlocking.single)
}
@Test
def testToVector(): Unit = {
val o = Observable.just(1, 2, 3).toVector
assertEquals(Seq(1, 2, 3), o.toBlocking.single)
}
@Test
def testToArray(): Unit = {
val o = Observable.just(1, 2, 3).toArray
assertArrayEquals(Array(1, 2, 3), o.toBlocking.single)
}
@Test
def testFilterNot(): Unit = {
val o = Observable.just(1, 2, 3).filterNot(_ > 2)
assertEquals(List(1, 2), o.toBlocking.toList)
}
@Test
def testCount(): Unit = {
assertEquals(1, Observable.just(1, 2, 3).count(_ > 2).toBlocking.single)
assertEquals(2, Observable.just(1, 2, 3).count(_ <= 2).toBlocking.single)
}
@Test
def testNonEmpty(): Unit = {
assertEquals(false, Observable.empty.nonEmpty.toBlocking.single)
assertEquals(true, Observable.just(1, 2, 3).nonEmpty.toBlocking.single)
}
@Test
def testTailWithBackpressure(): Unit = {
val result = mutable.ListBuffer[Int]()
var completed = false
var error = false
Observable.just(1, 2).tail.subscribe(new Subscriber[Int] {
override def onStart(): Unit = request(1)
override def onNext(v: Int): Unit = {
result += v
request(1)
}
override def onError(e: Throwable): Unit = error = true
override def onCompleted(): Unit = completed = true
})
assertEquals(List(2), result)
assertTrue(completed)
assertFalse(error)
}
@Test
def testToListWithBackpressure(): Unit = {
var result: List[Int] = null
var completed = false
var error = false
Observable.just(1, 2).toList.subscribe(new Subscriber[List[Int]] {
override def onStart(): Unit = request(1)
override def onNext(v: List[Int]): Unit = {
result = v
request(1)
}
override def onError(e: Throwable): Unit = error = true
override def onCompleted(): Unit = completed = true
})
assertEquals(List(1, 2), result)
assertTrue(completed)
assertFalse(error)
}
@Test
def testToMultimapWithBackpressure(): Unit = {
var result: mutable.MultiMap[Int, Int] = null
var completed = false
var error = false
Observable.just(1, 2, 3, 4).toMultiMap(_ % 2).subscribe(new Subscriber[mutable.MultiMap[Int, Int]] {
override def onStart(): Unit = request(1)
override def onNext(v: mutable.MultiMap[Int, Int]): Unit = {
result = v
request(1)
}
override def onError(e: Throwable): Unit = error = true
override def onCompleted(): Unit = completed = true
})
val expected = Map(0 -> Set(2, 4), 1 -> Set(1, 3))
assertEquals(expected, result)
assertTrue(completed)
assertFalse(error)
}
@Test
def testToMap(): Unit = {
val expectedMap1 = (0 to 100).map(i => (i % 2, i)).toMap
val m1 = (0 to 100).toObservable.toMap(_ % 2)
assertEquals(expectedMap1, m1.toBlocking.single)
val expectedMap2 = (0 to 100).map(i => (i % 2, i * 100)).toMap
val m2 = (0 to 100).toObservable.toMap(_ % 2, _ * 100)
assertEquals(expectedMap2, m2.toBlocking.single)
val expectedMap3 = (0 to 100).map(i => (i % 2, i * 100)).toMap
val m3 = (0 to 100).toObservable.map(i => (i % 2, i * 100)).toMap
assertEquals(expectedMap3, m3.toBlocking.single)
}
}
| {
"content_hash": "0b6166b39b88018ba056b0ddee76a4b8",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 107,
"avg_line_length": 29.7808564231738,
"alnum_prop": 0.6472976401928444,
"repo_name": "ReactiveX/RxScala",
"id": "f4132c64c803935530e675010a28b3ec9e618ff4",
"size": "12420",
"binary": false,
"copies": "1",
"ref": "refs/heads/0.x",
"path": "src/test/scala/rx/lang/scala/ObservableTest.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "510819"
},
{
"name": "Shell",
"bytes": "910"
}
],
"symlink_target": ""
} |
[](https://github.com/bigeasy/locket/actions)
[](https://codecov.io/gh/bigeasy/locket)
[](https://opensource.org/licenses/MIT)
<sub>_Salvage Necklace 5: Inside Locket by [B Zedan](http://www.flickr.com/people/bzedan/)._</sub>
<a href="http://www.flickr.com/photos/bzedan/2611547954/" title="Salvage Necklace 5: inside locket by B_Zedan, on Flickr"><img src="http://farm4.staticflickr.com/3273/2611547954_23eff61651_o.jpg" width="722" height="481" alt="Salvage Necklace 5: inside locket"></a>
A pure-JavaScript [leveldown](https://github.com/Level/leveldown) implementation
backed by a persistent and durable evented I/0 b-tree for use with
[levelup](https://github.com/Level/leveldown) — i.e. a database.
| What | Where |
| --- | --- |
| Discussion | https://github.com/bigeasy/locket/issues/1 |
| Documentation | https://bigeasy.github.io/locket |
| Source | https://github.com/bigeasy/locket |
| Issues | https://github.com/bigeasy/locket/issues |
| CI | https://travis-ci.org/bigeasy/locket |
| Coverage: | https://codecov.io/gh/bigeasy/locket |
| License: | MIT |
Locket installs from NPM.
```
//{ "mode": "text" }
npm install locket
```
## Living `README.md`
This `README.md` is also a unit test using the
[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the
Proof `okay` function to assert out statements in the readme. A Proof unit test
generally looks like this.
```javascript
//{ "code": { "tests": 1 }, "text": { "tests": 4 } }
require('proof')(%(tests)d, okay => {
//{ "include": "test", "mode": "code" }
//{ "include": "proof" }
})
```
```javascript
//{ "name": "proof", "mode": "text" }
okay('always okay')
okay(true, 'okay if true')
okay(1, 1, 'okay if equal')
okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')
```
You can run this unit test yourself to see the output from the various
code sections of the readme.
```text
//{ "mode": "text" }
git clone [email protected]:bigeasy/locket.git
cd locket
npm install --no-package-lock --no-save
node test/readme.t.js
```
## Usage
```javascript
//{ "name": "test" }
okay('okay')
```
| {
"content_hash": "8f789aae6b71aaef6dce5ec3ce5c2054",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 265,
"avg_line_length": 35.885714285714286,
"alnum_prop": 0.6353503184713376,
"repo_name": "bigeasy/locket",
"id": "44e510891ef13a149a4e7ee2a1620107aa12f585",
"size": "2522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "edify.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9954"
},
{
"name": "JavaScript",
"bytes": "46489"
},
{
"name": "Shell",
"bytes": "771"
}
],
"symlink_target": ""
} |
package io.scepta.generator.characteristics;
import java.util.Set;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import io.scepta.generator.CharacteristicProcessor;
import io.scepta.model.Characteristic;
import io.scepta.model.Dependency;
import io.scepta.model.Endpoint;
import io.scepta.model.PolicyGroup;
import io.scepta.runtime.SceptaRuntimeVersion;
import io.scepta.server.CharacteristicType;
import io.scepta.util.DOMUtil;
import io.scepta.util.PolicyDefinitionUtil;
/**
* This class implements the 'BatchWithRetryOnFailure' characteristic.
*
*/
public class BatchWithRetryOnFailure implements CharacteristicProcessor {
private static final org.w3c.dom.Element CONSUMER_PRODUCER_TEMPLATE;
private static final org.w3c.dom.Element CONSUMER_ONLY_TEMPLATE;
private static final java.util.Set<Dependency> DEPENDENCIES=new java.util.HashSet<Dependency>();
private static CharacteristicType TYPE;
static {
TYPE = new CharacteristicType().setName(BatchWithRetryOnFailure.class.getSimpleName());
TYPE.getPropertyDescriptors().put("batchSize",
new CharacteristicType.PropertyDescriptor().setMandatory(true).setDefaultValue("100"));
TYPE.getPropertyDescriptors().put("batchInterval",
new CharacteristicType.PropertyDescriptor().setMandatory(true).setDefaultValue("1000"));
TYPE.getPropertyDescriptors().put("maxRetry",
new CharacteristicType.PropertyDescriptor().setMandatory(true).setDefaultValue("3"));
org.w3c.dom.Document cpdoc=null;
org.w3c.dom.Document codoc=null;
try {
cpdoc = DOMUtil.textToDoc(BatchWithRetryOnFailure.class.getResourceAsStream(
"/templates/BatchWithRetryOnFailure-consumer-producer.xml"));
codoc = DOMUtil.textToDoc(BatchWithRetryOnFailure.class.getResourceAsStream(
"/templates/BatchWithRetryOnFailure-consumer-only.xml"));
} catch (Exception e) {
// TODO: ERROR
e.printStackTrace();
}
if (cpdoc != null) {
CONSUMER_PRODUCER_TEMPLATE = cpdoc.getDocumentElement();
} else {
CONSUMER_PRODUCER_TEMPLATE = null;
}
if (codoc != null) {
CONSUMER_ONLY_TEMPLATE = codoc.getDocumentElement();
} else {
CONSUMER_ONLY_TEMPLATE = null;
}
DEPENDENCIES.add(new Dependency()
.setGroupId("io.scepta")
.setArtifactId("scepta-runtime")
.setVersion(SceptaRuntimeVersion.getVersion()));
}
/**
* {@inheritDoc}
*/
@Override
public CharacteristicType getType() {
return (TYPE);
}
/**
* {@inheritDoc}
*/
@Override
public void process(PolicyGroup group, Endpoint endpoint,
Characteristic characteristic, Element elem) {
if (PolicyDefinitionUtil.isOnewayProducer(elem.getNodeName())) {
processProducer(group, endpoint, characteristic, elem);
} else if (PolicyDefinitionUtil.isConsumer(elem.getNodeName())) {
processConsumer(group, endpoint, characteristic, elem);
} else {
// TODO: Decide whether this should be an exception??
}
}
protected void processConsumer(PolicyGroup group, Endpoint endpoint,
Characteristic characteristic, Element elem) {
// Check if element is first action in top level route
if (elem.getParentNode() == null
|| elem.getParentNode().getParentNode() == null
|| !elem.getParentNode().getNodeName().equals("route")
|| !elem.getParentNode().getParentNode().getNodeName().equals("camelContext")) {
return;
}
// Extract final send actions, if using this same characteristic
Element nextActions=elem.getOwnerDocument().createElement("nextActions");
Element containedNodes=elem.getOwnerDocument().createElement("containedActions");
boolean f_findProducers=true;
org.w3c.dom.NodeList nl=elem.getParentNode().getChildNodes();
for (int i=nl.getLength()-1; i >= 0; i--) {
// Check if action is a producer
Node n=nl.item(i);
if (n == elem) {
break;
}
if (n instanceof Element) {
if (f_findProducers) {
f_findProducers = PolicyDefinitionUtil.isOnewayProducer(n.getNodeName());
}
if (f_findProducers) {
// Check if producer is an endpoint
String uri=((Element)n).getAttribute("uri");
String endpointName=PolicyDefinitionUtil.getEndpointName(uri);
if (endpointName != null) {
Endpoint ep=group.getEndpoint(endpointName);
if (ep != null
&& ep.hasCharacteristic(BatchWithRetryOnFailure.class.getSimpleName())) {
DOMUtil.insertFirst(nextActions, n);
continue;
}
}
}
}
DOMUtil.insertFirst(containedNodes, n);
}
applyTemplate(elem, containedNodes, nextActions);
defineRetryAction(elem);
addBean(elem.getOwnerDocument(), "aggregatorStrategy",
io.scepta.runtime.ListAggregator.class.getName());
addBean(elem.getOwnerDocument(), "retrySupport",
io.scepta.runtime.RetrySupport.class.getName());
}
protected void addBean(Document doc, String id, String clsName) {
NodeList nl=doc.getDocumentElement().getElementsByTagName("bean");
boolean f_found=false;
for (int i=0; !f_found && i < nl.getLength(); i++) {
String idAttr=((Element)nl.item(i)).getAttribute("id");
if (idAttr != null && idAttr.equals(id)) {
f_found = true;
}
}
if (!f_found) {
org.w3c.dom.Element bean=doc.createElement("bean");
bean.setAttribute("id", id);
bean.setAttribute("class", clsName);
doc.getDocumentElement().appendChild(bean);
}
}
protected void defineRetryAction(Element elem) {
Element retryRef=(Element)elem.getOwnerDocument().getElementsByTagName("RETRY").item(0);
if (retryRef != null) {
Element newNode=elem.getOwnerDocument().createElement("inOnly");
newNode.setAttribute("uri", elem.getAttribute("uri"));
DOMUtil.replaceNode(retryRef, newNode);
}
}
protected void applyTemplate(Element elem, Element containedNodes, Element nextActions) {
// Apply template
Element template=(Element)elem.getOwnerDocument().importNode(
(nextActions.getChildNodes().getLength() > 0 ? CONSUMER_PRODUCER_TEMPLATE :
CONSUMER_ONLY_TEMPLATE), true);
// Append template nodes after the current element
Element parent=(Element)elem.getParentNode();
while (template.hasChildNodes()) {
parent.appendChild(template.getFirstChild());
}
DOMUtil.replaceNodes((Element)parent.getElementsByTagName("ACTIONS").item(0), containedNodes);
if (nextActions.getChildNodes().getLength() > 0) {
DOMUtil.replaceNodes((Element)parent.getElementsByTagName("NEXT").item(0), nextActions);
}
}
protected void processProducer(PolicyGroup group, Endpoint endpoint,
Characteristic characteristic, Element elem) {
/* 1) Need to add aggregatorStrategy bean at top level if not already defined
* 2) Need to replace the completionSize and completionInterval info with the options
* defined for the characteristic - so that needs to be passed in.
* 3) The actual uri should have been replaced before being passed to this process.
* 4) Ideally we should use a template, that contains some kind of marker where the
* element should be relocated to.
*
<route id="receiveActivityUnit">
<aggregate strategyRef="aggregatorStrategy" completionSize="..." completionInterval="..." >
<correlationExpression>
<constant>true</constant>
</correlationExpression>
<setHeader headerName="retryCount">
<constant>0</constant>
</setHeader>
<inOnly uri="..."/>
</aggregate>
</route>
*/
Element route=elem.getOwnerDocument().createElement("route");
Element aggregate=elem.getOwnerDocument().createElement("aggregate");
route.appendChild(aggregate);
aggregate.setAttribute("strategyRef", "aggregateStrategy");
aggregate.setAttribute("completionSize", characteristic.getProperties().get("batchSize"));
aggregate.setAttribute("completionInterval", characteristic.getProperties().get("batchInterval"));
Element correlationExpression=elem.getOwnerDocument().createElement("correlationExpression");
aggregate.appendChild(correlationExpression);
Element constant1=elem.getOwnerDocument().createElement("constant");
correlationExpression.appendChild(constant1);
Text constant1Text=elem.getOwnerDocument().createTextNode("0");
constant1.appendChild(constant1Text);
Element setHeader=elem.getOwnerDocument().createElement("setHeader");
aggregate.appendChild(setHeader);
setHeader.setAttribute("headerName", "retryCount");
Element constant2=elem.getOwnerDocument().createElement("constant");
setHeader.appendChild(constant2);
Text constant2Text=elem.getOwnerDocument().createTextNode("0");
constant2.appendChild(constant2Text);
// Add new route inplace of supplied element
elem.getParentNode().replaceChild(route, elem);
aggregate.appendChild(elem);
addBean(elem.getOwnerDocument(), "aggregatorStrategy",
io.scepta.runtime.ListAggregator.class.getName());
}
@Override
public Set<Dependency> getDependencies() {
return (DEPENDENCIES);
}
}
| {
"content_hash": "580650b3ff59bddbf0dc8476469b9a0d",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 106,
"avg_line_length": 37.485611510791365,
"alnum_prop": 0.6291142884560023,
"repo_name": "scepta/scepta",
"id": "c0ef013a89b9d805c9d05f891b46f51cfa720b48",
"size": "11098",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/scepta-generator/src/main/java/io/scepta/generator/characteristics/BatchWithRetryOnFailure.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "992"
},
{
"name": "HTML",
"bytes": "38584"
},
{
"name": "Java",
"bytes": "231410"
},
{
"name": "JavaScript",
"bytes": "84638"
},
{
"name": "TypeScript",
"bytes": "37038"
}
],
"symlink_target": ""
} |
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from jsonfield import JSONField
from openslides.utils.models import RESTModelMixin
from .access_permissions import (
ObjectProtocolAccessPermissions,
ProtocolAccessPermissions,
)
class ObjectProtocolManager(models.Manager):
"""
Customized model manager for prefetching content objects.
"""
def get_full_queryset(self):
"""
Returns the normal queryset with all objectProtocols. In the background all
related items are prefetched from the database.
"""
return self.get_queryset().prefetch_related('content_object')
class ObjectProtocol(RESTModelMixin, models.Model):
"""
Model for a protocol entry for an agenda item.
"""
access_permissions = ObjectProtocolAccessPermissions()
objects = ObjectProtocolManager()
content_type = models.ForeignKey(
ContentType,
on_delete=models.SET_NULL,
null=True,
blank=True)
object_id = models.PositiveIntegerField(null=True, blank=True)
content_object = GenericForeignKey()
protocol = models.TextField(blank=True)
class Meta:
default_permissions = ()
permissions = (('can_write_protocol', 'Can write protocol'),)
unique_together = ('content_type', 'object_id')
class Protocol(RESTModelMixin, models.Model):
"""
Model for a protocol entry for an agenda item.
"""
access_permissions = ProtocolAccessPermissions()
protocol = JSONField(default=[])
class Meta:
default_permissions = ()
| {
"content_hash": "7ecc7fb9771d5910c8c8e3b4064b36b3",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 83,
"avg_line_length": 27.883333333333333,
"alnum_prop": 0.6999402271368799,
"repo_name": "OpenSlides/openslides-protocol",
"id": "3c35357bd518007a47eff7eb74af47245a4d9749",
"size": "1673",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "openslides_protocol/models.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "16994"
},
{
"name": "JavaScript",
"bytes": "24114"
},
{
"name": "Python",
"bytes": "14681"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe AliasLine do
before(:each) do
@al = AliasLine.new("gap='git add -p'")
end
it "is created with a string" do
AliasLine.new("gap='git add -p'")
end
it "can tell if it is valid" do
al = AliasLine.new("gap='git add -p'")
al.should be_valid
al = AliasLine.new("gap!LKJDSGHFHSD")
al.should_not be_valid
end
it "returns the alias_name" do
@al.alias_name.should == "gap"
end
it "returns the command" do
@al.command.should == "git add -p"
end
end
| {
"content_hash": "f89d3d0faa4aa84a89d1b2c0adab6c64",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 43,
"avg_line_length": 19.48148148148148,
"alnum_prop": 0.6254752851711026,
"repo_name": "paulmars/huffshell",
"id": "287a9d83f35afad7a6cfa59dfc4a689062a1cdf8",
"size": "526",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/shell/alias_line_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "20568"
},
{
"name": "Shell",
"bytes": "126"
}
],
"symlink_target": ""
} |
<h1><a href="cli/npm.html">npm</a></h1> <p>a JavaScript package manager</p>
<p><a href="https://travis-ci.org/npm/npm"><img src="https://img.shields.io/travis/npm/npm/master.svg" alt="Build Status"></a></p>
<h2 id="synopsis">SYNOPSIS</h2>
<p>This is just enough info to get you up and running.</p>
<p>Much more info available via <code>npm help</code> once it's installed.</p>
<h2 id="important">IMPORTANT</h2>
<p><strong>You need node v0.8 or higher to run this program.</strong></p>
<p>To install an old <strong>and unsupported</strong> version of npm that works on node 0.3
and prior, clone the git repo and dig through the old tags and branches.</p>
<h2 id="super-easy-install">Super Easy Install</h2>
<p>npm comes with <a href="http://nodejs.org/download/">node</a> now.</p>
<h3 id="windows-computers">Windows Computers</h3>
<p><a href="http://nodejs.org/download/">Get the MSI</a>. npm is in it.</p>
<h3 id="apple-macintosh-computers">Apple Macintosh Computers</h3>
<p><a href="http://nodejs.org/download/">Get the pkg</a>. npm is in it.</p>
<h3 id="other-sorts-of-unices">Other Sorts of Unices</h3>
<p>Run <code>make install</code>. npm will be installed with node.</p>
<p>If you want a more fancy pants install (a different version, customized
paths, etc.) then read on.</p>
<h2 id="fancy-install-unix-">Fancy Install (Unix)</h2>
<p>There's a pretty robust install script at
<a href="https://www.npmjs.com/install.sh">https://www.npmjs.com/install.sh</a>. You can download that and run it.</p>
<p>Here's an example using curl:</p>
<pre><code class="lang-sh">curl -L https://www.npmjs.com/install.sh | sh
</code></pre>
<h3 id="slightly-fancier">Slightly Fancier</h3>
<p>You can set any npm configuration params with that script:</p>
<pre><code class="lang-sh">npm_config_prefix=/some/path sh install.sh
</code></pre>
<p>Or, you can run it in uber-debuggery mode:</p>
<pre><code class="lang-sh">npm_debug=1 sh install.sh
</code></pre>
<h3 id="even-fancier">Even Fancier</h3>
<p>Get the code with git. Use <code>make</code> to build the docs and do other stuff.
If you plan on hacking on npm, <code>make link</code> is your friend.</p>
<p>If you've got the npm source code, you can also semi-permanently set
arbitrary config keys using the <code>./configure --key=val ...</code>, and then
run npm commands by doing <code>node cli.js <cmd> <args></code>. (This is helpful
for testing, or running stuff without actually installing npm itself.)</p>
<h2 id="windows-install-or-upgrade">Windows Install or Upgrade</h2>
<p>You can download a zip file from <a href="https://github.com/npm/npm/releases">https://github.com/npm/npm/releases</a>, and
unpack it in the <code>node_modules\npm\</code> folder inside node's installation folder.</p>
<p>To upgrade to npm 2, follow the Windows upgrade instructions in
the npm Troubleshooting Guide:</p>
<p><a href="https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows">https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows</a></p>
<p>If that's not fancy enough for you, then you can fetch the code with
git, and mess with it directly.</p>
<h2 id="installing-on-cygwin">Installing on Cygwin</h2>
<p>No.</p>
<h2 id="uninstalling">Uninstalling</h2>
<p>So sad to see you go.</p>
<pre><code class="lang-sh">sudo npm uninstall npm -g
</code></pre>
<p>Or, if that fails,</p>
<pre><code class="lang-sh">sudo make uninstall
</code></pre>
<h2 id="more-severe-uninstalling">More Severe Uninstalling</h2>
<p>Usually, the above instructions are sufficient. That will remove
npm, but leave behind anything you've installed.</p>
<p>If you would like to remove all the packages that you have installed,
then you can use the <code>npm ls</code> command to find them, and then <code>npm rm</code> to
remove them.</p>
<p>To remove cruft left behind by npm 0.x, you can use the included
<code>clean-old.sh</code> script file. You can run it conveniently like this:</p>
<pre><code class="lang-sh">npm explore npm -g -- sh scripts/clean-old.sh
</code></pre>
<p>npm uses two configuration files, one for per-user configs, and another
for global (every-user) configs. You can view them by doing:</p>
<pre><code class="lang-sh">npm config get userconfig # defaults to ~/.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc
</code></pre>
<p>Uninstalling npm does not remove configuration files by default. You
must remove them yourself manually if you want them gone. Note that
this means that future npm installs will not remember the settings that
you have chosen.</p>
<h2 id="using-npm-programmatically">Using npm Programmatically</h2>
<p>Although npm can be used programmatically, its API is meant for use by the CLI
<em>only</em>, and no guarantees are made regarding its fitness for any other purpose.
If you want to use npm to reliably perform some task, the safest thing to do is
to invoke the desired <code>npm</code> command with appropriate arguments.</p>
<p>The semantic version of npm refers to the CLI itself, rather than the
underlying API. <em>The internal API is not guaranteed to remain stable even when
npm's version indicates no breaking changes have been made according to
semver.</em></p>
<p>If you <em>still</em> would like to use npm programmatically, it's <em>possible</em>. The API
isn't very well documented, but it <em>is</em> rather simple.</p>
<p>Eventually, npm will be just a thin CLI wrapper around the modules that it
depends on, but for now, there are some things that only the CLI can do. You
should try using one of npm's dependencies first, and only use the API if what
you're trying to do is only supported by npm itself.</p>
<pre><code class="lang-javascript">var npm = require("npm")
npm.load(myConfigObject, function (er) {
if (er) return handlError(er)
npm.commands.install(["some", "args"], function (er, data) {
if (er) return commandFailed(er)
// command succeeded, and data might have some info
})
npm.registry.log.on("log", function (message) { .... })
})
</code></pre>
<p>The <code>load</code> function takes an object hash of the command-line configs.
The various <code>npm.commands.<cmd></code> functions take an <strong>array</strong> of
positional argument <strong>strings</strong>. The last argument to any
<code>npm.commands.<cmd></code> function is a callback. Some commands take other
optional arguments. Read the source.</p>
<p>You cannot set configs individually for any single npm function at this
time. Since <code>npm</code> is a singleton, any call to <code>npm.config.set</code> will
change the value for <em>all</em> npm commands in that process.</p>
<p>See <code>./bin/npm-cli.js</code> for an example of pulling config values off of the
command line arguments using nopt. You may also want to check out <code>npm
help config</code> to learn about all the options you can set there.</p>
<h2 id="more-docs">More Docs</h2>
<p>Check out the <a href="https://docs.npmjs.com/">docs</a>,
especially the <a href="https://docs.npmjs.com/misc/faq">faq</a>.</p>
<p>You can use the <code>npm help</code> command to read any of them.</p>
<p>If you're a developer, and you want to use npm to publish your program,
you should <a href="https://docs.npmjs.com/misc/developers">read this</a></p>
<h2 id="legal-stuff">Legal Stuff</h2>
<p>"npm" and "The npm Registry" are owned by npm, Inc.
All rights reserved. See the included LICENSE file for more details.</p>
<p>"Node.js" and "node" are trademarks owned by Joyent, Inc.</p>
<p>Modules published on the npm registry are not officially endorsed by
npm, Inc. or the Node.js project.</p>
<p>Data published to the npm registry is not part of npm itself, and is
the sole property of the publisher. While every effort is made to
ensure accountability, there is absolutely no guarantee, warranty, or
assertion expressed or implied as to the quality, fitness for a
specific purpose, or lack of malice in any given npm package.</p>
<p>If you have a complaint about a package in the public npm registry,
and cannot <a href="https://docs.npmjs.com/misc/disputes">resolve it with the package
owner</a>, please email
<a href="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
<p>Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.</p>
<h3 id="in-plainer-english">In plainer english</h3>
<p>npm is the property of npm, Inc.</p>
<p>If you publish something, it's yours, and you are solely accountable
for it.</p>
<p>If other people publish something, it's theirs.</p>
<p>Users can publish Bad Stuff. It will be removed promptly if reported.
But there is no vetting process for published modules, and you use
them at your own risk. Please inspect the source.</p>
<p>If you publish Bad Stuff, we may delete it from the registry, or even
ban your account in extreme cases. So don't do that.</p>
<h2 id="bugs">BUGS</h2>
<p>When you find issues, please report them:</p>
<ul>
<li>web:
<a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn't work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
<p>You can also look for isaacs in #node.js on irc://irc.freenode.net. He
will no doubt tell you to put the output in a gist or email.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="cli/npm.html">npm(1)</a></li>
<li><a href="misc/npm-faq.html">npm-faq(7)</a></li>
<li><a href="cli/npm-help.html">npm-help(1)</a></li>
<li><a href="misc/npm-index.html">npm-index(7)</a></li>
</ul>
| {
"content_hash": "9243fcf356bef9ab49a6289454d40e8a",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 288,
"avg_line_length": 61.50306748466258,
"alnum_prop": 0.7197007481296758,
"repo_name": "chirilo/ephace12345",
"id": "7aeadc7d5612ca6c01c4218642acbb1da48bd710",
"size": "10025",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/laravel-elixir/node_modules/npm/html/partial/doc/README.html",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "79514"
},
{
"name": "CSS",
"bytes": "443611"
},
{
"name": "HTML",
"bytes": "1003457"
},
{
"name": "JavaScript",
"bytes": "7397012"
},
{
"name": "PHP",
"bytes": "1143498"
}
],
"symlink_target": ""
} |
<?php
namespace OrganisationApi\Controller;
use DvsaCommonApi\Controller\AbstractDvsaRestfulController;
use DvsaCommonApi\Model\ApiResponse;
use OrganisationApi\Service\AuthorisedExaminerService;
class AuthorisedExaminerNameController extends AbstractDvsaRestfulController
{
/**
* @var AuthorisedExaminerService
*/
private $authorisedExaminerService;
public function __construct(
AuthorisedExaminerService $authorisedExaminerService
) {
$this->authorisedExaminerService = $authorisedExaminerService;
$this->setIdentifierName('organisationId');
}
public function get($id)
{
return ApiResponse::jsonOk($this->authorisedExaminerService->getName($id));
}
}
| {
"content_hash": "9161f09ee9bc8b43c05008e0c186f0de",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 83,
"avg_line_length": 27.11111111111111,
"alnum_prop": 0.75,
"repo_name": "dvsa/mot",
"id": "60f1c6e387d92f8be1a33118c47598778a54e21e",
"size": "732",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mot-api/module/OrganisationApi/src/OrganisationApi/Controller/AuthorisedExaminerNameController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "604618"
},
{
"name": "Dockerfile",
"bytes": "2693"
},
{
"name": "Gherkin",
"bytes": "189981"
},
{
"name": "HTML",
"bytes": "1579702"
},
{
"name": "Java",
"bytes": "1631717"
},
{
"name": "JavaScript",
"bytes": "156823"
},
{
"name": "Makefile",
"bytes": "2877"
},
{
"name": "PHP",
"bytes": "20142004"
},
{
"name": "PLpgSQL",
"bytes": "61098"
},
{
"name": "Python",
"bytes": "3354"
},
{
"name": "Ruby",
"bytes": "72"
},
{
"name": "SQLPL",
"bytes": "1739266"
},
{
"name": "Shell",
"bytes": "203709"
}
],
"symlink_target": ""
} |
package com.nortal.jroad.client.test;
import java.lang.reflect.Method;
import org.junit.Assert;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.ContextConfiguration;
import com.nortal.jroad.model.XRoadElement;
/**
* Base class for all X-road service implementation test classes.
*
* @author Roman Tekhov
* @author margush
*/
@ContextConfiguration(locations = { "classpath:client-test-common.xml" })
public abstract class BaseXRoadServiceImplTest extends AbstractJUnit4SpringContextTests {
/**
* Checks interface XRoadElement annotations<br>
* Every get method must have XRoadElement annotation. The annotation title can not by empty and the sequence can not by negative
* @param obj
*/
protected void checkXRoadAnnotation(final Class<?> obj){
Assert.assertNotNull(obj);
for(final Method method : obj.getDeclaredMethods()){
final String methodName = method.getName();
if(methodName.startsWith("get")){
final XRoadElement xroadElement = method.getAnnotation(XRoadElement.class);
Assert.assertFalse(obj.getName() + "#" + methodName + " has no annotation XRoadElement", xroadElement == null);
Assert.assertTrue(obj.getName() + "#" + methodName + " XRoadElement title is empty", xroadElement.title() != null && xroadElement.title().trim().length() > 0);
Assert.assertTrue(obj.getName() + "#" + methodName + " XRoadElement sequence is negative or 0", xroadElement.sequence() > 0);
}
}
}
}
| {
"content_hash": "c871157d19dd082999c9bad99c03807b",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 163,
"avg_line_length": 38.94871794871795,
"alnum_prop": 0.7432521395655036,
"repo_name": "nortal/j-road",
"id": "43fe1f7c432e0d5e7721ccb97d6428e94285a3fa",
"size": "1519",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "client-service/test/src/main/java/com/nortal/jroad/client/test/BaseXRoadServiceImplTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "978638"
},
{
"name": "Shell",
"bytes": "416"
}
],
"symlink_target": ""
} |
// Based on:
// of some code of 3Dlabs Inc. Ltd.
// and http://stackoverflow.com/questions/11365399/opengl-shader-a-spotlight-and-a-directional-light?answertab=active#tab-top
#version 100
#define FALSE 0
#define MAX_LIGHTS 8
struct Material {
vec4 ambient;
vec4 diffuse;
vec4 specular;
vec4 emission;
float shininess;
};
struct Light {
int enabled;
vec4 ambient;
vec4 diffuse;
vec4 specular;
vec4 position;
vec3 spotDirection;
float spotExponent;
float spotCosCutoff;
float constantAttenuation;
float linearAttenuation;
float quadraticAttenuation;
};
// standard layouts
attribute vec3 inVertex;
attribute vec3 inNormal;
attribute vec2 inTextureUV;
// uniforms
uniform mat4 mvpMatrix;
uniform mat4 mvMatrix;
uniform mat4 normalMatrix;
uniform vec4 sceneColor;
uniform vec4 effectColorMul;
uniform Material material;
uniform Light lights[MAX_LIGHTS];
// will be passed to fragment shader
varying vec2 fragTextureUV;
varying vec4 fragColor;
void computeLight(in int i, in vec3 normal, in vec3 position) {
vec3 lightDirection = lights[i].position.xyz - position.xyz;
float lightDistance = length(lightDirection);
lightDirection = normalize(lightDirection);
vec3 eyeDirection = normalize(-position);
vec3 reflectionDirection = normalize(reflect(-lightDirection, normal));
// compute attenuation
float lightAttenuation =
1.0 /
(
lights[i].constantAttenuation +
lights[i].linearAttenuation * lightDistance +
lights[i].quadraticAttenuation * lightDistance * lightDistance
);
// see if point on surface is inside cone of illumination
float lightSpotDot = dot(-lightDirection, normalize(lights[i].spotDirection));
float lightSpotAttenuation = 0.0;
if (lightSpotDot >= lights[i].spotCosCutoff) {
lightSpotAttenuation = pow(lightSpotDot, lights[i].spotExponent);
}
// Combine the spotlight and distance attenuation.
lightAttenuation *= lightSpotAttenuation;
// add color components to fragment color
fragColor+=
clamp(lights[i].ambient * material.ambient, 0.0, 1.0) +
clamp(lights[i].diffuse * material.diffuse * max(dot(normal, lightDirection), 0.0) * lightAttenuation, 0.0, 1.0) +
clamp(lights[i].specular * material.specular * pow(max(dot(reflectionDirection, eyeDirection), 0.0), 0.3 * material.shininess) * lightAttenuation, 0.0, 1.0);
}
void computeLights(in vec3 normal, in vec3 position) {
// process each light
for (int i = 0; i < MAX_LIGHTS; i++) {
// skip on disabled lights
if (lights[i].enabled == FALSE) continue;
// compute light
computeLight(i, normal, position);
}
}
void main(void) {
// pass texture uv to fragment shader
fragTextureUV = inTextureUV;
//
fragColor = vec4(0.0, 0.0, 0.0, 0.0);
fragColor+= clamp(sceneColor, 0.0, 1.0);
fragColor+= clamp(material.emission, 0.0, 1.0);
// compute gl position
gl_Position = mvpMatrix * vec4(inVertex, 1.0);
// Eye-coordinate position of vertex, needed in various calculations
vec4 position4 = mvMatrix * vec4(inVertex, 1.0);
vec3 position = position4.xyz / position4.w;
// compute the normal
vec3 normal = normalize(vec3(normalMatrix * vec4(inNormal, 0.0)));
// compute lights
computeLights(normal, position);
// take effect colors into account
fragColor = fragColor * effectColorMul;
fragColor.a = material.diffuse.a * effectColorMul.a;
}
| {
"content_hash": "aaac7f575011001b1ccf8cb8ca183cd3",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 159,
"avg_line_length": 27.081967213114755,
"alnum_prop": 0.7406174334140436,
"repo_name": "andreasdr/tdme",
"id": "587a114a38b5bf2e5fbe7a59a6e774de55c4a479",
"size": "6112",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "shader/gles2/lighting/render_vertexshader.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "41107"
},
{
"name": "HTML",
"bytes": "9159"
},
{
"name": "Java",
"bytes": "2029963"
}
],
"symlink_target": ""
} |
HackerRank
This repository holds solutions in various languages for miscellaneous problems from HackerRank.
It's mostly used for practicing random things and learning new languages, but I'll happily accept any pull requests if you want to add a valid solution in your favorite language.
If you find any issues with the solutions in the repository because problem statements have changed over time, open an issue and I'll check it out.
| {
"content_hash": "301f3646a129aacd142280c70689f3cc",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 178,
"avg_line_length": 62.57142857142857,
"alnum_prop": 0.817351598173516,
"repo_name": "Sammy-39/HackerRank",
"id": "9d69cb165abdd636fcb22edc18d53cf6631ac3da",
"size": "438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package org.rundeck.core.auth.app.type;
import org.rundeck.core.auth.access.AuthorizingIdResource;
import org.rundeck.core.auth.access.ProjectIdentifier;
import org.rundeck.core.auth.access.Singleton;
/**
* Authorizing interface to singleton Adhoc type within a project
*/
public interface AuthorizingProjectAdhoc
extends AuthorizingIdResource<Singleton, ProjectIdentifier>
{
}
| {
"content_hash": "0a1a525f9eb62ae28d68dff69a11ad7e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 67,
"avg_line_length": 30,
"alnum_prop": 0.8076923076923077,
"repo_name": "rundeck/rundeck",
"id": "e8e19f05b7b13978e36628485a8e1a5aa4287e37",
"size": "390",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "rundeck-authz/rundeck-authz-core/src/main/java/org/rundeck/core/auth/app/type/AuthorizingProjectAdhoc.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "416"
},
{
"name": "CSS",
"bytes": "65926"
},
{
"name": "Dockerfile",
"bytes": "16378"
},
{
"name": "Groovy",
"bytes": "11005411"
},
{
"name": "HTML",
"bytes": "7785"
},
{
"name": "Java",
"bytes": "4652516"
},
{
"name": "JavaScript",
"bytes": "2131949"
},
{
"name": "Less",
"bytes": "38211"
},
{
"name": "SCSS",
"bytes": "563997"
},
{
"name": "Shell",
"bytes": "502828"
},
{
"name": "TypeScript",
"bytes": "417941"
},
{
"name": "Vue",
"bytes": "570171"
}
],
"symlink_target": ""
} |
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.engine.impl.json;
import java.io.Reader;
import java.io.Writer;
import java.util.List;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.impl.util.json.JSONArray;
/**
* @author Tom Baeyens
*/
public class JsonListConverter<T> {
JsonObjectConverter<T> jsonObjectConverter;
public JsonListConverter(JsonObjectConverter<T> jsonObjectConverter) {
this.jsonObjectConverter = jsonObjectConverter;
}
public void toJson(List<T> list, Writer writer) {
toJsonArray(list).write(writer);
}
public String toJson(List<T> list) {
return toJsonArray(list).toString();
}
public String toJson(List<T> list, int indentFactor) {
return toJsonArray(list).toString(indentFactor);
}
private JSONArray toJsonArray(List<T> objects) {
JSONArray jsonArray = new JSONArray();
for (T object: objects) {
jsonArray.put(jsonObjectConverter.toJsonObject(object));
}
return jsonArray;
}
public List<T> toObject(Reader reader) {
throw new ActivitiException("not yet implemented");
}
public JsonObjectConverter<T> getJsonObjectConverter() {
return jsonObjectConverter;
}
public void setJsonObjectConverter(JsonObjectConverter<T> jsonObjectConverter) {
this.jsonObjectConverter = jsonObjectConverter;
}
}
| {
"content_hash": "92dbf3edf19c5fd97dc7e90ffb75557a",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 82,
"avg_line_length": 29.375,
"alnum_prop": 0.7367021276595744,
"repo_name": "springvelocity/xbpm5",
"id": "b5483cc3848cfae2a980b1c496fe46f2d41d0bf8",
"size": "1880",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "activiti-engine/src/main/java/org/activiti/engine/impl/json/JsonListConverter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "4980251"
},
{
"name": "Shell",
"bytes": "250"
}
],
"symlink_target": ""
} |
/*!
* \file
* \brief Texture format utilities.
*//*--------------------------------------------------------------------*/
#include "gluTextureUtil.hpp"
#include "gluRenderContext.hpp"
#include "gluContextInfo.hpp"
#include "tcuTextureUtil.hpp"
#include "tcuFormatUtil.hpp"
#include "glwEnums.hpp"
namespace glu
{
using std::string;
/*--------------------------------------------------------------------*//*!
* \brief Map tcu::TextureFormat to GL pixel transfer format.
*
* Maps generic texture format description to GL pixel transfer format.
* If no mapping is found, throws tcu::InternalError.
*
* \param texFormat Generic texture format.
* \return GL pixel transfer format.
*//*--------------------------------------------------------------------*/
TransferFormat getTransferFormat (tcu::TextureFormat texFormat)
{
using tcu::TextureFormat;
deUint32 format = GL_NONE;
deUint32 type = GL_NONE;
bool isInt = false;
switch (texFormat.type)
{
case TextureFormat::SIGNED_INT8:
case TextureFormat::SIGNED_INT16:
case TextureFormat::SIGNED_INT32:
case TextureFormat::UNSIGNED_INT8:
case TextureFormat::UNSIGNED_INT16:
case TextureFormat::UNSIGNED_INT32:
case TextureFormat::UNSIGNED_INT_1010102_REV:
isInt = true;
break;
default:
isInt = false;
break;
}
switch (texFormat.order)
{
case TextureFormat::A: format = GL_ALPHA; break;
case TextureFormat::L: format = GL_LUMINANCE; break;
case TextureFormat::LA: format = GL_LUMINANCE_ALPHA; break;
case TextureFormat::R: format = isInt ? GL_RED_INTEGER : GL_RED; break;
case TextureFormat::RG: format = isInt ? GL_RG_INTEGER : GL_RG; break;
case TextureFormat::RGB: format = isInt ? GL_RGB_INTEGER : GL_RGB; break;
case TextureFormat::RGBA: format = isInt ? GL_RGBA_INTEGER : GL_RGBA; break;
case TextureFormat::sRGB: format = GL_RGB; break;
case TextureFormat::sRGBA: format = GL_RGBA; break;
case TextureFormat::D: format = GL_DEPTH_COMPONENT; break;
case TextureFormat::DS: format = GL_DEPTH_STENCIL; break;
case TextureFormat::S: format = GL_STENCIL_INDEX; break;
default:
DE_ASSERT(false);
}
switch (texFormat.type)
{
case TextureFormat::SNORM_INT8: type = GL_BYTE; break;
case TextureFormat::SNORM_INT16: type = GL_SHORT; break;
case TextureFormat::UNORM_INT8: type = GL_UNSIGNED_BYTE; break;
case TextureFormat::UNORM_INT16: type = GL_UNSIGNED_SHORT; break;
case TextureFormat::UNORM_SHORT_565: type = GL_UNSIGNED_SHORT_5_6_5; break;
case TextureFormat::UNORM_SHORT_4444: type = GL_UNSIGNED_SHORT_4_4_4_4; break;
case TextureFormat::UNORM_SHORT_5551: type = GL_UNSIGNED_SHORT_5_5_5_1; break;
case TextureFormat::SIGNED_INT8: type = GL_BYTE; break;
case TextureFormat::SIGNED_INT16: type = GL_SHORT; break;
case TextureFormat::SIGNED_INT32: type = GL_INT; break;
case TextureFormat::UNSIGNED_INT8: type = GL_UNSIGNED_BYTE; break;
case TextureFormat::UNSIGNED_INT16: type = GL_UNSIGNED_SHORT; break;
case TextureFormat::UNSIGNED_INT32: type = GL_UNSIGNED_INT; break;
case TextureFormat::FLOAT: type = GL_FLOAT; break;
case TextureFormat::UNORM_INT_101010: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
case TextureFormat::UNORM_INT_1010102_REV: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
case TextureFormat::UNSIGNED_INT_1010102_REV: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: type = GL_UNSIGNED_INT_10F_11F_11F_REV; break;
case TextureFormat::UNSIGNED_INT_999_E5_REV: type = GL_UNSIGNED_INT_5_9_9_9_REV; break;
case TextureFormat::HALF_FLOAT: type = GL_HALF_FLOAT; break;
case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV; break;
case TextureFormat::UNSIGNED_INT_24_8: type = texFormat.order == TextureFormat::D
? GL_UNSIGNED_INT
: GL_UNSIGNED_INT_24_8; break;
default:
throw tcu::InternalError("Can't map texture format to GL transfer format");
}
return TransferFormat(format, type);
}
/*--------------------------------------------------------------------*//*!
* \brief Map tcu::TextureFormat to GL internal sized format.
*
* Maps generic texture format description to GL internal format.
* If no mapping is found, throws tcu::InternalError.
*
* \param texFormat Generic texture format.
* \return GL sized internal format.
*//*--------------------------------------------------------------------*/
deUint32 getInternalFormat (tcu::TextureFormat texFormat)
{
DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELORDER_LAST < (1<<16));
DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELTYPE_LAST < (1<<16));
#define PACK_FMT(ORDER, TYPE) ((int(ORDER) << 16) | int(TYPE))
#define FMT_CASE(ORDER, TYPE) PACK_FMT(tcu::TextureFormat::ORDER, tcu::TextureFormat::TYPE)
switch (PACK_FMT(texFormat.order, texFormat.type))
{
case FMT_CASE(RGBA, UNORM_SHORT_5551): return GL_RGB5_A1;
case FMT_CASE(RGBA, UNORM_SHORT_4444): return GL_RGBA4;
case FMT_CASE(RGB, UNORM_SHORT_565): return GL_RGB565;
case FMT_CASE(D, UNORM_INT16): return GL_DEPTH_COMPONENT16;
case FMT_CASE(S, UNSIGNED_INT8): return GL_STENCIL_INDEX8;
case FMT_CASE(RGBA, FLOAT): return GL_RGBA32F;
case FMT_CASE(RGBA, SIGNED_INT32): return GL_RGBA32I;
case FMT_CASE(RGBA, UNSIGNED_INT32): return GL_RGBA32UI;
case FMT_CASE(RGBA, UNORM_INT16): return GL_RGBA16;
case FMT_CASE(RGBA, SNORM_INT16): return GL_RGBA16_SNORM;
case FMT_CASE(RGBA, HALF_FLOAT): return GL_RGBA16F;
case FMT_CASE(RGBA, SIGNED_INT16): return GL_RGBA16I;
case FMT_CASE(RGBA, UNSIGNED_INT16): return GL_RGBA16UI;
case FMT_CASE(RGBA, UNORM_INT8): return GL_RGBA8;
case FMT_CASE(RGBA, SIGNED_INT8): return GL_RGBA8I;
case FMT_CASE(RGBA, UNSIGNED_INT8): return GL_RGBA8UI;
case FMT_CASE(sRGBA, UNORM_INT8): return GL_SRGB8_ALPHA8;
case FMT_CASE(RGBA, UNORM_INT_1010102_REV): return GL_RGB10_A2;
case FMT_CASE(RGBA, UNSIGNED_INT_1010102_REV): return GL_RGB10_A2UI;
case FMT_CASE(RGBA, SNORM_INT8): return GL_RGBA8_SNORM;
case FMT_CASE(RGB, UNORM_INT8): return GL_RGB8;
case FMT_CASE(RGB, UNSIGNED_INT_11F_11F_10F_REV): return GL_R11F_G11F_B10F;
case FMT_CASE(RGB, FLOAT): return GL_RGB32F;
case FMT_CASE(RGB, SIGNED_INT32): return GL_RGB32I;
case FMT_CASE(RGB, UNSIGNED_INT32): return GL_RGB32UI;
case FMT_CASE(RGB, UNORM_INT16): return GL_RGB16;
case FMT_CASE(RGB, SNORM_INT16): return GL_RGB16_SNORM;
case FMT_CASE(RGB, HALF_FLOAT): return GL_RGB16F;
case FMT_CASE(RGB, SIGNED_INT16): return GL_RGB16I;
case FMT_CASE(RGB, UNSIGNED_INT16): return GL_RGB16UI;
case FMT_CASE(RGB, SNORM_INT8): return GL_RGB8_SNORM;
case FMT_CASE(RGB, SIGNED_INT8): return GL_RGB8I;
case FMT_CASE(RGB, UNSIGNED_INT8): return GL_RGB8UI;
case FMT_CASE(sRGB, UNORM_INT8): return GL_SRGB8;
case FMT_CASE(RGB, UNSIGNED_INT_999_E5_REV): return GL_RGB9_E5;
case FMT_CASE(RGB, UNORM_INT_1010102_REV): return GL_RGB10;
case FMT_CASE(RG, FLOAT): return GL_RG32F;
case FMT_CASE(RG, SIGNED_INT32): return GL_RG32I;
case FMT_CASE(RG, UNSIGNED_INT32): return GL_RG32UI;
case FMT_CASE(RG, UNORM_INT16): return GL_RG16;
case FMT_CASE(RG, SNORM_INT16): return GL_RG16_SNORM;
case FMT_CASE(RG, HALF_FLOAT): return GL_RG16F;
case FMT_CASE(RG, SIGNED_INT16): return GL_RG16I;
case FMT_CASE(RG, UNSIGNED_INT16): return GL_RG16UI;
case FMT_CASE(RG, UNORM_INT8): return GL_RG8;
case FMT_CASE(RG, SIGNED_INT8): return GL_RG8I;
case FMT_CASE(RG, UNSIGNED_INT8): return GL_RG8UI;
case FMT_CASE(RG, SNORM_INT8): return GL_RG8_SNORM;
case FMT_CASE(R, FLOAT): return GL_R32F;
case FMT_CASE(R, SIGNED_INT32): return GL_R32I;
case FMT_CASE(R, UNSIGNED_INT32): return GL_R32UI;
case FMT_CASE(R, UNORM_INT16): return GL_R16;
case FMT_CASE(R, SNORM_INT16): return GL_R16_SNORM;
case FMT_CASE(R, HALF_FLOAT): return GL_R16F;
case FMT_CASE(R, SIGNED_INT16): return GL_R16I;
case FMT_CASE(R, UNSIGNED_INT16): return GL_R16UI;
case FMT_CASE(R, UNORM_INT8): return GL_R8;
case FMT_CASE(R, SIGNED_INT8): return GL_R8I;
case FMT_CASE(R, UNSIGNED_INT8): return GL_R8UI;
case FMT_CASE(R, SNORM_INT8): return GL_R8_SNORM;
case FMT_CASE(D, FLOAT): return GL_DEPTH_COMPONENT32F;
case FMT_CASE(D, UNSIGNED_INT_24_8): return GL_DEPTH_COMPONENT24;
case FMT_CASE(D, UNSIGNED_INT32): return GL_DEPTH_COMPONENT32;
case FMT_CASE(DS, FLOAT_UNSIGNED_INT_24_8_REV): return GL_DEPTH32F_STENCIL8;
case FMT_CASE(DS, UNSIGNED_INT_24_8): return GL_DEPTH24_STENCIL8;
default:
throw tcu::InternalError("Can't map texture format to GL internal format");
}
}
/*--------------------------------------------------------------------*//*!
* \brief Map generic compressed format to GL compressed format enum.
*
* Maps generic compressed format to GL compressed format enum value.
* If no mapping is found, throws tcu::InternalError.
*
* \param format Generic compressed format.
* \return GL compressed texture format.
*//*--------------------------------------------------------------------*/
deUint32 getGLFormat (tcu::CompressedTexture::Format format)
{
switch (format)
{
case tcu::CompressedTexture::ETC1_RGB8: return GL_ETC1_RGB8_OES;
case tcu::CompressedTexture::EAC_R11: return GL_COMPRESSED_R11_EAC;
case tcu::CompressedTexture::EAC_SIGNED_R11: return GL_COMPRESSED_SIGNED_R11_EAC;
case tcu::CompressedTexture::EAC_RG11: return GL_COMPRESSED_RG11_EAC;
case tcu::CompressedTexture::EAC_SIGNED_RG11: return GL_COMPRESSED_SIGNED_RG11_EAC;
case tcu::CompressedTexture::ETC2_RGB8: return GL_COMPRESSED_RGB8_ETC2;
case tcu::CompressedTexture::ETC2_SRGB8: return GL_COMPRESSED_SRGB8_ETC2;
case tcu::CompressedTexture::ETC2_RGB8_PUNCHTHROUGH_ALPHA1: return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
case tcu::CompressedTexture::ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: return GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
case tcu::CompressedTexture::ETC2_EAC_RGBA8: return GL_COMPRESSED_RGBA8_ETC2_EAC;
case tcu::CompressedTexture::ETC2_EAC_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
case tcu::CompressedTexture::ASTC_4x4_RGBA: return GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
case tcu::CompressedTexture::ASTC_5x4_RGBA: return GL_COMPRESSED_RGBA_ASTC_5x4_KHR;
case tcu::CompressedTexture::ASTC_5x5_RGBA: return GL_COMPRESSED_RGBA_ASTC_5x5_KHR;
case tcu::CompressedTexture::ASTC_6x5_RGBA: return GL_COMPRESSED_RGBA_ASTC_6x5_KHR;
case tcu::CompressedTexture::ASTC_6x6_RGBA: return GL_COMPRESSED_RGBA_ASTC_6x6_KHR;
case tcu::CompressedTexture::ASTC_8x5_RGBA: return GL_COMPRESSED_RGBA_ASTC_8x5_KHR;
case tcu::CompressedTexture::ASTC_8x6_RGBA: return GL_COMPRESSED_RGBA_ASTC_8x6_KHR;
case tcu::CompressedTexture::ASTC_8x8_RGBA: return GL_COMPRESSED_RGBA_ASTC_8x8_KHR;
case tcu::CompressedTexture::ASTC_10x5_RGBA: return GL_COMPRESSED_RGBA_ASTC_10x5_KHR;
case tcu::CompressedTexture::ASTC_10x6_RGBA: return GL_COMPRESSED_RGBA_ASTC_10x6_KHR;
case tcu::CompressedTexture::ASTC_10x8_RGBA: return GL_COMPRESSED_RGBA_ASTC_10x8_KHR;
case tcu::CompressedTexture::ASTC_10x10_RGBA: return GL_COMPRESSED_RGBA_ASTC_10x10_KHR;
case tcu::CompressedTexture::ASTC_12x10_RGBA: return GL_COMPRESSED_RGBA_ASTC_12x10_KHR;
case tcu::CompressedTexture::ASTC_12x12_RGBA: return GL_COMPRESSED_RGBA_ASTC_12x12_KHR;
case tcu::CompressedTexture::ASTC_4x4_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
case tcu::CompressedTexture::ASTC_5x4_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;
case tcu::CompressedTexture::ASTC_5x5_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;
case tcu::CompressedTexture::ASTC_6x5_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;
case tcu::CompressedTexture::ASTC_6x6_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
case tcu::CompressedTexture::ASTC_8x5_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;
case tcu::CompressedTexture::ASTC_8x6_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;
case tcu::CompressedTexture::ASTC_8x8_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
case tcu::CompressedTexture::ASTC_10x5_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;
case tcu::CompressedTexture::ASTC_10x6_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;
case tcu::CompressedTexture::ASTC_10x8_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;
case tcu::CompressedTexture::ASTC_10x10_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;
case tcu::CompressedTexture::ASTC_12x10_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;
case tcu::CompressedTexture::ASTC_12x12_SRGB8_ALPHA8: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
default:
throw tcu::InternalError("Can't map compressed format to GL format");
}
}
static tcu::TextureFormat::ChannelType mapGLChannelType (deUint32 dataType, bool normalized)
{
// \note Normalized bit is ignored where it doesn't apply.
using tcu::TextureFormat;
switch (dataType)
{
case GL_UNSIGNED_BYTE: return normalized ? TextureFormat::UNORM_INT8 : TextureFormat::UNSIGNED_INT8;
case GL_BYTE: return normalized ? TextureFormat::SNORM_INT8 : TextureFormat::SIGNED_INT8;
case GL_UNSIGNED_SHORT: return normalized ? TextureFormat::UNORM_INT16 : TextureFormat::UNSIGNED_INT16;
case GL_SHORT: return normalized ? TextureFormat::SNORM_INT16 : TextureFormat::SIGNED_INT16;
case GL_UNSIGNED_INT: return normalized ? TextureFormat::UNORM_INT32 : TextureFormat::UNSIGNED_INT32;
case GL_INT: return normalized ? TextureFormat::SNORM_INT32 : TextureFormat::SIGNED_INT32;
case GL_FLOAT: return TextureFormat::FLOAT;
case GL_UNSIGNED_SHORT_4_4_4_4: return TextureFormat::UNORM_SHORT_4444;
case GL_UNSIGNED_SHORT_5_5_5_1: return TextureFormat::UNORM_SHORT_5551;
case GL_UNSIGNED_SHORT_5_6_5: return TextureFormat::UNORM_SHORT_565;
case GL_HALF_FLOAT: return TextureFormat::HALF_FLOAT;
case GL_UNSIGNED_INT_2_10_10_10_REV: return normalized ? TextureFormat::UNORM_INT_1010102_REV : TextureFormat::UNSIGNED_INT_1010102_REV;
case GL_UNSIGNED_INT_10F_11F_11F_REV: return TextureFormat::UNSIGNED_INT_11F_11F_10F_REV;
case GL_UNSIGNED_INT_24_8: return TextureFormat::UNSIGNED_INT_24_8;
case GL_FLOAT_32_UNSIGNED_INT_24_8_REV: return TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV;
case GL_UNSIGNED_INT_5_9_9_9_REV: return TextureFormat::UNSIGNED_INT_999_E5_REV;
default:
DE_ASSERT(false);
return TextureFormat::CHANNELTYPE_LAST;
}
}
/*--------------------------------------------------------------------*//*!
* \brief Map GL pixel transfer format to tcu::TextureFormat.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param format GL pixel format.
* \param dataType GL data type.
* \return Generic texture format.
*//*--------------------------------------------------------------------*/
tcu::TextureFormat mapGLTransferFormat (deUint32 format, deUint32 dataType)
{
using tcu::TextureFormat;
switch (format)
{
case GL_ALPHA: return TextureFormat(TextureFormat::A, mapGLChannelType(dataType, true));
case GL_LUMINANCE: return TextureFormat(TextureFormat::L, mapGLChannelType(dataType, true));
case GL_LUMINANCE_ALPHA: return TextureFormat(TextureFormat::LA, mapGLChannelType(dataType, true));
case GL_RGB: return TextureFormat(TextureFormat::RGB, mapGLChannelType(dataType, true));
case GL_RGBA: return TextureFormat(TextureFormat::RGBA, mapGLChannelType(dataType, true));
case GL_BGRA: return TextureFormat(TextureFormat::BGRA, mapGLChannelType(dataType, true));
case GL_RG: return TextureFormat(TextureFormat::RG, mapGLChannelType(dataType, true));
case GL_RED: return TextureFormat(TextureFormat::R, mapGLChannelType(dataType, true));
case GL_RGBA_INTEGER: return TextureFormat(TextureFormat::RGBA, mapGLChannelType(dataType, false));
case GL_RGB_INTEGER: return TextureFormat(TextureFormat::RGB, mapGLChannelType(dataType, false));
case GL_RG_INTEGER: return TextureFormat(TextureFormat::RG, mapGLChannelType(dataType, false));
case GL_RED_INTEGER: return TextureFormat(TextureFormat::R, mapGLChannelType(dataType, false));
case GL_DEPTH_COMPONENT: return TextureFormat(TextureFormat::D, mapGLChannelType(dataType, true));
case GL_DEPTH_STENCIL: return TextureFormat(TextureFormat::DS, mapGLChannelType(dataType, true));
default:
throw tcu::InternalError(string("Can't map GL pixel format (") + tcu::toHex(format).toString() + ", " + tcu::toHex(dataType).toString() + ") to texture format");
}
}
/*--------------------------------------------------------------------*//*!
* \brief Map GL internal texture format to tcu::TextureFormat.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param internalFormat Sized internal format.
* \return Generic texture format.
*//*--------------------------------------------------------------------*/
tcu::TextureFormat mapGLInternalFormat (deUint32 internalFormat)
{
using tcu::TextureFormat;
switch (internalFormat)
{
case GL_RGB5_A1: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_SHORT_5551);
case GL_RGBA4: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_SHORT_4444);
case GL_RGB565: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_SHORT_565);
case GL_DEPTH_COMPONENT16: return TextureFormat(TextureFormat::D, TextureFormat::UNORM_INT16);
case GL_STENCIL_INDEX8: return TextureFormat(TextureFormat::S, TextureFormat::UNSIGNED_INT8);
case GL_RGBA32F: return TextureFormat(TextureFormat::RGBA, TextureFormat::FLOAT);
case GL_RGBA32I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT32);
case GL_RGBA32UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT32);
case GL_RGBA16: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT16);
case GL_RGBA16_SNORM: return TextureFormat(TextureFormat::RGBA, TextureFormat::SNORM_INT16);
case GL_RGBA16F: return TextureFormat(TextureFormat::RGBA, TextureFormat::HALF_FLOAT);
case GL_RGBA16I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT16);
case GL_RGBA16UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT16);
case GL_RGBA8: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8);
case GL_RGBA8I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT8);
case GL_RGBA8UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT8);
case GL_SRGB8_ALPHA8: return TextureFormat(TextureFormat::sRGBA, TextureFormat::UNORM_INT8);
case GL_RGB10_A2: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT_1010102_REV);
case GL_RGB10_A2UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT_1010102_REV);
case GL_RGBA8_SNORM: return TextureFormat(TextureFormat::RGBA, TextureFormat::SNORM_INT8);
case GL_RGB8: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT8);
case GL_R11F_G11F_B10F: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT_11F_11F_10F_REV);
case GL_RGB32F: return TextureFormat(TextureFormat::RGB, TextureFormat::FLOAT);
case GL_RGB32I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT32);
case GL_RGB32UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT32);
case GL_RGB16: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT16);
case GL_RGB16_SNORM: return TextureFormat(TextureFormat::RGB, TextureFormat::SNORM_INT16);
case GL_RGB16F: return TextureFormat(TextureFormat::RGB, TextureFormat::HALF_FLOAT);
case GL_RGB16I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT16);
case GL_RGB16UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT16);
case GL_RGB8_SNORM: return TextureFormat(TextureFormat::RGB, TextureFormat::SNORM_INT8);
case GL_RGB8I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT8);
case GL_RGB8UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT8);
case GL_SRGB8: return TextureFormat(TextureFormat::sRGB, TextureFormat::UNORM_INT8);
case GL_RGB9_E5: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT_999_E5_REV);
case GL_RGB10: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT_1010102_REV);
case GL_RG32F: return TextureFormat(TextureFormat::RG, TextureFormat::FLOAT);
case GL_RG32I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT32);
case GL_RG32UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT32);
case GL_RG16: return TextureFormat(TextureFormat::RG, TextureFormat::UNORM_INT16);
case GL_RG16_SNORM: return TextureFormat(TextureFormat::RG, TextureFormat::SNORM_INT16);
case GL_RG16F: return TextureFormat(TextureFormat::RG, TextureFormat::HALF_FLOAT);
case GL_RG16I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT16);
case GL_RG16UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT16);
case GL_RG8: return TextureFormat(TextureFormat::RG, TextureFormat::UNORM_INT8);
case GL_RG8I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT8);
case GL_RG8UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT8);
case GL_RG8_SNORM: return TextureFormat(TextureFormat::RG, TextureFormat::SNORM_INT8);
case GL_R32F: return TextureFormat(TextureFormat::R, TextureFormat::FLOAT);
case GL_R32I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT32);
case GL_R32UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32);
case GL_R16: return TextureFormat(TextureFormat::R, TextureFormat::UNORM_INT16);
case GL_R16_SNORM: return TextureFormat(TextureFormat::R, TextureFormat::SNORM_INT16);
case GL_R16F: return TextureFormat(TextureFormat::R, TextureFormat::HALF_FLOAT);
case GL_R16I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT16);
case GL_R16UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT16);
case GL_R8: return TextureFormat(TextureFormat::R, TextureFormat::UNORM_INT8);
case GL_R8I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT8);
case GL_R8UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT8);
case GL_R8_SNORM: return TextureFormat(TextureFormat::R, TextureFormat::SNORM_INT8);
case GL_DEPTH_COMPONENT32F: return TextureFormat(TextureFormat::D, TextureFormat::FLOAT);
case GL_DEPTH_COMPONENT24: return TextureFormat(TextureFormat::D, TextureFormat::UNSIGNED_INT_24_8);
case GL_DEPTH_COMPONENT32: return TextureFormat(TextureFormat::D, TextureFormat::UNSIGNED_INT32);
case GL_DEPTH32F_STENCIL8: return TextureFormat(TextureFormat::DS, TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV);
case GL_DEPTH24_STENCIL8: return TextureFormat(TextureFormat::DS, TextureFormat::UNSIGNED_INT_24_8);
default:
throw tcu::InternalError(string("Can't map GL sized internal format (") + tcu::toHex(internalFormat).toString() + ") to texture format");
}
}
bool isGLInternalColorFormatFilterable (deUint32 format)
{
switch (format)
{
case GL_R8:
case GL_R8_SNORM:
case GL_RG8:
case GL_RG8_SNORM:
case GL_RGB8:
case GL_RGB8_SNORM:
case GL_RGB565:
case GL_RGBA4:
case GL_RGB5_A1:
case GL_RGBA8:
case GL_RGBA8_SNORM:
case GL_RGB10_A2:
case GL_SRGB8:
case GL_SRGB8_ALPHA8:
case GL_R16F:
case GL_RG16F:
case GL_RGB16F:
case GL_RGBA16F:
case GL_R11F_G11F_B10F:
case GL_RGB9_E5:
return true;
case GL_RGB10_A2UI:
case GL_R32F:
case GL_RG32F:
case GL_RGB32F:
case GL_RGBA32F:
case GL_R8I:
case GL_R8UI:
case GL_R16I:
case GL_R16UI:
case GL_R32I:
case GL_R32UI:
case GL_RG8I:
case GL_RG8UI:
case GL_RG16I:
case GL_RG16UI:
case GL_RG32I:
case GL_RG32UI:
case GL_RGB8I:
case GL_RGB8UI:
case GL_RGB16I:
case GL_RGB16UI:
case GL_RGB32I:
case GL_RGB32UI:
case GL_RGBA8I:
case GL_RGBA8UI:
case GL_RGBA16I:
case GL_RGBA16UI:
case GL_RGBA32I:
case GL_RGBA32UI:
return false;
default:
DE_ASSERT(false);
return false;
}
}
static inline tcu::Sampler::WrapMode mapGLWrapMode (deUint32 wrapMode)
{
switch (wrapMode)
{
case GL_CLAMP_TO_EDGE: return tcu::Sampler::CLAMP_TO_EDGE;
case GL_CLAMP_TO_BORDER: return tcu::Sampler::CLAMP_TO_BORDER;
case GL_REPEAT: return tcu::Sampler::REPEAT_GL;
case GL_MIRRORED_REPEAT: return tcu::Sampler::MIRRORED_REPEAT_GL;
default:
throw tcu::InternalError("Can't map GL wrap mode " + tcu::toHex(wrapMode).toString());
}
}
static inline tcu::Sampler::FilterMode mapGLFilterMode (deUint32 filterMode)
{
switch (filterMode)
{
case GL_NEAREST: return tcu::Sampler::NEAREST;
case GL_LINEAR: return tcu::Sampler::LINEAR;
case GL_NEAREST_MIPMAP_NEAREST: return tcu::Sampler::NEAREST_MIPMAP_NEAREST;
case GL_NEAREST_MIPMAP_LINEAR: return tcu::Sampler::NEAREST_MIPMAP_LINEAR;
case GL_LINEAR_MIPMAP_NEAREST: return tcu::Sampler::LINEAR_MIPMAP_NEAREST;
case GL_LINEAR_MIPMAP_LINEAR: return tcu::Sampler::LINEAR_MIPMAP_LINEAR;
default:
throw tcu::InternalError("Can't map GL filter mode" + tcu::toHex(filterMode).toString());
}
}
/*--------------------------------------------------------------------*//*!
* \brief Map GL sampler parameters to tcu::Sampler.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param wrapS S-component wrap mode
* \param minFilter Minification filter mode
* \param magFilter Magnification filter mode
* \return Sampler description.
*//*--------------------------------------------------------------------*/
tcu::Sampler mapGLSampler (deUint32 wrapS, deUint32 minFilter, deUint32 magFilter)
{
return mapGLSampler(wrapS, wrapS, wrapS, minFilter, magFilter);
}
/*--------------------------------------------------------------------*//*!
* \brief Map GL sampler parameters to tcu::Sampler.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param wrapS S-component wrap mode
* \param wrapT T-component wrap mode
* \param minFilter Minification filter mode
* \param magFilter Magnification filter mode
* \return Sampler description.
*//*--------------------------------------------------------------------*/
tcu::Sampler mapGLSampler (deUint32 wrapS, deUint32 wrapT, deUint32 minFilter, deUint32 magFilter)
{
return mapGLSampler(wrapS, wrapT, wrapS, minFilter, magFilter);
}
/*--------------------------------------------------------------------*//*!
* \brief Map GL sampler parameters to tcu::Sampler.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param wrapS S-component wrap mode
* \param wrapT T-component wrap mode
* \param wrapR R-component wrap mode
* \param minFilter Minification filter mode
* \param magFilter Magnification filter mode
* \return Sampler description.
*//*--------------------------------------------------------------------*/
tcu::Sampler mapGLSampler (deUint32 wrapS, deUint32 wrapT, deUint32 wrapR, deUint32 minFilter, deUint32 magFilter)
{
return tcu::Sampler(mapGLWrapMode(wrapS), mapGLWrapMode(wrapT), mapGLWrapMode(wrapR),
mapGLFilterMode(minFilter), mapGLFilterMode(magFilter),
0.0f /* lod threshold */,
true /* normalized coords */,
tcu::Sampler::COMPAREMODE_NONE /* no compare */,
0 /* compare channel */,
tcu::Vec4(0.0f) /* border color, not used */);
}
/*--------------------------------------------------------------------*//*!
* \brief Map GL compare function to tcu::Sampler::CompareMode.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param mode GL compare mode
* \return Compare mode
*//*--------------------------------------------------------------------*/
tcu::Sampler::CompareMode mapGLCompareFunc (deUint32 mode)
{
switch (mode)
{
case GL_LESS: return tcu::Sampler::COMPAREMODE_LESS;
case GL_LEQUAL: return tcu::Sampler::COMPAREMODE_LESS_OR_EQUAL;
case GL_GREATER: return tcu::Sampler::COMPAREMODE_GREATER;
case GL_GEQUAL: return tcu::Sampler::COMPAREMODE_GREATER_OR_EQUAL;
case GL_EQUAL: return tcu::Sampler::COMPAREMODE_EQUAL;
case GL_NOTEQUAL: return tcu::Sampler::COMPAREMODE_NOT_EQUAL;
case GL_ALWAYS: return tcu::Sampler::COMPAREMODE_ALWAYS;
case GL_NEVER: return tcu::Sampler::COMPAREMODE_NEVER;
default:
throw tcu::InternalError("Can't map GL compare mode " + tcu::toHex(mode).toString());
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GL wrap mode.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param wrapMode Wrap mode
* \return GL wrap mode
*//*--------------------------------------------------------------------*/
deUint32 getGLWrapMode (tcu::Sampler::WrapMode wrapMode)
{
DE_ASSERT(wrapMode != tcu::Sampler::WRAPMODE_LAST);
switch (wrapMode)
{
case tcu::Sampler::CLAMP_TO_EDGE: return GL_CLAMP_TO_EDGE;
case tcu::Sampler::CLAMP_TO_BORDER: return GL_CLAMP_TO_BORDER;
case tcu::Sampler::REPEAT_GL: return GL_REPEAT;
case tcu::Sampler::MIRRORED_REPEAT_GL: return GL_MIRRORED_REPEAT;
default:
throw tcu::InternalError("Can't map wrap mode");
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GL filter mode.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param filterMode Filter mode
* \return GL filter mode
*//*--------------------------------------------------------------------*/
deUint32 getGLFilterMode (tcu::Sampler::FilterMode filterMode)
{
DE_ASSERT(filterMode != tcu::Sampler::FILTERMODE_LAST);
switch (filterMode)
{
case tcu::Sampler::NEAREST: return GL_NEAREST;
case tcu::Sampler::LINEAR: return GL_LINEAR;
case tcu::Sampler::NEAREST_MIPMAP_NEAREST: return GL_NEAREST_MIPMAP_NEAREST;
case tcu::Sampler::NEAREST_MIPMAP_LINEAR: return GL_NEAREST_MIPMAP_LINEAR;
case tcu::Sampler::LINEAR_MIPMAP_NEAREST: return GL_LINEAR_MIPMAP_NEAREST;
case tcu::Sampler::LINEAR_MIPMAP_LINEAR: return GL_LINEAR_MIPMAP_LINEAR;
default:
throw tcu::InternalError("Can't map filter mode");
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GL compare mode.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param compareMode Compare mode
* \return GL compare mode
*//*--------------------------------------------------------------------*/
deUint32 getGLCompareFunc (tcu::Sampler::CompareMode compareMode)
{
DE_ASSERT(compareMode != tcu::Sampler::COMPAREMODE_NONE);
switch (compareMode)
{
case tcu::Sampler::COMPAREMODE_NONE: return GL_NONE;
case tcu::Sampler::COMPAREMODE_LESS: return GL_LESS;
case tcu::Sampler::COMPAREMODE_LESS_OR_EQUAL: return GL_LEQUAL;
case tcu::Sampler::COMPAREMODE_GREATER: return GL_GREATER;
case tcu::Sampler::COMPAREMODE_GREATER_OR_EQUAL: return GL_GEQUAL;
case tcu::Sampler::COMPAREMODE_EQUAL: return GL_EQUAL;
case tcu::Sampler::COMPAREMODE_NOT_EQUAL: return GL_NOTEQUAL;
case tcu::Sampler::COMPAREMODE_ALWAYS: return GL_ALWAYS;
case tcu::Sampler::COMPAREMODE_NEVER: return GL_NEVER;
default:
throw tcu::InternalError("Can't map compare mode");
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GL cube face.
*
* If no mapping is found, throws tcu::InternalError.
*
* \param face Cube face
* \return GL cube face
*//*--------------------------------------------------------------------*/
deUint32 getGLCubeFace (tcu::CubeFace face)
{
DE_ASSERT(face != tcu::CUBEFACE_LAST);
switch (face)
{
case tcu::CUBEFACE_NEGATIVE_X: return GL_TEXTURE_CUBE_MAP_NEGATIVE_X;
case tcu::CUBEFACE_POSITIVE_X: return GL_TEXTURE_CUBE_MAP_POSITIVE_X;
case tcu::CUBEFACE_NEGATIVE_Y: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Y;
case tcu::CUBEFACE_POSITIVE_Y: return GL_TEXTURE_CUBE_MAP_POSITIVE_Y;
case tcu::CUBEFACE_NEGATIVE_Z: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Z;
case tcu::CUBEFACE_POSITIVE_Z: return GL_TEXTURE_CUBE_MAP_POSITIVE_Z;
default:
throw tcu::InternalError("Can't map cube face");
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GLSL sampler type for texture format.
*
* If no mapping is found, glu::TYPE_LAST is returned.
*
* \param format Texture format
* \return GLSL 1D sampler type for format
*//*--------------------------------------------------------------------*/
DataType getSampler1DType (tcu::TextureFormat format)
{
using tcu::TextureFormat;
if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
return TYPE_SAMPLER_1D;
if (format.order == TextureFormat::S)
return TYPE_LAST;
switch (tcu::getTextureChannelClass(format.type))
{
case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
return glu::TYPE_SAMPLER_1D;
case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
return glu::TYPE_INT_SAMPLER_1D;
case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
return glu::TYPE_UINT_SAMPLER_1D;
default:
return glu::TYPE_LAST;
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GLSL sampler type for texture format.
*
* If no mapping is found, glu::TYPE_LAST is returned.
*
* \param format Texture format
* \return GLSL 2D sampler type for format
*//*--------------------------------------------------------------------*/
DataType getSampler2DType (tcu::TextureFormat format)
{
using tcu::TextureFormat;
if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
return TYPE_SAMPLER_2D;
if (format.order == TextureFormat::S)
return TYPE_LAST;
switch (tcu::getTextureChannelClass(format.type))
{
case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
return glu::TYPE_SAMPLER_2D;
case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
return glu::TYPE_INT_SAMPLER_2D;
case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
return glu::TYPE_UINT_SAMPLER_2D;
default:
return glu::TYPE_LAST;
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GLSL sampler type for texture format.
*
* If no mapping is found, glu::TYPE_LAST is returned.
*
* \param format Texture format
* \return GLSL cube map sampler type for format
*//*--------------------------------------------------------------------*/
DataType getSamplerCubeType (tcu::TextureFormat format)
{
using tcu::TextureFormat;
if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
return TYPE_SAMPLER_CUBE;
if (format.order == TextureFormat::S)
return TYPE_LAST;
switch (tcu::getTextureChannelClass(format.type))
{
case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
return glu::TYPE_SAMPLER_CUBE;
case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
return glu::TYPE_INT_SAMPLER_CUBE;
case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
return glu::TYPE_UINT_SAMPLER_CUBE;
default:
return glu::TYPE_LAST;
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GLSL sampler type for texture format.
*
* If no mapping is found, glu::TYPE_LAST is returned.
*
* \param format Texture format
* \return GLSL 2D array sampler type for format
*//*--------------------------------------------------------------------*/
DataType getSampler2DArrayType (tcu::TextureFormat format)
{
using tcu::TextureFormat;
if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
return TYPE_SAMPLER_2D_ARRAY;
if (format.order == TextureFormat::S)
return TYPE_LAST;
switch (tcu::getTextureChannelClass(format.type))
{
case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
return glu::TYPE_SAMPLER_2D_ARRAY;
case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
return glu::TYPE_INT_SAMPLER_2D_ARRAY;
case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
return glu::TYPE_UINT_SAMPLER_2D_ARRAY;
default:
return glu::TYPE_LAST;
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GLSL sampler type for texture format.
*
* If no mapping is found, glu::TYPE_LAST is returned.
*
* \param format Texture format
* \return GLSL 3D sampler type for format
*//*--------------------------------------------------------------------*/
DataType getSampler3DType (tcu::TextureFormat format)
{
using tcu::TextureFormat;
if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
return TYPE_SAMPLER_3D;
if (format.order == TextureFormat::S)
return TYPE_LAST;
switch (tcu::getTextureChannelClass(format.type))
{
case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
return glu::TYPE_SAMPLER_3D;
case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
return glu::TYPE_INT_SAMPLER_3D;
case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
return glu::TYPE_UINT_SAMPLER_3D;
default:
return glu::TYPE_LAST;
}
}
/*--------------------------------------------------------------------*//*!
* \brief Get GLSL sampler type for texture format.
*
* If no mapping is found, glu::TYPE_LAST is returned.
*
* \param format Texture format
* \return GLSL cube map array sampler type for format
*//*--------------------------------------------------------------------*/
DataType getSamplerCubeArrayType (tcu::TextureFormat format)
{
using tcu::TextureFormat;
if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
return TYPE_SAMPLER_CUBE_ARRAY;
if (format.order == TextureFormat::S)
return TYPE_LAST;
switch (tcu::getTextureChannelClass(format.type))
{
case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
return glu::TYPE_SAMPLER_CUBE_ARRAY;
case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
return glu::TYPE_INT_SAMPLER_CUBE_ARRAY;
case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
return glu::TYPE_UINT_SAMPLER_CUBE_ARRAY;
default:
return glu::TYPE_LAST;
}
}
enum RenderableType
{
RENDERABLE_COLOR = (1<<0),
RENDERABLE_DEPTH = (1<<1),
RENDERABLE_STENCIL = (1<<2)
};
static deUint32 getRenderableBitsES3 (const ContextInfo& contextInfo, deUint32 internalFormat)
{
switch (internalFormat)
{
// Color-renderable formats
case GL_RGBA32I:
case GL_RGBA32UI:
case GL_RGBA16I:
case GL_RGBA16UI:
case GL_RGBA8:
case GL_RGBA8I:
case GL_RGBA8UI:
case GL_SRGB8_ALPHA8:
case GL_RGB10_A2:
case GL_RGB10_A2UI:
case GL_RGBA4:
case GL_RGB5_A1:
case GL_RGB8:
case GL_RGB565:
case GL_RG32I:
case GL_RG32UI:
case GL_RG16I:
case GL_RG16UI:
case GL_RG8:
case GL_RG8I:
case GL_RG8UI:
case GL_R32I:
case GL_R32UI:
case GL_R16I:
case GL_R16UI:
case GL_R8:
case GL_R8I:
case GL_R8UI:
return RENDERABLE_COLOR;
// GL_EXT_color_buffer_float
case GL_RGBA32F:
case GL_R11F_G11F_B10F:
case GL_RG32F:
case GL_R32F:
if (contextInfo.isExtensionSupported("GL_EXT_color_buffer_float"))
return RENDERABLE_COLOR;
else
return 0;
// GL_EXT_color_buffer_float / GL_EXT_color_buffer_half_float
case GL_RGBA16F:
case GL_RG16F:
case GL_R16F:
if (contextInfo.isExtensionSupported("GL_EXT_color_buffer_float") ||
contextInfo.isExtensionSupported("GL_EXT_color_buffer_half_float"))
return RENDERABLE_COLOR;
else
return 0;
// Depth formats
case GL_DEPTH_COMPONENT32F:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT16:
return RENDERABLE_DEPTH;
// Depth+stencil formats
case GL_DEPTH32F_STENCIL8:
case GL_DEPTH24_STENCIL8:
return RENDERABLE_DEPTH|RENDERABLE_STENCIL;
// Stencil formats
case GL_STENCIL_INDEX8:
return RENDERABLE_STENCIL;
default:
return 0;
}
}
/*--------------------------------------------------------------------*//*!
* \brief Check if sized internal format is color-renderable.
* \note Works currently only on ES3 context.
*//*--------------------------------------------------------------------*/
bool isSizedFormatColorRenderable (const RenderContext& renderCtx, const ContextInfo& contextInfo, deUint32 sizedFormat)
{
deUint32 renderable = 0;
if (renderCtx.getType().getAPI() == ApiType::es(3,0))
renderable = getRenderableBitsES3(contextInfo, sizedFormat);
else
throw tcu::InternalError("Context type not supported in query");
return (renderable & RENDERABLE_COLOR) != 0;
}
} // glu
| {
"content_hash": "7747eb6a5ac5d3005780e96d6dc64444",
"timestamp": "",
"source": "github",
"line_count": 995,
"max_line_length": 164,
"avg_line_length": 41.893467336683415,
"alnum_prop": 0.6731359754342193,
"repo_name": "Omegaphora/external_deqp",
"id": "41056c02b3878ebc03110da8bf854573c02c29ca",
"size": "42482",
"binary": false,
"copies": "7",
"ref": "refs/heads/lp5.1",
"path": "framework/opengl/gluTextureUtil.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "320"
},
{
"name": "C",
"bytes": "475786"
},
{
"name": "C++",
"bytes": "19009566"
},
{
"name": "CMake",
"bytes": "172110"
},
{
"name": "HTML",
"bytes": "55742"
},
{
"name": "Java",
"bytes": "22702"
},
{
"name": "Makefile",
"bytes": "25178"
},
{
"name": "Objective-C",
"bytes": "16593"
},
{
"name": "Objective-C++",
"bytes": "17364"
},
{
"name": "Python",
"bytes": "287686"
},
{
"name": "Shell",
"bytes": "166"
}
],
"symlink_target": ""
} |
package ru.stqa.pft.addressbook.appmanager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
/**
* Created by Sai on 18.09.2016.
*/
public class NavigationHelper extends HelperBase{
public NavigationHelper(WebDriver wd) {
super(wd);
}
public void groupPage() {
if(isElementPresent(By.tagName("h1"))
&& wd.findElement(By.tagName("h1")).getText().equals("Groups")
&& isElementPresent(By.name ("new"))){
return;
}
click(By.linkText("groups"));
}
public void homePage(){
if (isElementPresent(By.id("maintable"))){
return;
}
click(By.linkText("home"));
}
}
| {
"content_hash": "4b38e58870844dc8d9a7adb0c7e3aa5b",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 74,
"avg_line_length": 20.823529411764707,
"alnum_prop": 0.6497175141242938,
"repo_name": "shb2304/java_pft",
"id": "aea3e3fb6f461cf1ef9a25c1bbe4050c0725d594",
"size": "708",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addressbook-web-tests/src/test/java/ru/stqa/pft/addressbook/appmanager/NavigationHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "32173"
}
],
"symlink_target": ""
} |
var addRippleEffect = function (e) {
var target = e.target;
if (target.tagName.toLowerCase() !== 'button') return false;
var rect = target.getBoundingClientRect();
var ripple = target.querySelector('.ripple');
if (!ripple) {
ripple = document.createElement('span');
ripple.className = 'ripple';
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
target.appendChild(ripple);
}
ripple.classList.remove('show');
var top = e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop;
var left = e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft;
ripple.style.top = top + 'px';
ripple.style.left = left + 'px';
ripple.classList.add('show');
return false;
}
document.addEventListener('mousedown', addRippleEffect, false);
console.log('button.js ready'); | {
"content_hash": "801d079da156d1b79bd6f13e995a4232",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 92,
"avg_line_length": 39.130434782608695,
"alnum_prop": 0.6577777777777778,
"repo_name": "nttcom/skyway",
"id": "7f37384a6b019cf7041058d9d7e196e4dede0bde",
"size": "900",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "src/javascript/button.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "376456"
},
{
"name": "CoffeeScript",
"bytes": "504"
},
{
"name": "HTML",
"bytes": "180218"
},
{
"name": "JavaScript",
"bytes": "38317"
},
{
"name": "Ruby",
"bytes": "1192"
}
],
"symlink_target": ""
} |
class SlotMachine
include DataMapper::Resource
property :id, Serial
property :power_on, Boolean, :default => false
is :state_machine, :initial => :off, :column => :mode do
state :off,
:enter => :power_down,
:exit => :power_up
state :idle
state :spinning
state :report_loss
state :report_win
state :pay_out
event :pull_crank do
transition :from => :idle, :to => :spinning
end
event :turn_off do
transition :from => :idle, :to => :off
end
event :turn_on do
transition :from => :off, :to => :idle
end
end
def initialize
@log = []
super
end
def power_up
self.power_on = true
@log << [:power_up, Time.now]
end
def power_down
self.power_on = false
@log << [:power_down, Time.now]
end
end
SlotMachine.auto_migrate!
| {
"content_hash": "c3b5721b8dd100b31519585e49fc3607",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 58,
"avg_line_length": 18.02127659574468,
"alnum_prop": 0.5844155844155844,
"repo_name": "merbjedi/dm-more-hacked",
"id": "7a16dab4540b273f00cadd03e00a11e0e70d0c5b",
"size": "865",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "dm-is-state_machine/spec/examples/slot_machine.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "148"
},
{
"name": "Ruby",
"bytes": "696265"
}
],
"symlink_target": ""
} |
UPGRADE FROM 3.x to 4.0
=======================
ClassLoader
-----------
* The component has been removed. Use Composer instead.
Console
-------
* Setting unknown style options is not supported anymore and throws an
exception.
* The `QuestionHelper::setInputStream()` method is removed. Use
`StreamableInputInterface::setStream()` or `CommandTester::setInputs()`
instead.
Before:
```php
$input = new ArrayInput();
$questionHelper->setInputStream($stream);
$questionHelper->ask($input, $output, $question);
```
After:
```php
$input = new ArrayInput();
$input->setStream($stream);
$questionHelper->ask($input, $output, $question);
```
Before:
```php
$commandTester = new CommandTester($command);
$stream = fopen('php://memory', 'r+', false);
fputs($stream, "AppBundle\nYes");
rewind($stream);
$command->getHelper('question')->setInputStream($stream);
$commandTester->execute();
```
After:
```php
$commandTester = new CommandTester($command);
$commandTester->setInputs(array('AppBundle', 'Yes'));
$commandTester->execute();
```
* The `console.exception` event and the related `ConsoleExceptionEvent` class have
been removed in favor of the `console.error` event and the `ConsoleErrorEvent` class.
* The `SymfonyQuestionHelper::ask` default validation has been removed in favor of `Question::setValidator`.
Debug
-----
* The `ContextErrorException` class has been removed. Use `\ErrorException` instead.
* `FlattenException::getTrace()` now returns additional type descriptions
`integer` and `float`.
* Support for stacked errors in the `ErrorHandler` has been removed
DependencyInjection
-------------------
* Definitions and aliases are now private by default in 4.0. You should either use service injection
or explicitly define your services as public if you really need to inject the container.
* Relying on service auto-registration while autowiring is not supported anymore.
Explicitly inject your dependencies or create services whose ids are
their fully-qualified class name.
Before:
```php
namespace App\Controller;
use App\Mailer;
class DefaultController
{
public function __construct(Mailer $mailer) {
// ...
}
// ...
}
```
```yml
services:
App\Controller\DefaultController:
autowire: true
```
After:
```php
// same PHP code
```
```yml
services:
App\Controller\DefaultController:
autowire: true
# or
# App\Controller\DefaultController:
# arguments: { $mailer: "@App\Mailer" }
App\Mailer:
autowire: true
```
* Autowiring services based on the types they implement is not supported anymore. Rename (or alias) your services to their FQCN id to make them autowirable.
* `_defaults` and `_instanceof` are now reserved service names in Yaml configurations. Please rename any services with that names.
* Non-numeric keys in methods and constructors arguments have never been supported and are now forbidden. Please remove them if you happen to have one.
* Service names that start with an underscore are now reserved in Yaml files. Please rename any services with such names.
* Autowiring-types have been removed, use aliases instead.
Before:
```xml
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false">
<autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type>
</service>
```
After:
```xml
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" />
<service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" />
```
* Service identifiers and parameter names are now case sensitive.
* The `Reference` and `Alias` classes do not make service identifiers lowercase anymore.
* Using the `PhpDumper` with an uncompiled `ContainerBuilder` is not supported
anymore.
* Extending the containers generated by `PhpDumper` is not supported
anymore.
* The `DefinitionDecorator` class has been removed. Use the `ChildDefinition`
class instead.
* The `ResolveDefinitionTemplatesPass` class has been removed.
Use the `ResolveChildDefinitionsPass` class instead.
* Using unsupported configuration keys in YAML configuration files raises an
exception.
* Using unsupported options to configure service aliases raises an exception.
* Setting or unsetting a service with the `Container::set()` method is
no longer supported. Only synthetic services can be set or unset.
* Checking the existence of a private service with the `Container::has()`
method is no longer supported and will return `false`.
* Requesting a private service with the `Container::get()` method is no longer
supported.
* The ``strict`` attribute in service arguments has been removed.
The attribute is ignored since 3.0, so you can simply remove it.
* Top-level anonymous services in XML are no longer supported.
* The `ExtensionCompilerPass` has been moved to before-optimization passes with priority -1000.
EventDispatcher
---------------
* The `ContainerAwareEventDispatcher` class has been removed.
Use `EventDispatcher` with closure factories instead.
ExpressionLanguage
------------------
* The ability to pass a `ParserCacheInterface` instance to the `ExpressionLanguage`
class has been removed. You should use the `CacheItemPoolInterface` interface
instead.
Filesystem
----------
* The `Symfony\Component\Filesystem\LockHandler` has been removed,
use the `Symfony\Component\Lock\Store\FlockStore` class
or the `Symfony\Component\Lock\Store\FlockStore\SemaphoreStore` class directly instead.
Finder
------
* The `ExceptionInterface` has been removed.
* The `Symfony\Component\Finder\Iterator\FilterIterator` class has been
removed as it used to fix a bug which existed before version 5.5.23/5.6.7
Form
----
* The `choices_as_values` option of the `ChoiceType` has been removed.
* Support for data objects that implements both `Traversable` and
`ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed.
* Using callable strings as choice options in ChoiceType is not supported
anymore in favor of passing PropertyPath instances.
Before:
```php
'choice_value' => new PropertyPath('range'),
'choice_label' => 'strtoupper',
```
After:
```php
'choice_value' => 'range',
'choice_label' => function ($choice) {
return strtoupper($choice);
},
```
* Caching of the loaded `ChoiceListInterface` in the `LazyChoiceList` has been removed,
it must be cached in the `ChoiceLoaderInterface` implementation instead.
* Calling `isValid()` on a `Form` instance before submitting it is not supported
anymore and raises an exception.
Before:
```php
if ($form->isValid()) {
// ...
}
```
After:
```php
if ($form->isSubmitted() && $form->isValid()) {
// ...
}
```
* Using the "choices" option in ``CountryType``, ``CurrencyType``, ``LanguageType``,
``LocaleType``, and ``TimezoneType`` without overriding the ``choice_loader``
option is now ignored.
Before:
```php
$builder->add('custom_locales', LocaleType::class, array(
'choices' => $availableLocales,
));
```
After:
```php
$builder->add('custom_locales', LocaleType::class, array(
'choices' => $availableLocales,
'choice_loader' => null,
));
// or
$builder->add('custom_locales', LocaleType::class, array(
'choice_loader' => new CallbackChoiceLoader(function () {
return $this->getAvailableLocales();
}),
));
```
* Removed `ChoiceLoaderInterface` implementation in `TimezoneType`. Use the "choice_loader" option instead.
Before:
```php
class MyTimezoneType extends TimezoneType
{
public function loadChoices()
{
// override the method
}
}
```
After:
```php
class MyTimezoneType extends AbstractType
{
public function. getParent()
{
return TimezoneType::class;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefault('choice_loader', ...); // override the option instead
}
}
```
FrameworkBundle
---------------
* The `validator.mapping.cache.doctrine.apc` service has been removed.
* The "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter have been removed. Use the `Request::setTrustedProxies()` method in your front controller instead.
* The default value of the `framework.workflows.[name].type` configuration options is now `state_machine`.
* Support for absolute template paths has been removed.
* The following form types registered as services have been removed; use their
fully-qualified class name instead:
- `"form.type.birthday"`
- `"form.type.checkbox"`
- `"form.type.collection"`
- `"form.type.country"`
- `"form.type.currency"`
- `"form.type.date"`
- `"form.type.datetime"`
- `"form.type.email"`
- `"form.type.file"`
- `"form.type.hidden"`
- `"form.type.integer"`
- `"form.type.language"`
- `"form.type.locale"`
- `"form.type.money"`
- `"form.type.number"`
- `"form.type.password"`
- `"form.type.percent"`
- `"form.type.radio"`
- `"form.type.range"`
- `"form.type.repeated"`
- `"form.type.search"`
- `"form.type.textarea"`
- `"form.type.text"`
- `"form.type.time"`
- `"form.type.timezone"`
- `"form.type.url"`
- `"form.type.button"`
- `"form.type.submit"`
- `"form.type.reset"`
* The `framework.serializer.cache` option and the services
`serializer.mapping.cache.apc` and `serializer.mapping.cache.doctrine.apc`
have been removed. APCu should now be automatically used when available.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPass` has been removed.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been removed.
Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass` class has been removed.
Use the `Symfony\Component\Serializer\DependencyInjection\SerializerPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPass` class has been
removed. Use the `Symfony\Component\Form\DependencyInjection\FormPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\EventListener\SessionListener` class has been removed.
Use the `Symfony\Component\HttpKernel\EventListener\SessionListener` class instead.
* The `Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener` class has been
removed. Use the `Symfony\Component\HttpKernel\EventListener\TestSessionListener`
class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePass` class has been removed.
Use `Symfony\Component\Config\DependencyInjection\ConfigCachePass` class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPass` class has been
removed. Use the `Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass`
class instead.
* Class parameters related to routing have been removed
* router.options.generator_class
* router.options.generator_base_class
* router.options.generator_dumper_class
* router.options.matcher_class
* router.options.matcher_base_class
* router.options.matcher_dumper_class
* router.options.matcher.cache_class
* router.options.generator.cache_class
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ControllerArgumentValueResolverPass` class
has been removed. Use the `Symfony\Component\HttpKernel\DependencyInjection\ControllerArgumentValueResolverPass`
class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RoutingResolverPass`
class has been removed. Use the
`Symfony\Component\Routing\DependencyInjection\RoutingResolverPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\Translation\Translator` constructor now takes the
default locale as mandatory 3rd argument.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddValidatorInitializersPass` class has been
removed. Use the `Symfony\Component\Validator\DependencyInjection\AddValidatorInitializersPass`
class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConstraintValidatorsPass` class has been
removed. Use the `Symfony\Component\Validator\DependencyInjection\AddConstraintValidatorsPass`
class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ValidateWorkflowsPass` class
has been removed. Use the `Symfony\Component\Workflow\DependencyInjection\ValidateWorkflowsPass`
class instead.
* Using the `KERNEL_DIR` environment variable and the automatic guessing based
on the `phpunit.xml` file location have been removed from the `KernelTestCase::getKernelClass()`
method implementation. Set the `KERNEL_CLASS` environment variable to the
fully-qualified class name of your Kernel or override the `KernelTestCase::createKernel()`
or `KernelTestCase::getKernelClass()` method instead.
* The methods `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()`
have been removed.
* The `Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory` class has been removed.
Use `Symfony\Component\Validator\ContainerConstraintValidatorFactory` instead.
* The `--no-prefix` option of the `translation:update` command has
been removed.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheClearerPass` class has been removed.
Use the `Symfony\Component\HttpKernel\DependencyInjection\AddCacheClearerPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPass` class has been removed.
Use the `Symfony\Component\HttpKernel\DependencyInjection\AddCacheWarmerPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationDumperPass`
class has been removed. Use the
`Symfony\Component\Translation\DependencyInjection\TranslationDumperPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationExtractorPass`
class has been removed. Use the
`Symfony\Component\Translation\DependencyInjection\TranslationExtractorPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslatorPass`
class has been removed. Use the
`Symfony\Component\Translation\DependencyInjection\TranslatorPass` class instead.
* The `Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader`
class has been deprecated and will be removed in 4.0. Use the
`Symfony\Component\Translation\Reader\TranslationReader` class instead.
* The `translation.loader` service has been removed.
Use the `translation.reader` service instead.
* `AssetsInstallCommand::__construct()` now requires an instance of
`Symfony\Component\Filesystem\Filesystem` as first argument.
* `CacheClearCommand::__construct()` now requires an instance of
`Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface` as
first argument.
* `CachePoolClearCommand::__construct()` now requires an instance of
`Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer` as
first argument.
* `EventDispatcherDebugCommand::__construct()` now requires an instance of
`Symfony\Component\EventDispatcher\EventDispatcherInterface` as
first argument.
* `RouterDebugCommand::__construct()` now requires an instance of
`Symfony\Component\Routing\RouterInteface` as
first argument.
* `RouterMatchCommand::__construct()` now requires an instance of
`Symfony\Component\Routing\RouterInteface` as
first argument.
* `TranslationDebugCommand::__construct()` now requires an instance of
`Symfony\Component\Translation\TranslatorInterface` as
first argument.
* `TranslationUpdateCommand::__construct()` now requires an instance of
`Symfony\Component\Translation\TranslatorInterface` as
first argument.
HttpFoundation
--------------
* The `Request::setTrustedProxies()` method takes a new `$trustedHeaderSet` argument.
See http://symfony.com/doc/current/components/http_foundation/trusting_proxies.html for more info.
* The `Request::setTrustedHeaderName()` and `Request::getTrustedHeaderName()` methods have been removed.
* Extending the following methods of `Response`
is no longer possible (these methods are now `final`):
- `setDate`/`getDate`
- `setExpires`/`getExpires`
- `setLastModified`/`getLastModified`
- `setProtocolVersion`/`getProtocolVersion`
- `setStatusCode`/`getStatusCode`
- `setCharset`/`getCharset`
- `setPrivate`/`setPublic`
- `getAge`
- `getMaxAge`/`setMaxAge`
- `setSharedMaxAge`
- `getTtl`/`setTtl`
- `setClientTtl`
- `getEtag`/`setEtag`
- `hasVary`/`getVary`/`setVary`
- `isInvalid`/`isSuccessful`/`isRedirection`/`isClientError`/`isServerError`
- `isOk`/`isForbidden`/`isNotFound`/`isRedirect`/`isEmpty`
* The ability to check only for cacheable HTTP methods using `Request::isMethodSafe()` is
not supported anymore, use `Request::isMethodCacheable()` instead.
HttpKernel
----------
* Bundle inheritance has been removed.
* Relying on convention-based commands discovery is not supported anymore.
Use PSR-4 based service discovery instead.
Before:
```yml
# app/config/services.yml
services:
# ...
# implicit registration of all commands in the `Command` folder
```
After:
```yml
# app/config/services.yml
services:
# ...
# explicit commands registration
AppBundle\Command:
resource: '../../src/AppBundle/Command/*'
tags: ['console.command']
```
* Removed the `kernel.root_dir` parameter. Use the `kernel.project_dir` parameter
instead.
* Removed the `Kernel::getRootDir()` method. Use the `Kernel::getProjectDir()`
method instead.
* The `Extension::addClassesToCompile()` and `Extension::getClassesToCompile()` methods have been removed.
* Possibility to pass non-scalar values as URI attributes to the ESI and SSI
renderers has been removed. The inline fragment renderer should be used with
non-scalar attributes.
* The `ControllerResolver::getArguments()` method has been removed. If you
have your own `ControllerResolverInterface` implementation, you should
inject an `ArgumentResolverInterface` instance.
* The `DataCollector::varToString()` method has been removed in favor of `cloneVar()`.
* The `Psr6CacheClearer::addPool()` method has been removed. Pass an array of pools indexed
by name to the constructor instead.
* The `LazyLoadingFragmentHandler::addRendererService()` method has been removed.
* The `X-Status-Code` header method of setting a custom status code in the
response when handling exceptions has been removed. There is now a new
`GetResponseForExceptionEvent::allowCustomResponseCode()` method instead,
which will tell the Kernel to use the response code set on the event's
response object.
* The `Kernel::getEnvParameters()` method has been removed.
* The `SYMFONY__` environment variables are no longer processed automatically
by Symfony. Use the `%env()%` syntax to get the value of any environment
variable from configuration files instead.
* The `getCacheDir()` method of your kernel should not be called while building the container.
Use the `%kernel.cache_dir%` parameter instead. Not doing so may break the `cache:clear` command.
* The `Symfony\Component\HttpKernel\Config\EnvParametersResource` class has been removed.
Ldap
----
* The `RenameEntryInterface` has been removed, and merged with `EntryManagerInterface`
Process
-------
* The `Symfony\Component\Process\ProcessBuilder` class has been removed,
use the `Symfony\Component\Process\Process` class directly instead.
* The `ProcessUtils::escapeArgument()` method has been removed, use a command line array or give env vars to the `Process::start/run()` method instead.
* Environment variables are always inherited in sub-processes.
* Configuring `proc_open()` options has been removed.
* Configuring Windows and sigchild compatibility is not possible anymore - they are always enabled.
* Extending `Process::run()`, `Process::mustRun()` and `Process::restart()` is
not supported anymore.
* The `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class have been removed.
Profiler
--------
* The `profiler.matcher` option has been removed.
ProxyManager
------------
* The `ProxyDumper` class has been made final
Security
--------
* The `RoleInterface` has been removed. Extend the `Symfony\Component\Security\Core\Role\Role`
class instead.
* The `LogoutUrlGenerator::registerListener()` method expects a 6th `string $context = null` argument.
* The `AccessDecisionManager::setVoters()` method has been removed. Pass the
voters to the constructor instead.
* Support for defining voters that don't implement the `VoterInterface` has been removed.
SecurityBundle
--------------
* The `FirewallContext::getContext()` method has been removed, use the `getListeners()` and/or `getExceptionListener()` method instead.
* The `FirewallMap::$map` and `$container` properties have been removed.
* The `UserPasswordEncoderCommand` class does not allow `null` as the first argument anymore.
* `UserPasswordEncoderCommand` does not extend `ContainerAwareCommand` nor implement `ContainerAwareInterface` anymore.
* `InitAclCommand::__construct()` now requires an instance of
`Doctrine\DBAL\Connection` as first argument.
* `SetAclCommand::__construct()` now requires an instance of
`Symfony\Component\Security\Acl\Model\MutableAclProviderInterfaceConnection`
as first argument.
Serializer
----------
* The ability to pass a Doctrine `Cache` instance to the `ClassMetadataFactory`
class has been removed. You should use the `CacheClassMetadataFactory` class
instead.
* Not defining the 6th argument `$format = null` of the
`AbstractNormalizer::instantiateObject()` method when overriding it is not
supported anymore.
* Extending `ChainDecoder`, `ChainEncoder`, `ArrayDenormalizer` is not supported
anymore.
Translation
-----------
* Removed the backup feature from the file dumper classes.
* The default value of the `$readerServiceId` argument of `TranslatorPass::__construct()` has been changed to `"translation.reader"`.
* Removed `Symfony\Component\Translation\Writer\TranslationWriter::writeTranslations`,
use `Symfony\Component\Translation\Writer\TranslationWriter::write` instead.
* Removed support for passing `Symfony\Component\Translation\MessageSelector` as a second argument to the
`Translator::__construct()`. You should pass an instance of `Symfony\Component\Translation\Formatter\MessageFormatterInterface` instead.
TwigBundle
----------
* The `ContainerAwareRuntimeLoader` class has been removed. Use the
Twig `Twig_ContainerRuntimeLoader` class instead.
* Removed `DebugCommand` in favor of `Symfony\Bridge\Twig\Command\DebugCommand`.
* Removed `ContainerAwareInterface` implementation in `Symfony\Bundle\TwigBundle\Command\LintCommand`.
TwigBridge
----------
* removed the `Symfony\Bridge\Twig\Form\TwigRenderer` class, use the `FormRenderer`
class from the Form component instead
* Removed the possibility to inject the Form `TwigRenderer` into the `FormExtension`.
Upgrade Twig to `^1.30`, inject the `Twig_Environment` into the `TwigRendererEngine` and load
the `TwigRenderer` using the `Twig_FactoryRuntimeLoader` instead.
Before:
```php
use Symfony\Bridge\Twig\Extension\FormExtension;
use Symfony\Bridge\Twig\Form\TwigRenderer;
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
// ...
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'));
$rendererEngine->setEnvironment($twig);
$twig->addExtension(new FormExtension(new TwigRenderer($rendererEngine, $csrfTokenManager)));
```
After:
```php
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig);
$twig->addRuntimeLoader(new \Twig_FactoryRuntimeLoader(array(
TwigRenderer::class => function () use ($rendererEngine, $csrfTokenManager) {
return new TwigRenderer($rendererEngine, $csrfTokenManager);
},
)));
$twig->addExtension(new FormExtension());
```
* Removed the `TwigRendererEngineInterface` interface.
* The `TwigRendererEngine::setEnvironment()` method has been removed.
Pass the Twig Environment as second argument of the constructor instead.
* Removed `DebugCommand::set/getTwigEnvironment`. Pass an instance of
`Twig\Environment` as first argument of the constructor instead.
* Removed `LintCommand::set/getTwigEnvironment`. Pass an instance of
`Twig\Environment` as first argument of the constructor instead.
Validator
---------
* The default value of the `strict` option of the `Choice` constraint was changed
to `true`. Using any other value will throw an exception.
* The `DateTimeValidator::PATTERN` constant was removed.
* `Tests\Constraints\AbstractConstraintValidatorTest` has been removed in
favor of `Test\ConstraintValidatorTestCase`.
Before:
```php
// ...
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
class MyCustomValidatorTest extends AbstractConstraintValidatorTest
{
// ...
}
```
After:
```php
// ...
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
class MyCustomValidatorTest extends ConstraintValidatorTestCase
{
// ...
}
```
* Setting the `checkDNS` option of the `Url` constraint to `true` is dropped
in favor of `Url::CHECK_DNS_TYPE_*` constants values.
Before:
```php
$constraint = new Url(['checkDNS' => true]);
```
After:
```php
$constraint = new Url(['checkDNS' => Url::CHECK_DNS_TYPE_ANY]);
```
VarDumper
---------
* The `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$context = null`
argument and moves `$message = ''` argument at 4th position.
Before:
```php
VarDumperTestTrait::assertDumpEquals($dump, $data, $message = '');
```
After:
```php
VarDumperTestTrait::assertDumpEquals($dump, $data, $filter = 0, $message = '');
```
* The `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$context = null`
argument and moves `$message = ''` argument at 4th position.
Before:
```php
VarDumperTestTrait::assertDumpMatchesFormat($dump, $data, $message = '');
```
After:
```php
VarDumperTestTrait::assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '');
```
WebProfilerBundle
-----------------
* Removed the `getTemplates()` method of the `TemplateManager` class in favor
of the `getNames()` method
Workflow
--------
* Removed class name support in `WorkflowRegistry::add()` as second parameter.
Yaml
----
* Support for the `!str` tag was removed, use the `!!str` tag instead.
* Starting an unquoted string with a question mark followed by a space
throws a `ParseException`.
* Removed support for implicitly parsing non-string mapping keys as strings.
Mapping keys that are no strings will result in a `ParseException`. Use
quotes to opt-in for keys to be parsed as strings.
Before:
```php
$yaml = <<<YAML
null: null key
true: boolean true
2.0: float key
YAML;
Yaml::parse($yaml);
```
After:
```php
$yaml = <<<YAML
"null": null key
"true": boolean true
"2.0": float key
YAML;
Yaml::parse($yaml);
```
* Removed the `Yaml::PARSE_KEYS_AS_STRINGS` flag.
Before:
```php
$yaml = <<<YAML
null: null key
true: boolean true
2.0: float key
YAML;
Yaml::parse($yaml, Yaml::PARSE_KEYS_AS_STRINGS);
```
After:
```php
$yaml = <<<YAML
"null": null key
"true": boolean true
"2.0": float key
YAML;
Yaml::parse($yaml);
```
* Omitting the key of a mapping is not supported anymore and throws a `ParseException`.
* Mappings with a colon (`:`) that is not followed by a whitespace are not
supported anymore and lead to a `ParseException`(e.g. `foo:bar` must be
`foo: bar`).
* Starting an unquoted string with `%` leads to a `ParseException`.
* The `Dumper::setIndentation()` method was removed. Pass the indentation
level to the constructor instead.
* Removed support for passing `true`/`false` as the second argument to the
`parse()` method to trigger exceptions when an invalid type was passed.
Before:
```php
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', true);
```
After:
```php
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE);
```
* Removed support for passing `true`/`false` as the third argument to the
`parse()` method to toggle object support.
Before:
```php
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', false, true);
```
After:
```php
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_OBJECT);
```
* Removed support for passing `true`/`false` as the fourth argument to the
`parse()` method to parse objects as maps.
Before:
```php
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', false, false, true);
```
After:
```php
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_OBJECT_FOR_MAP);
```
* Removed support for passing `true`/`false` as the fourth argument to the
`dump()` method to trigger exceptions when an invalid type was passed.
Before:
```php
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, true);
```
After:
```php
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE);
```
* Removed support for passing `true`/`false` as the fifth argument to the
`dump()` method to toggle object support.
Before:
```php
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, false, true);
```
After:
```php
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, false, Yaml::DUMP_OBJECT);
```
* The `!!php/object` tag to indicate dumped PHP objects was removed in favor of
the `!php/object` tag.
* Duplicate mapping keys lead to a `ParseException`.
* The constructor arguments `$offset`, `$totalNumberOfLines` and
`$skippedLineNumbers` of the `Parser` class were removed.
* The behavior of the non-specific tag `!` is changed and now forces
non-evaluating your values.
* The `!php/object:` tag was removed in favor of the `!php/object` tag (without
the colon).
* The `!php/const:` tag was removed in favor of the `!php/const` tag (without
the colon).
Before:
```yml
!php/const:PHP_INT_MAX
```
After:
```yml
!php/const PHP_INT_MAX
```
| {
"content_hash": "3028ababca604ebbd59c0d016a9f6f8a",
"timestamp": "",
"source": "github",
"line_count": 1017,
"max_line_length": 211,
"avg_line_length": 30.997050147492626,
"alnum_prop": 0.709237406420505,
"repo_name": "backbone87/symfony",
"id": "a1284740a6a7fe3ec8fea1a0b7183150d954cf11",
"size": "31524",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "UPGRADE-4.0.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "333025"
},
{
"name": "PHP",
"bytes": "13651010"
},
{
"name": "Shell",
"bytes": "375"
}
],
"symlink_target": ""
} |
(function() {
/*globals tiki ENV ARGV ARGS */
"use modules false";
"use loader false";
/**
Implements a very simple handler for the loader registration API so that
additional scripts can load without throwing exceptions. This loader can
also return module instances for modules registered with an actual factory
function.
Note that this stub loader cannot be used on its own. You must load the
regular tiki package as well, which will replace this loader as soon as it
is fetched.
*/
if ("undefined" === typeof tiki) { var tiki = function() {
var T_UNDEFINED = 'undefined',
queue = [];
// save a registration method in a queue to be replayed later once the
// real loader is available.
function _record(method, args) {
queue.push({ m: method, a: args });
}
var tiki = {
// used to detect when real loader should replace this one
isBootstrap: true,
// log of actions to be replayed later
queue: queue,
// helpers just record into queue
register: function(packageId, opts) {
// this hack will make unit tests work for tiki by adding core_test to
// the list of dependencies.
if (packageId.match(/^tiki/) && this.ENV) {
if ((this.ENV.app === 'tiki') && (this.ENV.mode === 'test')) {
if (!opts.dependencies) opts.dependencies = {};
opts.dependencies['core_test'] = '~';
}
}
_record('register', arguments);
return this;
},
// Keep these around just in case we need them in the end...
// script: function() {
// _record('script', arguments);
// return this;
// },
//
// stylesheet: function() {
// _record('stylesheet', arguments);
// return this;
// },
// modules actually get saved as well a recorded so you can use them.
module: function(moduleId, factory) {
if (moduleId.match(/\:tiki$/)) this.tikiFactory = factory;
_record('module', arguments);
return this ;
},
// load the tikiFactory
start: function() {
var exp = {}, ret;
this.tikiFactory(null, exp, null); // no require or module!
ret = exp.Browser.start(this.ENV, this.ARGS, queue);
queue = null;
return ret ;
}
};
if (T_UNDEFINED !== typeof ENV) tiki.ENV = ENV;
if (T_UNDEFINED !== typeof ARGV) tiki.ARGS = ARGV; // for older versions
if (T_UNDEFINED !== typeof ARGS) tiki.ARGS = ARGS;
return tiki;
}(); }
tiki.register('::tiki/1.0.0', {
"name": "tiki",
"version": "1.0.0"
});
tiki.module('::tiki/1.0.0:tiki', function(require, exports, module) {
// ==========================================================================
// Project: Tiki - CommonJS Runtime
// Copyright: ©2009-2010 Apple Inc. All rights reserved.
// License: Licened under MIT license (see __preamble__.js)
// ==========================================================================
/*jslint evil:true */
/**
@file
This file implements the core building blocks needed to implement the
tiki runtime in an environment. If you can require this one module, you can
setup a runtime that will load additional packages.
It is important that this module NOT require() any other modules since a
functioning require() statement may not be available. The module can
populate, but not replace, the exports object.
To configure a Tiki runtime, you need to create a Sandbox and Loader
instance from this API with one or more loader Sources. The BrowserSource
object implements the basic source you need to work in the browser. The
Repository object implemented in the server-side only 'file' API can be
used to load from a local repository of packages.
*/
// used for type checking. This allows the type strings to be minified.
var T_FUNCTION = 'function',
T_STRING = 'string',
T_UNDEFINED = 'undefined';
var IS_CANONICAL = /^::/; // must begin with ::
var isCanonicalId = function(id) {
return !!IS_CANONICAL.exec(id);
};
var DEBUG = function() {
exports.debug.apply(this, arguments);
};
exports.debug = function() {
var msg = Array.prototype.join.call(arguments, '');
require('sys').debug(msg);
};
// ..........................................................
// CORE UTILITIES
//
var TMP_ARY = [];
/**
Tests whether the passed object is an array or not.
*/
var isArray;
if (Array.isArray) {
isArray = Array.isArray;
} else {
isArray = function(obj) {
if ('object' !== typeof obj) return false;
if (obj instanceof Array) return true;
return obj.constructor && (obj.constructor.name==='Array');
};
}
exports.isArray = isArray;
/**
Create a new object with the passed object as the prototype.
*/
var createObject;
if (Object.create) {
createObject = Object.create;
} else {
var K = function() {},
Kproto = K.prototype;
createObject = function(obj) {
if (!obj) obj = Object.prototype;
K.prototype = obj;
var ret = new K();
ret.prototype = obj;
K.prototype = Kproto;
return ret ;
};
}
exports.createObject = createObject;
var _constructor, _extend, extend;
// returns a new constructor function with clean closure...
_constructor = function() {
return function() {
if (this.init) return this.init.apply(this, arguments);
else return this;
};
};
_extend = function() {
return extend(this);
};
/**
Creates a "subclass" of the passed constructor. The default constructor
will call look for a local "init" method and call it.
If you don't pass an initial constructor, this will create a new based
object.
*/
extend = function(Constructor) {
var Ret = _constructor();
Ret.prototype = createObject(Constructor.prototype);
Ret.prototype.constructor = Ret;
Ret.super_ = Constructor;
Ret.extend = _extend;
return Ret;
};
exports.extend = extend;
/**
Invokes the passed fn on each item in the array in parallel. Invokes
done when finished.
# Example
parallel([1,2,3], function(item, done) {
// do something with item
done();
})(function(err) {
// invoked when done, err if there was an error
});
@param {Array} array
items to iterate
@param {Function} fn
callback to invoke
@returns {void}
*/
var parallel = function(array, fn) {
if (fn && !fn.displayName) fn.displayName = 'parallel#fn';
return function(done) {
if (array.length === 0) return done(null, []);
var len = array.length,
cnt = len,
cancelled = false,
idx;
var tail = function(err) {
if (cancelled) return; // nothing to do
if (err) {
cancelled = true;
return done(err);
}
if (--cnt <= 0) done();
};
tail.displayName = 'parallel#tail';
for(idx=0;idx<len;idx++) fn(array[idx], tail);
};
};
parallel.displayName = 'parallel';
/**
@private
Implements the sync map() on all platforms
*/
var map;
if (Array.prototype.map) {
map = function(array, fn) {
return array.map(fn);
};
} else {
map = function(array, fn) {
var idx, len = array.length, ret = [];
for(idx=0;idx<len;idx++) {
ret[idx] = fn(array[idx], idx);
}
return ret ;
};
}
map.displayName = 'map';
var PENDING = 'pending',
READY = 'ready',
RUNNING = 'running';
/**
Returns a function that will execute the continuable exactly once and
then cache the result. Invoking the same return function more than once
will simply return the old result.
This is a good replacement for promises in many cases.
h3. Example
{{{
// load a file only once
var loadit = Co.once(Co.fs.loadFile(pathToFile));
loadit(function(content) {
// loads the file
});
loadit(function(content) {
// if already loaded, just invokes with past content
});
}}}
@param {Function} cont
Continuable to invoke
@returns {Function}
A new continuable that will only execute once then returns the cached
result.
*/
var once = function(action, context) {
var state = PENDING,
queue = [],
makePending = false,
args = null;
var ret = function(callback) {
if (!context) context = this;
// cont has already finished, just invoke callback based on result
switch(state) {
// already resolved, invoke callback immediately
case READY:
callback.apply(null, args);
break;
// action has started running but hasn't finished yet
case RUNNING:
queue.push(callback);
break;
// action has not started yet
case PENDING:
queue.push(callback);
state = RUNNING;
action.call(context, function(err) {
args = Array.prototype.slice.call(arguments);
var oldQueue = queue, oldArgs = args;
if (makePending) {
state = PENDING;
queue = [];
args = null;
makePending = false;
} else {
state = READY;
queue = null;
}
if (oldQueue) {
oldQueue.forEach(function(q) { q.apply(null, oldArgs); });
}
});
break;
}
return this;
};
ret.displayName = 'once#handler';
// allow the action to be reset so it is called again
ret.reset = function() {
switch(state) {
// already run, need to reset
case READY:
state = PENDING;
queue = [];
args = null;
break;
// in process - set makePending so that resolving will reset to pending
case RUNNING:
makePending = true;
break;
// otherwise ignore pending since there is nothing to reset
}
};
ret.reset.displayName = 'once#handler.reset';
return ret ;
};
exports.once = once;
/**
Iterate over a property, setting display names on functions as needed.
Call this on your own exports to setup display names for debugging.
*/
var displayNames = function(obj, root) {
var k,v;
for(k in obj) {
if (!obj.hasOwnProperty(k)) continue ;
v = obj[k];
if ('function' === typeof v) {
if (!v.displayName) {
v.displayName = root ? (root+'.'+k) : k;
displayNames(v.prototype, v.displayName);
}
}
}
return obj;
};
// ..........................................................
// ERRORS
//
var NotFound = extend(Error);
NotFound.prototype.init = function(canonicalId, pkgId) {
var msg = canonicalId+' not found';
if (pkgId) {
if (T_STRING === typeof pkgId) msg = msg+' '+pkgId;
else msg = msg+' in package '+(pkgId.id || '(unknown)');
}
this.message = msg;
return this;
};
exports.NotFound = NotFound;
var InvalidPackageDef = extend(Error);
InvalidPackageDef.prototype.init = function(def, reason) {
if ('undefined' !== typeof JSON) def = JSON.stringify(def);
this.message = "Invalid package definition. "+reason+" "+def;
};
exports.InvalidPackageDef = InvalidPackageDef;
// ..........................................................
// semver
//
// ..........................................................
// NATCOMPARE
//
// Used with thanks to Kristof Coomans
// Find online at http://sourcefrog.net/projects/natsort/natcompare.js
// Cleaned up JSLint errors
/*
natcompare.js -- Perform 'natural order' comparisons of strings in JavaScript.
Copyright (C) 2005 by SCK-CEN (Belgian Nucleair Research Centre)
Written by Kristof Coomans <kristof[dot]coomans[at]sckcen[dot]be>
Based on the Java version by Pierre-Luc Paour, of which this is more or less a straight conversion.
Copyright (C) 2003 by Pierre-Luc Paour <[email protected]>
The Java version was based on the C version by Martin Pool.
Copyright (C) 2000 by Martin Pool <[email protected]>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
var natcompare = function() {
var isWhitespaceChar = function(a) {
var charCode = a.charCodeAt(0);
return charCode <= 32;
};
var isDigitChar = function(a) {
var charCode = a.charCodeAt(0);
return ( charCode >= 48 && charCode <= 57 );
};
var compareRight = function(a,b) {
var bias = 0,
ia = 0,
ib = 0,
ca, cb;
// The longest run of digits wins. That aside, the greatest
// value wins, but we can't know that it will until we've scanned
// both numbers to know that they have the same magnitude, so we
// remember it in BIAS.
for (;; ia++, ib++) {
ca = a.charAt(ia);
cb = b.charAt(ib);
if (!isDigitChar(ca) && !isDigitChar(cb)) return bias;
else if (!isDigitChar(ca)) return -1;
else if (!isDigitChar(cb)) return +1;
else if (ca < cb) if (bias === 0) bias = -1;
else if (ca > cb) if (bias === 0) bias = +1;
else if (ca === 0 && cb === 0) return bias;
}
};
var natcompare = function(a,b) {
var ia = 0,
ib = 0,
nza = 0,
nzb = 0,
ca, cb, result;
while (true) {
// only count the number of zeroes leading the last number compared
nza = nzb = 0;
ca = a.charAt(ia);
cb = b.charAt(ib);
// skip over leading spaces or zeros
while ( isWhitespaceChar( ca ) || ca =='0' ) {
if (ca == '0') nza++;
else nza = 0; // only count consecutive zeroes
ca = a.charAt(++ia);
}
while ( isWhitespaceChar( cb ) || cb == '0') {
if (cb == '0') nzb++;
else nzb = 0; // only count consecutive zeroes
cb = b.charAt(++ib);
}
// process run of digits
if (isDigitChar(ca) && isDigitChar(cb)) {
if ((result = compareRight(a.substring(ia), b.substring(ib))) !== 0) {
return result;
}
}
// The strings compare the same. Perhaps the caller
// will want to call strcmp to break the tie.
if (ca === 0 && cb === 0) return nza - nzb;
if (ca < cb) return -1;
else if (ca > cb) return +1;
++ia; ++ib;
}
};
return natcompare;
}();
exports.natcompare = natcompare;
// ..........................................................
// PUBLIC API
//
// Support Methods
var invalidVers = function(vers) {
return new Error('' + vers + ' is an invalid version string');
};
invalidVers.displayName = 'invalidVers';
var compareNum = function(vers1, vers2, num1, num2) {
num1 = Number(num1);
num2 = Number(num2);
if (isNaN(num1)) throw invalidVers(vers1);
if (isNaN(num2)) throw invalidVers(vers2);
return num1 - num2 ;
};
compareNum.displayName = 'compareNum';
var vparse;
var semver = {
/**
Parse the version number into its components. Returns result of a regex.
*/
parse: function(vers) {
var ret = vers.match(/^(=|~)?([\d]+?)(\.([\d]+?)(\.(.+))?)?$/);
if (!ret) return null; // no match
return [ret, ret[2], ret[4] || '0', ret[6] || '0', ret[1]];
},
/**
Returns the major version number of a version string.
@param {String} vers
version string
@returns {Number} version number or null if could not be parsed
*/
major: function(vers) {
return Number(vparse(vers)[1]);
},
/**
Returns the minor version number of a version string
@param {String} vers
version string
@returns {Number} version number or null if could not be parsed
*/
minor: function(vers) {
return Number(vparse(vers)[2]);
},
/**
Returns the patch of a version string. The patch value is always a string
not a number
*/
patch: function(vers) {
var ret = vparse(vers)[3];
return isNaN(Number(ret)) ? ret : Number(ret);
},
STRICT: 'strict',
NORMAL: 'normal',
/**
Returns the comparison mode. Will be one of NORMAL or STRICT
*/
mode: function(vers) {
var ret = vparse(vers)[4];
return ret === '=' ? semver.STRICT : semver.NORMAL;
},
/**
Compares two patch strings using the proper matching formula defined by
semver.org. Returns:
@param {String} patch1 first patch to compare
@param {String} patch2 second patch to compare
@returns {Number} -1 if patch1 < patch2, 1 if patch1 > patch2, 0 if equal
*/
comparePatch: function(patch1, patch2) {
var num1, num2;
if (patch1 === patch2) return 0; // equal
num1 = Number(patch1);
num2 = Number(patch2);
if (isNaN(num1)) {
if (isNaN(num2)) {
// do lexigraphic comparison
return natcompare(patch1, patch2);
} else return -1; // num2 is a number therefore num1 < num2
// num1 is a number but num2 is not so num1 > num2
} else if (isNaN(num2)) {
return 1 ;
} else {
return num1<num2 ? -1 : (num1>num2 ? 1 : 0) ;
}
},
/**
Compares two version strings, using natural sorting for the patch.
*/
compare: function(vers1, vers2) {
var ret ;
if (vers1 === vers2) return 0;
if (vers1) vers1 = vparse(vers1);
if (vers2) vers2 = vparse(vers2);
if (!vers1 && !vers2) return 0;
if (!vers1) return -1;
if (!vers2) return 1;
ret = compareNum(vers1[0], vers2[0], vers1[1], vers2[1]);
if (ret === 0) {
ret = compareNum(vers1[0], vers2[0], vers1[2], vers2[2]);
if (ret === 0) ret = semver.comparePatch(vers1[3], vers2[3]);
}
return (ret < 0) ? -1 : (ret>0 ? 1 : 0);
},
/**
Returns true if the second version string represents a version compatible
with the first version. In general this means the second version must be
greater than or equal to the first version but its major version must not
be different.
*/
compatible: function(reqVers, curVers) {
if (!reqVers) return true; // always compatible with no version
if (reqVers === curVers) return true; // fast path
// make sure these parse - or else treat them like null
if (reqVers && !vparse(reqVers)) reqVers = null;
if (curVers && !vparse(curVers)) curVers = null;
// try fast paths again in case they changed state
if (!reqVers) return true; // always compatible with no version
if (reqVers === curVers) return true; // fast path
// strict mode, must be an exact (semantic) match
if (semver.mode(reqVers) === semver.STRICT) {
return curVers && (semver.compare(reqVers, curVers)===0);
} else {
if (!curVers) return true; // if no vers, always assume compat
// major vers
if (semver.major(reqVers) !== semver.major(curVers)) return false;
return semver.compare(reqVers, curVers) <= 0;
}
},
/**
Normalizes version numbers so that semantically equivalent will be treated
the same.
*/
normalize: function(vers) {
var patch;
if (!vers || vers.length===0) return null;
vers = semver.parse(vers);
if (!vers) return null;
patch = Number(vers[3]);
if (isNaN(patch)) patch = vers[3];
return [Number(vers[1]), Number(vers[2]), patch].join('.');
}
};
exports.semver = semver;
vparse = semver.parse;
// ..........................................................
// FACTORY
//
/**
@constructor
A factory knows how to instantiate a new module for a sandbox, including
generating the require() method used by the module itself. You can return
custom factories when you install a plugin. Your module should export
loadFactory().
The default factory here actually expects to receive a module descriptor
as generated by the build tools.
*/
var Factory = exports.extend(Object);
exports.Factory = Factory;
Factory.prototype.init = function(moduleId, pkg, factory) {
this.id = moduleId;
this.pkg = pkg;
this.factory = factory;
};
/**
Actually generates a new set of exports for the named sandbox. The sandbox
must return a module object that can be used to generate the factory.
If the current value of the local factory is a string, then we will actually
eval/compile the factory as well.
@param sandbox {Sandbox}
The sandbox the will own the module instance
@param module {Module}
The module object the exports will belong to
@returns {Hash} exports from instantiated module
*/
Factory.prototype.call = function(sandbox, module) {
// get the factory function, evaluate if needed
var func = this.factory,
filename = this.__filename,
dirname = this.__dirname;
if (T_STRING === typeof(func)) {
func = this.factory = Factory.compile(func, this.pkg.id+':'+this.id);
}
// generate a nested require for this puppy
var req = sandbox.createRequire(module),
exp = module.exports;
func.call(exp, req, exp, module, filename, dirname);
return module.exports;
};
// standard wrapper around a module. replace item[1] with a string and join.
var MODULE_WRAPPER = [
'(function(require, exports, module) {',
null,
'\n});\n//@ sourceURL=',
null,
'\n'];
/**
Evaluates the passed string. Returns a function.
@param moduleText {String}
The module text to compile
@param moduleId {String}
Optional moduleId. If provided will be used for debug
@returns {Function} compiled factory
*/
Factory.compile = function(moduleText, moduleId) {
var ret;
MODULE_WRAPPER[1] = moduleText;
MODULE_WRAPPER[3] = moduleId || '(unknown module)';
ret = MODULE_WRAPPER.join('');
ret = eval(ret);
MODULE_WRAPPER[1] = MODULE_WRAPPER[3] = null;
return ret;
};
exports.Factory = Factory;
// ..........................................................
// MODULE
//
/**
A Module describes a single module, including its id, ownerPackage, and
the actual module exports once the module has been instantiated. It also
implements the resource() method which can lookup a resource on the module's
package.
*/
var Module = exports.extend(Object);
exports.Module = Module;
Module.prototype.init = function(id, ownerPackage, sandbox) {
this.id = id;
this.ownerPackage = ownerPackage;
this.exports = {};
var module = this;
/**
Lookup a resource on the module's ownerPackage. Returns a URL or path
for the discovered resource. The method used to detect the module or
package is implemented in the package.
Note that this method is generated for each module we create because some
code will try to pluck this method off of the module and call it in a
different context.
@param resourceId {String}
Full or partial name of resource to retrieve
@param done {Function}
Optional. Makes the resource discovery asyncronous
@returns {String} url or path if not called async
*/
this.resource = function(id) {
return sandbox.resource(id, module.id, ownerPackage);
};
};
// ..........................................................
// PACKAGE
//
/**
Package expects you to register the package with a config having the
following keys:
{
"name": "name-of-package" (vs canonical id)
"version": current version of package (if known)
// these are dependencies you require to run. If the package is
// async loaded, these will be the ones loaded
"dependencies": {
"package-name": "version"
},
// these map a specific package-name/version to a canonicalId that must
// be registered for the package to be loaded. You may include
// additional packages here that may be referenced but are not required
// to run (for example - lazy loaded packages)
//
// This also forms the universe of packages this particular package can
// reference.
//
"tiki:packages": {
"package-name": [
{ "version": "1.0.0", "id": "canonicalId", "url": "url" }
]
},
// ids mapped to urls. all of these scripts must be loaded for this
// package to be considered ready
"tiki:scripts": {
"id": "url"
},
// stylesheets that must be loaded for this package to be considered
// ready. The id is used so that the URL can load from a relative path
// that may move around and still be accurate.
"tiki:stylesheets": {
"id": "url",
"id": "url"
},
// maps asset paths for non-JS and non-CSS assets to URLs. Used to
// progrmatically load images, etc.
"tiki:resources": {
"asset/path": "url",
"asset/path": "url"
}
}
This registration ensures that the package and it's related assets are
loaded.
*/
var Package = exports.extend(Object);
exports.Package = Package;
Package.prototype.init = function(id, config) {
if (!isCanonicalId(id)) id = '::'+id; // normalize
this.id = id;
this.config = config;
this.isReady = true;
};
// ..........................................................
// Package Configs
//
/**
Retrieves the named config property. This method can be overidden by
subclasses to perform more advanced processing on the key data
@param {String} key
The key to retrieve
@returns {Object} the key value or undefined
*/
Package.prototype.get = function(key) {
return this.config ? this.config[key] : undefined;
};
/**
Updates the named config property.
@param {String} key
The key to update
@param {Object} value
The object value to change
@returns {Package} receiver
*/
Package.prototype.set = function(key, value) {
if (!this.config) this.config = {};
this.config[key] = value;
return this;
};
/**
Determines the required version of the named packageId, if any, specified
in this package.
@param {String} packageId
The packageId to lookup
@returns {String} The required version or null (meaning any)
*/
Package.prototype.requiredVersion = function(packageId) {
var deps = this.get('dependencies');
return deps ? deps[packageId] : null;
};
// ..........................................................
// Nested Packages
//
/**
Attempts to match the passed packageId and version to the receiver or a
nested package inside the receiver. If a match is found, returns the
packages canonicalId. Otherwise returns null.
This does not search remote sources for the package. It only looks at
what packages are available locally.
This method is called after a package version has been checked for
compatibility with the package dependencies. It is not necessary to
validate the requested version against any dependencies.
@param {String} packageId
The package id to look up
@param {String} vers
The expected version. If null, then return the newest version for the
package.
@param {String} Canonical packageId or null
*/
Package.prototype.canonicalPackageId = function(packageId, vers) {
if ((packageId === this.get('name')) &&
semver.compatible(vers, this.get('version'))) {
return this.id;
}
return null;
};
/**
Returns the receiver or an instance of a nested package if it matches the
canonicalId passed here. This method will only be called with a canonicalId
returned from a previous call to Package#canonicalPackageId.
If the package identified by the canonicalId is not available locally for
some reason, return null.
@param {String} canonicalId
The canonical packageId.
@returns {Package} a package instance or null
*/
Package.prototype.packageFor = function(canonicalId) {
if (canonicalId === this.id) return this;
return null;
};
/**
Verifies that the package identified by the passed canonical id is available
locally and ready for use. If it is not available, this method should
attempt to download the package from a remote source.
Invokes the `done` callback when complete.
If for some reason you cannot download and install the package you should
invoke the callback with an error object describing the reason. There are
a number of standard errors defined on Package such as NotFound.
@param {String} canonicalId
The canonical packageId
@param {Function} done
Callback to invoke with result. Pass an error object if the package
could not be loaded for some reason. Otherwise invoke with no params
@returns {void}
*/
Package.prototype.ensurePackage = function(canonicalId, done) {
if (canonicalId === this.id) return done();
else return done(new NotFound(canonicalId, this));
};
/**
Returns all packages in the package including the package itself and any
nested packages. Default just returns self.
*/
Package.prototype.catalogPackages = function() {
return [this];
};
// ..........................................................
// Package Module Loading
//
/**
Detects whether the moduleId exists in the current package.
@param {String} moduleId
The moduleId to check
@returns {Boolean} true if the module exists
*/
Package.prototype.exists = function(moduleId) {
return !!(this.factories && this.factories[moduleId]);
};
/**
Returns a Factory object for the passed moduleId or null if no matching
factory could be found.
@param {String} moduleId
The moduleId to check
@returns {Factory} factory object
*/
Package.prototype.load = function(moduleId) {
return this.factories ? this.factories[moduleId] : null;
};
// ..........................................................
// LOADER
//
// potentially optimize to avoid memory churn.
var joinPackageId = function joinPackageId(packageId, moduleId) {
return packageId+':'+moduleId;
};
/**
A loader is responsible for finding and loading factory functions. The
primary purpose of the loader is to find packages and modules in those
packages. The loader typically relies on one or more sources to actually
find a particular package.
*/
var Loader = exports.extend(Object);
exports.Loader = Loader;
Loader.prototype.init = function(sources) {
this.sources = sources || [];
this.clear();
};
/**
Clear caches in the loader causing future requests to go back to the
sources.
*/
Loader.prototype.clear = function() {
this.factories = {};
this.canonicalIds = {};
this.packages ={};
this.packageSources = {};
this.canonicalPackageIds = {};
};
/**
The default package. This can be replaced but normally it is empty, meaning
it will never match a module.
@property {Package}
*/
Loader.prototype.defaultPackage = new Package('default', {
name: "default"
});
/**
The anonymous package. This can be used when loading files outside of a
package.
@property {Package}
*/
Loader.prototype.anonymousPackage = new Package('(anonymous)', {
name: "(anonymous)"
});
/**
Discovers the canonical id for a module. A canonicalId is a valid URN that
can be used to uniquely identify a module.
that looks like:
::packageId:moduleId
For example:
::sproutcore-runtime/1.2.0:mixins/enumerable
Canonical Ids are discovered according to the following algorithm:
1. If you pass in an already canonicalId, return it
2. If you pass in a relative moduleId, it will be expanded and attached
to the workingPackage.
3. If you pass in a moduleId with a packageId embedded, lookup the latest
version of the package that is compatible with the passed workingPackage
4. If you pass a moduleId with no packageId embedded, then first look
for the module on the workingPackage.
5. If not found there, look for a packageId with the same name. If that is
found, return either packageId:index or packageId:packageId as module.
6. Otherwise, assume it is part of the default package.
@param {String} moduleId
The moduleId to lookup. May be a canonicalId, packageId:moduleId,
absolute moduleId or relative moduleId
@param {String} curModuleId
Optional. moduleId of the module requesting the lookup. Only needed if
the moduleId param might be relative.
@param {Package} workingPackage
The working package making the request. When searching for a package,
only use packages that are compatible with the workingPackage.
This parameter is also optional, though if you omit it, this method
assumes the anonymousPackage.
@returns {void}
*/
Loader.prototype.canonical = function(moduleId, curModuleId, workingPackage) {
var cache, cacheId, idx, packageId, canonicalId, pkg, ret;
// NORMALIZE PARAMS
// normalize params - curModuleId can be omitted (though relative ids won't)
// work
if (curModuleId && (T_STRING !== typeof curModuleId)) {
workingPackage = curModuleId;
curModuleId = null;
}
// return immediately if already canonical
if (isCanonicalId(moduleId)) return moduleId;
// if no workingPackage, assume anonymous
if (!workingPackage) workingPackage = this.anonymousPackage;
// Resolve moduleId - may return canonical
moduleId = this._resolve(moduleId, curModuleId, workingPackage);
if (isCanonicalId(moduleId)) return moduleId;
// then lookup in cache
cacheId = workingPackage ? workingPackage.id : '(null)';
cache = this.canonicalIds;
if (!cache) cache = this.canonicalIds = {};
if (!cache[cacheId]) cache[cacheId] = {};
cache = cache[cacheId];
if (cache[moduleId]) return cache[moduleId];
cacheId = moduleId; // save for later
// Not Found in Cache. Do a lookup
idx = moduleId.indexOf(':');
if (idx>=0) {
packageId = moduleId.slice(0,idx);
moduleId = moduleId.slice(idx+1);
if (moduleId[0]==='/') {
throw new Error('Absolute path not allowed with packageId');
}
}
// if packageId is provided, just resolve packageId to a canonicalId
ret = null;
if (packageId && (packageId.length>0)) {
canonicalId = this._canonicalPackageId(packageId, null, workingPackage);
if (canonicalId) ret = joinPackageId(canonicalId, moduleId);
// no packageId is provided, we'll need to do a little more searching
} else {
// first look in workingPackage for match...
if (workingPackage && workingPackage.exists(moduleId)) {
ret = joinPackageId(workingPackage.id, moduleId);
// not in working package, look for packageId:index or
// packageId:packageId
} else {
canonicalId = this._canonicalPackageId(moduleId, null, workingPackage);
if (canonicalId) pkg = this._packageFor(canonicalId, workingPackage);
if (pkg) {
if (pkg.exists('index')) ret = joinPackageId(pkg.id, 'index');
else if (pkg.exists(moduleId)) ret = joinPackageId(pkg.id,moduleId);
}
}
// not in working package and isn't a package itself, assume default
// package. If there is no defaultPackage, return with the working
// package. This will fail but at least the error will be more
// helpful
if (!ret) {
if (this.defaultPackage) packageId = this.defaultPackage.id;
else if (this.workingPackage) packageId = this.workingPackage.id;
else if (this.anonymousPackage) packageId = this.anonymousPackage.id;
else return packageId = null;
if (packageId) ret = joinPackageId(packageId, moduleId);
}
}
// save to cache and return
cache[cacheId] = ret;
return ret ;
};
/**
Loads a factory for the named canonical module Id. If you did not obtain
the canonical module id through the loader's canonical() method, then you
must also pass a workingPackage property so that the loader can locate the
package that owns the module.
The returns factory function can be used to actually generate a module.
@param {String} canonicalId
A canonical module id
@param {Package} workingPackage
Optional working package. Only required if you pass in a canonical id
that you did not obtain from the loader's canonical() method.
@returns {void}
*/
Loader.prototype.load = function(canonicalId, workingPackage, sandbox) {
var cache, ret, idx, packageId, moduleId, pkg;
if (!workingPackage) workingPackage = this.anonymousPackage;
cache = this.factories;
if (!cache) cache = this.factories = {};
if (cache[canonicalId]) return cache[canonicalId];
// not in cache - load from package
idx = canonicalId.indexOf(':',2);
packageId = canonicalId.slice(0,idx);
moduleId = canonicalId.slice(idx+1);
pkg = this._packageFor(packageId, workingPackage);
//@if(debug)
if (!pkg) DEBUG('Loader#load - '+packageId+' not found for '+moduleId);
//@endif
if (!pkg) return null; // not found
ret = pkg.load(moduleId, sandbox);
cache[canonicalId] = ret;
return ret ;
};
/**
Returns a catalog of all known packages visible to the workingPackage.
The catalog is simply an array of package objects in no particular order
*/
Loader.prototype.catalogPackages = function(workingPackage) {
if (!workingPackage) workingPackage = this.anonymousPackage;
var catalog = [], sources, idx, len, seen = {};
if (this.defaultPackage) catalog.push(this.defaultPackage);
// anonymous package is never visible unless it is working..
//if (this.anonymousPackage) ret.push(this.anonymousPackage);
// append any packages with versions that haven't been seen already
var append = function(packages) {
var idx, len, check, cur;
if (!packages) return; // nothing to do
len = packages.length;
for(idx=0;idx<len;idx++) {
cur = packages[idx];
check = seen[cur.get('name')];
if (!check) check = seen[cur.get('name')] = {};
if (!check[cur.get('version')]) {
catalog.push(cur);
check[cur.get('version')] = cur;
}
}
};
if (workingPackage) append(workingPackage.catalogPackages());
sources = this.sources;
len = sources.length;
for(idx=0;idx<len;idx++) append(sources[idx].catalogPackages());
seen = null; // no longer needed.
return catalog;
};
/**
Discovers the canonical id for a package. A cnaonicalID is a URN that can
be used to uniquely identify a package. It looks like:
::packageId
for example:
::sproutcore-datastore/1.2.0/1ef3ab23ce23ff938
If you need to perform some low-level operation on a package, this method
is the best way to identify the package you want to work with specifically.
## Examples
Find a compatible package named 'foo' in the current owner module:
loader.canonicalPackage('foo', ownerPackage, function(err, pkg) {
// process response
});
Find the package named 'foo', exactly version '1.0.0'. This may return a
packes nested in the ownerPackage:
loader.canonicalPackage('foo', '=1.0.0', ownerPackage, function(err, pkg) {
// process response
});
Find the latest version of 'foo' installed in the system - not specific to
any particular package
loader.canonicalPackage('foo', loader.anonymousPackage, function(err, pkg) {
// process result
});
@param {String|Package} packageId
The packageId to load. If you pass a package, the package itself will
be returned.
@param {String} vers
The required version. Pass null or omit this parameter to use the latest
version (compatible with the workingPackage).
@param {Package} workingPackage
The working package. This method will search in this package first for
nested packages. It will also consult the workingPackage to determine
the required version if you don't name a version explicitly.
You may pass null or omit this parameter, in which case the anonymous
package will be used for context.
@param {Function} done
Callback. Invoked with an error and the loaded package. If no matching
package can be found, invoked with null for the package.
@returns {void}
*/
Loader.prototype.canonicalPackageId = function(packageId, vers, workingPackage) {
var idx;
// fast path in case you pass in a package already
if (packageId instanceof Package) return packageId.id;
// fast path packageId is already canonical - slice of moduleId first
if (isCanonicalId(packageId)) {
idx = packageId.indexOf(':', 2);
if (idx>=0) packageId = packageId.slice(0,idx);
return packageId;
}
// normalize the params. vers may be omitted
if (vers && (T_STRING !== typeof vers)) {
workingPackage = vers;
vers = null;
}
// must always have a package
if (!workingPackage) workingPackage = this.anonymousPackage;
// if packageId includes a moduleId, slice it off
idx = packageId.indexOf(':');
if (idx>=0) packageId = packageId.slice(0, idx);
// now we can just pass onto internal primitive
return this._canonicalPackageId(packageId, vers, workingPackage);
};
/**
Primitive returns the package instance for the named canonicalId. You can
pass in a canonicalId for a package only or a package and module. In either
case, this method will only return the package instance itself.
Note that to load a canonicalId that was not resolved through the
canonicalPackageId() or canonical() method, you will need to also pass in
a workingPackage so the loader can find the package.
@param {String} canonicalId
The canonicalId to load a package for. May contain only the packageId or
a moduleId as well.
@param {Package} workingPackage
Optional workingPackage used to locate the package. This is only needed
if you request a canonicalId that you did not obtain through the
canonical*() methods on the loader.
@returns {void}
*/
Loader.prototype.packageFor = function(canonicalId, workingPackage){
if (!workingPackage) workingPackage = this.anonymousPackage;
// remove moduleId
var idx = canonicalId.indexOf(':', 2);
if (idx>=0) canonicalId = canonicalId.slice(0, idx);
return this._packageFor(canonicalId, workingPackage);
};
/**
Verifies that the named canonicalId is ready for use, including any of its
dependencies. You can pass in either a canonical packageId only or a
moduleId. In either case, this method will actually only check the package
properties for dependency resolution since dependencies are not tracked for
individual modules.
@param {String} canonicalId
The canonicalId to use for lookup
@param
*/
Loader.prototype.ready = function(canonicalId, workingPackage) {
if (!workingPackage) workingPackage = this.anonymousPackage;
// strip out moduleId
var idx = canonicalId.indexOf(':', 2),
moduleId, pkg;
if (idx >= 0) {
moduleId = canonicalId.slice(idx+1);
canonicalId = canonicalId.slice(0, idx);
}
if (this._packageReady(canonicalId, workingPackage, {})) {
pkg = this._packageFor(canonicalId, workingPackage);
if (!pkg) return false;
return !!pkg.exists(moduleId);
} else return false;
};
/**
Ensures the package that maps to the passed packageId/vers combo and all
of its known dependencies are loaded and ready for use. If anything is not
loaded, it will load them also.
Invokes the passed callback when loading is complete.
This method ends up calling ensurePackage() on one or more of its sources
to get the actual packages to load.
@param {String} packageId
The packageID to load. May be a packageId name or a canonical packageId
@param {String} vers
Optional version used to constrain the compatible package
@param {Package} workingPackage
Optional working package used to match the packageId. If the package
might be nested you should always pass a workingPackage. Default assumes
anonymousPackage.
@param {Function} done
Callback invoked when package is loaded. Passes an error if there was an
error. Otherwise no params.
@returns {void}
*/
Loader.prototype.ensurePackage = function(packageId, vers, workingPackage, done) {
// normalize params
if (vers && (T_STRING !== typeof vers)) {
done = workingPackage ;
workingPackage = vers;
vers = null;
}
if (workingPackage && (T_FUNCTION === typeof workingPackage)) {
done = workingPackage;
workingPackage = null;
}
if (!workingPackage) workingPackage = this.anonymousPackage;
this._ensurePackage(packageId, vers, workingPackage, {}, done);
};
/**
@private
Primitive for ensurePackage(). Does no param normalization. Called
recursively for dependencies.
*/
Loader.prototype._ensurePackage = function(packageId, vers, workingPackage, seen, done) {
var loader = this, canonicalId, source;
// find the canonicalId and source to ask to ensure...
canonicalId = this._canonicalPackageId(packageId, vers, workingPackage);
if (!canonicalId) {
return done(new NotFound(packageId, workingPackage));
}
if (seen[canonicalId]) return done(); // success
seen[canonicalId] = true;
source = this._sourceForCanonicalPackageId(canonicalId, workingPackage);
if (!source) {
return done(new NotFound(canonicalId, workingPackage));
}
source.ensurePackage(canonicalId, function(err) {
var pkg, deps, packageId, packageIds;
if (err) return done(err);
pkg = loader.packageFor(canonicalId, workingPackage);
if (!pkg) {
return done(new NotFound(canonicalId, workingPackage));
}
deps = pkg.get('dependencies');
if (!deps) return done(); // nothing to do
// map deps to array to we can process in parallel
packageIds = [];
for(packageId in deps) {
if (!deps.hasOwnProperty(packageId)) continue;
packageIds.push({ packageId: packageId, vers: deps[packageId] });
}
parallel(packageIds, function(info, done) {
loader._ensurePackage(info.packageId, info.vers, pkg, seen, done);
})(done);
});
};
/**
@private
Discovers the canonical packageId for the named packageId, version and
working package. This will also store in cache the source where you can
locare and load the associated package, if needed.
This primitive is used by all other package methods to resolve a package
into a canonicalId that can be used to reference a specific package instance
It does not perform any error checking on passed in parameters which is why
it should never be called directly outside of the Loader itself.
@param {String|Package} packageId
The packageId to load. If you pass a package, the package itself will
be returned.
@param {String} vers
The required version. Pass null or omit this parameter to use the latest
version (compatible with the workingPackage).
@param {Package} workingPackage
The working package. This method will search in this package first for
nested packages. It will also consult the workingPackage to determine
the required version if you don't name a version explicitly.
@returns {String}
*/
Loader.prototype._canonicalPackageId = function(packageId, vers, workingPackage) {
// fast paths
if (packageId instanceof Package) return packageId.id;
if (isCanonicalId(packageId)) return packageId;
if ((packageId === 'default') && this.defaultPackage) {
return this.defaultPackage.id;
}
var cache = this.canonicalPackageIds,
cacheId, sources, ret, idx, len, source;
// use anonymousPackage if no workingPackage is provided
if (!workingPackage) workingPackage = this.anonymousPackage;
if (!workingPackage) throw new Error('working package is required');
// if packageId is already canonical, vers must be null, otherwise lookup
// vers in working package
if (!vers) vers = workingPackage.requiredVersion(packageId);
// look in cache...
cacheId = workingPackage.id;
if (!cache) cache = this.canonicalPackageIds = {};
if (!cache[cacheId]) cache[cacheId] = {};
cache = cache[cacheId];
if (!cache[packageId]) cache[packageId] = {};
cache = cache[packageId];
if (cache[vers]) return cache[vers];
sources = this.sources;
// first, ask the workingPackage
ret = workingPackage.canonicalPackageId(packageId, vers);
source = workingPackage;
// not found - make sure there isn't another incompatible version in
// workingPackage. nested packages superceed all other packages so if there
// is an incompatible nested version we need to throw an error.
if (!ret) {
ret = workingPackage.canonicalPackageId(packageId, null);
if (ret) {
throw new Error(
workingPackage.get('name')+" contains an incompatible nested"+
" package "+packageId+" (expected: "+vers+")");
}
}
// next, if not found in the workingPackage, then ask each of our
// sources in turn until a match is found. When found, return
if (!ret && sources) {
len = sources.length;
for(idx=0;!ret && (idx<len);idx++) {
source = sources[idx];
ret = source.canonicalPackageId(packageId, vers);
}
}
if (ret) this._cachePackageSource(ret, workingPackage, source);
cache[vers] = ret;
return ret ;
};
// add a function to the cache that will immediately return the source
Loader.prototype._cachePackageSource = function(id, workingPackage, source) {
var scache = this.packageSources, pkgId = workingPackage.id;
if (!scache) scache = this.packageSources = {};
if (!scache[pkgId]) scache[pkgId] = {};
scache = scache[pkgId];
scache[id] = source;
};
/**
Looks up the source for the named canonicalId in the cache. Returns null
if no match is found.
*/
Loader.prototype._sourceForCanonicalPackageId = function(canonicalId, workingPackage) {
var scache = this.packageSources,
wpackageId = workingPackage.id,
pkg, sources, len, idx, ret;
if (!scache) scache = this.packageSources = {};
if (!scache[wpackageId]) scache[wpackageId] = {};
scache = scache[wpackageId];
if (scache[canonicalId]) return scache[canonicalId];
sources = this.sources;
// first, ask the workingPackage to find any matching package (since it
// can only have one version). Then check the returned version against
// the expected version.
if (workingPackage) {
pkg = workingPackage.packageFor(canonicalId);
if (pkg) ret = workingPackage;
}
if (!ret && sources) {
len = sources.length;
for(idx=0;!ret && (idx<len); idx++) {
ret = sources[idx];
if (!ret.packageFor(canonicalId)) ret = null;
}
}
scache[canonicalId] = ret;
return ret ;
};
/**
Primitive actually loads a package from a canonicalId. Throws an exception
if source for package is not already in cache. Also caches loaded package.
*/
Loader.prototype._packageFor = function(canonicalId, workingPackage) {
var cache, source, ret;
// special case - if default packageId just get the default package.
if (this.defaultPackage && (canonicalId === this.defaultPackage.id)) {
return this.defaultPackage;
}
// try to resolve out of cache
cache = this.packages;
if (!cache) cache = this.packages = {};
if (cache[canonicalId]) return cache[canonicalId];
source = this._sourceForCanonicalPackageId(canonicalId, workingPackage);
if (source) ret = source.packageFor(canonicalId);
cache[canonicalId] = ret;
return ret ;
};
/**
Primitive simply checks to see if the named canonicalId is ready or not
along with any dependencies
*/
Loader.prototype._packageReady = function(canonicalId, workingPackage, seen) {
var cache = this.packages, pkg, deps, packageId, vers;
// if we've already seen this package, exit immediately
if (seen[canonicalId]) return true;
seen[canonicalId] = true;
// first try to find the package for the receiver
pkg = this._packageFor(canonicalId, workingPackage);
if (!pkg) return false; // nothing to do.
// look at dependencies. make sure they are also loaded
deps = pkg.get('dependencies');
for(packageId in deps) {
if (!deps.hasOwnProperty(packageId)) continue;
vers = deps[packageId];
canonicalId = this._canonicalPackageId(packageId, vers, pkg);
if (!canonicalId) return false;
return this._packageReady(canonicalId, pkg, seen);
}
return true;
};
/**
Take a relative or fully qualified module name as well as an optional
base module Id name and returns a fully qualified module name. If you
pass a relative module name and no baseId, throws an exception.
Any embedded package name will remain in-tact.
resolve('foo', 'bar', 'my_package') => 'foo'
resolve('./foo', 'bar/baz', 'my_package') => 'my_package:bar/foo'
resolve('/foo/bar/baz', 'bar/baz', 'my_package') => 'default:/foo/bar/baz'
resolve('foo/../bar', 'baz', 'my_package') => 'foo/bar'
resolve('your_package:foo', 'baz', 'my_package') => 'your_package:foo'
If the returned id does not include a packageId then the canonical()
method will attempt to resolve the ID by searching the default package,
then the current package, then looking for a package by the same name.
@param {String} moduleId relative or fully qualified module id
@param {String} baseId fully qualified base id
@returns {String} fully qualified name
*/
Loader.prototype._resolve = function(moduleId, curModuleId, pkg){
var path, len, idx, part, parts, packageId, err;
// if id does not contain a packageId and it starts with a / then
// return with anonymous package id.
if (moduleId[0]==='/' && moduleId.indexOf(':')<0) {
return this.anonymousPackage.id + ':' + moduleId;
}
// contains relative components?
if (moduleId.match(/(^\.\.?\/)|(\/\.\.?\/)|(\/\.\.?\/?$)/)) {
// if we have a packageId embedded, get that first
if ((idx=moduleId.indexOf(':'))>=0) {
packageId = moduleId.slice(0,idx);
moduleId = moduleId.slice(idx+1);
path = []; // path must always be absolute.
// if no package ID, then use baseId if first component is . or ..
} else if (moduleId.match(/^\.\.?\//)) {
if (!curModuleId) {
throw new Error("id required to resolve relative id: "+moduleId);
}
// if base moduleId contains a packageId return an error
if (curModuleId.indexOf(':')>=0) {
throw new Error("current moduleId cannot contain packageId");
}
// use the pkg.id (which will be canonical)
if (pkg) packageId = pkg.id;
// work from current moduleId as base. Ignore current module name
path = curModuleId.split('/');
path.pop();
} else path = [];
// iterate through path components and update path
parts = moduleId.split('/');
len = parts.length;
for(idx=0;idx<len;idx++) {
part = parts[idx];
if (part === '..') {
if (path.length<1) throw new Error("invalid path: "+moduleId);
path.pop();
} else if (part !== '.') path.push(part);
}
moduleId = path.join('/');
if (packageId) moduleId = joinPackageId(packageId, moduleId);
}
return moduleId ;
};
// ..........................................................
// SANDBOX
//
/**
A Sandbox maintains a cache of instantiated modules. Whenever a modules
is instantiated, it will always be owned by a single sandbox. This way
when you required the same module more than once, you will always get the
same module.
Each sandbox is owned by a single loader, which is responsible for providing
the sandbox with Factory objects to instantiate new modules.
A sandbox can also have a 'main' module which can be used as a primary
entry point for finding other related modules.
*/
var Sandbox = exports.extend(Object);
exports.Sandbox = Sandbox;
Sandbox.prototype.init = function(loader, env, args, mainModuleId) {
this.loader = loader;
this.env = env;
this.args = args;
if (mainModuleId) this.main(mainModuleId);
this.clear();
};
Sandbox.prototype.catalogPackages = function(workingPackage) {
return this.loader.catalogPackages(workingPackage);
};
Sandbox.prototype.createRequire = function(module) {
var sandbox = this,
curId = module.id,
curPkg = module.ownerPackage,
reqd;
// basic synchronous require
var req = function(moduleId, packageId) {
if (packageId && moduleId.indexOf(':')<0) {
if (packageId.isPackage) packageId = packageId.id;
moduleId = packageId+':'+moduleId;
}
return sandbox.require(moduleId, curId, curPkg);
};
reqd = req.displayName = (curId||'(unknown)')+'#require';
// expose any native require. Mostly used by seed
req.nativeRequire = sandbox.nativeRequire;
// async version - packageId is optional
req.ensure = function(moduleIds, done) {
// always normalize moduleId to an array
if (!isArray(moduleIds)) {
moduleIds = Array.prototype.slice.call(arguments);
done = moduleIds.pop();
}
// ensure each module is loaded
parallel(moduleIds, function(moduleId, done) {
sandbox.ensure(moduleId, curId, curPkg, done);
})(function(err) {
if (err) return done(err);
if (done.length<=1) return done(); // don't lookup modules themselves
done(null, map(moduleIds, function(moduleId) {
return sandbox.require(moduleId, curId, curPkg);
}));
});
};
req.ensure.displayName = reqd+'.ensure';
// return true if the passed module or modules are ready for use right now
// this is like calling ensure() but it won't load anything that isn't
// actually ready
req.ready = function(moduleIds) {
var idx, len ;
// always normalize moduleId to an array
if (!isArray(moduleIds)) {
moduleIds = Array.prototype.slice.call(arguments);
}
len = moduleIds.length;
for(idx=0;idx<len;idx++) {
if (!sandbox.ready(moduleIds[idx], curId, curPkg)) return false;
}
return true;
};
req.ready.displayName = reqd+'.ready';
/**
Returns the package for the named packageId and optional version from
the perspective of the current package. This invokes a similar method
on the sandbox, which will pass it along to the loader, though a secure
sandbox may actually wrap the responses as well.
This method only acts on packages available locally. To get possibly
remote packages, you must first call require.ensurePackage() to ensure
the package and its dependencies have been loaded.
@param {String} packageId
The packageId to load
@param {String} vers
Optional version
@returns {Package} the package or null
*/
req.packageFor = function(packageId, vers) {
return sandbox.packageFor(packageId, vers, curPkg);
};
req.packageFor.displayName = reqd+'.packageFor';
/**
Asynchronously loads the named package and any dependencies if needed.
This is only required if you suspect your package may not be available
locally. If your callback accepts only one parameter, then the packages
will be loaded but not instantiated. The first parameter is always an
error object or null.
If your callback accepts more than one parameter, then the packages will
be instantiated and passed to your callback as well.
If a package cannot be loaded for some reason, your callback will be
invoked with an error of type NotFound.
@param {String} packageId
The packageId to load
@param {String} vers
Optional version
@param {Function} done
Callback invoked once packages have loaded.
@returns {Package} the package or null
*/
req.ensurePackage = function(packageId, vers, done) {
sandbox.ensurePackage(packageId, vers, curPkg, function(err) {
if (err) return done(err);
if (done.length <= 1) return done();
done(null, sandbox.packageFor(packageId, vers, curPkg));
});
};
req.ensurePackage.displayName = reqd+'.ensurePackage.displayName';
/**
Returns a catalog of all packages visible to the current module without
any additional loading. This may be an expensive operation; you should
only use it when necessary to detect plugins, etc.
*/
req.catalogPackages = function() {
return sandbox.catalogPackages(curPkg);
};
// mark main module in sandbox
req.main = sandbox.main();
req.env = sandbox.env;
req.args = sandbox.args;
req.sandbox = sandbox;
req.loader = sandbox.loader;
req.isTiki = true; // walk like a duck
return req;
};
// ..........................................................
// RESOLVING MODULE IDS
//
Sandbox.prototype.Module = Module;
/**
Retrieves a module object for the passed moduleId. You can also pass
optional package information, including an optional curModuleId and a
workingPackage. You MUST pass at least a workingPackage.
The returned module object represents the module but the module exports may
not yet be instantiated. Use require() to retrieve the module exports.
@param {String} moduleId
The module id to lookup. Should include a nested packageId
@param {String} curModuleId
Optional current module id to resolve relative modules.
@param {Package} workingPackage
The working package making the request
@returns {void}
*/
Sandbox.prototype.module = function(moduleId, curModuleId, workingPackage) {
var ret, canonicalId, cache, packageId, idx, pkg;
// assume canonicalId will normalize params
canonicalId = this.loader.canonical(moduleId, curModuleId, workingPackage);
if (!canonicalId) throw(new NotFound(moduleId, workingPackage));
// get out of cache first
cache = this.modules;
if (!cache) cache = this.modules = {};
if (ret = cache[canonicalId]) return ret;
// not in cache...add it
idx = canonicalId.indexOf(':', 2);
moduleId = canonicalId.slice(idx+1);
packageId = canonicalId.slice(0, idx);
pkg = this.loader.packageFor(packageId, workingPackage);
if (!pkg) throw(new NotFound(packageId, workingPackage));
ret = cache[canonicalId] = new this.Module(moduleId, pkg, this);
return ret ;
};
/**
Returns the main module for the sandbox. This should only be called
from the factory when it is setting main on itself. Otherwise the main
module may not exist yet.
Note that the mainModule will be resolved using the anonymousPackage so
the named module must be visible from there.
*/
Sandbox.prototype.main = function(newMainModuleId, workingPackage) {
if (newMainModuleId !== undefined) {
this._mainModule = null;
this._mainModuleId = newMainModuleId;
this._mainModuleWorkingPackage = workingPackage;
return this;
} else {
if (!this._mainModule && this._mainModuleId) {
workingPackage = this._mainModuleWorkingPackage;
this._mainModule = this.module(this._mainModuleId, workingPackage);
}
return this._mainModule;
}
};
/**
Returns the exports for the named module.
@param {String} moduleId
The module id to lookup. Should include a nested packageId
@param {String} curModuleId
Optional current module id to resolve relative modules.
@param {Package} workingPackage
The working package making the request
@param {Function} done
Callback to invoke when the module has been retrieved.
@returns {void}
*/
Sandbox.prototype.require = function(moduleId, curModuleId, workingPackage) {
var ret, canonicalId, cache, used, factory, module, exp;
// assume canonical() will normalize params
canonicalId = this.loader.canonical(moduleId, curModuleId, workingPackage);
if (!canonicalId) throw new NotFound(moduleId, workingPackage);
// return out of cache
cache = this.exports; used = this.usedExports;
if (!cache) cache = this.exports = {};
if (!used) used = this.usedExports = {};
if (ret = cache[canonicalId]) {
ret = ret.exports;
if (!used[canonicalId]) used[canonicalId] = ret;
return ret;
}
// not in cache, get factory, module, and run function...
factory = this.loader.load(canonicalId, workingPackage, this);
if (!factory) throw(new NotFound(canonicalId, workingPackage));
module = this.module(canonicalId, workingPackage);
cache[canonicalId] = module;
exp = factory.call(this, module);
module.exports = exp;
// check for cyclical refs
if (used[canonicalId] && (used[canonicalId] !== exp)) {
throw new Error("cyclical requires() in "+canonicalId);
}
return exp;
};
/**
Returns true if the given module is ready. This checks the local cache
first then hands this off to the loader.
*/
Sandbox.prototype.ready = function(moduleId, curModuleId, workingPackage) {
// assume canonicalPackageId() will normalize params
var id = this.loader.canonical(moduleId, curModuleId, workingPackage);
return id ? this.loader.ready(id) : false;
};
/**
Ensures the passed moduleId and all of its dependencies are available in
the local domain. If any dependencies are not available locally, attempts
to retrieve them from a remote server.
You don't usually call this method directly. Instead you should call the
require.ensure() method defined on a module's local require() method.
*/
Sandbox.prototype.ensure = function(moduleId, curModuleId, workingPackage, done) {
var id, loader, packageId, idx;
// normalize params so that done is in right place
if (curModuleId && (T_STRING !== typeof curModuleId)) {
done = workingPackage;
workingPackage = curModuleId;
curModuleId = null;
}
if (workingPackage && (T_FUNCTION === typeof workingPackage)) {
done = workingPackage ;
workingPackage = null;
}
id = this.loader.canonical(moduleId, curModuleId, workingPackage);
if (!id) return done(new NotFound(moduleId, workingPackage));
idx = id.indexOf(':', 2);
moduleId = id.slice(idx+1);
packageId = id.slice(0, idx);
loader = this.loader;
loader.ensurePackage(packageId, workingPackage, function(err) {
if (err) return done(err);
var pkg = loader.packageFor(packageId, workingPackage);
if (!pkg.exists(moduleId)) done(new NotFound(moduleId, pkg));
else done(); // all clear
});
};
/**
TODO: document
*/
Sandbox.prototype.packageFor = function(packageId, vers, workingPackage) {
// assume canonicalPackageId() will normalize params
var id = this.loader.canonicalPackageId(packageId, vers, workingPackage);
if (!id) return null;
return this.loader.packageFor(id);
};
/**
TODO: document
*/
Sandbox.prototype.ensurePackage = function(packageId, vers, workingPackage, done) {
// normalize params so that done is in right place
if (vers && (T_STRING !== typeof vers)) {
done = workingPackage;
workingPackage = vers;
vers = null;
}
if (workingPackage && (T_FUNCTION === typeof workingPackage)) {
done = workingPackage ;
workingPackage = null;
}
var id = this.loader.canonicalPackageId(packageId, vers, workingPackage);
if (!id) return done(new NotFound(packageId, workingPackage));
this.loader.ensurePackage(id, done);
};
/**
Returns the path or URL to a resource in the named package.
*/
Sandbox.prototype.resource = function(resourceId, moduleId, ownerPackage) {
if (!ownerPackage.resource) return null;
return ownerPackage.resource(resourceId, moduleId);
};
/**
Clears the sandbox. requiring modules will cause them to be reinstantied
*/
Sandbox.prototype.clear = function() {
this.exports = {};
this.modules = {};
this.usedExports = {};
return this;
};
// ..........................................................
// BROWSER
//
// Implements a default loader source for use in the browser. This object
// should also be set as the "require" global on the browser to allow for
// module registrations
var Browser = exports.extend(Object);
exports.Browser = Browser;
Browser.prototype.init = function() {
this._ready = {};
this._unload = {};
this.clear();
};
/**
Reset the browser caches. This would require all packages and modules
to register themselves. You should also clear the associated loader and
sandbox if you use this.
*/
Browser.prototype.clear = function() {
this.packageInfoByName = {}; // stores package info sorted by name/version
this.packageInfoById = {}; // stores package info sorted by id
this.packages = {}; // instantiated packages
this.factories = {}; // registered module factories by id
this.stylesheetActions = {}; // resolvable stylesheet load actions
this.scriptActions = {}; // resolvable script actions
this.ensureActions = {}; // resolvable package actions
};
/**
Configures a basic sandbox environment based on the browser. Now you can
register and require from it.
@returns {Browser} new instance
*/
Browser.start = function(env, args, queue) {
// build new chain of objects and setup require.
var browser, len, idx, action;
browser = new Browser();
browser.loader = new Loader([browser]);
browser.sandbox = new Sandbox(browser.loader, env, args);
browser.queue = queue;
var mod = {
id: 'index',
ownerPackage: browser.loader.anonymousPackage
};
browser.require = browser.sandbox.createRequire(mod);
// TODO: amend standard CommonJS methods for loading modules when they
// are standardized
return browser;
};
Browser.prototype.replay = function() {
var queue = this.queue,
len = queue ? queue.length : 0,
idx, action;
this.queue = null;
for(idx=0;idx<len;idx++) {
action = queue[idx];
this[action.m].apply(this, action.a);
}
return this;
};
// safe - in place of preamble start()
Browser.prototype.start = function() {
return this;
};
/**
Makes all dependencies of the passed canonical packageId global. Used
for backwards compatibility with non-CommonJS libraries.
*/
Browser.prototype.global = function(canonicalId) {
if (!domAvailable && !xhrAvailable) return this; // don't work out of brsr
var GLOBAL = (function() { return this; })();
var globals, pkg, deps, packageId, exports, keys, key, idx, len;
globals = this.globals;
if (!globals) globals = this.globals = {};
pkg = this.packageFor(canonicalId);
if (!pkg) throw new Error(canonicalId+' package not found');
deps = pkg.get('dependencies');
if (!deps) return this; // nothing to do
for(packageId in deps) {
if (!deps.hasOwnProperty(packageId)) continue;
canonicalId = this.loader.canonical(packageId, pkg);
if (globals[canonicalId]) continue;
globals[canonicalId] = true;
// some cases a dependency refers to a package that is itself not
// using modules. In this case just ignore
if (!this.sandbox.ready(packageId, pkg)) continue;
exports = this.sandbox.require(packageId, pkg);
if (keys = exports.__globals__) {
len = keys.length;
for(idx=0;idx<len;idx++) {
key = keys[idx];
GLOBAL[key] = exports[key];
}
// no __globals__ key is defined so just iterate through any exported
// properties. this should actually be the more common case
} else {
for(key in exports) {
if (!exports.hasOwnProperty(key)) continue;
GLOBAL[key] = exports[key];
}
}
}
return this;
};
// ..........................................................
// Ready & Unload Handlers
//
var buildInvocation = function(args) {
var context, method;
if (args.length === 1) {
context = null;
method = args[0];
args = Array.prototype.slice.call(args, 1);
} else {
context = args[0];
method = args[1];
args = Array.prototype.slice.call(args, 2);
}
return { target: context, method: method, args: args };
};
var queueListener = function(base, queueName, args) {
if (!base[queueName]) base[queueName] = [];
base[queueName].push(buildInvocation(args));
};
/**
Invoke the passed callback when the document is ready. You can pass
either an object/function or a moduleId and property name plus additional
arguments.
*/
Browser.prototype.addReadyListener = function(context, method) {
if (this._ready && this._ready.isReady) {
this._invoke(buildInvocation(arguments));
} else {
this._setupReadyListener();
queueListener(this._ready, 'queue', arguments);
}
};
/**
Invoke the passed callback just after any ready listeners have fired but
just before the main moduleId is required. This is primarily provided as
a way for legacy environments to hook in their own main function.
*/
Browser.prototype.addMainListener = function(context, method) {
if (this._ready && this._ready.isReady) {
this._invoke(buildInvocation(arguments));
} else {
this._setupReadyListener();
queueListener(this._ready, 'mqueue', arguments);
}
};
/**
Invoke the passed callback when the browser is about to unload.
*/
Browser.prototype.addUnloadListener = function(context, method) {
if (this._unload && this._unload.isUnloading) {
this._invoke(buildInvocation(arguments));
} else {
this._setupUnloadListener();
queueListener(this._unload, 'queue', arguments);
}
};
Browser.prototype._invoke = function(inv) {
var target = inv.target, method = inv.method;
if (T_STRING === typeof target) target = this.require(target);
if (T_STRING === typeof method) method = target[method];
if (method) method.apply(target, inv.args);
inv.target = inv.method = inv.args = null;
};
Browser.prototype._setupReadyListener = function() {
if (this._ready.setup) return this;
this._ready.setup =true;
var ready = this._ready, source = this, fire;
fire = function() {
if (ready.isReady) return;
ready.isReady = true;
// first cleanup any listeners so they don't fire again
if (ready.cleanup) ready.cleanup();
ready.cleanup = null;
var q, len, idx;
q = ready.queue;
len = q ? q.length : 0;
ready.queue = null;
for(idx=0;idx<len;idx++) source._invoke(q[idx]);
q = ready.mqueue;
len = q ? q.length : 0 ;
ready.mqueue = null;
for(idx=0;idx<len;idx++) source._invoke(q[idx]);
source._runMain(); // get main module.
};
// always listen for onready event - detect based on platform
// those code is derived from jquery 1.3.1
// server-side JS
if (T_UNDEFINED === typeof document) {
// TODO: handler server-side JS cases here
// Mozilla, Opera, webkit nightlies
} else if (document.addEventListener) {
// cleanup handler to be called whenever any registered listener fires
// should prevent additional listeners from firing
ready.cleanup = function() {
document.removeEventListener('DOMContentLoaded', fire, false);
document.removeEventListener('load', fire, false);
};
// register listeners
document.addEventListener('DOMContentLoaded', fire, false);
document.addEventListener('load', fire, false);
// IE
} else if (document.attachEvent) {
// cleanup handler - should cleanup all registered listeners
ready.cleanup = function() {
document.detachEvent('onreadystatechange', fire);
document.detachEvent('onload', fire);
ready.ieHandler = null; // will stop the ieHandler from firing again
};
// listen for readystate and load events
document.attachEvent('onreadystatechange', fire);
document.attachEvent('onload', fire);
// also if IE and no an iframe, continually check to see if the document
// is ready
// NOTE: DO NOT CHANGE TO ===, FAILS IN IE.
if ( document.documentElement.doScroll && window == window.top ) {
ready.ieHandler = function() {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
if (ready.ieHandler && !ready.isReady) {
try {
document.documentElement.doScroll("left");
} catch( error ) {
setTimeout( ready.ieHandler, 0 );
return;
}
}
// and execute any waiting functions
fire();
};
ready.ieHandler();
}
}
};
Browser._scheduleUnloadListener = function() {
if (this._unload.setup) return this;
this._unload.setup =true;
var unload = this._unload, source = this, fire;
unload.isUnloading = false;
fire = function() {
if (unload.isUnloading) return;
unload.isUnloading = true;
if (unload.cleanup) unload.cleanup();
unload.cleanup = null;
var q = unload.queue,
len = q ? q.length : 0,
idx, inv;
unload.queue = null;
for(idx=0;idx<len;idx++) source._invoke(q[idx]);
};
if (T_UNDEFINED === typeof document) {
// TODO: Handle server-side JS mode
} else if (document.addEventListener) {
unload.cleanup = function() {
document.removeEventListener('unload', fire);
};
document.addEventListener('unload', fire, false);
} else if (document.attachEvent) {
unload.cleanup = function() {
document.detachEvent('onunload', fire);
};
document.attachEvent('unload', fire);
}
};
// ..........................................................
// Registration API
//
/**
Sets the main moduleId on the sandbox. This module will be automatically
required after all other ready and main handlers have run when the document
is ready.
@param {String} moduleId
A moduleId with packageId included ideally. Can be canonicalId.
@returns {void}
*/
Browser.prototype.main = function(moduleId, method) {
if (this.sandbox) this.sandbox.main(moduleId);
this._setupReadyListener(); // make sure we listen for ready event
this._main = { id: moduleId, method: method };
};
Browser.prototype._runMain = function() {
if (!this._main) return ;
var moduleId = this._main.id,
method = this._main.method,
req = this.require;
if (!moduleId || !req) return ;
this._main = null;
// async load any main module dependencies if needed then require
req.ensure(moduleId, function(err) {
if (err) throw err;
var exp = req(moduleId);
if (T_STRING === typeof method) method = exp[method];
if (method) method.call(exp);
});
};
// creates a new action that will invoke the passed value then setup the
// resolve() method to wait on response
Browser.prototype._action = function(action) {
var ret;
ret = once(function(done) {
ret.resolve = function(err, val) {
ret.resolve = null; // no more...
done(err, val);
};
action();
});
return ret;
};
Browser.prototype._resolve = function(dict, key, value) {
// for pushed content, just create the action function
if (!dict[key]) dict[key] = function(done) { done(null, value); };
// if a value already exists, call resolve if still valid
else if (dict[key].resolve) dict[key].resolve(null, value);
return this;
};
Browser.prototype._fail = function(dict, key, err) {
if (dict[key].resolve) dict[key].resolve(err);
};
var T_SCRIPT = 'script',
T_STYLESHEET = 'stylesheet',
T_RESOURCE = 'resource';
/**
Normalizes package info, expanding some compacted items out to full
info needed.
*/
Browser.prototype._normalize = function(def, packageId) {
if (!isCanonicalId(packageId)) packageId = '::'+packageId;
def.id = packageId;
def.version = semver.normalize(def.version);
def['tiki:external'] = !!def['tiki:external'];
def['tiki:private'] = !!def['tiki:private']; // ditto
// expand list of resources
var base = def['tiki:base'];
if (def['tiki:resources']) {
def['tiki:resources'] = map(def['tiki:resources'], function(item) {
// expand a simple string into a default entry
if (T_STRING === typeof item) {
item = {
id: packageId+':'+item,
name: item
};
}
// must have an item name or you can't lookup the resource
if (!item.name) {
throw new InvalidPackageDef(def, 'resources must have a name');
}
if (!item.id) {
item.id = packageId+':'+item.name;
}
if (!isCanonicalId(item.id)) item.id = '::'+item.id;
// assume type from ext if one is provided
if (!item.type) {
if (item.name.match(/\.js$/)) item.type = T_SCRIPT;
else if (item.name.match(/\.css$/)) item.type = T_STYLESHEET;
else item.type = T_RESOURCE;
}
if (!item.url) {
if (base) item.url = base+'/'+item.name;
else item.url = item.id+item.name;
}
return item;
});
}
// always have a nested and dependencies hash, even if it is empty
if (!def.dependencies) def.dependencies = {};
var nested = def['tiki:nested'], key;
if (nested) {
for(key in nested) {
if (!nested.hasOwnProperty(key)) continue;
if (!isCanonicalId(nested[key])) nested[key] = '::'+nested[key];
}
} else def['tiki:nested'] = {};
return def;
};
/**
Register new package information.
*/
Browser.prototype.register = function(packageId, def) {
var reg, replace, name, vers, idx = -1;
// normalize some basics...
def = this._normalize(def, packageId);
packageId = def.id; // make sure to get normalized packageId
// see if a pkg with same id is registered. if so, replace it only if
// the new one is not external and the old one is
reg = this.packageInfoById;
if (!reg) reg = this.packageInfoById = {};
if (reg[packageId]) {
if (!reg[packageId]['tiki:external']) return this;
replace = reg[packageId];
}
reg[packageId] = def;
if (def.name) {
name = def.name;
vers = def.version;
reg = this.packageInfoByName;
if (!reg) reg = this.packageInfoByName = {};
if (!reg[name]) reg[name] = {};
reg = reg[name];
// update list of packageIds matching version...
if (!reg[vers] || (reg[vers].length<=1)) {
reg[vers] = [def];
} else {
if (replace) idx = reg[vers].indexOf(replace);
if (idx>=0) {
reg[vers] = reg[vers].slice(0, idx).concat(reg[vers].slice(idx+1));
}
reg[vers].push(def);
}
}
return this;
};
/**
Main registration API for all modules. Simply registers a module for later
use by a package.
*/
Browser.prototype.module = function(key, def) {
if (!isCanonicalId(key)) key = '::'+key;
this.factories[key] = def;
return this;
};
/**
Register a script that has loaded
*/
Browser.prototype.script = function(scriptId) {
if (!isCanonicalId(scriptId)) scriptId = '::'+scriptId;
this._resolve(this.scriptActions, scriptId, true);
};
/**
Register a stylesheet that has loaded.
*/
Browser.prototype.stylesheet = function(stylesheetId) {
if (!isCanonicalId(stylesheetId)) stylesheetId = '::'+stylesheetId;
this._resolve(this.stylesheetActions, stylesheetId, true);
};
// ..........................................................
// Called by Loader
//
var domAvailable = T_UNDEFINED !== typeof document && document.createElement;
var xhrAvailable = T_UNDEFINED !== typeof XMLHttpRequest;
/**
Whether to use XHR by default. If true, XHR is tried first to fetch script
resources; script tag injection is only used as a fallback if XHR fails. If
false (the default if the DOM is available), script tag injection is tried
first, and XHR is used as the fallback.
*/
Browser.prototype.xhr = !domAvailable;
/**
Whether to automatically wrap the fetched JavaScript in tiki.module() and
tiki.script() calls. With this on, CommonJS modules will "just work" without
preprocessing. Setting this to true requires, and implies, that XHR will be
used to fetch the files.
*/
Browser.prototype.autowrap = false;
var findPublicPackageInfo = function(infos) {
if (!infos) return null;
var loc = infos.length;
while(--loc>=0) {
if (!infos[loc]['tiki:private']) return infos[loc];
}
return null;
};
/**
Find the canonical package ID for the passed package ID and optional
version. This will look through all the registered package infos, only
searching those that are not private, but including external references.
*/
Browser.prototype.canonicalPackageId = function(packageId, vers) {
var info = this.packageInfoByName[packageId],
ret, cur, cvers, rvers;
if (vers) vers = semver.normalize(vers);
if (!info) return null; // not found
// see if we have caught a lucky break
if (info[vers] && (info[vers].length===1)) return info[vers][0].id;
// need to search...
for(cvers in info) {
if (!info.hasOwnProperty(cvers)) continue;
if (!semver.compatible(vers, cvers)) continue;
if (!ret || (semver.compare(rvers, cvers)<0)) {
ret = findPublicPackageInfo(info[cvers]);
if (ret) rvers = cvers;
}
}
return ret ? ret.id : null;
};
// get package for canonicalId, instantiate if needed
Browser.prototype.packageFor = function(canonicalId) {
var ret = this.packages[canonicalId];
if (ret) return ret ;
// instantiate if needed
ret = this.packageInfoById[canonicalId];
if (ret && !ret['tiki:external']) { // external refs can't be instantiated
ret = new this.Package(canonicalId, ret, this);
this.packages[canonicalId] = ret;
return ret ;
}
return null ; // not found
};
/**
Ensures the named canonical packageId and all of its dependent scripts are
loaded.
*/
Browser.prototype.ensurePackage = function(canonicalId, done) {
var action = this.ensureActions[canonicalId];
if (action) return action(done); // add another listener
// no action get - get the package info and start one.
var info = this.packageInfoById[canonicalId];
if (!info) {
return done(new NotFound(canonicalId, 'browser package info'));
}
var source = this;
action = once(function(done) {
var cnt = 1, ready = false, cancelled;
// invoked when an action finishes. Will resolve this action
// when all of them finish.
var cleanup = function(err) {
if (cancelled) return;
if (err) {
cancelled = true;
return done(err);
}
cnt = cnt-1;
if (cnt<=0 && ready) return done(null, info);
};
// proactively kick off any known packages. If a dependent package
// is not known here just skip it for now. This is just an optimization
// anyway. The Loader will take care of ensuring all dependencies are
// really met.
var dependencies = info.dependencies,
nested = info['tiki:nested'],
packageId, vers, depInfo, curId;
for(packageId in dependencies) {
if (!dependencies.hasOwnProperty(packageId)) continue;
curId = nested[packageId];
if (!curId) {
vers = dependencies[packageId];
curId = source.canonicalPackageId(packageId, vers);
}
if (curId && source.packageInfoById[canonicalId]) {
cnt++;
source.ensurePackage(curId, cleanup);
}
}
// step through resources and kick off each script and stylesheet
var resources = info['tiki:resources'],
lim = resources ? resources.length : 0,
loc, rsrc;
for(loc=0;loc<lim;loc++) {
rsrc = resources[loc];
if (rsrc.type === T_RESOURCE) continue;
if (rsrc.type === T_SCRIPT) {
cnt++;
source.ensureScript(rsrc.id, rsrc.url, cleanup);
} else if (rsrc.type === T_STYLESHEET) {
cnt++;
source.ensureStylesheet(rsrc.id, rsrc.url, cleanup);
}
}
// done, set ready to true so that the final handler can fire
ready = true;
cleanup();
});
this.ensureActions[canonicalId] = action;
action(done); // kick off
};
Browser.prototype.ensureScript = function(id, url, done) {
var action = this.scriptActions[id];
if (action) return action(done);
var source = this;
action = this._action(function() {
source._loadScript(id, url);
});
this.scriptActions[id] = action;
return action(done);
};
Browser.prototype.ensureStylesheet = function(id, url, done) {
var action = this.stylesheetActions[id];
if (action) return action(done);
var source = this;
action = this._action(function() {
source._loadStylesheet(id, url);
});
this.stylesheetActions[id] = action;
return action(done);
};
Browser.prototype._injectScript = function(id, url) {
var body, el;
body = document.body;
el = document.createElement('script');
el.src = url;
body.appendChild(el);
body = el = null;
};
Browser.prototype._xhrScript = function(id, url) {
var autowrap = this.autowrap;
var req = new XMLHttpRequest();
req.open('GET', url, true);
req.onreadystatechange = function(evt) {
// Accept 200 or 0 for local file requests.
if (req.readyState !== 4 || (req.status !== 200 && req.status !== 0)) {
return;
}
var src = req.responseText;
if (autowrap) {
src = "tiki.module('" + id + "', function(require, exports, module) {" +
src + "});" + "tiki.script('" + id + "');";
}
// Add a Firebug-style sourceURL parameter to help debugging.
eval(src + "\n//@ sourceURL=" + url);
// Immediately return after the eval. The script may have stomped all over
// our local state.
};
req.send(null);
};
Browser.prototype._loadScript = function(id, url) {
if (this.autowrap) {
this.xhr = true;
if (!xhrAvailable) {
DEBUG('Autowrap is on but XHR is not available. Danger ahead.');
}
}
if (xhrAvailable && domAvailable) {
if (this.xhr) {
try {
return this._xhrScript(id, url);
} catch (e) {
return this._injectScript(id, url);
}
} else {
try {
return this._injectScript(id, url);
} catch (e) {
return this._xhrScript(id, url);
}
}
} else if (xhrAvailable) {
return this._xhrScript(id, url);
} else if (domAvailable) {
return this._injectScript(id, url);
}
DEBUG('Browser#_loadScript() not supported on this platform.');
this.script(id);
};
if (domAvailable) {
// actually loads the stylesheet. separated out to ease unit testing
Browser.prototype._loadStylesheet = function(id, url) {
var body, el;
body = document.getElementsByTagName('head')[0] || document.body;
el = document.createElement('link');
el.rel = 'stylesheet';
el.href = url;
el.type = 'text/css';
body.appendChild(el);
el = body = null;
this.stylesheet(id); // no onload support - just notify now.
};
} else {
// actually loads the stylesheet. separated out to ease unit testing
Browser.prototype._loadStylesheet = function(id, url) {
DEBUG('Browser#_loadStylesheet() not supported on this platform.');
this.stylesheet(id);
};
}
// ..........................................................
// BROWSER PACKAGE
//
/**
Special edition of Package designed to work with the Browser source. This
kind of package knows how to get its data out of the Browser source on
demand.
*/
var BrowserPackage = Package.extend();
Browser.prototype.Package = BrowserPackage;
BrowserPackage.prototype.init = function(id, config, source) {
Package.prototype.init.call(this, id, config);
this.source = source;
};
// if not self, look for nested packages
BrowserPackage.prototype.canonicalPackageId = function(packageId, vers) {
var ret, nested, info;
ret = Package.prototype.canonicalPackageId.call(this, packageId, vers);
if (ret) return ret ;
nested = this.get('tiki:nested') || {};
ret = nested[packageId];
if (!ret) return null;
info = this.source.packageInfoById[ret];
return info && semver.compatible(vers,info.version) ? ret : null;
};
BrowserPackage.prototype.packageFor = function(canonicalId) {
var ret = Package.prototype.packageFor.call(this, canonicalId);
return ret ? ret : this.source.packageFor(canonicalId);
};
BrowserPackage.prototype.ensurePackage = function(canonicalId, done) {
if (canonicalId === this.id) return done();
this.source.ensurePackage(canonicalId, done);
};
BrowserPackage.prototype.catalogPackages = function() {
var ret = [this], nested, key;
nested = this.get('tiki:nested') || {};
for(key in nested) {
if (!nested.hasOwnProperty(key)) continue;
ret.push(this.source.packageFor(nested[key]));
}
return ret ;
};
BrowserPackage.prototype.exists = function(moduleId) {
var canonicalId = this.id+':'+moduleId;
return !!this.source.factories[canonicalId];
};
BrowserPackage.prototype.load = function(moduleId) {
var canonicalId, factory;
canonicalId = this.id+':'+moduleId;
factory = this.source.factories[canonicalId];
return factory ? new this.Factory(moduleId, this, factory) : null;
};
BrowserPackage.prototype.Factory = Factory;
displayNames(exports, 'tiki');
});
// ==========================================================================
// Project: Tiki - CommonJS Runtime
// Copyright: ©2009-2010 Apple Inc. All rights reserved.
// License: Licened under MIT license (see __preamble__.js)
// ==========================================================================
/*globals tiki ENV ARGS */
// This postamble runs when the loader and supporting modules are all
// registered, allowing the real loader to replace the bootstrap version.
// it is not wrapped as a module so that it can run immediately.
"use modules false";
"use loader false";
// note that the loader.start method is safe so that calling this more than
// once will only setup the default loader once.
tiki = tiki.start();
tiki.replay(); // replay queue
bespin.tiki = tiki;
})();
| {
"content_hash": "8634523297dae5276fe92f314e4a44d1",
"timestamp": "",
"source": "github",
"line_count": 3221,
"max_line_length": 99,
"avg_line_length": 29.21980751319466,
"alnum_prop": 0.6490963375373205,
"repo_name": "liamoc/opardum-server",
"id": "acf1743aea054cbe30e73bd19205b024cfe25469",
"size": "95605",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Client/opardum/bespin/BespinEmbedded-0.9a1/lib/tiki.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "74768"
},
{
"name": "JavaScript",
"bytes": "3968649"
},
{
"name": "Python",
"bytes": "104781"
},
{
"name": "Shell",
"bytes": "831"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "f9fa421df91f200d9a03706831d96586",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "6aa13f3c1ee57c131cd566609f52c8ad9212c6c9",
"size": "191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Melastomataceae/Haplophyllophora/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>M-Kernel: event</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">M-Kernel
</div>
<div id="projectbrief">EmbeddedRTOS</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">event</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2fb0c3f73b6b18f8635f1e48c0915870"><td class="memItemLeft" align="right" valign="top">HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga2fb0c3f73b6b18f8635f1e48c0915870">event_create</a> ()</td></tr>
<tr class="memdesc:ga2fb0c3f73b6b18f8635f1e48c0915870"><td class="mdescLeft"> </td><td class="mdescRight">creates event object. <a href="#ga2fb0c3f73b6b18f8635f1e48c0915870"></a><br/></td></tr>
<tr class="memitem:ga3196bf1fce1827158c25ec86f77d9663"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga3196bf1fce1827158c25ec86f77d9663">event_pulse</a> (HANDLE event)</td></tr>
<tr class="memdesc:ga3196bf1fce1827158c25ec86f77d9663"><td class="mdescLeft"> </td><td class="mdescRight">make event active, release all waiters, go inactive state <a href="#ga3196bf1fce1827158c25ec86f77d9663"></a><br/></td></tr>
<tr class="memitem:ga4b6319354d62283c48c152884f6f0e7b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga4b6319354d62283c48c152884f6f0e7b">event_set</a> (HANDLE event)</td></tr>
<tr class="memdesc:ga4b6319354d62283c48c152884f6f0e7b"><td class="mdescLeft"> </td><td class="mdescRight">make event active, release all waiters, stay in active state <a href="#ga4b6319354d62283c48c152884f6f0e7b"></a><br/></td></tr>
<tr class="memitem:ga8b232b6771ce730c5a708bf5b89f31c6"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga8b232b6771ce730c5a708bf5b89f31c6">event_is_set</a> (HANDLE event)</td></tr>
<tr class="memdesc:ga8b232b6771ce730c5a708bf5b89f31c6"><td class="mdescLeft"> </td><td class="mdescRight">check is event is active <a href="#ga8b232b6771ce730c5a708bf5b89f31c6"></a><br/></td></tr>
<tr class="memitem:ga243a4dc706ecbf63c1158c3b027252a2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga243a4dc706ecbf63c1158c3b027252a2">event_clear</a> (HANDLE event)</td></tr>
<tr class="memdesc:ga243a4dc706ecbf63c1158c3b027252a2"><td class="mdescLeft"> </td><td class="mdescRight">make event inactive <a href="#ga243a4dc706ecbf63c1158c3b027252a2"></a><br/></td></tr>
<tr class="memitem:gaa61edc455c115a004de6bc3e724e45b3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#gaa61edc455c115a004de6bc3e724e45b3">event_wait</a> (HANDLE event, <a class="el" href="structTIME.html">TIME</a> *timeout)</td></tr>
<tr class="memdesc:gaa61edc455c115a004de6bc3e724e45b3"><td class="mdescLeft"> </td><td class="mdescRight">wait for event <a href="#gaa61edc455c115a004de6bc3e724e45b3"></a><br/></td></tr>
<tr class="memitem:ga0140a35caa2e800b820b626133f59a04"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga0140a35caa2e800b820b626133f59a04">event_wait_ms</a> (HANDLE event, unsigned int timeout_ms)</td></tr>
<tr class="memdesc:ga0140a35caa2e800b820b626133f59a04"><td class="mdescLeft"> </td><td class="mdescRight">wait for event <a href="#ga0140a35caa2e800b820b626133f59a04"></a><br/></td></tr>
<tr class="memitem:ga4ef6fa339f9be820ea04d7bd9b48b41e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga4ef6fa339f9be820ea04d7bd9b48b41e">event_wait_us</a> (HANDLE event, unsigned int timeout_us)</td></tr>
<tr class="memdesc:ga4ef6fa339f9be820ea04d7bd9b48b41e"><td class="mdescLeft"> </td><td class="mdescRight">wait for event <a href="#ga4ef6fa339f9be820ea04d7bd9b48b41e"></a><br/></td></tr>
<tr class="memitem:ga6e4bdb6028f36b916a1629118b153263"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ga6e4bdb6028f36b916a1629118b153263">event_destroy</a> (HANDLE event)</td></tr>
<tr class="memdesc:ga6e4bdb6028f36b916a1629118b153263"><td class="mdescLeft"> </td><td class="mdescRight">destroy event <a href="#ga6e4bdb6028f36b916a1629118b153263"></a><br/></td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<p>event is a sync object. It's used, when thread(s) are waiting event from specific object.</p>
<p>event can be in 2 states: active and inactive. When event becomes active, every event waiting functions returns immediatly. If event is inactive, event waiting put thread in waiting state.</p>
<p>Because event_wait, event_wait_ms, event_wait_us can put current thread in waiting state, this functions can be called only from SYSTEM/USER context. Other functions, including event_set, event_pulse can be called from any context </p>
<h2>Function Documentation</h2>
<a class="anchor" id="ga243a4dc706ecbf63c1158c3b027252a2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void event_clear </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>make event inactive </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga2fb0c3f73b6b18f8635f1e48c0915870"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">HANDLE event_create </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>creates event object. </p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">event</td><td>HANDLE on success. On failure (out of memory), error will be raised </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga6e4bdb6028f36b916a1629118b153263"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void event_destroy </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>destroy event </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga8b232b6771ce730c5a708bf5b89f31c6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool event_is_set </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>check is event is active </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>if active, false if not </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga3196bf1fce1827158c25ec86f77d9663"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void event_pulse </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>make event active, release all waiters, go inactive state </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga4b6319354d62283c48c152884f6f0e7b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void event_set </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>make event active, release all waiters, stay in active state </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaa61edc455c115a004de6bc3e724e45b3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool event_wait </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structTIME.html">TIME</a> * </td>
<td class="paramname"><em>timeout</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>wait for event </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
<tr><td class="paramname">timeout,:</td><td>pointer to <a class="el" href="structTIME.html" title="structure for holding time units">TIME</a> structure </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>on success, false on timeout </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga0140a35caa2e800b820b626133f59a04"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool event_wait_ms </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"><em>timeout_ms</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>wait for event </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
<tr><td class="paramname">timeout_ms,:</td><td>timeout in milliseconds </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>on success, false on timeout </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga4ef6fa339f9be820ea04d7bd9b48b41e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool event_wait_us </td>
<td>(</td>
<td class="paramtype">HANDLE </td>
<td class="paramname"><em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"><em>timeout_us</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>wait for event </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">event,:</td><td>event handle </td></tr>
<tr><td class="paramname">timeout_ms,:</td><td>timeout in microseconds </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>on success, false on timeout </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Sep 12 2012 19:35:12 for M-Kernel by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>
| {
"content_hash": "a8b9c71a8843e02b138efd78917e134b",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 964,
"avg_line_length": 43.0144578313253,
"alnum_prop": 0.6362108565346479,
"repo_name": "alexeyk13/mkernel",
"id": "e1a322048c6e2cfd2f1d97d1da10ffcdf4f5010f",
"size": "17851",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/html/group__event.html",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Assembly",
"bytes": "30135"
},
{
"name": "C",
"bytes": "597959"
},
{
"name": "C++",
"bytes": "59851"
},
{
"name": "JavaScript",
"bytes": "37965"
},
{
"name": "Objective-C",
"bytes": "18819"
},
{
"name": "Perl",
"bytes": "2517"
}
],
"symlink_target": ""
} |
SET(CMAKE_DEPENDS_LANGUAGES
"CXX"
)
# The set of files for implicit dependencies of each language:
SET(CMAKE_DEPENDS_CHECK_CXX
"/home/jeff/dev/dev_apps/sand/ogre/ogre_src_v1-8-1/Samples/Grass/src/Grass.cpp" "/home/jeff/dev/dev_apps/sand/ogre/ogre_src_v1-8-1/build/Samples/Grass/CMakeFiles/Sample_Grass.dir/src/Grass.cpp.o"
)
SET(CMAKE_CXX_COMPILER_ID "GNU")
# Preprocessor definitions for this target.
SET(CMAKE_TARGET_DEFINITIONS
"BOOST_ALL_NO_LIB"
"USE_RTSHADER_SYSTEM"
)
# Targets to which this target links.
SET(CMAKE_TARGET_LINKED_INFO_FILES
"/home/jeff/dev/dev_apps/sand/ogre/ogre_src_v1-8-1/build/OgreMain/CMakeFiles/OgreMain.dir/DependInfo.cmake"
"/home/jeff/dev/dev_apps/sand/ogre/ogre_src_v1-8-1/build/Components/RTShaderSystem/CMakeFiles/OgreRTShaderSystem.dir/DependInfo.cmake"
)
# The include file search paths:
SET(CMAKE_C_TARGET_INCLUDE_PATH
"../OgreMain/include"
"include"
"/usr/include/freetype2"
"/usr/include/OIS"
"/usr/include/Cg"
".."
"../Samples/Common/include"
"../Components/RTShaderSystem/include"
"../Samples/Grass/include"
)
SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
| {
"content_hash": "71cd135c13912e1cd13d07f76fb80a10",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 197,
"avg_line_length": 36.02777777777778,
"alnum_prop": 0.7440246723207402,
"repo_name": "jjenki11/blaze-chem-rendering",
"id": "04e7c557494fca12fac16097341d264225626c14",
"size": "1364",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ogre/ogre_src_v1-8-1/build/Samples/Grass/CMakeFiles/Sample_Grass.dir/DependInfo.cmake",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "2476"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal">
<!--
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="250dp"
android:text="@string/loding"
android:textSize="20sp"
android:textStyle="bold" />
-->
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
| {
"content_hash": "7639822ea8ed130a5b9809dfd554f38d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 72,
"avg_line_length": 31.391304347826086,
"alnum_prop": 0.6509695290858726,
"repo_name": "tina0430/leejihee-",
"id": "8ac62cec3f53bd8102a12dcca5f0d289b19b77bd",
"size": "722",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "diarymemo/res/layout/loding.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "239008"
}
],
"symlink_target": ""
} |
/*!
\file ExtractedDeviceState.h
\author Andrew Kerr <[email protected]>
\date 31 Jan 2011
\brief Data structure describing device state with serialization and deserialization procedures
*/
// C++ includes
#include <iomanip>
#include <sstream>
#include <cassert>
#include <iostream>
#include <cstring>
// Boost includes
#include <boost/lexical_cast.hpp>
// Hydrazine includes
#include <hydrazine/interface/Exception.h>
#include <hydrazine/interface/debug.h>
#include <hydrazine/interface/Casts.h>
// Ocelot includes
#include <ocelot/util/interface/ExtractedDeviceState.h>
#ifdef REPORT_BASE
#undef REPORT_BASE
#endif
////////////////////////////////////////////////////////////////////////////////
// whether debugging messages are printed
#define REPORT_BASE 0
////////////////////////////////////////////////////////////////////////////////
template <typename ElemT>
struct HexTo {
ElemT value;
operator ElemT() const {return value;}
friend std::istream& operator>>(std::istream& in, HexTo& out) {
in >> std::hex >> out.value;
return in;
}
};
////////////////////////////////////////////////////////////////////////////////
static void emitEscapedString(std::ostream &out, const std::string &str) {
for (std::string::const_iterator c_it = str.begin();
c_it != str.end(); ++c_it) {
if (*c_it == '"') {
out << "\\\"";
}
else {
out << *c_it;
}
}
}
static std::ostream & serialize(std::ostream &out, const ir::Dim3 &dim) {
out << "[" << dim.x << ", " << dim.y << ", " << dim.z << "]";
return out;
}
static void deserialize(ir::Dim3 &dim, const hydrazine::json::Visitor& array) {
dim.x = array[0];
dim.y = array[1];
dim.z = array[2];
}
static std::ostream & serialize(std::ostream &out,
const std::vector<int> &ints) {
out << "[";
int n=0;
for (std::vector<int>::const_iterator i_it = ints.begin();
i_it != ints.end(); ++i_it) {
out << (n++ ? "," : "") << *i_it;
}
out << "]";
return out;
}
static void deserialize(std::vector<int>& ints,
const hydrazine::json::Visitor& array) {
const hydrazine::json::DenseArray& denseArray =
static_cast<const hydrazine::json::DenseArray&>(*array.value);
size_t size = denseArray.sequence.size();
ints.clear();
ints.resize(size);
std::memcpy(ints.data(), denseArray.sequence.data(), size);
}
static void serializeBinary(std::ostream &out, const size_t size,
const char *bytes, bool raw) {
const size_t wordSize = 4;
if (!raw) {
out << std::setbase(16);
out << std::setw(2*wordSize)
<< std::setfill('0');
}
for (size_t n = 0; n < size; n += wordSize) {
unsigned int word = 0;
for (size_t j = 0; j < wordSize; j++) {
if (j+n < size) {
word |= (((unsigned int)bytes[j+n] & 0x0ff) << (j * 8));
}
}
if (n) {
out << ", ";
}
if (!((n) % (8 * wordSize))) {
out << "\n";
}
out << (raw ? "" : "\"0x");
out << word << (raw ? "" : "\"");
}
out << std::setbase(10);
}
static void serializeBinary(std::ostream &out, const size_t size,
const char *bytes) {
out << "{ \"bytes\": " << std::setbase(10) << size << ", \"image\": [\n";
serializeBinary(out, size, bytes, true);
out << std::setbase(10) << "\n] }";
}
static void deserializeBinary(util::ByteVector &bytes,
const hydrazine::json::Array *arrayPtr, size_t size) {
size_t wordSize = 4;
bytes.clear();
bytes.reserve(size);
for (hydrazine::json::Array::ValueVector::const_iterator
it = arrayPtr->begin(); it != arrayPtr->end(); ++it) {
std::string wordString = (*it)->as_string();
unsigned int word =
boost::lexical_cast<HexTo<unsigned int> >(wordString);
for (size_t i = 0; i < wordSize; i++) {
bytes.push_back(word & 0x0ff);
word >>= 8;
}
}
bytes.resize(size, 0);
}
static void deserializeBinary(util::ByteVector &bytes,
const hydrazine::json::DenseArray *arrayPtr, size_t size) {
bytes.resize(size);
std::memcpy(bytes.data(), arrayPtr->sequence.data(), size);
}
static void deserializeBinary(util::ByteVector &bytes,
const hydrazine::json::Visitor &object) {
size_t size = object.parse<int>("bytes", 0);
if (hydrazine::json::Value *arrayValue = object.find("image")) {
if (arrayValue->type == hydrazine::json::Value::DenseArray) {
deserializeBinary(bytes,
static_cast<hydrazine::json::DenseArray *>(arrayValue), size);
}
else {
deserializeBinary(bytes,
static_cast<hydrazine::json::Array *>(arrayValue), size);
}
}
}
static void serializeBinary(std::ostream &out, const util::ByteVector &data) {
serializeBinary(out, data.size(), &data[0]);
}
////////////////////////////////////////////////////////////////////////////////
util::ExtractedDeviceState::MemoryAllocation::MemoryAllocation(const void *ptr,
size_t _size):
devicePointer(ptr), data(_size) {
}
size_t util::ExtractedDeviceState::MemoryAllocation::size() const {
return data.size();
}
void util::ExtractedDeviceState::MemoryAllocation::serialize(
std::ostream &out) const {
out << "{";
out << " \"device\": \"" << devicePointer << "\",\n";
out << " \"data\": ";
::serializeBinary(out, data);
out << "}";
}
void util::ExtractedDeviceState::MemoryAllocation::deserialize(
const hydrazine::json::Visitor &object) {
devicePointer = hydrazine::bit_cast<const void *>(
boost::lexical_cast<HexTo<size_t> >(
object.parse<std::string>("device", "0x00")));
if (hydrazine::json::Value *dataMemory = object.find("data")) {
deserializeBinary(data, hydrazine::json::Visitor(dataMemory));
}
}
////////////////////////////////////////////////////////////////////////////////
util::ExtractedDeviceState::GlobalAllocation::GlobalAllocation(const void *ptr,
size_t _size, const std::string& m, const std::string& g):
module(m), name(g), data(_size) {
}
size_t util::ExtractedDeviceState::GlobalAllocation::size() const {
return data.size();
}
void util::ExtractedDeviceState::GlobalAllocation::serialize(
std::ostream &out) const {
out << "{";
out << " \"module\": \"" << module << "\",\n";
out << " \"name\": \"" << name << "\",\n";
out << " \"data\": ";
::serializeBinary(out, data);
out << "}";
}
void util::ExtractedDeviceState::GlobalAllocation::deserialize(
const hydrazine::json::Visitor &object) {
module = object.parse<std::string>("module", "unknown-module");
name = object.parse<std::string>("name", "unknown-variable");
if (hydrazine::json::Value *dataMemory = object.find("data")) {
deserializeBinary(data, hydrazine::json::Visitor(dataMemory));
}
}
std::string util::ExtractedDeviceState::GlobalAllocation::key() const {
return module + ":" + name;
}
////////////////////////////////////////////////////////////////////////////////
void util::ExtractedDeviceState::KernelLaunch::serialize(
std::ostream &out) const {
out << "{ \"module\": \"" << moduleName << "\", \"kernel\": \""
<< kernelName << "\",\n";
out << " \"gridDim\": "; ::serialize(out, gridDim); out << ",\n";
out << " \"blockDim\": "; ::serialize(out, blockDim); out << ",\n";
out << " \"sharedMemorySize\": " << sharedMemorySize << ",\n";
out << " \"staticSharedMemorySize\": " << staticSharedMemorySize << ",\n";
out << " \"parameterMemory\": ";
serializeBinary(out, parameterMemory);
out << "}";
}
void util::ExtractedDeviceState::KernelLaunch::deserialize(
const hydrazine::json::Visitor &object) {
moduleName = object.parse<std::string>("module", "unknown-module");
kernelName = object.parse<std::string>("kernel", "unknown-kernel");
::deserialize(gridDim, object["gridDim"]);
::deserialize(blockDim, object["blockDim"]);
sharedMemorySize = object.parse<int>("sharedMemorySize", 0);
staticSharedMemorySize = object.parse<int>("staticSharedMemorySize", 0);
if (hydrazine::json::Value *parameterMemory =
object.find("parameterMemory")) {
deserializeBinary(this->parameterMemory,
hydrazine::json::Visitor(parameterMemory));
}
}
////////////////////////////////////////////////////////////////////////////////
util::ExtractedDeviceState::Module::Module() {
}
util::ExtractedDeviceState::Module::~Module() {
clear();
}
void util::ExtractedDeviceState::Module::clear() {
for(TextureMap::iterator texture = textures.begin();
texture != textures.end(); ++texture) {
delete texture->second;
}
textures.clear();
}
void util::ExtractedDeviceState::Module::serializeTexture(
const ir::Texture &texture,
std::ostream &out,
const std::string & prefix) const {
std::vector<int> bits;
bits.push_back(texture.x);
bits.push_back(texture.y);
bits.push_back(texture.z);
bits.push_back(texture.w);
out << "{\n";
out << " \"name\": \"" << texture.name << "\",\n";
out << " \"bits\": "; ::serialize(out, bits); out << ",\n";
out << " \"normalize\": "
<< (texture.normalize ? "true" : "false") << ",\n";
out << " \"normalizedFloat\": "
<< (texture.normalizedFloat ? "true" : "false") << ",\n";
out << " \"size\": "; ::serialize(out, texture.size); out << ",\n";
out << " \"type\": \"" << ir::Texture::toString(texture.type) << "\",\n";
out << " \"addressMode\": [ ";
for (int i = 0; i < 3; i++) {
out << (i ? ", " : "") << ir::Texture::toString(texture.addressMode[i]);
}
out << " ],\n";
out << " \"interpolation\": \""
<< ir::Texture::toString(texture.interpolation) << "\",\n";
out << " \"data\": \"" << texture.data << "\"\n";
out << "}\n";
}
void util::ExtractedDeviceState::Module::serialize(std::ostream &out,
const std::string & prefix) const {
out << "{\n";
out << " \"name\": \"" << name << "\",\n";
out << " \"ptx\": \"";
emitEscapedString(out, ptx);
out << "\"";
if (textures.size()) {
out << ",\n \"textures\": [\n";
int n = 0;
for (TextureMap::const_iterator t_it = textures.begin();
t_it != textures.end(); ++t_it) {
if (n++) { out << ",\n"; }
serializeTexture(*(t_it->second), out, prefix);
}
out << "]\n";
}
out << "}\n";
}
void util::ExtractedDeviceState::Module::deserialize(
const hydrazine::json::Visitor& object) {
name = object.parse<std::string>("name", "module");
ptx = object.parse<std::string>("ptx", "");
hydrazine::json::Value* textureValue = object.find("textures");
if (textureValue) {
hydrazine::json::Visitor texturesArray(textureValue);
for (hydrazine::json::Array::const_iterator
tex_it = texturesArray.begin_array();
tex_it != texturesArray.end_array(); ++tex_it) {
ir::Texture* texture = new ir::Texture;
deserializeTexture(*texture, hydrazine::json::Visitor(*tex_it));
this->textures[texture->demangledName()] = texture;
}
}
}
void util::ExtractedDeviceState::Module::deserializeTexture(
ir::Texture &texture,
const hydrazine::json::Visitor& object) {
texture.name = object.parse<std::string>("name", "unknown-texture");
std::vector<int> bits;
::deserialize(bits, object["bits"]);
texture.x = bits[0];
texture.y = bits[1];
texture.z = bits[2];
texture.w = bits[3];
texture.normalize = object.parse<bool>("normalize", false);
texture.normalizedFloat = object.parse<bool>("normalizedFloat", false);
::deserialize(texture.size, object["size"]);
texture.type = ir::Texture::typeFromString(
object.parse<std::string>("type", "Invalid"));
hydrazine::json::Visitor modeArray(object["addressMode"]);
texture.addressMode[0] = ir::Texture::modeFromString(modeArray[0]);
texture.addressMode[1] = ir::Texture::modeFromString(modeArray[1]);
texture.addressMode[2] = ir::Texture::modeFromString(modeArray[2]);
texture.interpolation = ir::Texture::interpolationFromString(
object.parse<std::string>("interpolation", "Invalid"));
texture.data = hydrazine::bit_cast<void *>(
boost::lexical_cast<HexTo<size_t> >(
object.parse<std::string>("data", "0x00")));
}
////////////////////////////////////////////////////////////////////////////////
util::ExtractedDeviceState::Application::Application() {
name = "cudaApp";
}
void util::ExtractedDeviceState::Application::serialize(
std::ostream &out) const {
out << "{\n\"name\": \"";
emitEscapedString(out, name);
out << "\",\n\"cudaDevice\":\"";
emitEscapedString(out, cudaDevice);
out << "\"}";
}
void util::ExtractedDeviceState::Application::deserialize(
const hydrazine::json::Visitor &object) {
name = object.parse<std::string>("name", "cudaApp");
cudaDevice = object.parse<std::string>("cudaDevice", "gpu");
}
////////////////////////////////////////////////////////////////////////////////
//! \brief constructs from an istream - input must be JSON document
util::ExtractedDeviceState::ExtractedDeviceState(std::istream &in) {
deserialize(in);
}
util::ExtractedDeviceState::ExtractedDeviceState() {
}
util::ExtractedDeviceState::~ExtractedDeviceState() {
clear();
}
//! \brief store data in host memory to file
void util::ExtractedDeviceState::serialize(std::ostream &out) const {
// only serialize the module containing the executed kernel
size_t n = 0;
out << "{\n";
out << "\"application\":";
application.serialize(out);
out << ",\n\"allocations\": [";
n = 0;
for (GlobalAllocationMap::const_iterator
alloc_it = globalAllocations.begin();
alloc_it != globalAllocations.end(); ++alloc_it) {
out << (n++ ? ",\n":"");
alloc_it->second->serialize(out);
}
out << "],\n\"global_allocations\": [";
n = 0;
for (GlobalVariableMap::const_iterator
alloc_it = globalVariables.begin();
alloc_it != globalVariables.end(); ++alloc_it) {
out << (n++ ? ",\n":"");
alloc_it->second->serialize(out);
}
out << "],\n\"post_launch_allocations\": [";
n = 0;
for (GlobalAllocationMap::const_iterator
alloc_it = postLaunchGlobalAllocations.begin();
alloc_it != postLaunchGlobalAllocations.end(); ++alloc_it) {
out << (n++ ? ",\n":"");
alloc_it->second->serialize(out);
}
out << "],\n\"post_launch_global_allocations\": [";
n = 0;
for (GlobalVariableMap::const_iterator
alloc_it = postLaunchGlobalVariables.begin();
alloc_it != postLaunchGlobalVariables.end(); ++alloc_it) {
out << (n++ ? ",\n":"");
alloc_it->second->serialize(out);
}
out << "],\n";
out <<" \"kernelLaunch\": ";
launch.serialize(out);
out << ",\n";
out << "\"modules\": [";
ModuleMap::const_iterator mod_it = modules.find(launch.moduleName);
if (mod_it == modules.end()) {
n = 0;
for (ModuleMap::const_iterator mod_it = modules.begin();
mod_it != modules.end(); ++mod_it) {
out << (n++ ? ",":"");
mod_it->second->serialize(out, application.name);
}
}
else {
mod_it->second->serialize(out);
}
out << "]\n";
out << "}\n";
}
//! \brief load data from JSON file to host memory
void util::ExtractedDeviceState::deserialize(std::istream &in) {
hydrazine::json::Parser parser;
hydrazine::json::Object *stateObject = 0;
{
stateObject = parser.parse_object(in);
hydrazine::json::Visitor object(stateObject);
application.deserialize(object["application"]);
launch.deserialize(object["kernelLaunch"]);
hydrazine::json::Visitor allocationsArray(object["allocations"]);
for (hydrazine::json::Array::const_iterator
alloc_it = allocationsArray.begin_array();
alloc_it != allocationsArray.end_array(); ++alloc_it) {
MemoryAllocation* allocation = new MemoryAllocation;
allocation->deserialize(hydrazine::json::Visitor(*alloc_it));
globalAllocations[allocation->devicePointer] = allocation;
}
hydrazine::json::Visitor globalsArray(object["global_allocations"]);
for (hydrazine::json::Array::const_iterator
alloc_it = globalsArray.begin_array();
alloc_it != globalsArray.end_array(); ++alloc_it) {
GlobalAllocation* allocation = new GlobalAllocation;
allocation->deserialize(hydrazine::json::Visitor(*alloc_it));
globalVariables[allocation->key()] = allocation;
}
hydrazine::json::Visitor postAllocationsArray(
object["post_launch_allocations"]);
for (hydrazine::json::Array::const_iterator
alloc_it = postAllocationsArray.begin_array();
alloc_it != postAllocationsArray.end_array(); ++alloc_it) {
MemoryAllocation* allocation = new MemoryAllocation;
allocation->deserialize(hydrazine::json::Visitor(*alloc_it));
postLaunchGlobalAllocations[allocation->devicePointer] = allocation;
}
hydrazine::json::Visitor postGlobalsArray(
object["post_launch_global_allocations"]);
for (hydrazine::json::Array::const_iterator
alloc_it = postGlobalsArray.begin_array();
alloc_it != postGlobalsArray.end_array(); ++alloc_it) {
GlobalAllocation* allocation = new GlobalAllocation;
allocation->deserialize(hydrazine::json::Visitor(*alloc_it));
postLaunchGlobalVariables[allocation->key()] = allocation;
}
hydrazine::json::Visitor modulesArray(object["modules"]);
for (hydrazine::json::Array::const_iterator
mod_it = modulesArray.begin_array();
mod_it != modulesArray.end_array(); ++mod_it) {
Module* module = new Module;
module->deserialize(hydrazine::json::Visitor(*mod_it));
modules[module->name] = module;
}
}
if (stateObject) delete stateObject;
}
//! \brief clear all data structures
void util::ExtractedDeviceState::clear() {
for (ModuleMap::iterator mod_it = modules.begin();
mod_it != modules.end(); ++mod_it) {
delete mod_it->second;
}
modules.clear();
clearData();
}
void util::ExtractedDeviceState::clearData() {
for (GlobalAllocationMap::iterator ga_it = globalAllocations.begin();
ga_it != globalAllocations.end(); ++ga_it) {
delete ga_it->second;
}
globalAllocations.clear();
for (GlobalAllocationMap::iterator
ga_it = postLaunchGlobalAllocations.begin();
ga_it != postLaunchGlobalAllocations.end(); ++ga_it) {
delete ga_it->second;
}
postLaunchGlobalAllocations.clear();
for (GlobalVariableMap::iterator ga_it = globalVariables.begin();
ga_it != globalVariables.end(); ++ga_it) {
delete ga_it->second;
}
globalVariables.clear();
for (GlobalVariableMap::iterator ga_it = postLaunchGlobalVariables.begin();
ga_it != postLaunchGlobalVariables.end(); ++ga_it) {
delete ga_it->second;
}
postLaunchGlobalVariables.clear();
}
| {
"content_hash": "07151949c94ec1b12e9547f5b913ef2d",
"timestamp": "",
"source": "github",
"line_count": 634,
"max_line_length": 96,
"avg_line_length": 28.329652996845425,
"alnum_prop": 0.6241857357608152,
"repo_name": "gtcasl/gpuocelot",
"id": "0cb5755dbdc8a6c9a3d876aee08b269a47f277e7",
"size": "17961",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "ocelot/ocelot/util/implementation/ExtractedDeviceState.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "90"
},
{
"name": "C",
"bytes": "8190503"
},
{
"name": "C++",
"bytes": "213392210"
},
{
"name": "CSS",
"bytes": "7539"
},
{
"name": "Cuda",
"bytes": "4460719"
},
{
"name": "GLSL",
"bytes": "9487"
},
{
"name": "Groff",
"bytes": "36345781"
},
{
"name": "HTML",
"bytes": "778470"
},
{
"name": "LLVM",
"bytes": "37352"
},
{
"name": "Makefile",
"bytes": "183387"
},
{
"name": "Matlab",
"bytes": "40739"
},
{
"name": "Objective-C",
"bytes": "23566"
},
{
"name": "Pascal",
"bytes": "30344"
},
{
"name": "Python",
"bytes": "164148"
},
{
"name": "Shell",
"bytes": "486540"
},
{
"name": "Yacc",
"bytes": "39271"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0) on Wed Aug 14 21:12:41 EDT 2013 -->
<title>Uses of Class org.drip.analytics.daycount.DCAct_365L</title>
<meta name="date" content="2013-08-14">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.drip.analytics.daycount.DCAct_365L";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/drip/analytics/daycount/DCAct_365L.html" title="class in org.drip.analytics.daycount">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/drip/analytics/daycount/\class-useDCAct_365L.html" target="_top">Frames</a></li>
<li><a href="DCAct_365L.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.drip.analytics.daycount.DCAct_365L" class="title">Uses of Class<br>org.drip.analytics.daycount.DCAct_365L</h2>
</div>
<div class="classUseContainer">No usage of org.drip.analytics.daycount.DCAct_365L</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/drip/analytics/daycount/DCAct_365L.html" title="class in org.drip.analytics.daycount">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/drip/analytics/daycount/\class-useDCAct_365L.html" target="_top">Frames</a></li>
<li><a href="DCAct_365L.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "ada966b35bd7e57d33ace4a5d2c65a48",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 139,
"avg_line_length": 37.17391304347826,
"alnum_prop": 0.5946198830409357,
"repo_name": "tectronics/rootfinder",
"id": "24b7322403c53467872875a234d2bb911dba5560",
"size": "4275",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "2.2/docs/Javadoc/org/drip/analytics/daycount/class-use/DCAct_365L.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "34839"
},
{
"name": "HTML",
"bytes": "77000232"
},
{
"name": "Java",
"bytes": "10842587"
}
],
"symlink_target": ""
} |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, TypeOperators, UndecidableInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Either
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : [email protected]
-- Stability : experimental
-- Portability : portable
--
-- The Either type, and associated operations.
--
-----------------------------------------------------------------------------
module Data.Either (
Either(..),
either,
lefts,
rights,
isLeft,
isRight,
fromLeft,
fromRight,
partitionEithers,
) where
import GHC.Base
import GHC.Show
import GHC.Read
import Data.Type.Equality
-- $setup
-- Allow the use of some Prelude functions in doctests.
-- >>> import Prelude ( (+), (*), length, putStrLn )
{-
-- just for testing
import Test.QuickCheck
-}
{-|
The 'Either' type represents values with two possibilities: a value of
type @'Either' a b@ is either @'Left' a@ or @'Right' b@.
The 'Either' type is sometimes used to represent a value which is
either correct or an error; by convention, the 'Left' constructor is
used to hold an error value and the 'Right' constructor is used to
hold a correct value (mnemonic: \"right\" also means \"correct\").
==== __Examples__
The type @'Either' 'String' 'Int'@ is the type of values which can be either
a 'String' or an 'Int'. The 'Left' constructor can be used only on
'String's, and the 'Right' constructor can be used only on 'Int's:
>>> let s = Left "foo" :: Either String Int
>>> s
Left "foo"
>>> let n = Right 3 :: Either String Int
>>> n
Right 3
>>> :type s
s :: Either String Int
>>> :type n
n :: Either String Int
The 'fmap' from our 'Functor' instance will ignore 'Left' values, but
will apply the supplied function to values contained in a 'Right':
>>> let s = Left "foo" :: Either String Int
>>> let n = Right 3 :: Either String Int
>>> fmap (*2) s
Left "foo"
>>> fmap (*2) n
Right 6
The 'Monad' instance for 'Either' allows us to chain together multiple
actions which may fail, and fail overall if any of the individual
steps failed. First we'll write a function that can either parse an
'Int' from a 'Char', or fail.
>>> import Data.Char ( digitToInt, isDigit )
>>> :{
let parseEither :: Char -> Either String Int
parseEither c
| isDigit c = Right (digitToInt c)
| otherwise = Left "parse error"
>>> :}
The following should work, since both @\'1\'@ and @\'2\'@ can be
parsed as 'Int's.
>>> :{
let parseMultiple :: Either String Int
parseMultiple = do
x <- parseEither '1'
y <- parseEither '2'
return (x + y)
>>> :}
>>> parseMultiple
Right 3
But the following should fail overall, since the first operation where
we attempt to parse @\'m\'@ as an 'Int' will fail:
>>> :{
let parseMultiple :: Either String Int
parseMultiple = do
x <- parseEither 'm'
y <- parseEither '2'
return (x + y)
>>> :}
>>> parseMultiple
Left "parse error"
-}
data Either a b = Left a | Right b
deriving (Eq, Ord, Read, Show)
-- | @since 3.0
instance Functor (Either a) where
fmap _ (Left x) = Left x
fmap f (Right y) = Right (f y)
-- | @since 4.9.0.0
instance Semigroup (Either a b) where
Left _ <> b = b
a <> _ = a
#if !defined(__HADDOCK_VERSION__)
-- workaround https://github.com/haskell/haddock/issues/680
stimes n x
| n <= 0 = errorWithoutStackTrace "stimes: positive multiplier expected"
| otherwise = x
#endif
-- | @since 3.0
instance Applicative (Either e) where
pure = Right
Left e <*> _ = Left e
Right f <*> r = fmap f r
-- | @since 4.4.0.0
instance Monad (Either e) where
Left l >>= _ = Left l
Right r >>= k = k r
-- | Case analysis for the 'Either' type.
-- If the value is @'Left' a@, apply the first function to @a@;
-- if it is @'Right' b@, apply the second function to @b@.
--
-- ==== __Examples__
--
-- We create two values of type @'Either' 'String' 'Int'@, one using the
-- 'Left' constructor and another using the 'Right' constructor. Then
-- we apply \"either\" the 'length' function (if we have a 'String')
-- or the \"times-two\" function (if we have an 'Int'):
--
-- >>> let s = Left "foo" :: Either String Int
-- >>> let n = Right 3 :: Either String Int
-- >>> either length (*2) s
-- 3
-- >>> either length (*2) n
-- 6
--
either :: (a -> c) -> (b -> c) -> Either a b -> c
either f _ (Left x) = f x
either _ g (Right y) = g y
-- | Extracts from a list of 'Either' all the 'Left' elements.
-- All the 'Left' elements are extracted in order.
--
-- ==== __Examples__
--
-- Basic usage:
--
-- >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
-- >>> lefts list
-- ["foo","bar","baz"]
--
lefts :: [Either a b] -> [a]
lefts x = [a | Left a <- x]
{-# INLINEABLE lefts #-} -- otherwise doesnt get an unfolding, see #13689
-- | Extracts from a list of 'Either' all the 'Right' elements.
-- All the 'Right' elements are extracted in order.
--
-- ==== __Examples__
--
-- Basic usage:
--
-- >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
-- >>> rights list
-- [3,7]
--
rights :: [Either a b] -> [b]
rights x = [a | Right a <- x]
{-# INLINEABLE rights #-} -- otherwise doesnt get an unfolding, see #13689
-- | Partitions a list of 'Either' into two lists.
-- All the 'Left' elements are extracted, in order, to the first
-- component of the output. Similarly the 'Right' elements are extracted
-- to the second component of the output.
--
-- ==== __Examples__
--
-- Basic usage:
--
-- >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
-- >>> partitionEithers list
-- (["foo","bar","baz"],[3,7])
--
-- The pair returned by @'partitionEithers' x@ should be the same
-- pair as @('lefts' x, 'rights' x)@:
--
-- >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
-- >>> partitionEithers list == (lefts list, rights list)
-- True
--
partitionEithers :: [Either a b] -> ([a],[b])
partitionEithers = foldr (either left right) ([],[])
where
left a ~(l, r) = (a:l, r)
right a ~(l, r) = (l, a:r)
-- | Return `True` if the given value is a `Left`-value, `False` otherwise.
--
-- @since 4.7.0.0
--
-- ==== __Examples__
--
-- Basic usage:
--
-- >>> isLeft (Left "foo")
-- True
-- >>> isLeft (Right 3)
-- False
--
-- Assuming a 'Left' value signifies some sort of error, we can use
-- 'isLeft' to write a very simple error-reporting function that does
-- absolutely nothing in the case of success, and outputs \"ERROR\" if
-- any error occurred.
--
-- This example shows how 'isLeft' might be used to avoid pattern
-- matching when one does not care about the value contained in the
-- constructor:
--
-- >>> import Control.Monad ( when )
-- >>> let report e = when (isLeft e) $ putStrLn "ERROR"
-- >>> report (Right 1)
-- >>> report (Left "parse error")
-- ERROR
--
isLeft :: Either a b -> Bool
isLeft (Left _) = True
isLeft (Right _) = False
-- | Return `True` if the given value is a `Right`-value, `False` otherwise.
--
-- @since 4.7.0.0
--
-- ==== __Examples__
--
-- Basic usage:
--
-- >>> isRight (Left "foo")
-- False
-- >>> isRight (Right 3)
-- True
--
-- Assuming a 'Left' value signifies some sort of error, we can use
-- 'isRight' to write a very simple reporting function that only
-- outputs \"SUCCESS\" when a computation has succeeded.
--
-- This example shows how 'isRight' might be used to avoid pattern
-- matching when one does not care about the value contained in the
-- constructor:
--
-- >>> import Control.Monad ( when )
-- >>> let report e = when (isRight e) $ putStrLn "SUCCESS"
-- >>> report (Left "parse error")
-- >>> report (Right 1)
-- SUCCESS
--
isRight :: Either a b -> Bool
isRight (Left _) = False
isRight (Right _) = True
-- instance for the == Boolean type-level equality operator
type family EqEither a b where
EqEither ('Left x) ('Left y) = x == y
EqEither ('Right x) ('Right y) = x == y
EqEither a b = 'False
type instance a == b = EqEither a b
-- | Return the contents of a 'Left'-value or a default value otherwise.
--
-- @since 4.10.0.0
--
-- ==== __Examples__
--
-- Basic usage:
--
-- >>> fromLeft 1 (Left 3)
-- 3
-- >>> fromLeft 1 (Right "foo")
-- 1
--
fromLeft :: a -> Either a b -> a
fromLeft _ (Left a) = a
fromLeft a _ = a
-- | Return the contents of a 'Right'-value or a default value otherwise.
--
-- @since 4.10.0.0
--
-- ==== __Examples__
--
-- Basic usage:
--
-- >>> fromRight 1 (Right 3)
-- 3
-- >>> fromRight 1 (Left "foo")
-- 1
--
fromRight :: b -> Either a b -> b
fromRight _ (Right b) = b
fromRight b _ = b
{-
{--------------------------------------------------------------------
Testing
--------------------------------------------------------------------}
prop_partitionEithers :: [Either Int Int] -> Bool
prop_partitionEithers x =
partitionEithers x == (lefts x, rights x)
-}
| {
"content_hash": "fdcf88bd5e64b560a7787d297710384a",
"timestamp": "",
"source": "github",
"line_count": 346,
"max_line_length": 88,
"avg_line_length": 26.54335260115607,
"alnum_prop": 0.5939677700348432,
"repo_name": "rahulmutt/ghcvm",
"id": "a08dbc5d41ae626a8c96862b634fe83aa0cbf8ca",
"size": "9184",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "libraries/base/Data/Either.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "11231"
},
{
"name": "C++",
"bytes": "3747"
},
{
"name": "Haskell",
"bytes": "10903832"
},
{
"name": "Java",
"bytes": "538983"
},
{
"name": "Logos",
"bytes": "104511"
},
{
"name": "Pascal",
"bytes": "113793"
},
{
"name": "Ruby",
"bytes": "6"
},
{
"name": "Shell",
"bytes": "2726"
}
],
"symlink_target": ""
} |
from __future__ import print_function
from __future__ import division
import ftplib
from fnmatch import fnmatch
from StringIO import StringIO
import pkgutil
import importlib
from path import path
from fuzzywuzzy import process
import resources
from magicmethods import load_class
from yml import ConfigReader, HistoryReader
from messenger import Messenger
class FTP(object):
"""
Model of a basic FTP server. Inherits a few methods from class:`ftplib.FTP`
as well as extends with a few new methods making it more like `ftputil`.
.. code-block::
>>> from cosmid.core import FTP
>>> ftp = FTP("ftp.ensembl.org", "anonymous", "")
>>> ftp.ls("")
['ls-lR.gz',
'.message',
'.ok_to_rsync',
'pub',
...
]
:param str url: URL for the server to connect to
:param str username: Username for an account on the server
:param str password: Password to the accound on the server
"""
def __init__(self, url, username, password):
super(FTP, self).__init__()
self.url = url
self.username = username
self.password = password
# Connect to the FTP server
self.ftp = ftplib.FTP(url, username, password)
# Shortcuts
self.nlst = self.ftp.nlst
self.retrbinary = self.ftp.retrbinary
self.sendcmd = self.ftp.sendcmd
self.size = self.ftp.size
def ls(self, dir_path="."):
"""
<public> Functions like `ls` in Unix where it lists the folders and files
in a specific directory. Compared to `nlst` it doesn't return the full
path for each file/folder.
:param str dir_path: (optional) Path to directory
:returns: List of files/folders in the directory
:rtype: list
"""
return [path_.split("/")[-1] for path_ in self.nlst(dir_path)]
def file(self, path):
"""
<public> Open a file-like object for reading txt-files on the server
without downloading it locally first.
:param str path: Path to file
:returns: File-like object
:rtype: StringIO object
"""
r = StringIO()
self.retrbinary("RETR " + path, r.write)
# Rewind the "file"
r.seek(0)
return r
def fileSize(self, path):
"""
<public> Returns the file size of a certain file on the server in MB.
:param str path: Path to file
:returns: Size of file in megabytes
:rtype: int
"""
# Switch to Binary mode (to be able to get size)
self.sendcmd("TYPE i")
return round(self.size(path)/1000000, 2)
def listFiles(self, dirPath, pattern):
"""
<public> Like `ls` but has the option to match file/folder names to a
pattern.
:param str dirPath: Path to directory
:param str pattern: Glob-like pattern to match against files
:returns: List of files/folders in the directory matching the pattern
:rtype: list
"""
return [item for item in self.ls(dirPath) if fnmatch(item, pattern)]
def commit(self, fullPath, dest, mode=None):
"""
<public>: Saves a file from the server, locally in the `dest`.
:param str fullPath: Path from the cwd to the file to download
:param str dest: Local path+filename where you want to save the file
:param str mode: (optional) "b" for binary files
:returns: 0: OK, >0: NOT OK
"""
# Is the remote file gzipped? (Binary format)
if mode is None:
if fullPath.endswith(".gz") or fullPath.endswith(".bam"):
mode = "b"
else:
# Default mode is to download non-binary files
mode = ""
# Open connection to the destination file and retrive the file
with open(dest, "w" + mode) as handle:
self.retrbinary("RETR " + fullPath, handle.write)
class Registry(object):
"""
Hub of-sorts to talk with different `Cosmid` related files and resources. Can
be seen as the API endpoint for `Cosmid`.
"""
def __init__(self):
super(Registry, self).__init__()
# Set up YAML parser for optional config file
self.config_path = path("cosmid.yaml")
self.config = ConfigReader(self.config_path)
# Extract stuff from config
self.email = self.config.find("email")
# Path to resource storage directory
self.directory = path(self.config.find("directory", default="resources"))
# Load history file consisting of already downloaded resources
self.history_path = path(self.directory + "/.cosmid.yaml")
self.history = HistoryReader(self.history_path)
# Set up a :class:`cosmid.messenger.Messenger`
self.messenger = Messenger("cosmid")
def get(self, resource_id, type_="class"):
"""
<public> Returns an instance of the specified resource class. Dodges an
``ImportError`` when failing to import a resource and returns ``None``
instead.
.. code-block:: python
>>> resource = registry.get("ccds")
>>> resource.latest()
'Hs104'
:param str resource_id: The resource key (name of module)
:returns: A class instance of the resource
"""
try:
if type_ == "class":
return load_class("cosmid.resources.{}.Resource".format(resource_id))()
elif type_ == "module":
return importlib.import_module("cosmid.resources." + resource_id)
else:
raise ValueError("Argument must be either 'class' or 'module'.")
except ImportError:
return None
def grab(self, resource_id, target, collapse=False):
"""
<public> Returns all that's nessesary to download a specific resource.
The method will try to correct both ``resource_id`` and the ``target``
release tag.
:param str resource_id: What resource to download
:param str target: What release of the resource to download
"""
# Either import resource class or print warning and move on.
# Test matching the resource ID
options = [item[0] for item in self.ls()]
resource_id = self.matchOne(resource_id, options)
if resource_id is None:
message = "Couldn't match resource ID: '{}'".format(resource_id)
self.messenger.send("warning", message)
return None, None, None, None
# Get the resource
resource = self.get(resource_id)
# Now let's figure out the version
# No specified version will match to the latest resource release
if target == "latest":
version = resource.latest()
else:
options = resource.versions()
version = self.matchOne(target, options)
if version is None:
message = ("Couldn't match version '{id}#{v}'; {vers}"
.format(v=target, id=resource.id, vers=", ".join(options)))
self.messenger.send("warning", message)
return None, None, None, None
# Get the goahead! (that we haven't already downloaded it)
if self.goahead(resource, version):
# Finally we can determine the paths to download and save the files
dl_paths = resource.paths(version)
if collapse:
# The user can select to store all downloaded files in the same
# directory
resource_dir = ""
else:
# Or by default separate different resources into subdirectories
resource_dir = "/" + resource.id
save_paths = [("{dir}{mid}/{file}"
.format(dir=self.directory, mid=resource_dir, file=name))
for name in resource.names]
# Add the resource to the history file as downloaded
self.history.add(resource_id, {
"version": version,
"target": target,
"names": resource.names,
"sources": dl_paths
})
return resource, dl_paths, save_paths, version
else:
# The resource was already downloaded
return None, None, None, None
def ls(self):
"""
<public> Returns a list of resource IDs and docstrings for all the
included resource modules.
*Reference*: http://stackoverflow.com/questions/1707709/list-all-the-modules-that-are-part-of-a-python-package
.. code-block:: python
>>> registry.ls()
[('ccds', 'A curated database of generic element'), ...]
:returns: A list of tuples: ``(resource_id, docstring)``
:rtype: list
"""
# Store everything here
items = []
prefix = resources.__name__ + "."
# Fetch all the resource modules
modules = pkgutil.iter_modules(resources.__path__, prefix)
# Loop over all resource modules
for importer, modpath, ispkg in modules:
# Strip path
modname = modpath.split(".")[-1]
# Load the `Resource` class for the module
module = self.get(modname, type_="module")
# Save name and docstring
items.append((modname, module.__doc__))
return items
def search(self, query, limit=5):
"""
<public> Fuzzy matches a query string against each of the resource IDs and
returns a limited number of results in order of match score.
.. code-block:: python
>>> registry.search("asmebly", limit=2)
[('ensembl_assembly', 68),
('ncbi_assembly', 68)]
:param str query: A string to match against the resource IDs
:param int limit: (optional) A maximum number of results to return
:returns: A list of tuples: ``(resource_id, score)`
:rtype: list
"""
# List all the available resources
resources = self.ls()
# Focus on resource IDs
resource_ids = [resource[0] for resource in resources]
# Fuzzy match against the resource IDs and return in order of best match
return process.extract(query, resource_ids, limit=limit)
def matchOne(self, target, options, threshold=60):
"""
<public> Fuzzy matches e.g. a target version tag against a list of options.
Returns the most likely match if the match score is sufficient.
.. code-block:: python
>>> resource = registry.get("ccds")
>>> registry.matchOne(104, resource.versions())
'Hs104'
>>> registry.matchOne("ensembl", registry.ls())
'ensembl_assembly'
:param object target: Any Python object to match with
:param list options: A list of possible options to match against
:param int threshold: A lower threshold for accepting a best match
:returns: The object with the best match (unless score is below threshold)
:rtype: Python object
"""
# Match against the options and extract the top match only
result, score = process.extractOne(target, map(str, options))
# Arbitrary lower limit for returning a *mathcing* result
if score >= threshold:
return result
else:
return None
def goahead(self, resource, version):
"""
Determines whether it's any idea in going ahead with a download.
"""
# Get any currently downloaded resources
current = self.history.find(resource.id, default={})
# Make sure we haven't already downloaded the resource
if current.get("version") == version:
message = "'{}' already downloaded and up-to-date.".format(resource.id)
self.messenger.send("update", message)
return False
return True
| {
"content_hash": "f6c73d88a98507d1cff52517897042ca",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 114,
"avg_line_length": 30.20498614958449,
"alnum_prop": 0.6507703595011005,
"repo_name": "robinandeer/cosmid",
"id": "79419658bd13cb07a9349c61ca36427fd98c2b89",
"size": "10927",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cosmid/core.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "64984"
}
],
"symlink_target": ""
} |
<?php
namespace SilverStripe\Comments\Forms;
use SilverStripe\Forms\CompositeField;
use SilverStripe\Forms\EmailField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\HiddenField;
use SilverStripe\Forms\ReadonlyField;
use SilverStripe\Forms\RequiredFields;
use SilverStripe\Forms\TextareaField;
use SilverStripe\Forms\TextField;
use SilverStripe\Security\Member;
use SilverStripe\Control\Cookie;
use SilverStripe\Core\Convert;
use SilverStripe\Security\Security;
use SilverStripe\Comments\Model\Comment;
use SilverStripe\Control\Controller;
use SilverStripe\Comments\Controllers\CommentingController;
use SilverStripe\Core\Config\Config;
class CommentForm extends Form
{
/**
* @param string $name
* @param CommentingController $controller
*/
public function __construct($name, CommentingController $controller)
{
$usePreview = $controller->getOption('use_preview');
$nameRequired = _t('CommentInterface.YOURNAME_MESSAGE_REQUIRED', 'Please enter your name');
$emailRequired = _t('CommentInterface.EMAILADDRESS_MESSAGE_REQUIRED', 'Please enter your email address');
$emailInvalid = _t('CommentInterface.EMAILADDRESS_MESSAGE_EMAIL', 'Please enter a valid email address');
$urlInvalid = _t('CommentInterface.COMMENT_MESSAGE_URL', 'Please enter a valid URL');
$commentRequired = _t('CommentInterface.COMMENT_MESSAGE_REQUIRED', 'Please enter your comment');
$fields = FieldList::create(
$dataFields = CompositeField::create(
// Name
$a = TextField::create('Name', _t('CommentInterface.YOURNAME', 'Your name'))
->setCustomValidationMessage($nameRequired)
->setAttribute('data-msg-required', $nameRequired),
// Email
EmailField::create(
'Email',
_t('SilverStripe\\Comments\\Controllers\\CommentingController.EMAILADDRESS', 'Your email address (will not be published)')
)
->setCustomValidationMessage($emailRequired)
->setAttribute('data-msg-required', $emailRequired)
->setAttribute('data-msg-email', $emailInvalid)
->setAttribute('data-rule-email', true),
// Url
TextField::create('URL', _t('SilverStripe\\Comments\\Controllers\\CommentingController.WEBSITEURL', 'Your website URL'))
->setAttribute('data-msg-url', $urlInvalid)
->setAttribute('data-rule-url', true),
// Comment
TextareaField::create('Comment', _t('SilverStripe\\Comments\\Controllers\\CommentingController.COMMENTS', 'Comments'))
->setCustomValidationMessage($commentRequired)
->setAttribute('data-msg-required', $commentRequired)
),
HiddenField::create('ParentID'),
HiddenField::create('ParentClassName'),
HiddenField::create('ReturnURL'),
HiddenField::create('ParentCommentID')
);
// Preview formatted comment. Makes most sense when shortcodes or
// limited HTML is allowed. Populated by JS/Ajax.
if ($usePreview) {
$fields->insertAfter(
ReadonlyField::create('PreviewComment', _t('CommentInterface.PREVIEWLABEL', 'Preview'))
->setAttribute('style', 'display: none'), // enable through JS
'Comment'
);
}
$dataFields->addExtraClass('data-fields');
// save actions
$actions = FieldList::create(
$postAction = new FormAction('doPostComment', _t('CommentInterface.POST', 'Post'))
);
if ($usePreview) {
$actions->push(
FormAction::create('doPreviewComment', _t('CommentInterface.PREVIEW', 'Preview'))
->addExtraClass('action-minor')
->setAttribute('style', 'display: none') // enable through JS
);
}
$required = new RequiredFields(
$controller->config()->required_fields
);
parent::__construct($controller, $name, $fields, $actions, $required);
// if the record exists load the extra required data
if ($record = $controller->getOwnerRecord()) {
// Load member data
$member = Member::currentUser();
if (($record->CommentsRequireLogin || $record->PostingRequiredPermission) && $member) {
$fields = $this->Fields();
$fields->removeByName('Name');
$fields->removeByName('Email');
$fields->insertBefore(
new ReadonlyField(
'NameView',
_t('CommentInterface.YOURNAME', 'Your name'),
$member->getName()
),
'URL'
);
$fields->push(new HiddenField('Name', '', $member->getName()));
$fields->push(new HiddenField('Email', '', $member->Email));
}
// we do not want to read a new URL when the form has already been submitted
// which in here, it hasn't been.
$this->loadDataFrom(array(
'ParentID' => $record->ID,
'ReturnURL' => $controller->getRequest()->getURL(),
'ParentClassName' => $controller->getParentClass()
));
if ($holder = $record->getCommentHolderID()) {
$this->setHTMLID($holder);
}
}
// Set it so the user gets redirected back down to the form upon form fail
$this->setRedirectToFormOnValidationError(true);
// load any data from the cookies
if ($data = Cookie::get('CommentsForm_UserData')) {
$data = Convert::json2array($data);
$this->loadDataFrom(array(
'Name' => isset($data['Name']) ? $data['Name'] : '',
'URL' => isset($data['URL']) ? $data['URL'] : '',
'Email' => isset($data['Email']) ? $data['Email'] : ''
));
// allow previous value to fill if comment not stored in cookie (i.e. validation error)
$prevComment = Cookie::get('CommentsForm_Comment');
if ($prevComment && $prevComment != '') {
$this->loadDataFrom(array('Comment' => $prevComment));
}
}
}
/**
* @param array $data
* @param Form $form
* @return HTTPResponse
*/
public function doPreviewComment($data, $form)
{
$data['IsPreview'] = 1;
return $this->doPostComment($data, $form);
}
/**
* Process which creates a {@link Comment} once a user submits a comment from this form.
*
* @param array $data
* @param Form $form
* @return HTTPResponse
*/
public function doPostComment($data, $form)
{
// Load class and parent from data
if (isset($data['ParentClassName'])) {
$this->controller->setParentClass($data['ParentClassName']);
}
if (isset($data['ParentID']) && ($class = $this->controller->getParentClass())) {
$this->controller->setOwnerRecord($class::get()->byID($data['ParentID']));
}
if (!$this->controller->getOwnerRecord()) {
return $this->getRequestHandler()->httpError(404);
}
// cache users data
Cookie::set('CommentsForm_UserData', Convert::raw2json($data));
Cookie::set('CommentsForm_Comment', $data['Comment']);
// extend hook to allow extensions. Also see onAfterPostComment
$this->controller->extend('onBeforePostComment', $form);
// If commenting can only be done by logged in users, make sure the user is logged in
if (!$this->controller->getOwnerRecord()->canPostComment()) {
return Security::permissionFailure(
$this,
_t(
'SilverStripe\\Comments\\Controllers\\CommentingController.PERMISSIONFAILURE',
"You're not able to post comments to this page. Please ensure you are logged in and have an "
. 'appropriate permission level.'
)
);
}
if ($member = Security::getCurrentUser()) {
$form->Fields()->push(new HiddenField('AuthorID', 'Author ID', $member->ID));
}
// What kind of moderation is required?
switch ($this->controller->getOwnerRecord()->ModerationRequired) {
case 'Required':
$requireModeration = true;
break;
case 'NonMembersOnly':
$requireModeration = empty($member);
break;
case 'None':
default:
$requireModeration = false;
break;
}
$comment = Comment::create();
$form->saveInto($comment);
$comment->ParentID = $data['ParentID'];
$comment->ParentClass = $data['ParentClassName'];
$comment->AllowHtml = $this->controller->getOption('html_allowed');
$comment->Moderated = !$requireModeration;
// Save into DB, or call pre-save hooks to give accurate preview
$usePreview = $this->controller->getOption('use_preview');
$isPreview = $usePreview && !empty($data['IsPreview']);
if ($isPreview) {
$comment->extend('onBeforeWrite');
} else {
$comment->write();
// extend hook to allow extensions. Also see onBeforePostComment
$this->controller->extend('onAfterPostComment', $comment);
}
// we want to show a notification if comments are moderated
if ($requireModeration && !$comment->IsSpam) {
$this->getRequest()->getSession()->set('CommentsModerated', 1);
}
// clear the users comment since it passed validation
Cookie::set('CommentsForm_Comment', false);
// Find parent link
if (!empty($data['ReturnURL'])) {
$url = $data['ReturnURL'];
} elseif ($parent = $comment->Parent()) {
$url = $parent->Link();
} else {
return $this->controller->redirectBack();
}
// Given a redirect page exists, attempt to link to the correct anchor
if ($comment->IsSpam) {
// Link to the form with the error message contained
$hash = $form->FormName();
} elseif (!$comment->Moderated) {
// Display the "awaiting moderation" text
$hash = 'moderated';
} else {
// Link to the moderated, non-spam comment
$hash = $comment->Permalink();
}
return $this->controller->redirect(Controller::join_links($url, "#{$hash}"));
}
}
| {
"content_hash": "27c37c056c9f97c2de4b8e5e5f684397",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 142,
"avg_line_length": 39.64028776978417,
"alnum_prop": 0.5655172413793104,
"repo_name": "gordonbanderson/silverstripe-comments",
"id": "977eb03050e5096d940b25b613130b2299e4a1bc",
"size": "11020",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Forms/CommentForm.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "5783"
},
{
"name": "JavaScript",
"bytes": "6991"
},
{
"name": "PHP",
"bytes": "171877"
},
{
"name": "Scheme",
"bytes": "5722"
}
],
"symlink_target": ""
} |
<!--
This template loads for the 'tab.about' state (app.js)
-->
<ion-view title="About oto">
<ion-content has-header="true" has-tabs="true" padding="true">
<img src="img/ionic.png" class="ionic-logo">
<p>
oto
</p>
<p>
github:
<a href="http://forum.ionicframework.com/" target="_blank">link</a>
</p>
yeeeeeeeeeee.
</p>
</ion-content>
</ion-view>
| {
"content_hash": "cce0920045a080f5fe8a93c6e53b1d81",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 69,
"avg_line_length": 20.842105263157894,
"alnum_prop": 0.5732323232323232,
"repo_name": "ronnpang1/otocopy",
"id": "ef07bb9e206a7cf70483cf956099b9ae8e02cdea",
"size": "396",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/templates/about.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "106"
},
{
"name": "Batchfile",
"bytes": "250"
},
{
"name": "C#",
"bytes": "1090"
},
{
"name": "CSS",
"bytes": "1051958"
},
{
"name": "CoffeeScript",
"bytes": "58014"
},
{
"name": "HTML",
"bytes": "373344"
},
{
"name": "Java",
"bytes": "6207"
},
{
"name": "JavaScript",
"bytes": "6710127"
},
{
"name": "Shell",
"bytes": "1186"
}
],
"symlink_target": ""
} |
/* eslint-disable */
'use strict';
/*::
import type { Fragment, ReaderFragment } from 'relay-runtime';
import type { FragmentType } from "relay-runtime";
declare export opaque type RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$fragmentType: FragmentType;
export type RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$data = {|
+id: string,
+name: ?string,
+$fragmentType: RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$fragmentType,
|};
export type RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$key = {
+$data?: RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$data,
+$fragmentSpreads: RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$fragmentType,
...
};
*/
var node/*: ReaderFragment*/ = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
}
],
"type": "User",
"abstractKey": null
};
if (__DEV__) {
(node/*: any*/).hash = "8fb94afd920ae45f035f75359e26d76e";
}
module.exports = ((node/*: any*/)/*: Fragment<
RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$fragmentType,
RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user$data,
>*/);
| {
"content_hash": "0822f300a553970c5dd2c4615ba051b1",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 116,
"avg_line_length": 28.072727272727274,
"alnum_prop": 0.711139896373057,
"repo_name": "wincent/relay",
"id": "5d5967eba3efee9389f6c73295492b0fe0b31e55",
"size": "1845",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "packages/relay-runtime/store/__tests__/__generated__/RelayModernEnvironmentExecuteWithDeferAndModuleTestQuery_user.graphql.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "41275"
},
{
"name": "HTML",
"bytes": "103730"
},
{
"name": "JavaScript",
"bytes": "3271517"
},
{
"name": "Python",
"bytes": "1730"
},
{
"name": "Rust",
"bytes": "3512319"
},
{
"name": "Shell",
"bytes": "417"
},
{
"name": "TypeScript",
"bytes": "26864"
}
],
"symlink_target": ""
} |
from login.permissions import cache_clear
def mqtt_cache_clear():
# call cache_clear locally
cache_clear()
# and signal through mqtt
from mqtt.publish import SingletonPublishClient
SingletonPublishClient().publish_message('cache_clear')
| {
"content_hash": "ac9de1aa2cd7747e5a0543f72cf3bc9f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 59,
"avg_line_length": 23.727272727272727,
"alnum_prop": 0.7394636015325671,
"repo_name": "EMSTrack/WebServerAndClient",
"id": "5b0134d3dfc2be04506d7c623d016a14796ddf41",
"size": "261",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mqtt/cache_clear.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "10055"
},
{
"name": "HTML",
"bytes": "105332"
},
{
"name": "JavaScript",
"bytes": "169499"
},
{
"name": "Python",
"bytes": "609216"
}
],
"symlink_target": ""
} |
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.util.io;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadCompatible;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.EnumSet;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
* Allows to print "colored" strings by parsing predefined string keywords,
* which, depending on the useColor value are either replaced with ANSI terminal
* coloring sequences (as defined by the {@link AnsiTerminal} class) or stripped.
*
* Supported keywords are defined by the enum {@link AnsiTerminalPrinter.Mode}.
* Following keywords are supported:
* INFO - switches color to green.
* ERROR - switches color to bold red.
* WARNING - switches color to magenta.
* NORMAL - resets terminal to the default state.
*
* Each keyword is starts with prefix "{#" followed by the enum constant name
* and suffix "#}". Keywords should not be inserted manually - provided enum
* constants should be used instead.
*/
@ThreadCompatible
public class AnsiTerminalPrinter {
private static final String MODE_PREFIX = "{#";
private static final String MODE_SUFFIX = "#}";
// Mode pattern must match MODE_PREFIX and do lookahead for the rest of the
// mode string.
private static final String MODE_PATTERN = "\\{\\#(?=[A-Z]+\\#\\})";
/**
* List of supported coloring modes for the {@link AnsiTerminalPrinter}.
*/
public static enum Mode {
INFO, // green
ERROR, // bold red
WARNING, // magenta
DEFAULT; // default color
@Override
public String toString() {
return MODE_PREFIX + name() + MODE_SUFFIX;
}
}
private static final Logger logger = Logger.getLogger(AnsiTerminalPrinter.class.getName());
private static final EnumSet<Mode> MODES = EnumSet.allOf(Mode.class);
private static final Pattern PATTERN = Pattern.compile(MODE_PATTERN);
private final OutputStream stream;
private final PrintWriter writer;
private final AnsiTerminal terminal;
private boolean useColor;
private Mode lastMode = Mode.DEFAULT;
/**
* Creates new instance using provided OutputStream and sets coloring logic
* for that instance.
*/
public AnsiTerminalPrinter(OutputStream out, boolean useColor) {
this.useColor = useColor;
terminal = new AnsiTerminal(out);
writer = new PrintWriter(out, true);
stream = out;
}
/**
* Writes the specified string to the output stream while injecting coloring
* sequences when appropriate mode keyword is found and flushes.
*
* List of supported mode keywords is defined by the enum {@link Mode}.
*
* See class documentation for details.
*/
public void print(String str) {
for (String part : PATTERN.split(str)) {
int index = part.indexOf(MODE_SUFFIX);
// Mode name will contain at least one character, so suffix index
// must be at least 1. If it isn't then there is no match.
if (index > 1) {
for (Mode mode : MODES) {
if (index == mode.name().length() && part.startsWith(mode.name())) {
setupTerminal(mode);
part = part.substring(index + MODE_SUFFIX.length());
break;
}
}
}
writer.print(part);
writer.flush();
}
}
public void printLn(String str) {
print(str + "\n");
}
/**
* Returns the underlying OutputStream.
*/
public OutputStream getOutputStream() {
return stream;
}
/**
* Injects coloring escape sequences if output should be colored and mode
* has been changed.
*/
private void setupTerminal(Mode mode) {
if (!useColor) {
return;
}
try {
if (lastMode != mode) {
terminal.resetTerminal();
lastMode = mode;
if (mode == Mode.DEFAULT) {
return; // Terminal is already reset - nothing else to do.
} else if (mode == Mode.INFO) {
terminal.textGreen();
} else if (mode == Mode.ERROR) {
terminal.textRed();
terminal.textBold();
} else if (mode == Mode.WARNING) {
terminal.textMagenta();
}
}
} catch (IOException e) {
// AnsiTerminal state is now considered to be inconsistent - coloring
// should be disabled to prevent future use of AnsiTerminal instance.
logger.warning("Disabling coloring due to " + e.getMessage());
useColor = false;
}
}
}
| {
"content_hash": "83cc8148c9d64efcc78191d997c3c2d8",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 93,
"avg_line_length": 32.65806451612903,
"alnum_prop": 0.6689055709205848,
"repo_name": "spxtr/bazel",
"id": "e1dd5e5ec32cea81643c6cd9cbc60447a4fa046c",
"size": "5062",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "src/main/java/com/google/devtools/build/lib/util/io/AnsiTerminalPrinter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "14332"
},
{
"name": "C++",
"bytes": "985839"
},
{
"name": "HTML",
"bytes": "20974"
},
{
"name": "Java",
"bytes": "25691487"
},
{
"name": "JavaScript",
"bytes": "9186"
},
{
"name": "Makefile",
"bytes": "248"
},
{
"name": "PowerShell",
"bytes": "5473"
},
{
"name": "Protocol Buffer",
"bytes": "114160"
},
{
"name": "Python",
"bytes": "574080"
},
{
"name": "Roff",
"bytes": "481"
},
{
"name": "Shell",
"bytes": "909294"
}
],
"symlink_target": ""
} |
A master project to improve the UF VIVO ingests and support tools. In particular:
1. Upgrade the person ingest
1. Upgrade the grant ingest
1. Upgrade the publication ingest
1. Upgrade the courses ingest
1. Upgrade vivotools
The development of new vivotools will improve our ability to support all aspects of VIVO, in particular,
the production of data products -- reports and visualizations.
| {
"content_hash": "aee76c3a23f08b4d9535299243f39ed5",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 105,
"avg_line_length": 39.6,
"alnum_prop": 0.8005050505050505,
"repo_name": "mconlon17/vivo-1.5-improvement",
"id": "65d75c1c8b239e66e16e2d13a6d438260e1065f9",
"size": "420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "70774"
},
{
"name": "TeX",
"bytes": "551"
}
],
"symlink_target": ""
} |
<?php
//require_once 'PHPUnit/Framework.php';
class AllTests extends Test_SuiteBase {
public static function suite() {
$suite = new AllTests('Models');
$suite->addTest(TestSuite_Basics_AllTests::suite());
$suite->addTest(TestSuite_Datatypes_AllTests::suite());
$suite->addTest(TestSuite_Inheritance_AllTests::suite());
$suite->addTest(TestSuite_Rest_AllTests::suite());
return $suite;
}}
?>
| {
"content_hash": "5f41a3e17c518e6aadf9863ede19f0de",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 65,
"avg_line_length": 29.1875,
"alnum_prop": 0.6209850107066381,
"repo_name": "PatidarWeb/pimcore",
"id": "ff1cf5e8d80c030f93dbef5cb9c9813f1f12ca2e",
"size": "467",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tests/AllTests.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
namespace rec {
namespace util {
namespace thread {
// Callbacks for functions or methods which return null.
template <typename Type>
Callback* makeCallback(Type o) {
return new callback::Pointer<Type>(o);
}
template <typename Type, typename Method>
Callback* methodCallback(Type* o, Method m) {
return new callback::Callback0<Type, Method>(o, m);
}
template <typename Type, typename Method, typename Value>
Callback* methodCallback(Type* o, Method m, Value v) {
return new callback::Callback1<Type, Method, Value>(o, m, v);
}
template <typename Type, typename Method, typename V1, typename V2>
Callback* methodCallback(Type* o, Method m, V1 v1, V2 v2) {
return new callback::Callback2<Type, Method, V1, V2>(o, m, v1, v2);
}
template <typename Type, typename Method, typename V1, typename V2, typename V3>
Callback* methodCallback(Type* o, Method m, V1 v1, V2 v2, V3 v3) {
return new callback::Callback3<Type, Method, V1, V2, V3>(o, m, v1, v2, v3);
}
template <typename Type, typename Method, typename V1, typename V2, typename V3, typename V4>
Callback* methodCallback(Type* o, Method m, V1 v1, V2 v2, V3 v3, V4 v4) {
return new callback::Callback4<Type, Method, V1, V2, V3, V4>(o, m, v1, v2, v3, v4);
}
} // namespace thread
} // namespace util
} // namespace rec
#endif // __REC_UTIL_THREAD_MAKECALLBACK__
| {
"content_hash": "76390f291cf40e2dea5bf681431a108b",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 93,
"avg_line_length": 32.53658536585366,
"alnum_prop": 0.7091454272863568,
"repo_name": "rec/echomesh",
"id": "5eee1eb8088903b68e413824cb4ddff311002bc8",
"size": "1650",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "code/cpp/rec/util/thread/MakeCallback.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "5723427"
},
{
"name": "C++",
"bytes": "10326191"
},
{
"name": "CSS",
"bytes": "2048"
},
{
"name": "HTML",
"bytes": "22355"
},
{
"name": "Java",
"bytes": "25383"
},
{
"name": "M4",
"bytes": "32321"
},
{
"name": "Makefile",
"bytes": "215120"
},
{
"name": "Objective-C",
"bytes": "93003"
},
{
"name": "Objective-C++",
"bytes": "394207"
},
{
"name": "Python",
"bytes": "1117634"
},
{
"name": "Shell",
"bytes": "735767"
}
],
"symlink_target": ""
} |
package brooklyn.util.file;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipOutputStream;
import brooklyn.util.exceptions.Exceptions;
import brooklyn.util.file.ArchiveUtils.ArchiveType;
import brooklyn.util.os.Os;
import brooklyn.util.text.Identifiers;
import com.google.common.collect.Maps;
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
/**
* Build a Zip or Jar archive.
* <p>
* Supports creating temporary archives that will be deleted on exit, if no name is
* specified. The created file must be a Java archive type, with the extension {@code .zip},
* {@code .jar}, {@code .war} or {@code .ear}.
* <p>
* Examples:
* <pre> File zip = ArchiveBuilder.archive("data/archive.zip")
* .entry("src", applicationDir + "/deploy/" + version + "/src/")
* .entry("lib", applicationDir + "/deploy/" + version + "/lib/")
* .entry("etc/config.ini", applicationDir + "/config.ini")
* .create();
* </pre>
* <pre> OutputStream remote = ...;
* Map<String, File> entries = ...;
* ArchiveBuilder.zip()
* .add("resources/data.csv")
* .addAll(entries)
* .stream(remote);
* </pre>
*/
public class ArchiveBuilder {
/**
* Create an {@link ArchiveBuilder} for an archive with the given name.
*/
public static ArchiveBuilder archive(String archive) {
return new ArchiveBuilder(archive);
}
/**
* Create an {@link ArchiveBuilder} for a {@link ArchiveType#ZIP Zip} format archive.
*/
public static ArchiveBuilder zip() {
return new ArchiveBuilder(ArchiveType.ZIP);
}
/**
* Create an {@link ArchiveBuilder} for a {@link ArchiveType#JAR Jar} format archive.
*/
public static ArchiveBuilder jar() {
return new ArchiveBuilder(ArchiveType.JAR);
}
private ArchiveType type;
private File archive;
private Manifest manifest;
private Map<String, File> entries = Maps.newHashMap();
private ArchiveBuilder() {
this(ArchiveType.ZIP);
}
private ArchiveBuilder(String filename) {
this(ArchiveType.of(filename));
named(filename);
}
private ArchiveBuilder(ArchiveType type) {
checkNotNull(type);
checkArgument(ArchiveType.ZIP_ARCHIVES.contains(type));
this.type = type;
this.manifest = new Manifest();
}
/**
* Set the location of the generated archive file.
*/
public ArchiveBuilder named(String name) {
checkNotNull(name);
String ext = Files.getFileExtension(name);
if (ext.isEmpty()) {
name = name + "." + type.toString();
} else if (type != ArchiveType.of(name)) {
throw new IllegalArgumentException(String.format("Extension for '%s' did not match archive type of %s", ext, type));
}
this.archive = new File(Os.tidyPath(name));
return this;
}
/**
* @see #named(String)
*/
public ArchiveBuilder named(File file) {
checkNotNull(file);
return named(file.getPath());
}
/**
* Add a manifest entry with the given {@code key} and {@code value}.
*/
public ArchiveBuilder manifest(Object key, Object value) {
checkNotNull(key, "key");
checkNotNull(value, "value");
manifest.getMainAttributes().put(key, value);
return this;
}
/**
* Add the file located at the {@code filePath} to the archive.
*
* @see #add(File)
*/
public ArchiveBuilder add(String filePath) {
checkNotNull(filePath, "filePath");
return add(new File(Os.tidyPath(filePath)));
}
/**
* Add the {@code file} to the archive.
* <p>
* If the file path is absolute, or points to a file above the current directory,
* the file is added to the archive as a top-level entry, using the file name only.
* For relative {@code filePath}s below the current directory, the file is added
* using the path given and is assumed to be located relative to the current
* working directory.
* <p>
* No checks for file existence are made at this stage.
*
* @see #entry(String, File)
*/
public ArchiveBuilder add(File file) {
checkNotNull(file, "file");
String filePath = Os.tidyPath(file.getPath());
if (file.isAbsolute() || filePath.startsWith("../")) {
return entry(Os.mergePaths(".", file.getName()), file);
} else {
return entry(Os.mergePaths(".", filePath), file);
}
}
/**
* Add the file located at the {@code filePath}, relative to the {@code baseDir},
* to the archive.
* <p>
* Uses the {@code filePath} as the name of the file in the archive. Note that the
* two path components are simply concatenated using {@link Os#mergePaths(String...)}
* which may not behave as expected if the {@code filePath} is absolute or points to
* a location above the current directory.
* <p>
* Use {@link #entry(String, String)} directly or {@link #entries(Map)} for complete
* control over file locations and names in the archive.
*
* @see #entry(String, String)
*/
public ArchiveBuilder add(String baseDir, String filePath) {
checkNotNull(baseDir, "baseDir");
checkNotNull(filePath, "filePath");
return entry(Os.mergePaths(".", filePath), Os.mergePaths(baseDir, filePath));
}
/**
* Add the contents of the directory named {@code dirName} to the archive.
*
* @see #addDir(File)
*/
public ArchiveBuilder addDir(String dirName) {
checkNotNull(dirName, "dirName");
return addDir(new File(Os.tidyPath(dirName)));
}
/**
* Add the contents of the directory {@code dir} to the archive.
* <p>
* Uses {@literal .} as the parent directory name for the contents.
*
* @see #entry(String, File)
*/
public ArchiveBuilder addDir(File dir) {
checkNotNull(dir, "dir");
return entry(".", dir);
}
/**
* Add the collection of {@code files} to the archive.
*
* @see #add(String)
*/
public ArchiveBuilder add(Iterable<String> files) {
checkNotNull(files, "files");
for (String filePath : files) {
add(filePath);
}
return this;
}
/**
* Add the collection of {@code files}, relative to the {@code baseDir}, to
* the archive.
*
* @see #add(String, String)
*/
public ArchiveBuilder add(String baseDir, Iterable<String> files) {
checkNotNull(baseDir, "baseDir");
checkNotNull(files, "files");
for (String filePath : files) {
add(baseDir, filePath);
}
return this;
}
/**
* Add the {@code file} to the archive with the path {@code entryPath}.
*
* @see #entry(String, File)
*/
public ArchiveBuilder entry(String entryPath, String filePath) {
checkNotNull(entryPath, "entryPath");
checkNotNull(filePath, "filePath");
return entry(entryPath, new File(filePath));
}
/**
* Add the {@code file} to the archive with the path {@code entryPath}.
*/
public ArchiveBuilder entry(String entryPath, File file) {
checkNotNull(entryPath, "entryPath");
checkNotNull(file, "file");
this.entries.put(entryPath, file);
return this;
}
/**
* Add a {@link Map} of entries to the archive.
* <p>
* The keys should be the names of the file entries to be added to the archive and
* the value should point to the actual {@link File} to be added.
* <p>
* This allows complete control over the directory structure of the eventual archive,
* as the entry names do not need to bear any relationship to the name or location
* of the files on the filesystem.
*/
public ArchiveBuilder entries(Map<String, File> entries) {
checkNotNull(entries, "entries");
this.entries.putAll(entries);
return this;
}
/**
* Generates the archive and ouputs it to the given stream, ignoring any file name.
* <p>
* This will add a manifest filw if the type is a Jar archive.
*/
public void stream(OutputStream output) {
try {
ZipOutputStream target;
if (type == ArchiveType.ZIP) {
target = new ZipOutputStream(output);
} else {
manifest(Attributes.Name.MANIFEST_VERSION, "1.0");
target = new JarOutputStream(output, manifest);
}
for (String entry : entries.keySet()) {
entry(entry, entries.get(entry), target);
}
target.close();
} catch (IOException ioe) {
throw Exceptions.propagate(ioe);
}
}
/**
* Generates the archive, saving it with the given name.
*/
public File create(String archiveFile) {
return named(archiveFile).create();
}
/**
* Generates the archive.
* <p>
* If no name has been specified, the archive will be created as a temporary file with
* a unique name, that is deleted on exit. Otherwise, the given name will be used.
*/
public File create() {
if (archive == null) {
File temp = new File(Os.tmp(), "brooklyn-archive-" + Identifiers.makeRandomId(6));
temp.deleteOnExit();
named(temp);
}
try {
OutputStream output = new FileOutputStream(archive);
stream(output);
output.close();
} catch (IOException ioe) {
throw Exceptions.propagate(ioe);
}
return archive;
}
/**
* Recursively add files to the archive.
* <p>
* Code adapted from this <a href="http://stackoverflow.com/questions/1281229/how-to-use-jaroutputstream-to-create-a-jar-file">example</a>
* <p>
* <strong>Note</strong> {@link File} provides no support for symbolic links, and as such there is
* no way to ensure that a symbolic link to a directory is not followed when traversing the
* tree. In this case, iterables created by this traverser could contain files that are
* outside of the given directory or even be infinite if there is a symbolic link loop.
*/
private void entry(String path, File source, ZipOutputStream target) throws IOException {
String name = path.replace("\\", "/");
if (source.isDirectory()) {
name += "/";
JarEntry entry = new JarEntry(name);
entry.setTime(source.lastModified());
target.putNextEntry(entry);
target.closeEntry();
Iterable<File> children = Files.fileTreeTraverser().children(source);
for (File child : children) {
entry(Os.mergePaths(path, child.getName()), child, target);
}
return;
}
JarEntry entry = new JarEntry(name);
entry.setTime(source.lastModified());
target.putNextEntry(entry);
ByteStreams.copy(Files.newInputStreamSupplier(source), target);
target.closeEntry();
}
}
| {
"content_hash": "3be00f519ea1f884460fdfdc761a6b88",
"timestamp": "",
"source": "github",
"line_count": 352,
"max_line_length": 142,
"avg_line_length": 32.96590909090909,
"alnum_prop": 0.6107376766632195,
"repo_name": "merrickjyoungibm/brooklyn",
"id": "fae8a8c5412f6e34477b3896463d15fa446446c8",
"size": "12206",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "core/src/main/java/brooklyn/util/file/ArchiveBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
// OpmTestBundle:Default:index.html.twig
return array (
);
| {
"content_hash": "69f8217a3925f7059e31b62d037f0c69",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 40,
"avg_line_length": 13.2,
"alnum_prop": 0.7121212121212122,
"repo_name": "oxia-Opm/opm_dev",
"id": "d843967df893a94e26c5f79f7e12a4ed05bde68c",
"size": "66",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/cache/dev/assetic/config/7/712207b64ff1fbc209c90827d36c955e.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "917524"
},
{
"name": "PHP",
"bytes": "57493"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.