text:
.class Lcom/samsung/android/contextaware/utilbundle/CaPowerManager$1;
.super Landroid/content/BroadcastReceiver;
.source "CaPowerManager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;

# direct methods
.method constructor <init>(Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;)V
    .locals 0

    iput-object p1, p0, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager$1;->this$0:Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method

# virtual methods
.method public final onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 2

    if-nez p1, :cond_0

    iget-object v0, p0, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager$1;->this$0:Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;

    invoke-static {v0}, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;->-get3(Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;)Landroid/os/Handler;

    move-result-object v0

    const/16 v1, 0x1001

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    return-void

    :cond_0
    if-nez p2, :cond_1

    iget-object v0, p0, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager$1;->this$0:Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;

    invoke-static {v0}, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;->-get3(Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;)Landroid/os/Handler;

    move-result-object v0

    const/16 v1, 0x1002

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    return-void

    :cond_1
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "android.intent.action.ACTION_POWER_CONNECTED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    iget-object v0, p0, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager$1;->this$0:Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;

    invoke-static {v0}, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;->-get3(Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;)Landroid/os/Handler;

    move-result-object v0

    const/16 v1, 0x1005

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    :cond_2
    :goto_0
    return-void

    :cond_3
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "android.intent.action.ACTION_POWER_DISCONNECTED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager$1;->this$0:Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;

    invoke-static {v0}, Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;->-get3(Lcom/samsung/android/contextaware/utilbundle/CaPowerManager;)Landroid/os/Handler;

    move-result-object v0

    const/16 v1, 0x1006

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    goto :goto_0
.end method


text:
package user

object PersonsEndPoints {
  val basePath: String = "/persons"

  def createSingle = basePath

  def createBulkPath = s"$basePath/bulk"

  def listPaginatedPath(page: Int) = s"$basePath/$page"

  def findByNamePath(name: String) = s"$basePath/name/$name"

  def count = s"$basePath/count"

  def clean = s"$basePath/clean"

  def reset = s"$basePath/reset"
}

redpajama_set_name: RedPajamaGithub


text:
#import "MDCAlertControllerView.h"
#import "MDCAlertControllerView+Private.h"

#import <MDFInternationalization/MDFInternationalization.h>

#import "MaterialButtons.h"
#import "MaterialTypography.h"

// https://material.io/guidelines/components/dialogs.html#dialogs-specs
static const MDCFontTextStyle kTitleTextStyle = MDCFontTextStyleTitle;
static const MDCFontTextStyle kMessageTextStyle = MDCFontTextStyleBody1;
static const MDCFontTextStyle kButtonTextStyle = MDCFontTextStyleButton;

static const UIEdgeInsets MDCDialogContentInsets = {24.0, 24.0, 24.0, 24.0};
static const CGFloat MDCDialogContentVerticalPadding = 20.0;

static const UIEdgeInsets MDCDialogActionsInsets = {8.0, 8.0, 8.0, 8.0};
static const CGFloat MDCDialogActionsHorizontalPadding = 8.0;
static const CGFloat MDCDialogActionsVerticalPadding = 8.0;
static const CGFloat MDCDialogActionButtonHeight = 36.0;
static const CGFloat MDCDialogActionButtonMinimumWidth = 48.0;

static const CGFloat MDCDialogMessageOpacity = 0.54f;

@interface MDCAlertControllerView ()

@property(nonatomic, nonnull, strong) UIScrollView *contentScrollView;
@property(nonatomic, nonnull, strong) UIScrollView *actionsScrollView;

@property(nonatomic, getter=isVerticalActionsLayout) BOOL verticalActionsLayout;

@end

@implementation MDCAlertControllerView {
    NSMutableArray<MDCFlatButton *> *_actionButtons;
    BOOL _mdc_adjustsFontForContentSizeCategory;
}

- (instancetype)initWithFrame:(CGRect)frame {
  self = [super initWithFrame:frame];
  if (self) {
    self.backgroundColor = [UIColor whiteColor];
    self.autoresizesSubviews = NO;
    self.clipsToBounds = YES;

    self.contentScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero];
    self.contentScrollView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.contentScrollView];

    self.actionsScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero];
    self.actionsScrollView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.actionsScrollView];

    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.titleLabel.numberOfLines = 0;
    self.titleLabel.textAlignment = NSTextAlignmentNatural;
    if (self.mdc_adjustsFontForContentSizeCategory) {
      self.titleLabel.font = [UIFont mdc_preferredFontForMaterialTextStyle:MDCFontTextStyleTitle];
    } else {
      self.titleLabel.font = [MDCTypography titleFont];
    }
    [self.contentScrollView addSubview:self.titleLabel];

    self.messageLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.messageLabel.numberOfLines = 0;
    self.messageLabel.textAlignment = NSTextAlignmentNatural;
    if (self.mdc_adjustsFontForContentSizeCategory) {
      self.messageLabel.font = [UIFont mdc_preferredFontForMaterialTextStyle:MDCFontTextStyleBody1];
    } else {
      self.messageLabel.font = [MDCTypography body1Font];
    }
    self.messageLabel.textColor = [UIColor colorWithWhite:0.0f alpha:MDCDialogMessageOpacity];
    [self.contentScrollView addSubview:self.messageLabel];

    _actionButtons = [[NSMutableArray alloc] init];

    [self setNeedsLayout];
  }

  return self;
}

- (void)dealloc {
  [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (NSArray<UIButton *>*)actionButtons{
  return (NSArray<UIButton *>*)_actionButtons;
}

- (NSString *)title {
  return self.titleLabel.text;
}

- (void)setTitle:(NSString *)title {
  self.titleLabel.text = title;

  [self setNeedsLayout];
}

- (void)addActionButtonTitle:(NSString *)actionTitle target:(id)target selector:(SEL)selector {
  MDCFlatButton *actionButton = [[MDCFlatButton alloc] initWithFrame:CGRectZero];
  actionButton.mdc_adjustsFontForContentSizeCategory = self.mdc_adjustsFontForContentSizeCategory;
  [actionButton setTitle:actionTitle forState:UIControlStateNormal];
  if (_buttonColor) {
    // We only set if _buttonColor since settingTitleColor to nil doesn't reset the title to the
    // default
    [actionButton setTitleColor:_buttonColor forState:UIControlStateNormal];
  }
  [actionButton setTitleFont:_buttonFont forState:UIControlStateNormal];
  // TODO(#1726): Determine default text color values for Normal and Disabled
  CGRect buttonRect = actionButton.bounds;
  buttonRect.size.height = MAX(buttonRect.size.height, MDCDialogActionButtonHeight);
  buttonRect.size.width = MAX(buttonRect.size.width, MDCDialogActionButtonMinimumWidth);
  actionButton.frame = buttonRect;
  [actionButton addTarget:target
                   action:selector
         forControlEvents:UIControlEventTouchUpInside];
  [self.actionsScrollView addSubview:actionButton];

  [_actionButtons addObject:actionButton];
}

- (void)setTitleFont:(UIFont *)font {
  _titleFont = font;

  [self updateTitleFont];
}

- (void)updateTitleFont {
  // If we have a custom font apply it to the label.
  // If not, fall back to the Material specified font.
  if (_titleFont) {
    // If we are automatically adjusting for Dynamic Type resize the font based on the text style
    if (_mdc_adjustsFontForContentSizeCategory) {
      _titleLabel.font =
      [_titleFont mdc_fontSizedForMaterialTextStyle:kTitleTextStyle
                               scaledForDynamicType:_mdc_adjustsFontForContentSizeCategory];
    } else {
      _titleLabel.font = _titleFont;
    }
  } else {
    // TODO(#2709): Migrate to a single source of truth for fonts
    // There is no custom font, so use the default font.
    if (_mdc_adjustsFontForContentSizeCategory) {
      // If we are using the default (system) font loader, retrieve the
      // font from the UIFont preferredFont API.
      if ([MDCTypography.fontLoader isKindOfClass:[MDCSystemFontLoader class]]) {
        _titleLabel.font = [UIFont mdc_preferredFontForMaterialTextStyle:kTitleTextStyle];
      } else {
        // There is a custom font loader, retrieve the font and scale it.
        UIFont *customTypographyFont = [MDCTypography titleFont];
        _titleLabel.font =
        [customTypographyFont mdc_fontSizedForMaterialTextStyle:kTitleTextStyle
                                           scaledForDynamicType:_mdc_adjustsFontForContentSizeCategory];
      }
    } else {
      // If we are using the default (system) font loader, retrieve the
      // font from the UIFont standardFont API.
      if ([MDCTypography.fontLoader isKindOfClass:[MDCSystemFontLoader class]]) {
        _titleLabel.font = [UIFont mdc_standardFontForMaterialTextStyle:kTitleTextStyle];
      } else {
        // There is a custom font loader, retrieve the font from it.
        _titleLabel.font = [MDCTypography titleFont];
      }
    }
  }

  [self setNeedsLayout];
}

- (void)setTitleColor:(UIColor *)titleColor {
  _titleColor = titleColor;

  _titleLabel.textColor = titleColor;
}

- (NSString *)message {
  return self.messageLabel.text;
}

- (void)setMessage:(NSString *)message {
  self.messageLabel.text = message;

  [self setNeedsLayout];
}

- (void)setMessageFont:(UIFont *)messageFont {
  _messageFont = messageFont;

  [self updateMessageFont];
}

- (void)updateMessageFont {
  // If we have a custom font apply it to the label.
  // If not, fall back to the Material specified font.
  if (_messageFont) {
    if (_mdc_adjustsFontForContentSizeCategory) {
      // If we are automatically adjusting for Dynamic Type resize the font based on the text style
      _messageLabel.font =
          [_messageFont mdc_fontSizedForMaterialTextStyle:kMessageTextStyle
                                     scaledForDynamicType:_mdc_adjustsFontForContentSizeCategory];
    } else {
      _messageLabel.font = _messageFont;
    }
  } else {
    // TODO(#2709): Migrate to a single source of truth for fonts
    // There is no custom font, so use the default font.
    if (_mdc_adjustsFontForContentSizeCategory) {
      // If we are using the default (system) font loader, retrieve the
      // font from the UIFont preferredFont API.
      if ([MDCTypography.fontLoader isKindOfClass:[MDCSystemFontLoader class]]) {
        _messageLabel.font = [UIFont mdc_preferredFontForMaterialTextStyle:kMessageTextStyle];
      } else {
        // There is a custom font loader, retrieve the font and scale it.
        UIFont *customTypographyFont = [MDCTypography body1Font];
        _messageLabel.font =
        [customTypographyFont mdc_fontSizedForMaterialTextStyle:kMessageTextStyle
                                           scaledForDynamicType:_mdc_adjustsFontForContentSizeCategory];
      }
    } else {
      // If we are using the default (system) font loader, retrieve the
      // font from the UIFont standardFont API.
      if ([MDCTypography.fontLoader isKindOfClass:[MDCSystemFontLoader class]]) {
        _messageLabel.font = [UIFont mdc_standardFontForMaterialTextStyle:kMessageTextStyle];
      } else {
        // There is a custom font loader, retrieve the font from it.
        _messageLabel.font = [MDCTypography body1Font];
      }
    }
  }

  [self setNeedsLayout];
}

- (void)setMessageColor:(UIColor *)messageColor {
  _messageColor = messageColor;

  _messageLabel.textColor = messageColor;
}

- (void)setButtonFont:(UIFont *)font {
  _buttonFont = font;

  [self updateButtonFont];
}

- (void)updateButtonFont {
  // If we have a custom font apply it.
  // If not, fall back to the Material specified font.
  UIFont *finalButtonFont;
  if (_buttonFont) {
    // If we are automatically adjusting for Dynamic Type resize the font based on the text style
    if (_mdc_adjustsFontForContentSizeCategory) {
      finalButtonFont =
          [_buttonFont mdc_fontSizedForMaterialTextStyle:kTitleTextStyle
                                    scaledForDynamicType:_mdc_adjustsFontForContentSizeCategory];
    } else {
      finalButtonFont = _buttonFont;
    }
  } else {
    // TODO(#2709): Migrate to a single source of truth for fonts
    // There is no custom font, so use the default font.
    if (_mdc_adjustsFontForContentSizeCategory) {
      // If we are using the default (system) font loader, retrieve the
      // font from the UIFont preferredFont API.
      if ([MDCTypography.fontLoader isKindOfClass:[MDCSystemFontLoader class]]) {
        finalButtonFont = [UIFont mdc_preferredFontForMaterialTextStyle:kButtonTextStyle];
      } else {
        // There is a custom font loader, retrieve the font and scale it.
        UIFont *customTypographyFont = [MDCTypography titleFont];
        finalButtonFont =
            [customTypographyFont mdc_fontSizedForMaterialTextStyle:kButtonTextStyle
                 scaledForDynamicType:_mdc_adjustsFontForContentSizeCategory];
      }
    } else {
      // If we are using the default (system) font loader, retrieve the
      // font from the UIFont standardFont API.
      if ([MDCTypography.fontLoader isKindOfClass:[MDCSystemFontLoader class]]) {
        finalButtonFont = [UIFont mdc_standardFontForMaterialTextStyle:kButtonTextStyle];
      } else {
        // There is a custom font loader, retrieve the font from it.
        finalButtonFont = [MDCTypography titleFont];
      }
    }
  }

  for (MDCFlatButton *button in self.actionButtons) {
    [button setTitleFont:finalButtonFont forState:UIControlStateNormal];
  }

  [self setNeedsLayout];
}

- (void)setButtonColor:(UIColor *)color {
  _buttonColor = color;

  for (MDCFlatButton *button in self.actionButtons) {
    [button setTitleColor:_buttonColor forState:UIControlStateNormal];
  }
}

#pragma mark - Internal

- (CGSize)actionButtonsSizeInHorizontalLayout {
  CGSize size = CGSizeZero;
  if (0 < [self.actionButtons count]) {
    size.height =
    MDCDialogActionsInsets.top + MDCDialogActionButtonHeight + MDCDialogActionsInsets.bottom;
    size.width = MDCDialogActionsInsets.left + MDCDialogActionsInsets.right;
    for (UIButton *button in self.actionButtons) {
      size.width += CGRectGetWidth(button.bounds);
      if (button != [self.actionButtons lastObject]) {
        size.width += MDCDialogActionsHorizontalPadding;
      }
    }
  }

  return size;
}

- (CGSize)actionButtonsSizeInVericalLayout {
  CGSize size = CGSizeZero;
  if (0 < [self.actionButtons count]) {
    size.height = MDCDialogActionsInsets.top + MDCDialogActionsInsets.bottom;
    size.width = MDCDialogActionsInsets.left + MDCDialogActionsInsets.right;
    for (UIButton *button in self.actionButtons) {
      size.height += CGRectGetHeight(button.bounds);
      size.width = MAX(size.width, CGRectGetWidth(button.bounds));
      if (button != [self.actionButtons lastObject]) {
        size.height += MDCDialogActionsVerticalPadding;
      }
    }
  }

  return size;
}

// @param boundsSize should not include any internal margins or padding
- (CGSize)calculatePreferredContentSizeForBounds:(CGSize)boundsSize {
  // Content & Actions
  CGSize contentSize = [self calculateContentSizeThatFitsWidth:boundsSize.width];
  CGSize actionSize = [self calculateActionsSizeThatFitsWidth:boundsSize.width];

  // Final Sizing
  CGSize totalSize;
  totalSize.width = MAX(contentSize.width, actionSize.width);
  totalSize.height = contentSize.height + actionSize.height;

  return totalSize;
}

// @param boundingWidth should not include any internal margins or padding
- (CGSize)calculateContentSizeThatFitsWidth:(CGFloat)boundingWidth {
  CGSize boundsSize = CGRectInfinite.size;
  boundsSize.width = boundingWidth - MDCDialogContentInsets.left - MDCDialogContentInsets.right;

  CGSize titleSize = [self.titleLabel sizeThatFits:boundsSize];
  CGSize messageSize = [self.messageLabel sizeThatFits:boundsSize];

  CGFloat contentWidth = MAX(titleSize.width, messageSize.width);
  contentWidth += MDCDialogContentInsets.left + MDCDialogContentInsets.right;

  CGFloat contentInternalVerticalPadding = 0.0;
  if (0.0 < titleSize.height && 0.0 < messageSize.height) {
    contentInternalVerticalPadding = MDCDialogContentVerticalPadding;
  }
  CGFloat contentHeight = titleSize.height + contentInternalVerticalPadding + messageSize.height;
  contentHeight += MDCDialogContentInsets.top + MDCDialogContentInsets.bottom;

  CGSize contentSize;
  contentSize.width = (CGFloat)ceil(contentWidth);
  contentSize.height = (CGFloat)ceil(contentHeight);

  return contentSize;
}

// @param boundingWidth should not include any internal margins or padding
- (CGSize)calculateActionsSizeThatFitsWidth:(CGFloat)boundingWidth {
  CGSize boundsSize = CGRectInfinite.size;
  boundsSize.width = boundingWidth;

  CGSize horizontalSize = [self actionButtonsSizeInHorizontalLayout];
  CGSize verticalSize = [self actionButtonsSizeInVericalLayout];

  CGSize actionsSize;
  if (boundsSize.width < horizontalSize.width) {
    // Use VerticalLayout
    actionsSize.width = MIN(verticalSize.width, boundsSize.width);
    actionsSize.height = MIN(verticalSize.height, boundsSize.height);
  } else {
    // Use HorizontalLayout
    actionsSize.width = MIN(horizontalSize.width, boundsSize.width);
    actionsSize.height = MIN(horizontalSize.height, boundsSize.height);
  }

  actionsSize.width = (CGFloat)ceil(actionsSize.width);
  actionsSize.height = (CGFloat)ceil(actionsSize.height);

  return actionsSize;
}

- (void)layoutSubviews {
  [super layoutSubviews];

  for (UIButton *button in self.actionButtons) {
    [button sizeToFit];
  }

  // Used to calculate the height of the scrolling content, so we limit the width.
  CGSize boundsSize = CGRectInfinite.size;
  boundsSize.width = CGRectGetWidth(self.bounds);

  // Content
  CGSize contentSize = [self calculateContentSizeThatFitsWidth:boundsSize.width];

  CGRect contentRect = CGRectZero;
  contentRect.size.width = CGRectGetWidth(self.bounds);
  contentRect.size.height = contentSize.height;

  self.contentScrollView.contentSize = contentRect.size;

  // Place Content in contentScrollView
  boundsSize.width = boundsSize.width - MDCDialogContentInsets.left - MDCDialogContentInsets.right;
  CGSize titleSize = [self.titleLabel sizeThatFits:boundsSize];
  titleSize.width = boundsSize.width;
  CGSize messageSize = [self.messageLabel sizeThatFits:boundsSize];
  messageSize.width = boundsSize.width;
  boundsSize.width = boundsSize.width + MDCDialogContentInsets.left + MDCDialogContentInsets.right;

  CGFloat contentInternalVerticalPadding = 0.0;
  if (0.0 < titleSize.height && 0.0 < messageSize.height) {
    contentInternalVerticalPadding = MDCDialogContentVerticalPadding;
  }

  CGRect titleFrame = CGRectMake(MDCDialogContentInsets.left, MDCDialogContentInsets.top,
                                 titleSize.width, titleSize.height);
  CGRect messageFrame = CGRectMake(MDCDialogContentInsets.left,
                                   CGRectGetMaxY(titleFrame) + contentInternalVerticalPadding,
                                   messageSize.width, messageSize.height);

  self.titleLabel.frame = titleFrame;
  self.messageLabel.frame = messageFrame;

  // Actions
  CGSize actionSize = [self calculateActionsSizeThatFitsWidth:boundsSize.width];
  const CGFloat horizontalActionHeight =
  MDCDialogActionsInsets.top + MDCDialogActionButtonHeight + MDCDialogActionsInsets.bottom;
  if (horizontalActionHeight < actionSize.height) {
    self.verticalActionsLayout = YES;
  } else {
    self.verticalActionsLayout = NO;
  }

  CGRect actionsFrame = CGRectZero;
  actionsFrame.size.width = CGRectGetWidth(self.bounds);
  if (0 < [self.actionButtons count]) {
    actionsFrame.size.height = actionSize.height;
  }
  self.actionsScrollView.contentSize = actionsFrame.size;

  // Place buttons in actionsScrollView
  if (self.isVerticalActionsLayout) {
    CGPoint buttonCenter;
    buttonCenter.x = self.actionsScrollView.contentSize.width * 0.5f;
    buttonCenter.y = self.actionsScrollView.contentSize.height - MDCDialogActionsInsets.bottom;
    for (UIButton *button in self.actionButtons) {
      CGRect buttonRect = button.frame;

      buttonCenter.y -= buttonRect.size.height * 0.5;

      button.center = buttonCenter;

      if (button != [self.actionButtons lastObject]) {
        buttonCenter.y -= buttonRect.size.height * 0.5;
        buttonCenter.y -= MDCDialogActionsVerticalPadding;
      }
    }
  } else {
    CGPoint buttonOrigin = CGPointZero;
    buttonOrigin.x = self.actionsScrollView.contentSize.width - MDCDialogActionsInsets.right;
    buttonOrigin.y = MDCDialogActionsInsets.top;
    for (UIButton *button in self.actionButtons) {
      CGRect buttonRect = button.frame;

      buttonOrigin.x -= buttonRect.size.width;
      buttonRect.origin = buttonOrigin;

      button.frame = buttonRect;

      if (button != [self.actionButtons lastObject]) {
        buttonOrigin.x -= MDCDialogActionsHorizontalPadding;
      }
    }
    // Handle RTL
    if (self.mdf_effectiveUserInterfaceLayoutDirection ==
        UIUserInterfaceLayoutDirectionRightToLeft) {
      for (UIButton *button in self.actionButtons) {
        CGRect flippedRect =
          MDFRectFlippedHorizontally(button.frame, CGRectGetWidth(self.bounds));
        button.frame = flippedRect;
      }
    }
  }

  // Place scrollviews
  CGRect contentScrollViewRect = CGRectZero;
  contentScrollViewRect.size = self.contentScrollView.contentSize;

  CGRect actionsScrollViewRect = CGRectZero;
  actionsScrollViewRect.size = self.actionsScrollView.contentSize;

  const CGFloat requestedHeight =
  self.contentScrollView.contentSize.height + self.actionsScrollView.contentSize.height;
  if (requestedHeight <= CGRectGetHeight(self.bounds)) {
    // Simple layout case : both content and actions fit on the screen at once
    self.contentScrollView.frame = contentScrollViewRect;

    actionsScrollViewRect.origin.y =
    CGRectGetHeight(self.bounds) - actionsScrollViewRect.size.height;
    self.actionsScrollView.frame = actionsScrollViewRect;
  } else {
    // Complex layout case : Split the space between the two scrollviews
    if (CGRectGetHeight(contentScrollViewRect) < CGRectGetHeight(self.bounds) * 0.5f) {
      actionsScrollViewRect.size.height =
      CGRectGetHeight(self.bounds) - contentScrollViewRect.size.height;
    } else {
      CGFloat maxActionsHeight = CGRectGetHeight(self.bounds) * 0.5f;
      actionsScrollViewRect.size.height = MIN(maxActionsHeight, actionsScrollViewRect.size.height);
    }
    actionsScrollViewRect.origin.y =
    CGRectGetHeight(self.bounds) - actionsScrollViewRect.size.height;
    self.actionsScrollView.frame = actionsScrollViewRect;

    contentScrollViewRect.size.height =
    CGRectGetHeight(self.bounds) - actionsScrollViewRect.size.height;
    self.contentScrollView.frame = contentScrollViewRect;
  }
}

#pragma mark - Dynamic Type

- (BOOL)mdc_adjustsFontForContentSizeCategory {
  return _mdc_adjustsFontForContentSizeCategory;
}

- (void)mdc_setAdjustsFontForContentSizeCategory:(BOOL)adjusts {
  _mdc_adjustsFontForContentSizeCategory = adjusts;

  for (MDCFlatButton *button in _actionButtons) {
    button.mdc_adjustsFontForContentSizeCategory = adjusts;
  }

  [self updateFontsForDynamicType];
}

// Update the fonts used based on whether Dynamic Type is enabled
- (void)updateFontsForDynamicType {
  [self updateTitleFont];
  [self updateMessageFont];
  [self updateButtonFont];

  [self setNeedsLayout];
}

@end


text:
package de.hamsterhobel.jira.internal;

import static org.junit.Assert.assertEquals;

import java.text.ParseException;
import java.util.Date;

import org.junit.Test;

import de.hamsterhobel.jira.test.TestData;

/**
 * Tests for {@link Utils}.
 *
 * @author Thomas Irgang
 *
 */
public class UtilsTest {

	/**
	 * Test for {@link Utils#parseDateTime(String)}.
	 *
	 * @throws ParseException
	 *             if {@link TestData} JSON_DATE is no valid JSON_DATE
	 *             {@link String}
	 */
	@Test
	public void testParseDate() throws ParseException {
		Date date = Utils.parseDateTime(TestData.JSON_DATE);
		assertEquals(1494417047711l, date.getTime());
	}

}


text:
<?php

/**
 * Admin user manager.
 * Returns template, that arranges two other templates ("user_list.tpl"
 * and "user_main.tpl") to frame.
 * Admin Menu: User Administration -> Users.
 */
class Admin_User extends oxAdminView
{

    /**
     * Current class template name.
     *
     * @var string
     */
    protected $_sThisTemplate = 'user.tpl';
}


text:
<?php
function promotion_boxYTShortcode($atts,$contentC,$module_id,$id,$database){
	$css ='';
	$return ='';
	if($module_id != "0"){
		$css .= "/* Style Promotion Box */ \n";
		$css .= $atts->css_internal;
		// Get Css in $css variable
		$padding = '';
		$bdt_hbg = ($atts->button_background_hover) ? $atts->button_background_hover :'';
        $width = ($atts->type=="arrow-box" ? "100%" : $atts->width);
		$atts->arrow_height = '52px';
        if (intval($atts->promotion_radius) > 40 && intval($atts->button_radius) > 40) {
            $padding = "padding: 20px 20px 20px 40px;";
        }
        if($atts->type=="border")
        {
        	$background = 'border:' . $atts->promotion_background.' 1px solid; background:#fff;';
			$css .= '#'.$id.' .border{'.$background.'}';
        }else if($atts->type =="background-border")
        {
        	$background = 'border:' . $atts->border_color.' 1px solid; background:'.$atts->promotion_background.';';
        	$css .= '#'.$id.' .background-border{ '. $background.'}';
        }
        else
        {
        	$background = 'background-color:' . $atts->promotion_background;
        	$css .= '#'.$id.' { ' . $background.'}';
        }
        $css .= '#'.$id.' {'.$padding.'; border-radius:' . $atts->promotion_radius. '; margin-bottom:15px; '.$background.' }';
        $css .= '#'.$id.' a.cta-dbtn { border-radius:' . $atts->button_radius . '; color:' . $atts->button_color . '; background:' . $atts->button_background . ';}';
        $css .= '#'.$id.' a.cta-dbtn:hover { background:' . $bdt_hbg . ';}';
        $css .= '#'.$id.' .cta-content > h3 { color: '.$atts->title_color.';}';
        $css .= '#'.$id.' .cta-content div { color:' . $atts->promotion_color.';}';
        $css .= '#'.$id.' .cta-content h3 { color:' . $atts->promotion_color.'; margin:0; padding:0}';
        if($atts->type == "arrow-box") {
        	$css .= '@media only screen and (min-width: 980px){';
        	$css .='#'.$id.'.arrow-box {position: relative;padding-right:'.$atts->arrow_height.';}';
        	$css .='#'.$id.'.arrow-box:before{content: "";width: 0px;height: 0px;position: absolute;border-style: solid;border-color:transparent transparent transparent #FFF  ;border-width: '.$atts->arrow_height.';	top:0px;left: 0;z-index: 1;}';
			$css .='#'.$id.'.arrow-box:after{content: "";	width: 0px;	height: 0px;position: absolute;	border-style: solid;border-color: #FFF #FFF #FFF transparent ;border-width: '.$atts->arrow_height.' ;	top:0px;right: 0;z-index: 1;}';
			$css .= '#'.$id.'.arrow-box .cta-content {margin:0 '.$atts->arrow_height.'}';
			$css .= '#'.$id.'.arrow-box a.cta-dbtn {margin-right:'.$atts->arrow_height.'}';
			$css .='}';
        }
		$css .= '#'.$id.'{width:'.$width.'%;}';
		$file = '../catalog/view/javascript/so_page_builder/css/style_render_'.$module_id.'.css';
		// Open the file to get existing content
		$current = file_get_contents($file);
		// Append a new person to the file
		$current .= $css."\n";
		// Write the contents back to the file
		file_put_contents($file, $current);
	}else{
		/*------Check isset Value Before Call value---------*/
		$name_shortcode_	= 'name_shortcode_'.$database['language_id'];
		$text_name_shortcode = '';
		if(isset($atts->$name_shortcode_) && ($atts->$name_shortcode_ != '')){
			$text_name_shortcode = $atts->$name_shortcode_;
		}
		$yt_title_ 			= 'yt_title_'.$database['language_id'];
		$text_yt_title = '';
		if(isset($atts->$yt_title_) && ($atts->$yt_title_ != '')){
			$text_yt_title = $atts->$yt_title_;
		}
		$button_text_ 			= 'button_text_'.$database['language_id'];

		$text_button_text = '';
		if(isset($atts->$button_text_) && ($atts->$button_text_ != '')){
			$text_button_text = $atts->$button_text_;
		}

		$content_ 			= 'content_'.$database['language_id'];
		$text_content 		= '';
		if(isset($atts->$content_) && ($atts->$content_ != '')){
			$text_content 	= $atts->$content_;
		}
	/*--------------------------------------------------*/
		if($atts->name_shortcode_status == "yes" && $text_name_shortcode != ''){
			$return .= '
'.$text_name_shortcode.'
';
		}
        $title  = ($text_yt_title) ? "
" . $text_yt_title . "
" : '';
        $return  .= '
align .' '.$atts->type.' '.$atts->yt_class.'">';
        $return .= "target . "' href='" . $atts->button_link . "'>" . $text_button_text . "";
        $return .= "
" . $title ."
".$text_content."

";
        $return .= "target . "' href='" . $atts->button_link . "'>" . $text_button_text . "";
        $return .= '

';
	}
	 return $return;
}

?>


text:
$(document).foundation();
Foundation.MediaQuery._init()

//
// Custom JS
// --------------------------------------------------

if (Foundation.MediaQuery.atLeast('medium') && !document.body.classList.contains("home") && !document.body.classList.contains("page")) {
  var script   = document.createElement("script");
  script.src   = "https://hypothes.is/embed.js";
  script.async = true;
  document.head.appendChild(script);
}


text:
@implementation TTResourceSampleAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(UIApplication *)application {

  // Override point for customization after application launch
  [window makeKeyAndVisible];

  [TTResourceConfig setSite:@"http://localhost:3000/"];
  [TTResourceConfig setResponseType:TTResponseFormatXML];

  //Find all the bobs
  //xxtodo

  //Delete all the Bobs
  //xxtodo

  //Create a Bob
  Person *bob = [[[Person alloc] init] autorelease];
  bob.name = @"Bob";
  [bob createRemote];

  //Find that bob
  //xxtodo

  //Update a Bob
  //xxtodo

  //Destroy my bob
  //xxtodo

  NSLog(@"Finn.");
}

- (void)dealloc {
  [window release];
  [super dealloc];
}

@end


text:
module StuffHelper
end


text:
using StreamingClient.Base.Util;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Twitch.Base.Models.NewAPI.Subscriptions;
using Twitch.Base.Models.NewAPI.Users;

namespace Twitch.Base.Services.NewAPI
{
    /// <summary>
    /// The APIs for Subscription-based services.
    /// </summary>
    public class SubscriptionsService : NewTwitchAPIServiceBase
    {
        /// <summary>
        /// Creates an instance of the SubscriptionsService.
        /// </summary>
        /// <param name="connection">The Twitch connection to use</param>
        public SubscriptionsService(TwitchConnection connection) : base(connection) { }

        /// <summary>
        /// Gets all subscriptions for a broadcaster
        /// </summary>
        /// <param name="broadcaster">The broadcaster to get subscriptions for</param>
        /// <param name="maxResults">The maximum number of results. Will be either that amount or slightly more</param>
        /// <returns>The broadcaster's subscriptions</returns>
        public async Task<IEnumerable<SubscriptionModel>> GetAllSubscriptions(UserModel broadcaster, int maxResults = 1)
        {
            Validator.ValidateVariable(broadcaster, "broadcaster");
            return await this.GetPagedDataResultAsync<SubscriptionModel>("subscriptions?broadcaster_id=" + broadcaster.id, maxResults);
        }

        /// <summary>
        /// Gets the subscriptions for a broadcaster for the specified user IDs.
        /// </summary>
        /// <param name="broadcaster">The broadcaster to get subscriptions for</param>
        /// <param name="userIDs">The user IDs to get subscriptions for</param>
        /// <returns>The broadcaster's subscriptions</returns>
        public async Task<IEnumerable<SubscriptionModel>> GetSubscriptions(UserModel broadcaster, IEnumerable<string> userIDs)
        {
            Validator.ValidateVariable(broadcaster, "broadcaster");
            Validator.ValidateList(userIDs, "userIDs");
            return await this.GetPagedDataResultAsync<SubscriptionModel>("subscriptions?broadcaster_id=" + broadcaster.id + "&user_id=" + string.Join("&user_id=", userIDs), userIDs.Count());
        }

        /// <summary>
        /// Gets the subscriptions for a broadcaster for the specified user IDs.
        /// </summary>
        /// <param name="broadcaster">The broadcaster to get subscriptions for</param>
        /// <param name="user">The user to get subscription for</param>
        /// <returns>The broadcaster's subscriptions</returns>
        public async Task<SubscriptionModel> GetSubscription(UserModel broadcaster, UserModel user)
        {
            Validator.ValidateVariable(broadcaster, "broadcaster");
            Validator.ValidateVariable(user, "user");
            IEnumerable<SubscriptionModel> subscriptions = await this.GetPagedDataResultAsync<SubscriptionModel>("subscriptions/user?broadcaster_id=" + broadcaster.id + "&user_id=" + user.id);
            return (subscriptions != null) ? subscriptions.FirstOrDefault() : null;
        }

        /// <summary>
        /// Gets the total number of subscribers for a channel.
        /// </summary>
        /// <param name="broadcaster">The channel to get the total number of subscribers for</param>
        /// <returns>The total number of subscribers for the channel</returns>
        public async Task<long> GetSubscriptionsCount(UserModel broadcaster)
        {
            Validator.ValidateVariable(broadcaster, "broadcaster");
            return await this.GetPagedResultTotalCountAsync("subscriptions?broadcaster_id=" +broadcaster.id);
        }
    }
}


text:
"use strict";
var inherits = require('util').inherits;
var Validator = require('./core/validator');
var And = require('./and');

var Wrapper = function (validator) {
	Validator.call(this);
	this.validator = validator;
};
inherits(Wrapper, Validator);

Wrapper.prototype.code = 'wrapper';

Wrapper.prototype.validate = function (ctx) {
	return this.validateByWrapped(ctx);
};

Wrapper.prototype.validateByWrapped = function (ctx) {
	return this.validator.validate(ctx);
};

Wrapper.getShort = function (corrector) {
	return function (validator) {
		validator = corrector.toValidator(validator);
		return new Wrapper(validator);
	};
};

Wrapper.wrapMany = function (validator, args, corrector) {
	if (args.length > 1) {
		var validators = corrector.toValidators(args);
		validator = new And(validators);
	}
	else {
		validator = corrector.toValidator(validator);
	}
	return validator;
};

module.exports = Wrapper;


text:
<?php

/**
 * @file
 * Contains Drupal\Console\Command\User\LoginUrlCommand.
 */

namespace Drupal\Console\Command\User;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;

/**
 * Class UserLoginCommand.
 *
 * @package Drupal\Console
 */
class LoginUrlCommand extends UserBase
{
    /**
     * LoginUrlCommand constructor.
     *
     * @param EntityTypeManagerInterface $entityTypeManager
     */
    public function __construct(EntityTypeManagerInterface $entityTypeManager)
    {
        parent::__construct($entityTypeManager);
    }

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this
            ->setName('user:login:url')
            ->setDescription($this->trans('commands.user.login.url.description'))
            ->addArgument(
                'user',
                InputArgument::REQUIRED,
                $this->trans('commands.user.login.url.options.user'),
                null
            )
            ->setAliases(['ulu']);
    }

    /**
     * {@inheritdoc}
     */
    protected function interact(InputInterface $input, OutputInterface $output)
    {
        $this->getUserArgument();
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $user = $input->getArgument('user');
        $userEntity = $this->getUserEntity($user);

        if (!$userEntity) {
            $this->getIo()->error(
                sprintf(
                    $this->trans('commands.user.login.url.errors.invalid-user'),
                    $user
                )
            );

            return 1;
        }

        $url = user_pass_reset_url($userEntity) . '/login';
        $this->getIo()->success(
            sprintf(
                $this->trans('commands.user.login.url.messages.url'),
                $userEntity->getUsername()
            )
        );

        $this->getIo()->simple($url);
        $this->getIo()->newLine();

        return 0;
    }
}


text:
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using FluentAssertions;

namespace EasyReflectionTests
{
    [TestFixture]
    public class MemberInfoExtensionsTests
    {
        private Type type;

        [SetUp]
        public void SetUp()
        {
            this.type = typeof(TestClass);
        }

        [Test]
        public void PropertyInfoGetNamesReturnsNames()
        {
            var names = type.GetGettersAndSetters().GetNames();
            var expectedGettersAndSetters = new[] { "PublicProperty", "PrivateProperty", "ProtectedProperty", "InternalProperty" };
            names.Should().Contain(expectedGettersAndSetters).And.HaveCount(expectedGettersAndSetters.Count());
        }

        [Test]
        public void FieldInfoGetNamesReturnsNames()
        {
            var names = type.GetAllFields().GetNames();
            var expectedFields = new[] { "publicField", "privateField", "protectedField", "internalField" };
            names.Should().Contain(expectedFields).And.HaveCount(expectedFields.Count());
        }
    }
}


text:
package de.tum.in.www1.artemis.service.connectors.jenkins.jobs;

import java.util.Set;

import org.w3c.dom.*;

public class JenkinsJobPermissionsUtils {

    public static void removePermissionsFromFolder(Document jobConfig, Set<JenkinsJobPermission> permissionsToRemove, Set<String> userLogins) throws DOMException {
        var folderAuthorizationMatrix = "com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty";
        removePermissionsFromElement(folderAuthorizationMatrix, jobConfig, permissionsToRemove, userLogins);
    }

    public static void removePermissionsFromJob(Document jobConfig, Set<JenkinsJobPermission> permissionsToRemove, Set<String> userLogins) throws DOMException {
        var jobAuthorizationMatrix = "hudson.security.AuthorizationMatrixProperty";
        removePermissionsFromElement(jobAuthorizationMatrix, jobConfig, permissionsToRemove, userLogins);
    }

    /**
     * Removes the specified permissions belonging to all specified users from the xml document. Permission
     * elements must be children of the AuthorizationMatrixProperty element. Doesn't do anything
     * if AuthorizationMatrixProperty is missing.
     *
     * @param document The xml document
     * @param permissionsToRemove  a list of permissions to remove from the user
     * @param userLogins  the logins of the users to remove the permissions from
     */
    private static void removePermissionsFromElement(String elementTagName, Document document, Set<JenkinsJobPermission> permissionsToRemove, Set<String> userLogins)
            throws DOMException {
        Node authorizationMatrixElement = document.getElementsByTagName(elementTagName).item(0);
        if (authorizationMatrixElement == null) {
            return;
        }

        permissionsToRemove.forEach(jenkinsJobPermission -> userLogins.forEach(userLogin -> {
            // The permission in the xml node has the format: com.jenkins.job.permission:user-login
            String permission = jenkinsJobPermission.getName() + ":" + userLogin;
            removePermission(authorizationMatrixElement, permission);
        }));
    }

    /**
     * Removes the permission element from the authorization matrix.
     *
     * @param authorizationMatrix The authorization matrix node
     * @param permission the permission to remove
     */
    private static void removePermission(Node authorizationMatrix, String permission) throws DOMException {
        NodeList permissionNodes = authorizationMatrix.getChildNodes();
        int nodeCount = permissionNodes.getLength();
        for (int i = 0; i < nodeCount; i++) {
            Node permissionNode = permissionNodes.item(i);
            if (permissionNode.getTextContent().equals(permission)) {
                authorizationMatrix.removeChild(permissionNode);
                return;
            }
        }
    }

    public static void addPermissionsToFolder(Document folderConfig, Set<JenkinsJobPermission> jenkinsJobPermissions, Set<String> userLogins) throws DOMException {
        var folderAuthorizationMatrix = "com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty";
        addPermissionsToDocument(folderAuthorizationMatrix, folderConfig, jenkinsJobPermissions, userLogins);
    }

    public static void addPermissionsToJob(Document jobConfig, Set<JenkinsJobPermission> jenkinsJobPermissions, Set<String> userLogins) throws DOMException {
        var jobAuthorizationMatrix = "hudson.security.AuthorizationMatrixProperty";
        addPermissionsToDocument(jobAuthorizationMatrix, jobConfig, jenkinsJobPermissions, userLogins);
    }

    /**
     * Adds all jenkinsJobPermissions for all specific Jenkins users into the xml document.
     *
     * @param document the xml document
     * @param jenkinsJobPermissions a list of Jenkins job permissions to be added for the specific user
     * @param userLogins the login names of the users
     */
    private static void addPermissionsToDocument(String elementTagName, Document document, Set<JenkinsJobPermission> jenkinsJobPermissions, Set<String> userLogins)
            throws DOMException {
        var authorizationMatrixElement = JenkinsJobPermissionsUtils.getOrCreateAuthorizationMatrixPropertyElement(elementTagName, document);
        userLogins.forEach(userLogin -> addPermissionsToAuthorizationMatrix(document, authorizationMatrixElement, jenkinsJobPermissions, userLogin));
        JenkinsJobPermissionsUtils.addAuthorizationMatrixToDocument(authorizationMatrixElement, document);
    }

    /**
     * Retrieves the AuthorizationMatrixProperty element from the document if it exists or creates a new one
     * pre-configured with matrixauth.inheritance.InheritParentStrategy.
     * @param document The xml document
     * @return AuthorizationMatrixProperty element
     */
    private static Element getOrCreateAuthorizationMatrixPropertyElement(String authorizationMatrixTagName, Document document) throws DOMException {
        Element authorizationMatrixElement = (Element) document.getElementsByTagName(authorizationMatrixTagName).item(0);
        if (authorizationMatrixElement != null) {
            return authorizationMatrixElement;
        }

        // Create the element
        Element strategyElement = document.createElement("inheritanceStrategy");
        strategyElement.setAttribute("class", "org.jenkinsci.plugins.matrixauth.inheritance.InheritParentStrategy");

        authorizationMatrixElement = document.createElement(authorizationMatrixTagName);
        authorizationMatrixElement.appendChild(strategyElement);
        return authorizationMatrixElement;
    }

    /**
     * Adds all jenkinsJobPermissions specified for the specific Jenkins user into the authorizationMatrixElement.
     * The resulting output element has the following format:
     * <pre>
     * {@code
     *      <com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty>
     *          ...existing permissions
     *          <permission>hudson.model.the.jenkins.permission1:userLogin</permission>
     *          ...
     *          <permission>hudson.model.the.jenkins.permissionn:userLogin</permission>
     *      </com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty>
     * }
     * </pre>
     * @param authorizationMatrixElement the com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty element
     * @param jenkinsJobPermissions      a list of Jenkins job permissions to be added for the specific user
     * @param userLogin                  the login name of the user
     */
    private static void addPermissionsToAuthorizationMatrix(Document document, Element authorizationMatrixElement, Set<JenkinsJobPermission> jenkinsJobPermissions,
            String userLogin) throws DOMException {
        NodeList existingPermissionElements = authorizationMatrixElement.getElementsByTagName("permission");
        jenkinsJobPermissions.forEach(jenkinsJobPermission -> {
            // The permission in the xml node has the format: com.jenkins.job.permission:user-login
            String permission = jenkinsJobPermission.getName() + ":" + userLogin;

            // Add the permission if it doesn't exist.
            boolean permissionExists = permissionExistInPermissionList(existingPermissionElements, permission);
            if (!permissionExists) {
                // Permission element has format <permission>com.jenkins.job.permission:user-login</permission>
                Element permissionElement = document.createElement("permission");
                permissionElement.setTextContent(permission);
                authorizationMatrixElement.appendChild(permissionElement);
            }
        });
    }

    /**
     * Iterates over the permission node list and checks if the specified permission exists as the text
     * content of the node.
     *
     * @param permissionList The node list containing permission elements
     * @param permission the permission
     * @return if the list contains permissions
     */
    private static boolean permissionExistInPermissionList(NodeList permissionList, String permission) throws DOMException {
        int nodeCount = permissionList.getLength();
        for (int i = 0; i < nodeCount; i++) {
            Node permissionNode = permissionList.item(i);
            if (permissionNode.getTextContent().equals(permission)) {
                return true;
            }
        }
        return false;
    }

    /**
     * Adds the authorizationMatrixElement into the document. The function checks the document if the properties
     * element exist and creates one if it doesn't. The authorizationMatrixElement must be a child if this tag.
     *
     * @param authorizationMatrixElement the com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty element
     * @param document                   the Jenkins Job config.xml
     */
    private static void addAuthorizationMatrixToDocument(Element authorizationMatrixElement, Document document) throws DOMException {
        // The authorization matrix is stored inside the <properties/> tag within the document. Either find it
        // or create a new one.
        NodeList propertyElements = document.getElementsByTagName("properties");

        Node propertiesElement = propertyElements.item(0);
        if (propertiesElement == null) {
            propertiesElement = document.createElement("properties");
            document.appendChild(propertiesElement);
        }

        propertiesElement.appendChild(authorizationMatrixElement);
    }
}


text:
<?php
	namespace CTN;
	use \CTN\Session;

	class AuthFactory {
		private static $instance = NULL;

		public static function getInstance() {
			if(self::$instance === NULL) {
				self::$instance = new self();
			}

			return self::$instance;
		}

		public function isLoggedIn() {
			$user_id	= Session::get('user_id');
			$login		= (!empty($user_id) && $user_id > 0);

			// Update activity
			if($login) {
				Database::update(DATABASE_PREFIX . 'users', 'id', [
					'id'				=> $user_id,
					'time_activity'		=> date('Y-m-d H:i:s'),
					'security_logout'	=> 'N'
				]);
			}

			return $login;
		}

		public function getID() {
			return Session::get('user_id');
		}

		public function getUsername() {
			return Session::get('user_name');
		}

		public function logout() {
			Database::update(DATABASE_PREFIX . 'users', 'id', [
				'id'				=> $this->getID(),
				'time_activity'		=> date('Y-m-d H:i:s'),
				'security_logout'	=> 'Y'
			]);

			Session::remove('user_id');
			Session::remove('user_name');
			Session::remove('security_logout');
		}

		public function hadLoggedOut() {
			$security_logout = Session::get('security_logout');
			return $security_logout === 'Y' || $security_logout === NULL;
		}

		public function login($username, $password) {
			$result = Database::single('SELECT * FROM `' . DATABASE_PREFIX . 'users` WHERE `username`=:username AND `password`=:password LIMIT 1', array(
				'username'	=> $username,
				'password'	=> hash('sha256', $password)
			));

			if($result == false) {
				throw new \Exception('Unknown User');
				return false;
			}

			if($result->id > 0) {
				Session::set('user_name',		$result->username);
				Session::set('user_id',			$result->id);
				Session::set('security_logout', $result->security_logout);
			} else {
				throw new \Exception('Unknown User');
				return false;
			}

			return true;
		}

		public function isAdmin() {
			return $this->getData('status') == 'Admin';
		}

		public function getData($name) {
			$result = Database::single('SELECT * FROM `' . DATABASE_PREFIX . 'users` WHERE `id`=:user_id LIMIT 1', array(
				'user_id'	=> $this->getID()
			));

			if($result == false) {
				return null;
			}

			return $result->{$name};
		}
	}

	class Auth {
		public static function isLoggedIn() {
			return AuthFactory::getInstance()->isLoggedIn();
		}

		public static function login($username, $password) {
			return AuthFactory::getInstance()->login($username, $password);
		}

		public static function logout() {
			return AuthFactory::getInstance()->logout();
		}

		public static function getID() {
			return AuthFactory::getInstance()->getID();
		}

		public static function getUsername() {
			return AuthFactory::getInstance()->getUsername();
		}

		public static function hadLoggedOut() {
			return AuthFactory::getInstance()->hadLoggedOut();
		}

		public static function getData($name) {
			return AuthFactory::getInstance()->getData($name);
		}

		public static function isAdmin() {
			return AuthFactory::getInstance()->isAdmin();
		}
	}
?>


text:
package com.cyborgJenn.cyborgUtils.module.accessories.inventory;

import com.cyborgJenn.cyborgUtils.api.AccessoryType;
import com.cyborgJenn.cyborgUtils.api.IAccessory;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

public class SlotAccessories extends Slot
{
	AccessoryType type;
	/**
	 *
	 * @param Inventory
	 * @param type
	 * @param index
	 * @param xPosition
	 * @param yPosition
	 */
	public SlotAccessories(IInventory inventory, AccessoryType type, int index, int xPosition, int yPosition)
	{
		super(inventory, index, xPosition, yPosition);
        this.type = type;

	}
	/**
     * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
     */
    @Override
    public boolean isItemValid(ItemStack stack)
    {
    	return stack!=null && stack.getItem() !=null &&
        	   stack.getItem() instanceof IAccessory &&
        	   ((IAccessory)stack.getItem()).getAccessoryType(stack)==this.type &&
        	   ((IAccessory)stack.getItem()).canEquip(stack, ((InventoryAccessories)this.inventory).player.get());
    }

	@Override
	public boolean canTakeStack(EntityPlayer player) {
		return this.getStack()!=null &&
			   ((IAccessory)this.getStack().getItem()).canUnequip(this.getStack(), player);
	}

	@Override
    public int getSlotStackLimit()
    {
        return 1;
    }
}


text:
#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING

//#define DEBUG_RELDTFMT

#include <stdio.h>
#include <stdlib.h>

#include "reldtfmt.h"
#include "unicode/msgfmt.h"
#include "unicode/smpdtfmt.h"

#include "gregoimp.h" // for CalendarData
#include "cmemory.h"

U_NAMESPACE_BEGIN

/**
 * An array of URelativeString structs is used to store the resource data loaded out of the bundle.
 */
struct URelativeString {
    int32_t offset;         /** offset of this item, such as, the relative date **/
    int32_t len;            /** length of the string **/
    const UChar* string;    /** string, or NULL if not set **/
};

static const char DT_DateTimePatternsTag[]="DateTimePatterns";

UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RelativeDateFormat)

RelativeDateFormat::RelativeDateFormat(const RelativeDateFormat& other) :
DateFormat(other), fDateFormat(NULL), fTimeFormat(NULL), fCombinedFormat(NULL),
fDateStyle(other.fDateStyle), fTimeStyle(other.fTimeStyle), fLocale(other.fLocale),
fDayMin(other.fDayMin), fDayMax(other.fDayMax),
fDatesLen(other.fDatesLen), fDates(NULL)
{
    if(other.fDateFormat != NULL) {
        fDateFormat = (DateFormat*)other.fDateFormat->clone();
    } else {
        fDateFormat = NULL;
    }
    if (fDatesLen > 0) {
        fDates = (URelativeString*) uprv_malloc(sizeof(fDates[0])*fDatesLen);
        uprv_memcpy(fDates, other.fDates, sizeof(fDates[0])*fDatesLen);
    }
    //fCalendar = other.fCalendar->clone();
/*
    if(other.fTimeFormat != NULL) {
        fTimeFormat = (DateFormat*)other.fTimeFormat->clone();
    } else {
        fTimeFormat = NULL;
    }
*/
}

RelativeDateFormat::RelativeDateFormat( UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const Locale& locale, UErrorCode& status)
 : DateFormat(), fDateFormat(NULL), fTimeFormat(NULL), fCombinedFormat(NULL),
fDateStyle(dateStyle), fTimeStyle(timeStyle), fLocale(locale), fDatesLen(0), fDates(NULL)
 {
    if(U_FAILURE(status) ) {
        return;
    }

    if(fDateStyle != UDAT_NONE) {
        EStyle newStyle = (EStyle)(fDateStyle & ~UDAT_RELATIVE);
        // Create a DateFormat in the non-relative style requested.
        fDateFormat = createDateInstance(newStyle, locale);
    }
    if(fTimeStyle >= UDAT_FULL && fTimeStyle <= UDAT_SHORT) {
        fTimeFormat = createTimeInstance((EStyle)fTimeStyle, locale);
    } else if(fTimeStyle != UDAT_NONE) {
        // don't support other time styles (e.g. relative styles), for now
        status = U_ILLEGAL_ARGUMENT_ERROR;
        return;
    }

    // Initialize the parent fCalendar, so that parse() works correctly.
    initializeCalendar(NULL, locale, status);
    loadDates(status);
}

RelativeDateFormat::~RelativeDateFormat() {
    delete fDateFormat;
    delete fTimeFormat;
    delete fCombinedFormat;
    uprv_free(fDates);
}

Format* RelativeDateFormat::clone(void) const {
    return new RelativeDateFormat(*this);
}

UBool RelativeDateFormat::operator==(const Format& other) const {
    if(DateFormat::operator==(other)) {
        // DateFormat::operator== guarantees following cast is safe
        RelativeDateFormat* that = (RelativeDateFormat*)&other;
        return (fDateStyle==that->fDateStyle   &&
                fTimeStyle==that->fTimeStyle   &&
                fLocale==that->fLocale);
    }
    return FALSE;
}

UnicodeString& RelativeDateFormat::format(  Calendar& cal,
                                UnicodeString& appendTo,
                                FieldPosition& pos) const {

    UErrorCode status = U_ZERO_ERROR;
    UChar emptyStr = 0;
    UnicodeString dateString(&emptyStr);

    // calculate the difference, in days, between 'cal' and now.
    int dayDiff = dayDifference(cal, status);

    // look up string
    int32_t len;
    const UChar *theString = getStringForDay(dayDiff, len, status);
    if(U_SUCCESS(status) && (theString!=NULL)) {
        // found a relative string
        dateString.setTo(theString, len);
    }

    if(fTimeFormat == NULL || fCombinedFormat == 0) {
        if (dateString.length() > 0) {
            appendTo.append(dateString);
        } else if(fDateFormat != NULL) {
            fDateFormat->format(cal,appendTo,pos);
        }
    } else {
        if (dateString.length() == 0 && fDateFormat != NULL) {
            fDateFormat->format(cal,dateString,pos);
        }
        UnicodeString timeString(&emptyStr);
        FieldPosition timepos = pos;
        fTimeFormat->format(cal,timeString,timepos);
        Formattable timeDateStrings[] = { timeString, dateString };
        fCombinedFormat->format(timeDateStrings, 2, appendTo, pos, status); // pos is ignored by this
        int32_t offset;
        if (pos.getEndIndex() > 0 && (offset = appendTo.indexOf(dateString)) >= 0) {
            // pos.field was found in dateString, offset start & end based on final position of dateString
            pos.setBeginIndex( pos.getBeginIndex() + offset );
            pos.setEndIndex( pos.getEndIndex() + offset );
        } else if (timepos.getEndIndex() > 0 && (offset = appendTo.indexOf(timeString)) >= 0) {
            // pos.field was found in timeString, offset start & end based on final position of timeString
            pos.setBeginIndex( timepos.getBeginIndex() + offset );
            pos.setEndIndex( timepos.getEndIndex() + offset );
        }
    }

    return appendTo;
}

UnicodeString&
RelativeDateFormat::format(const Formattable& obj,
                         UnicodeString& appendTo,
                         FieldPosition& pos,
                         UErrorCode& status) const
{
    // this is just here to get around the hiding problem
    // (the previous format() override would hide the version of
    // format() on DateFormat that this function correspond to, so we
    // have to redefine it here)
    return DateFormat::format(obj, appendTo, pos, status);
}

void RelativeDateFormat::parse( const UnicodeString& text,
                    Calendar& cal,
                    ParsePosition& pos) const {

    // Can the fDateFormat parse it?
    if(fDateFormat != NULL) {
        ParsePosition aPos(pos);
        fDateFormat->parse(text,cal,aPos);
        if((aPos.getIndex() != pos.getIndex()) &&
            (aPos.getErrorIndex()==-1)) {
                pos=aPos; // copy the sub parse
                return; // parsed subfmt OK
        }
    }

    // Linear search the relative strings
    for(int n=0;n<fDatesLen;n++) {
        if(fDates[n].string != NULL &&
            (0==text.compare(pos.getIndex(),
                         fDates[n].len,
                         fDates[n].string))) {
            UErrorCode status = U_ZERO_ERROR;

            // Set the calendar to now+offset
            cal.setTime(Calendar::getNow(),status);
            cal.add(UCAL_DATE,fDates[n].offset, status);

            if(U_FAILURE(status)) {
                // failure in setting calendar fields
                pos.setErrorIndex(pos.getIndex()+fDates[n].len);
            } else {
                pos.setIndex(pos.getIndex()+fDates[n].len);
            }
            return;
        }
    }

    // parse failed
}

UDate
RelativeDateFormat::parse( const UnicodeString& text,
                         ParsePosition& pos) const {
    // redefined here because the other parse() function hides this function's
    // cunterpart on DateFormat
    return DateFormat::parse(text, pos);
}

UDate
RelativeDateFormat::parse(const UnicodeString& text, UErrorCode& status) const
{
    // redefined here because the other parse() function hides this function's
    // counterpart on DateFormat
    return DateFormat::parse(text, status);
}

const UChar *RelativeDateFormat::getStringForDay(int32_t day, int32_t &len, UErrorCode &status) const {
    if(U_FAILURE(status)) {
        return NULL;
    }

    // Is it outside the resource bundle's range?
    if(day < fDayMin || day > fDayMax) {
        return NULL; // don't have it.
    }

    // Linear search the held strings
    for(int n=0;n<fDatesLen;n++) {
        if(fDates[n].offset == day) {
            len = fDates[n].len;
            return fDates[n].string;
        }
    }

    return NULL;  // not found.
}

UnicodeString&
RelativeDateFormat::toPattern(UnicodeString& result, UErrorCode& status) const
{
    if (!U_FAILURE(status)) {
        result.remove();
        if (fTimeFormat == NULL || fCombinedFormat == 0) {
            if (fDateFormat != NULL) {
                UnicodeString datePattern;
                this->toPatternDate(datePattern, status);
                if (!U_FAILURE(status)) {
                    result.setTo(datePattern);
                }
            }
        } else {
            UnicodeString datePattern, timePattern;
            this->toPatternDate(datePattern, status);
            this->toPatternTime(timePattern, status);
            if (!U_FAILURE(status)) {
                Formattable timeDatePatterns[] = { timePattern, datePattern };
                FieldPosition pos;
                fCombinedFormat->format(timeDatePatterns, 2, result, pos, status);
            }
        }
    }
    return result;
}

UnicodeString&
RelativeDateFormat::toPatternDate(UnicodeString& result, UErrorCode& status) const
{
    if (!U_FAILURE(status)) {
        result.remove();
        if ( fDateFormat ) {
            if ( fDateFormat->getDynamicClassID()==SimpleDateFormat::getStaticClassID() ) {
                ((SimpleDateFormat*)fDateFormat)->toPattern(result);
            } else {
                status = U_UNSUPPORTED_ERROR;
            }
        }
    }
    return result;
}

UnicodeString&
RelativeDateFormat::toPatternTime(UnicodeString& result, UErrorCode& status) const
{
    if (!U_FAILURE(status)) {
        result.remove();
        if ( fTimeFormat ) {
            if ( fTimeFormat->getDynamicClassID()==SimpleDateFormat::getStaticClassID() ) {
                ((SimpleDateFormat*)fTimeFormat)->toPattern(result);
            } else {
                status = U_UNSUPPORTED_ERROR;
            }
        }
    }
    return result;
}

void
RelativeDateFormat::applyPatterns(const UnicodeString& datePattern, const UnicodeString& timePattern, UErrorCode &status)
{
    if (!U_FAILURE(status)) {
        if ( fDateFormat && fDateFormat->getDynamicClassID()!=SimpleDateFormat::getStaticClassID() ) {
            status = U_UNSUPPORTED_ERROR;
            return;
        }
        if ( fTimeFormat && fTimeFormat->getDynamicClassID()!=SimpleDateFormat::getStaticClassID() ) {
            status = U_UNSUPPORTED_ERROR;
            return;
        }
        if ( fDateFormat ) {
            ((SimpleDateFormat*)fDateFormat)->applyPattern(datePattern);
        }
        if ( fTimeFormat ) {
            ((SimpleDateFormat*)fTimeFormat)->applyPattern(timePattern);
        }
    }
}

void RelativeDateFormat::loadDates(UErrorCode &status) {
    CalendarData calData(fLocale, "gregorian", status);

    UErrorCode tempStatus = status;
    UResourceBundle *dateTimePatterns = calData.getByKey(DT_DateTimePatternsTag, tempStatus);
    if(U_SUCCESS(tempStatus)) {
        int32_t patternsSize = ures_getSize(dateTimePatterns);
        if (patternsSize > kDateTime) {
            int32_t resStrLen = 0;

            int32_t glueIndex = kDateTime;
            if (patternsSize >= (DateFormat::kDateTimeOffset + DateFormat::kShort + 1)) {
                // Get proper date time format
                switch (fDateStyle) {
 	            case kFullRelative:
 	            case kFull:
 	                glueIndex = kDateTimeOffset + kFull;
 	                break;
 	            case kLongRelative:
 	            case kLong:
 	                glueIndex = kDateTimeOffset + kLong;
 	                break;
 	            case kMediumRelative:
 	            case kMedium:
 	                glueIndex = kDateTimeOffset + kMedium;
 	                break;
 	            case kShortRelative:
 	            case kShort:
 	                glueIndex = kDateTimeOffset + kShort;
 	                break;
 	            default:
 	                break;
 	            }
            }

            const UChar *resStr = ures_getStringByIndex(dateTimePatterns, glueIndex, &resStrLen, &tempStatus);
            fCombinedFormat = new MessageFormat(UnicodeString(TRUE, resStr, resStrLen), fLocale, tempStatus);
        }
    }

    UResourceBundle *strings = calData.getByKey3("fields", "day", "relative", status);
    // set up min/max
    fDayMin=-1;
    fDayMax=1;

    if(U_FAILURE(status)) {
        fDatesLen=0;
        return;
    }

    fDatesLen = ures_getSize(strings);
    fDates = (URelativeString*) uprv_malloc(sizeof(fDates[0])*fDatesLen);

    // Load in each item into the array...
    int n = 0;

    UResourceBundle *subString = NULL;

    while(ures_hasNext(strings) && U_SUCCESS(status)) {  // iterate over items
        subString = ures_getNextResource(strings, subString, &status);

        if(U_FAILURE(status) || (subString==NULL)) break;

        // key = offset #
        const char *key = ures_getKey(subString);

        // load the string and length
        int32_t aLen;
        const UChar* aString = ures_getString(subString, &aLen, &status);

        if(U_FAILURE(status) || aString == NULL) break;

        // calculate the offset
        int32_t offset = atoi(key);

        // set min/max
        if(offset < fDayMin) {
            fDayMin = offset;
        }
        if(offset > fDayMax) {
            fDayMax = offset;
        }

        // copy the string pointer
        fDates[n].offset = offset;
        fDates[n].string = aString;
        fDates[n].len = aLen;

        n++;
    }
    ures_close(subString);

    // the fDates[] array could be sorted here, for direct access.
}

// this should to be in DateFormat, instead it was copied from SimpleDateFormat.

Calendar*
RelativeDateFormat::initializeCalendar(TimeZone* adoptZone, const Locale& locale, UErrorCode& status)
{
    if(!U_FAILURE(status)) {
        fCalendar = Calendar::createInstance(adoptZone?adoptZone:TimeZone::createDefault(), locale, status);
    }
    if (U_SUCCESS(status) && fCalendar == NULL) {
        status = U_MEMORY_ALLOCATION_ERROR;
    }
    return fCalendar;
}

int32_t RelativeDateFormat::dayDifference(Calendar &cal, UErrorCode &status) {
    if(U_FAILURE(status)) {
        return 0;
    }
    // TODO: Cache the nowCal to avoid heap allocs? Would be difficult, don't know the calendar type
    Calendar *nowCal = cal.clone();
    nowCal->setTime(Calendar::getNow(), status);

    // For the day difference, we are interested in the difference in the (modified) julian day number
    // which is midnight to midnight.  Using fieldDifference() is NOT correct here, because
    // 6pm Jan 4th  to 10am Jan 5th should be considered "tomorrow".
    int32_t dayDiff = cal.get(UCAL_JULIAN_DAY, status) - nowCal->get(UCAL_JULIAN_DAY, status);

    delete nowCal;
    return dayDiff;
}

U_NAMESPACE_END

#endif


text:
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace DetailWorkflow.Models
{
    public class ExternalLoginConfirmationViewModel
    {
        [Required]
        [Display(Name = "Email")]
        public string Email { get; set; }
    }

    public class ExternalLoginListViewModel
    {
        public string ReturnUrl { get; set; }
    }

    public class SendCodeViewModel
    {
        public string SelectedProvider { get; set; }
        public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
        public string ReturnUrl { get; set; }
        public bool RememberMe { get; set; }
    }

    public class VerifyCodeViewModel
    {
        [Required]
        public string Provider { get; set; }

        [Required]
        [Display(Name = "Code")]
        public string Code { get; set; }
        public string ReturnUrl { get; set; }

        [Display(Name = "Remember this browser?")]
        public bool RememberBrowser { get; set; }

        public bool RememberMe { get; set; }
    }

    public class ForgotViewModel
    {
        [Required]
        [Display(Name = "Email")]
        public string Email { get; set; }
    }

    public class LoginViewModel
    {
        [Required]
        [Display(Name = "Email")]
        [EmailAddress]
        public string Email { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [Display(Name = "Remember me?")]
        public bool RememberMe { get; set; }
    }

    public class RegisterViewModel
    {
        [Required]
        [EmailAddress]
        [Display(Name = "Email")]
        public string Email { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [Display(Name = "First Name")]
        [StringLength(15, ErrorMessage = "First Name should be 15 characters or less")]
        public string FirstName { get; set; }

        [Display(Name = "Last Name")]
        [StringLength(15, ErrorMessage = "Last Name should be 15 characters or less")]
        public string LastName { get; set; }

        [StringLength(20, ErrorMessage = "City should be 20 characters or less")]
        public string City { get; set; }

        [StringLength(2, ErrorMessage = "State should be 2 characters", MinimumLength = 2)]
        public string State { get; set; }

        [StringLength(30, ErrorMessage = "Address should be 30 characters or less")]
        public string Address { get; set; }

        [Display(Name = "Zip Code")]
        [StringLength(10, ErrorMessage = "Zip Code should be 10 characters or less")]
        public string ZipCode { get; set; }
    }

    public class ResetPasswordViewModel
    {
        [Required]
        [EmailAddress]
        [Display(Name = "Email")]
        public string Email { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        public string Code { get; set; }
    }

    public class ForgotPasswordViewModel
    {
        [Required]
        [EmailAddress]
        [Display(Name = "Email")]
        public string Email { get; set; }
    }
}


text:
package com.angkorteam.fintech.ddl;

public interface Topic {

    public static final String NAME = "topic_subscriber";

    public interface Field {

        public static final String ID = "id";

        public static final String TOPIC_ID = "topic_id";

        public static final String USER_ID = "user_id";

        public static final String SUBSCRIPTION_DATE = "subscription_date";

    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="match_parent">
<FrameLayout
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:id="@+id/fragmentContainer"></FrameLayout>
    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="3"
        android:id="@+id/detailFragmentContainer"></FrameLayout>
</LinearLayout>


text:
#ifndef V_TOPIC_ADAPTER_H
#define V_TOPIC_ADAPTER_H

#include "v_kernel.h"
#include "v_entity.h"
#include "v_status.h"

#if defined (__cplusplus)
extern "C" {
#endif
#include "os_if.h"

#ifdef OSPL_BUILD_CORE
#define OS_API OS_API_EXPORT
#else
#define OS_API OS_API_IMPORT
#endif
/* !!!!!!!!NOTE From here no more includes are allowed!!!!!!! */

/**
 * \brief The v_topicAdapter cast methods.
 *
 * This method casts an object to a v_topicAdapter object.
 * Before the cast is performed, if the NDEBUG flag is not set,
 * the type of the object is checked to be v_topicAdapter or
 * one of its subclasses.
 */
#define v_topicAdapter(o) (C_CAST(o,v_topicAdapter))

#define v_topicAdapterTopic(_this)\
        (v_topic(v_topicAdapter(_this)->topic))

#define v_topicAdapterGetQos(_this)\
        v_topicGetQos(v_topicAdapter(_this)->topic)

#define v_topicAdapterSetQos(_this, qos)\
        v_topicSetQos(v_topicAdapter(_this)->topic, qos)

#define v_topicAdapterName(_this) \
        (v_entityName(v_topicAdapter(_this)))

#define v_topicAdapterMessageType(_this) \
        (v_topicAdapter(_this)->topic->messageType)

#define v_topicAdapterMessageKeyList(_this) \
        (v_topicAdapter(_this)->topic->messageKeyList)

#define v_topicAdapterDataType(_this) \
        (v_topicAdapter(_this)->topic->dataField->type)

#define v_topicAdapterQosRef(_this) \
        (v_topicAdapter(_this)->topic->qos)

#define v_topicAdapterKeyExpr(_this) \
        (v_topicAdapter(_this)->topic->keyExpr)

#define v_topicAdapterDataOffset(_this) \
        (v_topicAdapter(_this)->topic->dataField->offset)

#define v_topicAdapterData(_this,_msg) \
        ((c_voidp)C_DISPLACE(_msg,v_topicDataOffset(v_topicAdapter(_this))->topic))

#define v_topicAdapterAccessMode(_this)\
        (v_topicAdapter(_this)->topic->accessMode)

#define v_topicAdapterDisposeAllData(_this)\
        v_topicDisposeAllData(v_topicAdapter(_this)->topic)

#define v_topicAdapterMetaDescriptor(_this)\
        v_topicMetaDescriptor(v_topicAdapter(_this)->topic)

#define v_topicAdapterParticipant(_this)\
        v_participant(v_topic(_this)->owner)

OS_API v_topicAdapter
v_topicAdapterNew(
    v_participant p,
    const c_char *name,
    const c_char *typeName,
    const c_char *keyList,
    v_topicQos qos);

OS_API v_topicAdapter
v_topicAdapterNewFromTopicInfo (
    v_participant p,
    const struct v_topicInfo *info,
    c_bool announce);

OS_API void
v_topicAdapterFree(
    v_topicAdapter adapter);

OS_API v_topicAdapter
v_topicAdapterWrap(
    v_participant p,
    v_topic topic);

#undef OS_API

#if defined (__cplusplus)
}
#endif

#endif


text:
package org.prevayler.foundation.network;

import java.io.IOException;

public class OldNetworkImpl {

  public ObjectSocket openSocket(String serverIpAddress, int serverPort) throws IOException {
    return new ObjectSocketImpl(serverIpAddress, serverPort);
  }

  public ObjectServerSocket openObjectServerSocket(int port) throws IOException {
    return new ObjectServerSocketImpl(port);
  }
}


text:
package mah.ui.support.swing.pane.item;

import mah.common.util.CollectionUtils;
import mah.ui.UiException;
import mah.ui.pane.item.ItemPane;
import mah.ui.pane.Text;
import mah.ui.pane.item.TextItem;
import mah.ui.support.swing.pane.SwingPane;
import mah.ui.support.swing.theme.SwingLayoutTheme;
import mah.ui.support.swing.util.StringUtils;
import mah.ui.support.swing.util.SwingUtils;
import mah.ui.theme.LayoutTheme;

import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultStyledDocument;
import javax.swing.text.Style;
import javax.swing.text.StyledDocument;
import java.awt.*;

/**
 * Created by zgq on 2017-01-14 13:36
 */
public class TextItemPane implements ItemPane<TextItem>, SwingPane {
    private static final int TEXT_LEN = 150;
    private JPanel panel;
    private JPanel container;
    private JPanel middlePanel;
    private JTextPane text;
    private JLabel numLabel;
    private TextItem item;
    private ItemPaneTheme theme;
    private static final int ITEM_HEIGHT = 58;

    public TextItemPane(TextItem item, int num) {
        init(item, num);
    }

    private void init(TextItem item, int num) {
        try {
            this.panel = new JPanel();
            this.panel.setLayout(new BorderLayout());
            this.panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
            this.container = SwingUtils.createPanelWithXBoxLayout();
            this.container.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 5));
            this.middlePanel = SwingUtils.createPanelWithYBoxLayout();
            this.middlePanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
            this.container.add(middlePanel);
            this.panel.add(container);
            this.panel.setPreferredSize(new Dimension(580, ITEM_HEIGHT));
            initText();
            initNum();
            this.item = item;
            reset(item, num);
        } catch (Exception e) {
            throw new UiException(e);
        }
    }

    private void initNum() {
        this.numLabel = new JLabel("text");
        this.container.add(this.numLabel);
    }

    private void initText() {
        this.text = new JTextPane();
        this.text.setEditable(false);
        this.middlePanel.add(this.text);
    }

    @Override
    public TextItem getItem() {
        return item;
    }

    private void applyBackgroundToMiddlePanel(Color color) {
        this.text.setBackground(color);
        this.container.setBackground(color);
        this.middlePanel.setBackground(color);
    }

    private void applyBackground(Color color) {
        this.panel.setBackground(color);
        applyBackgroundToMiddlePanel(color);
    }

    private void applyBackground(ItemPaneTheme theme) {
        applyBackground(theme.getBackgroundColor());
    }

    @Override
    public void pending() {
        applyBackgroundToMiddlePanel(theme.getPendingBackgroundColor());
        Text content = item.getText();
        java.util.List<Integer> highlightIndexs = content.getHighlightIndexs();
        if (CollectionUtils.isNotEmpty(highlightIndexs)) {
            this.text.setDocument(highlightText(highlightIndexs, content));
        }
    }

    private DefaultStyledDocument highlightText(java.util.List<Integer> highlightIndexs, Text textObj) {
        String text = textObj.getText();
        String con = StringUtils.getStrBySpecificLength(text, TEXT_LEN);
        DefaultStyledDocument hightlightDocument = HightlightHelper.createHightlightDocument(con, highlightIndexs,
                theme.getHighlightStyle(), theme.getNormalTextStyle());
        return hightlightDocument;
    }

    @Override
    public void reset(TextItem item, int num) {
        setContent(item);
        setNum(num);
        this.item = item;
    }

    private void setNum(int num) {
        this.numLabel.setText(String.valueOf(num));
    }

    private void setContent(TextItem item) {
        setNormalText(item.getText());
    }

    @Override
    public void unpending() {
        applyBackground(this.theme);
        setNormalText(this.item.getText());
    }

    private void setNormalText(Text text) {
        String qualifyStr = StringUtils.getStrBySpecificLength(text.getText(), TEXT_LEN);
        this.text.setDocument(createNormalDocument(qualifyStr));
    }

    private StyledDocument createNormalDocument(String text) {
        StyledDocument document = new DefaultStyledDocument();
        try {
            Style style = theme != null ? theme.getNormalTextStyle() : null;
            document.insertString(0, text, style);
            return document;
        } catch (BadLocationException e) {
            throw new UiException(e);
        }
    }

    @Override
    public JPanel getPanel() {
        return panel;
    }

    @Override
    public void apply(LayoutTheme theme) {
        if (theme instanceof SwingLayoutTheme) {
            SwingLayoutTheme layoutTheme = (SwingLayoutTheme) theme;
            this.theme = new ItemPaneTheme(layoutTheme);
            setNormalText(item.getText());
            decorateNum(this.theme);
            applyBackground(this.theme);
        }
    }

    private void decorateNum(ItemPaneTheme theme) {
        numLabel.setForeground(theme.getNumColor());
    }
}


text:
package com.storme;

import android.content.ContentValues;
import android.database.Cursor;

/**
 * Created by brett on 24/02/15.
 */

public class LongFieldColumn extends FieldColumn {

    public LongFieldColumn() { super(Long.class); }

    @Override
    public String getColumnType() { return "INTEGER"; }

    @Override
    public void setValueFromCursor(Object inst, Cursor cursor, int position) {
        setValue(inst, cursor.getLong(position));
    }

    @Override
    public void addFieldValue(Object inst, ContentValues values) throws IllegalAccessException {
        values.put(name, field.getLong(inst));
    }
}


text:
import Page from "helpers/spa_base";
import {LoginPage} from "views/pages/login_page";

export class LoginPageSPA extends Page {
  constructor() {
    super(LoginPage);
  }

  protected showHeader() {
    return false;
  }

  protected enableUsageDataAndVersionUpdating() {
    return false;
  }
}

//tslint:disable-next-line
new LoginPageSPA();