text:
.class Lcom/android/internal/widget/ActionBarView$HomeView;
.super Landroid/widget/FrameLayout;
.source "ActionBarView.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/widget/ActionBarView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "HomeView"
.end annotation

# instance fields
.field private mIconView:Landroid/widget/ImageView;

.field private mUpView:Landroid/view/View;

.field private mUpWidth:I

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 1257
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/android/internal/widget/ActionBarView$HomeView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 1258
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 1261
    invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 1262
    return-void
.end method

# virtual methods
.method public dispatchHoverEvent(Landroid/view/MotionEvent;)Z
    .locals 1
    .parameter "event"

    .prologue
    .line 1290
    invoke-virtual {p0, p1}, Lcom/android/internal/widget/ActionBarView$HomeView;->onHoverEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    return v0
.end method

.method public dispatchPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)Z
    .locals 1
    .parameter "event"

    .prologue
    .line 1274
    invoke-virtual {p0, p1}, Lcom/android/internal/widget/ActionBarView$HomeView;->onPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V

    .line 1275
    const/4 v0, 0x1

    return v0
.end method

.method public getLeftOffset()I
    .locals 2

    .prologue
    .line 1300
    iget-object v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getVisibility()I

    move-result v0

    const/16 v1, 0x8

    if-ne v0, v1, :cond_0

    iget v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpWidth:I

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected onFinishInflate()V
    .locals 1

    .prologue
    .line 1295
    const v0, 0x1020226

    invoke-virtual {p0, v0}, Lcom/android/internal/widget/ActionBarView$HomeView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    .line 1296
    const v0, 0x102002c

    invoke-virtual {p0, v0}, Lcom/android/internal/widget/ActionBarView$HomeView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    .line 1297
    return-void
.end method

.method protected onLayout(ZIIII)V
    .locals 17
    .parameter "changed"
    .parameter "l"
    .parameter "t"
    .parameter "r"
    .parameter "b"

    .prologue
    .line 1348
    sub-int v14, p5, p3

    div-int/lit8 v12, v14, 0x2

    .line 1349
    .local v12, vCenter:I
    sub-int v13, p4, p2

    .line 1350
    .local v13, width:I
    const/4 v9, 0x0

    .line 1351
    .local v9, upOffset:I
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v14}, Landroid/view/View;->getVisibility()I

    move-result v14

    const/16 v15, 0x8

    if-eq v14, v15, :cond_0

    .line 1352
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v14}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v8

    check-cast v8, Landroid/widget/FrameLayout$LayoutParams;

    .line 1353
    .local v8, upLp:Landroid/widget/FrameLayout$LayoutParams;
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v14}, Landroid/view/View;->getMeasuredHeight()I

    move-result v7

    .line 1354
    .local v7, upHeight:I
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v14}, Landroid/view/View;->getMeasuredWidth()I

    move-result v11

    .line 1355
    .local v11, upWidth:I
    div-int/lit8 v14, v7, 0x2

    sub-int v10, v12, v14

    .line 1356
    .local v10, upTop:I
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    const/4 v15, 0x0

    add-int v16, v10, v7

    move/from16 v0, v16

    invoke-virtual {v14, v15, v10, v11, v0}, Landroid/view/View;->layout(IIII)V

    .line 1357
    iget v14, v8, Landroid/widget/FrameLayout$LayoutParams;->leftMargin:I

    add-int/2addr v14, v11

    iget v15, v8, Landroid/widget/FrameLayout$LayoutParams;->rightMargin:I

    add-int v9, v14, v15

    .line 1358
    sub-int/2addr v13, v9

    .line 1359
    add-int p2, p2, v9

    .line 1361
    .end local v7           #upHeight:I
    .end local v8           #upLp:Landroid/widget/FrameLayout$LayoutParams;
    .end local v10           #upTop:I
    .end local v11           #upWidth:I
    :cond_0
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    invoke-virtual {v14}, Landroid/widget/ImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v4

    check-cast v4, Landroid/widget/FrameLayout$LayoutParams;

    .line 1362
    .local v4, iconLp:Landroid/widget/FrameLayout$LayoutParams;
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    invoke-virtual {v14}, Landroid/widget/ImageView;->getMeasuredHeight()I

    move-result v2

    .line 1363
    .local v2, iconHeight:I
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    invoke-virtual {v14}, Landroid/widget/ImageView;->getMeasuredWidth()I

    move-result v6

    .line 1364
    .local v6, iconWidth:I
    sub-int v14, p4, p2

    div-int/lit8 v1, v14, 0x2

    .line 1365
    .local v1, hCenter:I
    iget v14, v4, Landroid/widget/FrameLayout$LayoutParams;->leftMargin:I

    div-int/lit8 v15, v6, 0x2

    sub-int v15, v1, v15

    invoke-static {v14, v15}, Ljava/lang/Math;->max(II)I

    move-result v14

    add-int v3, v9, v14

    .line 1366
    .local v3, iconLeft:I
    iget v14, v4, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I

    div-int/lit8 v15, v2, 0x2

    sub-int v15, v12, v15

    invoke-static {v14, v15}, Ljava/lang/Math;->max(II)I

    move-result v5

    .line 1367
    .local v5, iconTop:I
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    add-int v15, v3, v6

    add-int v16, v5, v2

    move/from16 v0, v16

    invoke-virtual {v14, v3, v5, v15, v0}, Landroid/widget/ImageView;->layout(IIII)V

    .line 1368
    return-void
.end method

.method protected onMeasure(II)V
    .locals 13
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    .line 1305
    iget-object v1, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    const/4 v3, 0x0

    const/4 v5, 0x0

    move-object v0, p0

    move v2, p1

    move v4, p2

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/widget/ActionBarView$HomeView;->measureChildWithMargins(Landroid/view/View;IIII)V

    .line 1306
    iget-object v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v10

    check-cast v10, Landroid/widget/FrameLayout$LayoutParams;

    .line 1307
    .local v10, upLp:Landroid/widget/FrameLayout$LayoutParams;
    iget v0, v10, Landroid/widget/FrameLayout$LayoutParams;->leftMargin:I

    iget-object v1, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v1}, Landroid/view/View;->getMeasuredWidth()I

    move-result v1

    add-int/2addr v0, v1

    iget v1, v10, Landroid/widget/FrameLayout$LayoutParams;->rightMargin:I

    add-int/2addr v0, v1

    iput v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpWidth:I

    .line 1308
    iget-object v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getVisibility()I

    move-result v0

    const/16 v1, 0x8

    if-ne v0, v1, :cond_0

    const/4 v3, 0x0

    .line 1309
    .local v3, width:I
    :goto_0
    iget v0, v10, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I

    iget-object v1, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    invoke-virtual {v1}, Landroid/view/View;->getMeasuredHeight()I

    move-result v1

    add-int/2addr v0, v1

    iget v1, v10, Landroid/widget/FrameLayout$LayoutParams;->bottomMargin:I

    add-int v6, v0, v1

    .line 1310
    .local v6, height:I
    iget-object v1, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    const/4 v5, 0x0

    move-object v0, p0

    move v2, p1

    move v4, p2

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/widget/ActionBarView$HomeView;->measureChildWithMargins(Landroid/view/View;IIII)V

    .line 1311
    iget-object v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v9

    check-cast v9, Landroid/widget/FrameLayout$LayoutParams;

    .line 1312
    .local v9, iconLp:Landroid/widget/FrameLayout$LayoutParams;
    iget v0, v9, Landroid/widget/FrameLayout$LayoutParams;->leftMargin:I

    iget-object v1, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    invoke-virtual {v1}, Landroid/widget/ImageView;->getMeasuredWidth()I

    move-result v1

    add-int/2addr v0, v1

    iget v1, v9, Landroid/widget/FrameLayout$LayoutParams;->rightMargin:I

    add-int/2addr v0, v1

    add-int/2addr v3, v0

    .line 1313
    iget v0, v9, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I

    iget-object v1, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    invoke-virtual {v1}, Landroid/widget/ImageView;->getMeasuredHeight()I

    move-result v1

    add-int/2addr v0, v1

    iget v1, v9, Landroid/widget/FrameLayout$LayoutParams;->bottomMargin:I

    add-int/2addr v0, v1

    invoke-static {v6, v0}, Ljava/lang/Math;->max(II)I

    move-result v6

    .line 1316
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v11

    .line 1317
    .local v11, widthMode:I
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v7

    .line 1318
    .local v7, heightMode:I
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v12

    .line 1319
    .local v12, widthSize:I
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v8

    .line 1321
    .local v8, heightSize:I
    sparse-switch v11, :sswitch_data_0

    .line 1332
    :goto_1
    sparse-switch v7, :sswitch_data_1

    .line 1343
    :goto_2
    invoke-virtual {p0, v3, v6}, Lcom/android/internal/widget/ActionBarView$HomeView;->setMeasuredDimension(II)V

    .line 1344
    return-void

    .line 1308
    .end local v3           #width:I
    .end local v6           #height:I
    .end local v7           #heightMode:I
    .end local v8           #heightSize:I
    .end local v9           #iconLp:Landroid/widget/FrameLayout$LayoutParams;
    .end local v11           #widthMode:I
    .end local v12           #widthSize:I
    :cond_0
    iget v3, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpWidth:I

    goto :goto_0

    .line 1323
    .restart local v3       #width:I
    .restart local v6       #height:I
    .restart local v7       #heightMode:I
    .restart local v8       #heightSize:I
    .restart local v9       #iconLp:Landroid/widget/FrameLayout$LayoutParams;
    .restart local v11       #widthMode:I
    .restart local v12       #widthSize:I
    :sswitch_0
    invoke-static {v3, v12}, Ljava/lang/Math;->min(II)I

    move-result v3

    .line 1324
    goto :goto_1

    .line 1326
    :sswitch_1
    move v3, v12

    .line 1327
    goto :goto_1

    .line 1334
    :sswitch_2
    invoke-static {v6, v8}, Ljava/lang/Math;->min(II)I

    move-result v6

    .line 1335
    goto :goto_2

    .line 1337
    :sswitch_3
    move v6, v8

    .line 1338
    goto :goto_2

    .line 1321
    nop

    :sswitch_data_0
    .sparse-switch
        -0x80000000 -> :sswitch_0
        0x40000000 -> :sswitch_1
    .end sparse-switch

    .line 1332
    :sswitch_data_1
    .sparse-switch
        -0x80000000 -> :sswitch_2
        0x40000000 -> :sswitch_3
    .end sparse-switch
.end method

.method public onPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
    .locals 2
    .parameter "event"

    .prologue
    .line 1280
    invoke-super {p0, p1}, Landroid/widget/FrameLayout;->onPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V

    .line 1281
    invoke-virtual {p0}, Lcom/android/internal/widget/ActionBarView$HomeView;->getContentDescription()Ljava/lang/CharSequence;

    move-result-object v0

    .line 1282
    .local v0, cdesc:Ljava/lang/CharSequence;
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 1283
    invoke-virtual {p1}, Landroid/view/accessibility/AccessibilityEvent;->getText()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 1285
    :cond_0
    return-void
.end method

.method public setIcon(Landroid/graphics/drawable/Drawable;)V
    .locals 1
    .parameter "icon"

    .prologue
    .line 1269
    iget-object v0, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mIconView:Landroid/widget/ImageView;

    invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 1270
    return-void
.end method

.method public setUp(Z)V
    .locals 2
    .parameter "isUp"

    .prologue
    .line 1265
    iget-object v1, p0, Lcom/android/internal/widget/ActionBarView$HomeView;->mUpView:Landroid/view/View;

    if-eqz p1, :cond_0

    const/4 v0, 0x0

    :goto_0
    invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V

    .line 1266
    return-void

    .line 1265
    :cond_0
    const/16 v0, 0x8

    goto :goto_0
.end method

redpajama_set_name: RedPajamaGithub


text:
package com.paypal.selion.internal.reports.services;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.AbstractMap;
import java.util.Date;
import java.util.Map.Entry;
import java.util.TimeZone;
import java.util.logging.Level;

import com.paypal.selion.logger.SeLionLogger;
import com.paypal.test.utilities.logging.SimpleLogger;

/**
 * This class is responsible for providing formatting helpers to JSON generator, Runtime Reporter and HTML Reporter to
 * help parse and display the report data in appropriate format in each of their report formats.
 *
 */
public class ReporterDateFormatter {

    private static SimpleLogger logger = SeLionLogger.getLogger();

    public static final String CURRENTDATE = "currentDate";

    private static DateFormat getFormatter() {
        // DEVNOTE: Format required to support Internet Explorer browser.
        return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
    }

    /**
     * Return an ISO 8601 combined date and time string for specified date/time in host machine's default time zone.
     *
     * @param date
     *            Date
     * @return String with format "yyyy-MM-dd'T'HH:mm:ss.SSS+XXXX where XXXX corresponds to the host's time zone."
     */
    public static String getISO8601String(Date date) {
        return getISO8601StringWithSpecificTimeZone(date, TimeZone.getDefault());
    }

    /**
     * Return an ISO 8601 combined date and time string for specified date/time. The returned date and time format is
     * compatible with JavaScript on Internet Explorer.
     *
     * @param date
     *            Date
     * @param zone
     *            Time zone to be used.
     * @return String with format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" where XXX corresponds to the input time zone. example:
     *         UTC time is represented as '2015-01-21T02:21:33.955Z' example: PST time is represented as
     *         '2015-01-20T18:21:33.955-08:00'
     */
    public static String getISO8601StringWithSpecificTimeZone(Date date, TimeZone zone) {
        DateFormat formatter = getFormatter();
        formatter.setTimeZone(zone);
        return formatter.format(date);
    }

    /**
     * Return an reader friendly date from ISO 8601 combined date and time string.
     *
     * @param dateISOString
     *            String for date in ISO format.
     * @return String with format "yyyy-MM-dd'T'HH:mm:ss.SSS+XXXX where XXXX corresponds to the host's time zone."
     */
    public static String getStringFromISODateString(String dateISOString) {
        Date date;
        String formattedDate;
        DateFormat formatter = getFormatter();
        try {
            date = formatter.parse(dateISOString);
            formattedDate = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(date);
        } catch (ParseException e) {
            logger.log(Level.WARNING, e.getMessage(), e);
            formattedDate = dateISOString;
        }
        return formattedDate;
    }

    /**
     * Formats specific keys and values into readable form for HTML Reporter.
     *
     * @param entryItem
     *      A single key value Entry to be formatted.
     * @return The formatted key value Entry or the original Entry, if no formatting is required
     */
    public static Entry<String, String> formatReportDataForBrowsableReports(Entry<String, String> entryItem) {
        String key = entryItem.getKey();
        String value = entryItem.getValue();

        String formattedKey = key;
        String formattedValue = value;

        switch (key) {
        case ReporterDateFormatter.CURRENTDATE:
            formattedKey = "Current Date";
            formattedValue = ReporterDateFormatter.getStringFromISODateString(value);
            break;
        default:
            break;
        }

        return new AbstractMap.SimpleImmutableEntry<String, String>(formattedKey, formattedValue);
    }

}


text:
FontBuddy
=========

Because putting text on the screen in XNA/MonoGame shouldn't so hard, gosh darn it!

This is pretty simple to use... you create one of these things, load up a font into it, and draw some text.  When you draw text you can choose how to justify it, makes it waaay easier to line up your text with other stuff.

Some of these have some different parameters that you might want to tweak, like where the shadow are positioned or speed or whatever.

Some of the different font effects are shadow text, pulsating text, shaky text, opposite text, and rainbow text.  These are all pretty simple, there's no shader magic or nothing going on.

Cheers!

An example project showing how to use many of the FontBuddies is at
https://github.com/dmanning23/FontBuddySample


text:
ALTER TABLE `account`
  ADD CONSTRAINT `FK_AccountsCreatedBy_ToUsersId` FOREIGN KEY (`CreatedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_AccountsModifiedBy_ToUsersId` FOREIGN KEY (`ModifiedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `envelope`
--
ALTER TABLE `envelope`
  ADD CONSTRAINT `FK_EnvelopesAccountId_ToAccountId` FOREIGN KEY (`AccountId`) REFERENCES `account` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_EnvelopesCreatedBy_ToUsersId` FOREIGN KEY (`CreatedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_EnvelopesModifiedBy_ToUsersId` FOREIGN KEY (`ModifiedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `filterEnvelope`
--
ALTER TABLE `filterEnvelope`
  ADD CONSTRAINT `FK_FiltersEnvelopeId_ToEnvelopesId` FOREIGN KEY (`EnvelopeId`) REFERENCES `envelope` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_FiltersFilterId_ToFiltersId` FOREIGN KEY (`FilterId`) REFERENCES `userFilter` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `filterLabel`
--
ALTER TABLE `filterLabel`
  ADD CONSTRAINT `FK_FilterLabelsFilterId_ToFiltersId` FOREIGN KEY (`FilterId`) REFERENCES `userFilter` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `label`
--
ALTER TABLE `label`
  ADD CONSTRAINT `FK_LabelsCreatedBy_ToUsersId` FOREIGN KEY (`CreatedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_LabelsTransactionId_ToTransactionId` FOREIGN KEY (`TransactionId`) REFERENCES `transaction` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `Logs`
--
ALTER TABLE `Logs`
  ADD CONSTRAINT `FK_LogsUserId_ToUsersId` FOREIGN KEY (`UserId`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `transaction`
--
ALTER TABLE `transaction`
  ADD CONSTRAINT `FK_TransactionsCreatedBy_ToUsersId` FOREIGN KEY (`CreatedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_TransactionsEnvelopeId_ToEnvelopesId` FOREIGN KEY (`EnvelopeId`) REFERENCES `envelope` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_TransactionsModifiedBy_ToUsersId` FOREIGN KEY (`ModifiedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `userAccount`
--
ALTER TABLE `userAccount`
  ADD CONSTRAINT `FK_UserAccountsAccountId_ToAccountId` FOREIGN KEY (`AccountId`) REFERENCES `account` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_UserAccountsCreatedBy_ToUsersId` FOREIGN KEY (`CreatedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_UserAccountsModifiedBy_ToUsersId` FOREIGN KEY (`ModifiedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_UserAccountsUserId_ToUsersId` FOREIGN KEY (`UserId`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `userFilter`
--
ALTER TABLE `userFilter`
  ADD CONSTRAINT `FK_FiltersCreatedBy_ToUsersId` FOREIGN KEY (`UserId`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_FiltersModifiedBy_ToUsersId` FOREIGN KEY (`ModifiedBy`) REFERENCES `user` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for view `vw_account_sum`
--
ALTER VIEW `vw_account_sum`
  ADD CONSTRAINT `FK_VwAccountSum_AccountId_ToAccountId` FOREIGN KEY (`AccountId`) REFERENCES `account` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,

--
-- Constraints for view `vw_envelope_sum`
--
ALTER VIEW `vw_envelope_sum`
  ADD CONSTRAINT `FK_VwEnvelopeSum_EnvelopeId_ToEnvelopeId` FOREIGN KEY (`EnvelopeId`) REFERENCES `envelope` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,


text:
""" This document defines the Base Manager and BaseQuerySet classes"""

# django
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.db.models import Count

# standard library
import json

class QuerySet(models.query.QuerySet):
    def to_json(self):
        return json.dumps(list(self.values()), cls=DjangoJSONEncoder)

    def find_duplicates(self, *fields):
        duplicates = self.values(*fields).annotate(Count('id'))
        return duplicates.order_by().filter(id__count__gt=1)

class BaseManager(models.Manager):
    """
     This is the base manager, all model should implement it
    """

    def get_queryset(self):
        """
        Returns a new QuerySet object.
        """
        return QuerySet(self.model, using=self._db)

    def to_json(self):
        qs = self.get_queryset()

        return json.dumps(list(qs.values()), cls=DjangoJSONEncoder)

    def find_duplicates(self, *fields):
        qs = self.get_queryset()
        return qs.find_duplicates(*fields)


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

#if !(PORTABLE || DNXCORE50 || NETFX_CORE || PORTABLE40)
using System;
using System.Diagnostics;
using System.Reflection;
#if NETFX_CORE
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#elif DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Utilities;
using Newtonsoft.Json.Tests.TestObjects;
using Newtonsoft.Json.Tests.Serialization;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;

#endif

namespace Newtonsoft.Json.Tests.Utilities
{
    [TestFixture]
    public class DynamicReflectionDelegateFactoryTests : TestFixtureBase
    {
        [Test]
        public void ConstructorWithRefString()
        {
            ConstructorInfo constructor = typeof(OutAndRefTestClass).GetConstructors().Single(c => c.GetParameters().Count() == 1);

            var creator = DynamicReflectionDelegateFactory.Instance.CreateParameterizedConstructor(constructor);

            object[] args = new object[] { "Input" };
            OutAndRefTestClass o = (OutAndRefTestClass)creator(args);
            Assert.IsNotNull(o);
            Assert.AreEqual("Input", o.Input);
        }

        [Test]
        public void ConstructorWithRefStringAndOutBool()
        {
            ConstructorInfo constructor = typeof(OutAndRefTestClass).GetConstructors().Single(c => c.GetParameters().Count() == 2);

            var creator = DynamicReflectionDelegateFactory.Instance.CreateParameterizedConstructor(constructor);

            object[] args = new object[] { "Input", false };
            OutAndRefTestClass o = (OutAndRefTestClass)creator(args);
            Assert.IsNotNull(o);
            Assert.AreEqual("Input", o.Input);
            Assert.AreEqual(true, o.B1);
        }

        [Test]
        public void ConstructorWithRefStringAndRefBoolAndRefBool()
        {
            ConstructorInfo constructor = typeof(OutAndRefTestClass).GetConstructors().Single(c => c.GetParameters().Count() == 3);

            var creator = DynamicReflectionDelegateFactory.Instance.CreateParameterizedConstructor(constructor);

            object[] args = new object[] { "Input", true, null };
            OutAndRefTestClass o = (OutAndRefTestClass)creator(args);
            Assert.IsNotNull(o);
            Assert.AreEqual("Input", o.Input);
            Assert.AreEqual(true, o.B1);
            Assert.AreEqual(false, o.B2);
        }

        [Test]
        public void CreateGetWithBadObjectTarget()
        {
            ExceptionAssert.Throws<InvalidCastException>(() =>
            {
                Person p = new Person();
                p.Name = "Hi";

                Func<object, object> setter = DynamicReflectionDelegateFactory.Instance.CreateGet<object>(typeof(Movie).GetProperty("Name"));

                setter(p);
            }, "Unable to cast object of type 'Newtonsoft.Json.Tests.TestObjects.Person' to type 'Newtonsoft.Json.Tests.TestObjects.Movie'.");
        }

        [Test]
        public void CreateSetWithBadObjectTarget()
        {
            ExceptionAssert.Throws<InvalidCastException>(() =>
            {
                Person p = new Person();
                Movie m = new Movie();

                Action<object, object> setter = DynamicReflectionDelegateFactory.Instance.CreateSet<object>(typeof(Movie).GetProperty("Name"));

                setter(m, "Hi");

                Assert.AreEqual(m.Name, "Hi");

                setter(p, "Hi");

                Assert.AreEqual(p.Name, "Hi");
            }, "Unable to cast object of type 'Newtonsoft.Json.Tests.TestObjects.Person' to type 'Newtonsoft.Json.Tests.TestObjects.Movie'.");
        }

        [Test]
        public void CreateSetWithBadTarget()
        {
            ExceptionAssert.Throws<InvalidCastException>(() =>
            {
                object structTest = new StructTest();

                Action<object, object> setter = DynamicReflectionDelegateFactory.Instance.CreateSet<object>(typeof(StructTest).GetProperty("StringProperty"));

                setter(structTest, "Hi");

                Assert.AreEqual("Hi", ((StructTest)structTest).StringProperty);

                setter(new TimeSpan(), "Hi");
            }, "Specified cast is not valid.");
        }

        [Test]
        public void CreateSetWithBadObjectValue()
        {
            ExceptionAssert.Throws<InvalidCastException>(() =>
            {
                Movie m = new Movie();

                Action<object, object> setter = DynamicReflectionDelegateFactory.Instance.CreateSet<object>(typeof(Movie).GetProperty("Name"));

                setter(m, new Version("1.1.1.1"));
            }, "Unable to cast object of type 'System.Version' to type 'System.String'.");
        }

        [Test]
        public void CreateStaticMethodCall()
        {
            MethodInfo castMethodInfo = typeof(JsonSerializerTest.DictionaryKey).GetMethod("op_Implicit", new[] { typeof(string) });

            Assert.IsNotNull(castMethodInfo);

            MethodCall<object, object> call = DynamicReflectionDelegateFactory.Instance.CreateMethodCall<object>(castMethodInfo);

            object result = call(null, "First!");
            Assert.IsNotNull(result);

            JsonSerializerTest.DictionaryKey key = (JsonSerializerTest.DictionaryKey)result;
            Assert.AreEqual("First!", key.Value);
        }

        [Test]
        public void CreatePropertyGetter()
        {
            PropertyInfo namePropertyInfo = typeof(Person).GetProperty(nameof(Person.Name));

            Assert.IsNotNull(namePropertyInfo);

            var call = DynamicReflectionDelegateFactory.Instance.CreateGet<Person>(namePropertyInfo);

            Person p = new Person();
            p.Name = "Name!";

            object result = call(p);
            Assert.IsNotNull(result);

            Assert.AreEqual("Name!", (string)result);
        }
    }
}

#endif


text:
CREATE TABLE [dbo].[Customer]
(
	[Id] INT NOT NULL PRIMARY KEY,
    [FName] VARCHAR(100) NULL,
    [LName] VARCHAR(100) NULL,
    [Company] VARCHAR(100) NULL,
    [Email] VARCHAR(100) NULL,
    [Address] VARCHAR(100) NULL,
    [Phone] VARCHAR(50) NULL
)


text:
<link rel="stylesheet" type="text/css" href="./files/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="./files/css/style.css" />
<script src="./files/js/jquery.js"></script>
<script src="./files/js/colors.js"></script>
<!--<link rel="stylesheet" type="text/css" href="./files/css/fonts.css" />-->

<script>

  function togglepubs(showall) {
    $(".selected-false").toggle();
    var btn = $("#pubs-toggle span");
    if (showall) {
      btn.text("Show Selected");
      $("#pubs-title").text("All Publications")
    } else {
      btn.text("Show All");
      $("#pubs-title").text("Selected Publications")
    }
  }

  // publications
  var showall = true;
  $("#pubs-toggle").click(() => {
      showall = !showall;
      togglepubs(showall)
  })
  togglepubs(showall)
//$(".selected-false").hide();
</script>

<script src="./files/js/mypic.js"></script>

<script src="./files/js/handlebars.js"></script>
<script src="./files/js/underscore.js"></script>
<script src="./files/js/bootstrap.min.js"></script>
<script src="./files/js/d3.js"></script>
<script src="./files/js/webcomponents-lite.min.js"></script>
<script src="./files/js/scroll.js"></script>
<!--<link rel="import" href="https://components.cloudstitch.com/components/cloudstitch-handlebars/cloudstitch-handlebars.vulcanized.html"/>-->

<script>
//  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
//  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
//  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
//  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
//
//  ga('create', 'UA-87373541-1', 'auto');
//  ga('send', 'pageview');
//
</script>


text:
function setForms(num) {
    var mainNumber, SubNumber, ThirdNumber;
    do {
        mainNumber = parseInt(num * Math.random());
        SubNumber = parseInt(num * Math.random());
        ThirdNumber = parseInt(num * Math.random());
        console.log(mainNumber, SubNumber, ThirdNumber);
    } while (mainNumber !== SubNumber !== ThirdNumber);
    return [mainNumber, SubNumber, ThirdNumber];
}

console.log(setForms(4));


text:
package java.util;
public abstract class ListResourceBundle extends java.util.ResourceBundle {
	public ListResourceBundle() { }
	protected abstract java.lang.Object[][] getContents();
	public java.util.Enumeration getKeys() { return null; }
	public final java.lang.Object handleGetObject(java.lang.String var0) { return null; }
}


text:
//// TODO:
//// [O] Contracts
//// [O] Documentation

namespace Splunk.Client
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Threading.Tasks;
    using System.Xml;

    /// <summary>
    /// Provides a class that represents a Splunk service response message.
    /// </summary>
    /// <seealso cref="T:System.IComparable"/>
    /// <seealso cref="T:System.IComparable{Splunk.Client.Message}"/>
    /// <seealso cref="T:System.IEquatable{Splunk.Client.Message}"/>
    public sealed class Message : IComparable, IComparable<Message>, IEquatable<Message>
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Message"/> class.
        /// </summary>
        /// <param name="type">
        /// The message type.
        /// </param>
        /// <param name="text">
        /// The message text.
        /// </param>
        internal Message(MessageType type, string text)
        {
            Contract.Requires<ArgumentOutOfRangeException>(MessageType.Debug <= type && type <= MessageType.Fatal, "type");
            Contract.Requires<ArgumentNullException>(text != null, "text");
            this.MessageType = type;
            this.Text = text;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the text of the current <see cref="Message"/>.
        /// </summary>
        /// <value>
        /// Text of the current <see cref="Message"/>.
        /// </value>
        public string Text
        { get; private set; }

        /// <summary>
        /// Gets the type of the current <see cref="Message"/>.
        /// </summary>
        /// <value>
        /// Type of the current <see cref="Message"/>.
        /// </value>
        public MessageType MessageType
        { get; private set; }

        #endregion

        #region Methods

        /// <summary>
        /// Compares the current <see cref="Message"/> with another object and
        /// returns an integer that indicates whether the current
        /// <see cref="Message"/> precedes, follows, or appears in the same position
        /// in the sort order as the other object.
        /// </summary>
        /// <param name="other">
        /// The object to compare to the current <see cref="Message"/>.
        /// </param>
        /// <returns>
        /// A 32-bit signed integer that indicates whether this instance precedes,
        /// follows, or appears in the same position in the sort order as
        /// <paramref name="other"/>.
        /// <list type="table">
        /// <listheader>
        ///   <term>
        ///     Value
        ///   </term>
        ///   <description>
        ///     Condition
        ///   </description>
        /// </listheader>
        /// <item>
        ///   <term>
        ///     Less than zero
        ///   </term>
        ///   <description>
        ///     This instance precedes <paramref name="other"/>.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>
        ///     Zero
        ///   </term>
        ///   <description>
        ///     This instance is in the same position in the sort order as paramref
        ///     name="other"/>.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>
        ///     Greater than zero
        ///   </term>
        ///   <description>
        ///     This instance follows <paramref name="other"/>,
        ///     <paramref name= "other"/> is not a <see cref="Message"/>, or
        ///     <paramref name= "other"/> is <c>null</c>.
        ///   </description>
        /// </item>
        /// </list>
        /// </returns>
        /// <seealso cref="M:System.IComparable.CompareTo(object)"/>
        public int CompareTo(object other)
        {
            return this.CompareTo(other as Message);
        }

        /// <summary>
        /// Compares the current <see cref="Message"/> with another one and returns
        /// an integer that indicates whether the current <see cref= "Message"/>
        /// precedes, follows, or appears in the same position in the sort order as
        /// the other one.
        /// </summary>
        /// <param name="other">
        /// The object to compare with the current <see cref="Message"/>.
        /// </param>
        /// <returns>
        /// A 32-bit signed integer that indicates whether this instance precedes,
        /// follows, or appears in the same position in the sort order as
        /// <paramref name="other"/>.
        /// <list type="table">
        /// <listheader>
        ///   <term>
        ///     Value
        ///   </term>
        ///   <description>
        ///     Condition
        ///   </description>
        /// </listheader>
        /// <item>
        ///   <term>
        ///     Less than zero
        ///   </term>
        ///   <description>
        ///     This instance precedes <paramref name="other"/>.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>
        ///     Zero
        ///   </term>
        ///   <description>
        ///     This instance is in the same position in the sort order as
        ///      <paramref name="other"/>.
        ///   </description>
        /// </item>
        /// <item>
        ///   <term>
        ///     Greater than zero
        ///   </term>
        ///   <description>
        ///     This instance follows <paramref name="other"/> or
        ///     <paramref name="other"/> is <c>null</c>.
        ///   </description>
        /// </item>
        /// </list>
        /// </returns>
        public int CompareTo(Message other)
        {
            if (other == null)
            {
                return 1;
            }

            if (object.ReferenceEquals(this, other))
            {
                return 0;
            }

            int difference = this.MessageType - other.MessageType;

            return difference != 0 ? difference : string.Compare(this.Text, other.Text, StringComparison.Ordinal);
        }

        /// <summary>
        /// Determines whether the current <see cref="Message"/> and another object
        /// are equal.
        /// </summary>
        /// <param name="other">
        /// The object to compare with the current <see cref="Message"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if <paramref name="other"/> is a non <c>null</c>
        /// <see cref="Message"/> and is the same as the current
        /// <see cref="Message"/>;
        /// otherwise, <c>false</c>.
        /// </returns>
        /// <seealso cref="M:System.Object.Equals(object)"/>
        public override bool Equals(object other)
        {
            return this.Equals(other as Message);
        }

        /// <summary>
        /// Determines whether the current <see cref="Message"/> and another one are
        /// equal.
        /// </summary>
        /// <param name="other">
        /// The object to compare with the current <see cref="Message"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if <paramref name="other"/> is non <c>null</c> and is the
        /// same as the current <see cref="Message"/>; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(Message other)
        {
            if ((object)other == null)
            {
                return false;
            }
            return object.ReferenceEquals(this, other) || (this.MessageType == other.MessageType && this.Text == other.Text);
        }

        /// <summary>
        /// Computes the hash code for the current <see cref="Message"/>.
        /// </summary>
        /// <returns>
        /// The hash code for the current <see cref="Message"/>.
        /// </returns>
        /// <seealso cref="M:System.Object.GetHashCode()"/>
        public override int GetHashCode()
        {
            // TODO: Check this against the algorithm presented in Effective Java
            int hash = 17;

            hash = (hash * 23) + this.MessageType.GetHashCode();
            hash = (hash * 23) + this.Text.GetHashCode();

            return hash;
        }

        /// <summary>
        /// Greater-than comparison operator.
        /// </summary>
        /// <param name="a">
        /// The first <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <param name="b">
        /// The second <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <returns>
        /// The result of the operation.
        /// </returns>
        public static bool operator >(Message a, Message b)
        {
            if ((object)a == null)
            {
                return false;
            }

            return a.CompareTo(b) > 0;
        }

        /// <summary>
        /// Greater-than-or-equal comparison operator.
        /// </summary>
        /// <param name="a">
        /// The first <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <param name="b">
        /// The second <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <returns>
        /// The result of the operation.
        /// </returns>
        public static bool operator >=(Message a, Message b)
        {
            if ((object)a == null)
            {
                return (object)b == null;
            }

            return a.CompareTo(b) < 0;
        }

        /// <summary>
        /// Determines whether two <see cref="Message"/> instances have the same
        /// value.
        /// </summary>
        /// <param name="a">
        /// The first <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <param name="b">
        /// The second <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the value of <paramref name="a"/> is the same as the value
        /// of <paramref name="b"/>; otherwise, <c>false</c>.
        /// </returns>
        public static bool operator ==(Message a, Message b)
        {
            if (object.ReferenceEquals(a, b))
            {
                return true;
            }

            if ((object)a == null || (object)b == null)
            {
                return false;
            }

            return a.Equals(b);
        }

        /// <summary>
        /// Determines whether two <see cref="Message"/> instances have different
        /// values.
        /// </summary>
        /// <param name="a">
        /// The first <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <param name="b">
        /// The second <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the value of <paramref name="a"/> is different than the
        /// value of <paramref name="b"/>; otherwise, <c>false</c>.
        /// </returns>
        public static bool operator !=(Message a, Message b)
        {
            return !(a == b);
        }

        /// <summary>
        /// Gets a string representation for the current <see cref="Message"/>.
        /// </summary>
        /// <returns>
        /// A string representation of the current <see cref="Message"/>.
        /// </returns>
        /// <seealso cref="M:System.Object.ToString()"/>
        public override string ToString()
        {
            return string.Concat(this.MessageType.ToString(), ": ", this.Text);
        }

        /// <summary>
        /// Less-than comparison operator.
        /// </summary>
        /// <param name="a">
        /// The first <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <param name="b">
        /// The second <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <returns>
        /// The result of the operation.
        /// </returns>
        public static bool operator <(Message a, Message b)
        {
            if ((object)a == null)
            {
                return (object)b != null;
            }

            return a.CompareTo(b) < 0;
        }

        /// <summary>
        /// Less-than-or-equal comparison operator.
        /// </summary>
        /// <param name="a">
        /// The first <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <param name="b">
        /// The second <see cref="Message"/> to compare or <c>null</c>.
        /// </param>
        /// <returns>
        /// The result of the operation.
        /// </returns>
        public static bool operator <=(Message a, Message b)
        {
            if ((object)a == null)
            {
                return true;
            }

            return a.CompareTo(b) < 0;
        }

        #endregion

        #region Privates/internals

        /// <summary>
        /// Reads messages asynchronously.
        /// </summary>
        /// <param name="reader">
        /// The reader.
        /// </param>
        /// <returns>
        /// The messages.
        /// </returns>
        internal static async Task<ReadOnlyCollection<Message>> ReadMessagesAsync(XmlReader reader)
        {
            var messages = new List<Message>();

            if (await reader.MoveToDocumentElementAsync("response").ConfigureAwait(false))
            {
                await reader.ReadAsync().ConfigureAwait(false);
                reader.EnsureMarkup(XmlNodeType.Element, "messages");
                await reader.ReadAsync().ConfigureAwait(false);

                while (reader.NodeType == XmlNodeType.Element && reader.Name == "msg")
                {
                    var name = reader.GetRequiredAttribute("type");
                    var type = EnumConverter<MessageType>.Instance.Convert(name);
                    var text = await reader.ReadElementContentAsStringAsync().ConfigureAwait(false);

                    messages.Add(new Message(type, text));
                }

                reader.EnsureMarkup(XmlNodeType.EndElement, "messages");
            }

            return new ReadOnlyCollection<Message>(messages);
        }

        #endregion
    }
}


text:
<?php

/**
 * Отображает окно для массового переименования файлов.
 * @global GtkRadioButton $active_type_rename
 * @global GtkWindow      $main_window
 * @global array          $lang
 */
function bulk_rename_window()
{
    global $active_type_rename, $main_window, $lang;

    $active_type_rename = 'upper';

    $wnd = new GtkWindow();
    $wnd->set_title($lang['bulk_rename']['title']);
    $wnd->set_icon(GdkPixbuf::new_from_file(ICON_PROGRAM));
    $wnd->set_position(Gtk::WIN_POS_CENTER);
    $wnd->set_resizable(FALSE);
    $wnd->set_modal(TRUE);
    $wnd->set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
    $wnd->set_transient_for($main_window);
    $wnd->connect_simple('destroy', array('Gtk', 'main_quit'));
    $wnd->set_border_width(10);

    $vbox = new GtkVBox;
    $vbox->set_spacing(2);

    $upper_radio = new GtkRadioButton(NULL, $lang['bulk_rename']['upper']);
    $upper_radio->set_tooltip_text($lang['bulk_rename']['upper_hint']);
    $vbox->pack_start($upper_radio);

    $lower_radio = new GtkRadioButton($upper_radio, $lang['bulk_rename']['lower']);
    $lower_radio->set_tooltip_text($lang['bulk_rename']['lower_hint']);
    $vbox->pack_start($lower_radio);

    $ucfirst_radio = new GtkRadioButton($upper_radio, $lang['bulk_rename']['ucfirst']);
    $ucfirst_radio->set_tooltip_text($lang['bulk_rename']['ucfirst_hint']);
    $vbox->pack_start($ucfirst_radio);

    $order_radio = new GtkRadioButton($upper_radio, $lang['bulk_rename']['order']);
    $order_radio->set_tooltip_text($lang['bulk_rename']['order_hint']);
    $order_name_label = new GtkLabel($lang['bulk_rename']['order_label']);
    $order_name_entry = new GtkEntry($lang['bulk_rename']['order_default_name']);
    $order_hbox = new GtkHBox;
    $order_hbox->set_sensitive(FALSE);
    $order_hbox->pack_start($order_name_label, FALSE, FALSE);
    $order_hbox->pack_start($order_name_entry, TRUE, TRUE);
    $order_vbox = new GtkVBox;
    $order_vbox->pack_start($order_radio);
    $order_vbox->pack_start($order_hbox);
    $vbox->pack_start($order_vbox);

    $replace_radio = new GtkRadioButton($upper_radio, $lang['bulk_rename']['replace']);
    $replace_radio->set_tooltip_text($lang['bulk_rename']['replace_hint']);
    $replace_oldname_label = new GtkLabel($lang['bulk_rename']['replace_match']);
    $replace_oldname_entry = new GtkEntry();
    $replace_newname_label = new GtkLabel($lang['bulk_rename']['replace_replace']);
    $replace_newname_entry = new GtkEntry();
    $replace_table = new GtkTable();
    $replace_table->set_sensitive(FALSE);
    $replace_table->attach($replace_oldname_label, 0, 1, 0, 1, Gtk::SHRINK);
    $replace_table->attach($replace_oldname_entry, 1, 2, 0, 1);
    $replace_table->attach($replace_newname_label, 0, 1, 1, 2, Gtk::SHRINK);
    $replace_table->attach($replace_newname_entry, 1, 2, 1, 2);
    $vbox->pack_start($replace_radio);
    $vbox->pack_start($replace_table);

    $vbox->pack_start(new GtkHSeparator);

    $ext_check = new GtkCheckButton($lang['bulk_rename']['ext']);
    $ext_check->set_active(TRUE);
    $ext_check->set_tooltip_text($lang['bulk_rename']['ext_hint']);

    $hidden_check = new GtkCheckButton($lang['bulk_rename']['hidden']);
    $hidden_check->set_active(TRUE);
    $hidden_check->set_tooltip_text($lang['bulk_rename']['hidden_hint']);

    $check_vbox = new GtkVBox;
    $check_vbox->pack_start($ext_check);
    $check_vbox->pack_start($hidden_check);
    $vbox->pack_start($check_vbox);

    $vbox->pack_start(new GtkHSeparator(), FALSE, FALSE);

    $btn_hbox = new GtkHBox();
    $button_cancel = new GtkButton();
    $btn_hbox->pack_start($label = new GtkLabel($lang['bulk_rename']['cancel']));
    $label->set_use_underline(TRUE);
    $button_cancel->add($btn_hbox);
    $button_ok = new GtkButton();
    $btn_hbox = new GtkHBox();
    $btn_hbox->pack_start($label = new GtkLabel($lang['bulk_rename']['rename']));
    $label->set_use_underline(TRUE);
    $button_ok->add($btn_hbox);
    $hhbox = new GtkHButtonBox();
    $hhbox->set_layout(Gtk::BUTTONBOX_END);
    $hhbox->set_spacing(4);
    $hhbox->add($button_ok);
    $hhbox->add($button_cancel);
    $vbox->pack_start($hhbox, FALSE, FALSE);

    $upper_radio->connect_simple('toggled', 'active_type_rename', 'upper', $order_hbox, $replace_table, $ext_check);
    $lower_radio->connect_simple('toggled', 'active_type_rename', 'lower', $order_hbox, $replace_table, $ext_check);
    $ucfirst_radio->connect_simple('toggled', 'active_type_rename', 'ucfirst', $order_hbox, $replace_table, $ext_check);
    $order_radio->connect_simple('toggled', 'active_type_rename', 'order', $order_hbox, $replace_table, $ext_check);
    $replace_radio->connect_simple('toggled', 'active_type_rename', 'replace', $order_hbox, $replace_table, $ext_check);
    $button_cancel->connect_simple('clicked', 'bulk_rename_window_close', $wnd);
    $button_ok->connect_simple(
        'clicked', 'bulk_rename_action', $wnd,
        $ext_check, $hidden_check, $order_name_entry,
        $replace_oldname_entry, $replace_newname_entry
    );

    $wnd->add($vbox);
    $wnd->show_all();
    Gtk::main();
}

/**
 * Функция заносит в глобальную переменную тип переименования файлов
 * и делает неактивными некоторые элементы интерфейса.
 * @global string        $active_type_rename
 * @param string         $type      Тип переименования
 * @param GtkBox         $order     Контейнер с элементами интерфейса
 * @param GtkTable       $replace   Контейнер с элементами интерфейса
 * @param GtkCheckButton $extension Флажок "Оставить прежние расширения"
 */
function active_type_rename($type, $order, $replace, $extension)
{
    global $active_type_rename;

    if ($type == 'order')
    {
        $order->set_sensitive(TRUE);
        $replace->set_sensitive(FALSE);
        $extension->set_sensitive(TRUE);
    }
    elseif ($type == 'replace')
    {
        $order->set_sensitive(FALSE);
        $replace->set_sensitive(TRUE);
        $extension->set_sensitive(FALSE);
    }
    else
    {
        $order->set_sensitive(FALSE);
        $replace->set_sensitive(FALSE);
        $extension->set_sensitive(TRUE);
    }
    $active_type_rename = $type;
}
//todo: Заменять запрещенные символы в Виндовс.
 /**
  * Массовое переименование всех файлов в текущей директории.
  * @global string $active_type_rename
  * @global array  $start
  * @global string $panel
  * @param GtkWindow      $window    Окно, которое будет закрыто после завершения операции
  * @param GtkCheckButton $extension Переключатель, отвечающий за переименование расширения
  * @param GtkCheckButton $hidden    Переключатель, отвечающий за пропуск скрытых файлов
  * @param GtkEntry       $order     Поле ввода, используется, если тип переименования 'order'
  * @param GtkEntry       $match     Поле ввода строки поиска, используется, если тип переименования 'replace'
  * @param GtkEntry       $replace   Поле ввода строки замены, используется, если тип переименования 'replace'
  */
function bulk_rename_action($window, $extension, $hidden, $order, $match, $replace)
{
    global $active_type_rename, $start, $panel;

    $opendir = opendir($start[$panel]);

    // Используется для переименования файлов 'По порядку'
    $i = 1;

    while (FALSE !== ($file = readdir($opendir)))
    {
        $filename = $start[$panel] . DS . $file;

        // Пропускаем директории '.' и '..'
        if ($file == '.' OR $file == '..' OR !is_file($filename))
        {
            continue;
        }

        // При необходимости пропускаем скрытые файлы
        if ($hidden->get_active() === TRUE)
        {
            if (preg_match("#^\.(.+?)#", $file))
                continue;
        }

        // Верхний регистр
        if ($active_type_rename == 'upper')
        {
            // Оставляем прежние расширения
            if ($extension->get_active() === TRUE)
            {
                $explode = explode('.', $file);
                $count = count($explode);
                // Если у файла нет расширения
                if ($count == 1)
                {
					rename($filename, $start[$panel] . DS . mb_strtoupper($file));
                    continue;
                }
                $new_file = '';
                for ($i = 0; $i < $count; $i++)
                {
					$new_file .= ($i < $count - 1)
						? mb_strtoupper($explode[$i]) . '.'
						: $explode[$i];
                }
                rename($filename, $start[$panel] . DS . $new_file);
            }
            // Переименовываем вместе с расширениями
            else
            {
				rename($filename, $start[$panel] . DS . mb_strtoupper($file));
            }
        }
        // Нижний регистр
        elseif ($active_type_rename == 'lower')
        {
            // Оставляем прежние расширения
            if ($extension->get_active() === TRUE)
            {
                $explode = explode ('.', $file);
                $count = count($explode);
                // Если у файла нет расширения
                if ($count == 1)
                {
					rename($filename, $start[$panel] . DS . mb_strtolower($file));
                    continue;
                }
                $new_file = '';
                for ($i = 0; $i < $count; $i++)
                {
					$new_file .= ($i < $count - 1)
						? mb_strtolower($explode[$i]) . '.'
						: $explode[$i];
                }
                rename($filename, $start[$panel] . DS . $new_file);
            }
            // Переименовываем вместе с расширениями
            else
            {
				rename($filename, $start[$panel] . DS . mb_strtolower($file));
            }
        }
        elseif ($active_type_rename == 'ucfirst')
        {
			rename($filename, $start[$panel] . DS . mb_ucfirst(mb_strtolower($file)));
        }
        // По порядку
        elseif ($active_type_rename == 'order')
        {
            $name = $order->get_text();

            if (empty($name))
            {
                $name = $lang['bulk_rename']['order_default_name'];
            }

            // Оставляем прежние расширения
            if ($extension->get_active() === TRUE)
            {
                $explode = explode('.', $file);
                $count = count($explode);
                // Если у файла нет расширения
				$out = ($count == 1)
					? $name . $i
					: $name . $i . '.' . $explode[$count - 1];

                rename($filename, $start[$panel] . DS . $out);
            }
            // Переименовываем вместе с расширениями
            else
            {
                rename($filename, $start[$panel] . DS . $name . $i);
            }
            $i++;
        }
        // Замена
        elseif ($active_type_rename == 'replace')
        {
            $mtc = $match->get_text();
            $rpl = $replace->get_text();
            rename($filename, $start[$panel] . DS . str_replace($mtc, $rpl, $file));
        }
    }
    closedir($opendir);
    change_dir('none', '', 'all');
    $window->destroy();
}

/**
 * Реализация ф-ции mb_ucfirst - переводит первую букву строки в заглавную.
 * @param  string $string Старое имя файла
 * @return string $string Новое имя файла
 */
if (!function_exists('mb_ucfirst'))
{
    function mb_ucfirst($string)
    {
        $string = mb_strtoupper(mb_substr($string, 0, 1)) . mb_substr($string, 1);
        return $string;
    }
}

/**
 * Закрытие окна.
 * @param GtkWindow $window Закрываемое окно
 */
function bulk_rename_window_close($window)
{
    $window->destroy();
}


text:
namespace Google.Cloud.ContactCenterInsights.V1.Snippets
{
    // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async_flattened_resourceNames]
    using Google.Cloud.ContactCenterInsights.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedContactCenterInsightsClientSnippets
    {
        /// <summary>Snippet for DeletePhraseMatcherAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public async Task DeletePhraseMatcherResourceNamesAsync()
        {
            // Create client
            ContactCenterInsightsClient contactCenterInsightsClient = await ContactCenterInsightsClient.CreateAsync();
            // Initialize request argument(s)
            PhraseMatcherName name = PhraseMatcherName.FromProjectLocationPhraseMatcher("[PROJECT]", "[LOCATION]", "[PHRASE_MATCHER]");
            // Make the request
            await contactCenterInsightsClient.DeletePhraseMatcherAsync(name);
        }
    }
    // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async_flattened_resourceNames]
}


text:
external help file: Microsoft.Azure.Commands.Relay.dll-Help.xml
online version:
schema: 2.0.0
---

# Remove-AzureRmRelayAuthorizationRule

## SYNOPSIS
Removes the authorization rule of a HybridConnection from the given Relay entities (Namespace/WcfRelay/HybridConnection).

## SYNTAX

### NamespaceAuthorizationRuleSet (Default)
```
Remove-AzureRmRelayAuthorizationRule [-ResourceGroupName] <String> [-Namespace] <String> [-Name] <String> [-WhatIf]
 [-Confirm]
```

### WcfRelayAuthorizationRuleSet
```
Remove-AzureRmRelayAuthorizationRule [-ResourceGroupName] <String> [[-Namespace] <String>] [-WcfRelay] <String>
 [-Name] <String> [-WhatIf] [-Confirm]
```

### HybridConnectionAuthorizationRuleSet
```
Remove-AzureRmRelayAuthorizationRule [-ResourceGroupName] <String> [[-Namespace] <String>]
 [-HybridConnection] <String> [-Name] <String> [-WhatIf] [-Confirm]
```

## DESCRIPTION
The **Remove-AzureRmRelayAuthorizationRule** cmdlet removes the authorization rule of the given Relay entities (Namespace/WcfRelay/HybridConnection).

## EXAMPLES

### Example 1
```
PS C:\> Remove-AzureRmRelayAuthorizationRule -ResourceGroupName Default-ServiceBus-WestUS -Namespace TestNameSpace-Relay1 -Name AuthoRule1
```

Removes the authorization rule `AuthoRule1` of the namespace `TestNameSpace-Relay1`.

### Example 2
```
PS C:\> Remove-AzureRmRelayAuthorizationRule -ResourceGroupName Default-ServiceBus-WestUS -Namespace TestNameSpace-Relay1 -WcfRelay TestWcfRelay -Name AuthoRule1
```

Removes the authorization rule `AuthoRule1` of the WcfRelay `TestWcfRelay` from the namespace `TestNameSpace-Relay1`.

### Example 3
```
PS C:\> Remove-AzureRmRelayAuthorizationRule -ResourceGroupName Default-ServiceBus-WestUS -Namespace TestNameSpace-Relay1 -HybridConnection TestHybridConnection -Name AuthoRule1
```

Removes the authorization rule `AuthoRule1` of the HybridConnection `TestHybridConnection` from the namespace `TestNameSpace-Relay1`.

## PARAMETERS

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -HybridConnection
HybridConnection Name.

```yaml
Type: String
Parameter Sets: HybridConnectionAuthorizationRuleSet
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Name
AuthorizationRule Name.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Namespace
Namespace Name.

```yaml
Type: String
Parameter Sets: NamespaceAuthorizationRuleSet
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

```yaml
Type: String
Parameter Sets: WcfRelayAuthorizationRuleSet, HybridConnectionAuthorizationRuleSet
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ResourceGroupName
Resource Group Name.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -WcfRelay
WcfRelay Name.

```yaml
Type: String
Parameter Sets: WcfRelayAuthorizationRuleSet
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## INPUTS

### System.String

## OUTPUTS

### System.Boolean

## NOTES

## RELATED LINKS


text:
package com.github.steveash.maxclique;

import java.util.Iterator;
import java.util.Set;

import com.google.common.collect.ImmutableSet;

/**
 * Represents one weighted clique; weights are all positive
 * @author Steve Ash
 */
public class Clique<T> implements Iterable<T> {
    private static final Clique<Object> instance = new Clique<>(ImmutableSet.<Object>of(), 0);

    public static <T> Clique<T> nullClique() {
        return (Clique<T>) instance;
    }

    private final ImmutableSet<T> members;
    private final double totalWeight;

    public Clique(ImmutableSet<T> members, double totalWeight) {
        this.members = members;
        this.totalWeight = totalWeight;
    }

    @Override
    public Iterator<T> iterator() {
        return members.iterator();
    }

    public Set<T> members() { return members; }

    public double totalWeight() { return totalWeight; }

    public int size() {
        return members.size();
    }

    public boolean isEmpty() {
        return members.isEmpty();
    }

    public boolean isSingleMember() {
        return members.size() == 1;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Clique clique = (Clique) o;

        if (!members.equals(clique.members)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return members.hashCode();
    }

    @Override
    public String toString() {
        return "Clique{" +
                "members=" + members +
                ", totalWeight=" + totalWeight +
                '}';
    }
}


text:
package Examples;

//////////////////////////////////////////////////////////////////////////
// Copyright (c) 2001-2022 Aspose Pty Ltd. All Rights Reserved.
//
// This file is part of Aspose.Words. The source code in this file
// is only intended as a supplement to the documentation, and is provided
// "as is", without warranty of any kind, either expressed or implied.
//////////////////////////////////////////////////////////////////////////

import com.aspose.words.CompatibilityOptions;
import com.aspose.words.Document;
import com.aspose.words.MsWordVersion;
import org.testng.Assert;
import org.testng.annotations.Test;

@Test
public class ExCompatibilityOptions extends ApiExampleBase
{
    @Test
    public void tables() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2002);

        Assert.assertEquals(false, compatibilityOptions.getAdjustLineHeightInTable());
        Assert.assertEquals(false, compatibilityOptions.getAlignTablesRowByRow());
        Assert.assertEquals(true, compatibilityOptions.getAllowSpaceOfSameStyleInTable());
        Assert.assertEquals(true, compatibilityOptions.getDoNotAutofitConstrainedTables());
        Assert.assertEquals(true, compatibilityOptions.getDoNotBreakConstrainedForcedTable());
        Assert.assertEquals(false, compatibilityOptions.getDoNotBreakWrappedTables());
        Assert.assertEquals(false, compatibilityOptions.getDoNotSnapToGridInCell());
        Assert.assertEquals(false, compatibilityOptions.getDoNotUseHTMLParagraphAutoSpacing());
        Assert.assertEquals(true, compatibilityOptions.getDoNotVertAlignCellWithSp());
        Assert.assertEquals(false, compatibilityOptions.getForgetLastTabAlignment());
        Assert.assertEquals(true, compatibilityOptions.getGrowAutofit());
        Assert.assertEquals(false, compatibilityOptions.getLayoutRawTableWidth());
        Assert.assertEquals(false, compatibilityOptions.getLayoutTableRowsApart());
        Assert.assertEquals(false, compatibilityOptions.getNoColumnBalance());
        Assert.assertEquals(false, compatibilityOptions.getOverrideTableStyleFontSizeAndJustification());
        Assert.assertEquals(false, compatibilityOptions.getUseSingleBorderforContiguousCells());
        Assert.assertEquals(true, compatibilityOptions.getUseWord2002TableStyleRules());
        Assert.assertEquals(false, compatibilityOptions.getUseWord2010TableStyleRules());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.Tables.docx");
    }

    @Test
    public void breaks() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2000);

        Assert.assertEquals(false, compatibilityOptions.getApplyBreakingRules());
        Assert.assertEquals(true, compatibilityOptions.getDoNotUseEastAsianBreakRules());
        Assert.assertEquals(false, compatibilityOptions.getShowBreaksInFrames());
        Assert.assertEquals(true, compatibilityOptions.getSplitPgBreakAndParaMark());
        Assert.assertEquals(true, compatibilityOptions.getUseAltKinsokuLineBreakRules());
        Assert.assertEquals(false, compatibilityOptions.getUseWord97LineBreakRules());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.Breaks.docx");
    }

    @Test
    public void spacing() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2000);

        Assert.assertEquals(false, compatibilityOptions.getAutoSpaceLikeWord95());
        Assert.assertEquals(true, compatibilityOptions.getDisplayHangulFixedWidth());
        Assert.assertEquals(false, compatibilityOptions.getNoExtraLineSpacing());
        Assert.assertEquals(false, compatibilityOptions.getNoLeading());
        Assert.assertEquals(false, compatibilityOptions.getNoSpaceRaiseLower());
        Assert.assertEquals(false, compatibilityOptions.getSpaceForUL());
        Assert.assertEquals(false, compatibilityOptions.getSpacingInWholePoints());
        Assert.assertEquals(false, compatibilityOptions.getSuppressBottomSpacing());
        Assert.assertEquals(false, compatibilityOptions.getSuppressSpBfAfterPgBrk());
        Assert.assertEquals(false, compatibilityOptions.getSuppressSpacingAtTopOfPage());
        Assert.assertEquals(false, compatibilityOptions.getSuppressTopSpacing());
        Assert.assertEquals(false, compatibilityOptions.getUlTrailSpace());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.Spacing.docx");
    }

    @Test
    public void wordPerfect() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2000);

        Assert.assertEquals(false, compatibilityOptions.getSuppressTopSpacingWP());
        Assert.assertEquals(false, compatibilityOptions.getTruncateFontHeightsLikeWP6());
        Assert.assertEquals(false, compatibilityOptions.getWPJustification());
        Assert.assertEquals(false, compatibilityOptions.getWPSpaceWidth());
        Assert.assertEquals(false, compatibilityOptions.getWrapTrailSpaces());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.WordPerfect.docx");
    }

    @Test
    public void alignment() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2000);

        Assert.assertEquals(true, compatibilityOptions.getCachedColBalance());
        Assert.assertEquals(true, compatibilityOptions.getDoNotVertAlignInTxbx());
        Assert.assertEquals(true, compatibilityOptions.getDoNotWrapTextWithPunct());
        Assert.assertEquals(false, compatibilityOptions.getNoTabHangInd());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.Alignment.docx");
    }

    @Test
    public void legacy() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2000);

        Assert.assertEquals(false, compatibilityOptions.getFootnoteLayoutLikeWW8());
        Assert.assertEquals(false, compatibilityOptions.getLineWrapLikeWord6());
        Assert.assertEquals(false, compatibilityOptions.getMWSmallCaps());
        Assert.assertEquals(false, compatibilityOptions.getShapeLayoutLikeWW8());
        Assert.assertEquals(false, compatibilityOptions.getUICompat97To2003());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.Legacy.docx");
    }

    @Test
    public void list() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2000);

        Assert.assertEquals(true, compatibilityOptions.getUnderlineTabInNumList());
        Assert.assertEquals(true, compatibilityOptions.getUseNormalStyleForList());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.List.docx");
    }

    @Test
    public void misc() throws Exception {
        Document doc = new Document();

        CompatibilityOptions compatibilityOptions = doc.getCompatibilityOptions();
        compatibilityOptions.optimizeFor(MsWordVersion.WORD_2000);

        Assert.assertEquals(false, compatibilityOptions.getBalanceSingleByteDoubleByteWidth());
        Assert.assertEquals(false, compatibilityOptions.getConvMailMergeEsc());
        Assert.assertEquals(false, compatibilityOptions.getDoNotExpandShiftReturn());
        Assert.assertEquals(false, compatibilityOptions.getDoNotLeaveBackslashAlone());
        Assert.assertEquals(false, compatibilityOptions.getDoNotSuppressParagraphBorders());
        Assert.assertEquals(true, compatibilityOptions.getDoNotUseIndentAsNumberingTabStop());
        Assert.assertEquals(false, compatibilityOptions.getPrintBodyTextBeforeHeader());
        Assert.assertEquals(false, compatibilityOptions.getPrintColBlack());
        Assert.assertEquals(true, compatibilityOptions.getSelectFldWithFirstOrLastChar());
        Assert.assertEquals(false, compatibilityOptions.getSubFontBySize());
        Assert.assertEquals(false, compatibilityOptions.getSwapBordersFacingPgs());
        Assert.assertEquals(false, compatibilityOptions.getTransparentMetafiles());
        Assert.assertEquals(true, compatibilityOptions.getUseAnsiKerningPairs());
        Assert.assertEquals(false, compatibilityOptions.getUseFELayout());
        Assert.assertEquals(false, compatibilityOptions.getUsePrinterMetrics());

        // In the output document, these settings can be accessed in Microsoft Word via
        // File -> Options -> Advanced -> Compatibility options for...
        doc.save(getArtifactsDir() + "CompatibilityOptions.Misc.docx");
    }
}


text:
/*
 * resourceful.js: Top-level plugin exposing resourceful to flatiron app
 *
 * (C) 2011, Nodejitsu Inc.
 * MIT LICENSE
 *
 */
var path = require('path'),
    fs = require('fs'),
    flatiron = require('../../flatiron'),
    common = flatiron.common,
    resourceful,
    existsSync = fs.existsSync || path.existsSync;

try {
  //
  // Attempt to require resourceful.
  //
  resourceful = require('resourceful');
}
catch (ex) {
  //
  // Do nothing since this is a progressive enhancement
  //
  console.warn('flatiron.plugins.resourceful requires the `resourceful` module from npm');
  console.warn('install using `npm install resourceful`.');
  console.trace();
  process.exit(1);
}

exports.name = 'resourceful';

exports.attach = function (options) {
  var app = this;
  options = options || {};

  //
  // Accept string `options`.
  //
  if (typeof options === 'string') {
    options = { root: options };
  }

  //
  // Create `app.resources` if it does not exist already.
  //
  app.resources = app.resources || {};

  //
  // Expose a couple of resourceful helpers
  //
  app.define = resourceful.define;

  //
  // Lazy-load the resources directory based on a few intelligent defaults:
  //
  // * `options.dir`: Explicit path to resources directory
  // * `options.root`: Relative root to the resources directory ('/app/resources')
  // * `app.root`: Relative root to the resources directory ('/app/resources')
  //
  if (options.dir || options.root || app.root) {
    app._resourceDir = options.dir
      || path.join(options.root || app.root, 'app', 'resources');

    try {
      existsSync(app._resourceDir)
    }
    catch (err) {
      //
      // If an invalid path has been provided, don't attempt to load it
      //
      console.error('invalid resource path: ' + app._resourceDir);
      return;
    }

    var files = common.tryReaddirSync(app._resourceDir);

    if (files.length === 0) {
      //
      // If no resources were found in the path, warn, but don't error
      //
      console.warn('no resources found at: ' + app._resourceDir);
    }

    files.forEach(function (file) {
      file = file.replace('.js', '');
      app.resources.__defineGetter__(common.capitalize(file), function () {
        delete app.resources[common.capitalize(file)];
        return app.resources[common.capitalize(file)] = require(
          path.resolve(app._resourceDir, file)
        );
      });
    });

  }
  //
  // TODO: Determine how best to integrate `restful` here.
  //
};

exports.init = function (done) {
  var app = this,
      options;

  //
  // Attempt to merge defaults passed to `app.use(flatiron.plugins.resourceful)`
  // with any additional configuration that may have been loaded.
  //
  options = common.mixin(
    {},
    app.options['resourceful'],
    app.config.get('resourceful') || {}
  );

  app.config.set('resourceful', options);

  //
  // Remark: Should we accept the autoMigrate option?
  //
  if (options.engine) {
    resourceful.use(options.engine, options);
  }

  done();
};


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.motechproject.mobile.imp.util;

import org.motechproject.mobile.core.manager.CoreManager;
import org.motechproject.mobile.core.model.IncomingMessage;
import org.motechproject.mobile.core.model.IncomingMessageFormParameter;
import org.motechproject.mobile.core.model.IncomingMessageFormParameterImpl;
import org.motechproject.mobile.core.model.IncomingMessageImpl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.*;
import static org.easymock.EasyMock.*;

/**
 * Test for IncomingMessageParserImpl class
 *
 *  Date : Dec 5, 2009
 * @author Kofi A. Asamoah (yoofi@dreamoval.com)
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:META-INF/imp-test-config.xml"})
public class IncomingMessageParserImplTest {
    CoreManager mockCore;

    @Autowired
    IncomingMessageParserImpl imParser;

    public IncomingMessageParserImplTest() {
    }

    @Before
    public void setup(){
        mockCore = createMock(CoreManager.class);
        imParser.setCoreManager(mockCore);
    }

    /**
     * Test of parseRequest method, of class IncomingMessageParserImpl.
     */
    @Test
    public void testParseRequest() {
        System.out.println("parseRequest");
        String message = "Type=GENERAL\naction=test\nmessage=Test,, Tester";

        expect(
                mockCore.createIncomingMessage()
                ).andReturn(new IncomingMessageImpl());

        replay(mockCore);
        IncomingMessage result = imParser.parseRequest(message);
        verify(mockCore);

        assertNotNull(result);
        assertEquals(message, result.getContent());
    }

    /**
     * Test of getComand method, of class IncomingMessageParserImpl.
     */
    @Test
    public void testGetComand() {
        System.out.println("getComand");
        String message = "Type=GENERAL\naction=test\nmessage=Test,, Tester";

        String expResult = "type";
        String result = imParser.getCommand(message);
        assertEquals(expResult, result);

        message = "someting=test Type";
        expResult = "";
        result = imParser.getCommand(message);
        assertEquals(expResult, result);
    }

    /**
     * Test of getFormCode method, of class IncomingMessageParserImpl.
     */
    @Test
    public void testGetFormCode() {
        System.out.println("getFormCode");
        String message = "Type=GENERAL\naction=test\nmessage=Test,, Tester";
        String expResult = "GENERAL";
        String result = imParser.getFormCode(message);
        assertEquals(expResult, result);
    }

    /**
     * Test of getParams method, of class IncomingMessageParserImpl.
     */
    @Test
    public void testGetParams() {
        System.out.println("getParams");
        String message = "Type=GENERAL\naction=test\nmessage=Test, Dream Tester\ndob = 01.01.01\ndue-date=right. now\ntest_format=all";

        List<IncomingMessageFormParameter> expResult = new ArrayList<IncomingMessageFormParameter>();

        IncomingMessageFormParameter param1 = new IncomingMessageFormParameterImpl();
        param1.setName("action");
        param1.setValue("test");
        expResult.add(param1);

        IncomingMessageFormParameter param2 = new IncomingMessageFormParameterImpl();
        param1.setName("message");
        param1.setValue("Test, Dream Tester");
        expResult.add(param2);

        IncomingMessageFormParameter param3 = new IncomingMessageFormParameterImpl();
        param1.setName("dob");
        param1.setValue("01.01.01");
        expResult.add(param3);

        IncomingMessageFormParameter param4 = new IncomingMessageFormParameterImpl();
        param1.setName("due-date");
        param1.setValue("right. now");
        expResult.add(param4);

        IncomingMessageFormParameter param5 = new IncomingMessageFormParameterImpl();
        param1.setName("test_format");
        param1.setValue("all");
        expResult.add(param5);

        expect(
                mockCore.createIncomingMessageFormParameter()
                ).andReturn(new IncomingMessageFormParameterImpl()).times(expResult.size());

        replay(mockCore);
        Map<String,IncomingMessageFormParameter> result = imParser.getParams(message);
        verify(mockCore);

        assertNotNull(result);
        assertEquals(result.size(), expResult.size());
    }

}


text:
A collection of interfaces and base classes for DomainEvents, Aggregates and Snapshotting (the write part of CQRS). Modeled after DPC14

[![Gitter chat](https://badges.gitter.im/bashilbers/domain.png)](https://gitter.im/bashilbers/domain)
[![PHP ~5.5](https://img.shields.io/badge/php-%3E%3D5.5-8892BF.svg)](https://secure.php.net)
[![Latest Stable Version](https://poser.pugx.org/bashilbers/domain/v/stable)](https://packagist.org/packages/bashilbers/domain)
[![Dependency Status](https://www.versioneye.com/user/projects/55ad59a16437390017000025/badge.svg?style=flat)](https://www.versioneye.com/user/projects/55ad59a16437390017000025)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Travis build status](https://travis-ci.org/bashilbers/domain.svg)](https://travis-ci.org/bashilbers/domain)
[![Scrutinizer build Status](https://scrutinizer-ci.com/g/bashilbers/domain/badges/build.png?b=master)](https://scrutinizer-ci.com/g/bashilbers/domain/?branch=master)
[![Quality Score](https://scrutinizer-ci.com/g/bashilbers/domain/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/bashilbers/domain/?branch=master)

## What is this?

Nothing. Move along. At the Dutch PHP Conference in 2014 I had been introduced to Event Sourcing and knew directly this was something
I wanted to be involved with. This repo is not intended for production usage. It is my personal playground.

## Other DDD/ES/CQRS inspirational projects

* [EventCentric.Core](https://github.com/event-centric/EventCentric.Core) - Event Sourcing and CQRS in PHP
* [LiteCQRS](https://github.com/beberlei/litecqrs-php) - Small convention based CQRS library for PHP
* [predaddy](https://github.com/szjani/predaddy) - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
* [ProophEventSourcing](https://github.com/prooph/event-sourcing) - Provides basic functionality for event-sourced aggregates
* [ProophEventStore](https://github.com/prooph/event-store) - PHP 5.4+ EventStore Implementation
* [ProophServiceBus](https://github.com/prooph/service-bus) - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
* [Malocher EventStore](https://github.com/malocher/event-store) - Event Sourcing Library for PHP
* [Malocher cqrs-esb](https://github.com/malocher/cqrs-esb) - CQRS + Service Bus for PHP
* [Goodby EventSourcing](https://github.com/goodby/event-sourcing) - EventSourcing
* [Governor](https://github.com/davidkalosi/GovernorFramework) - A complete PHP CQRS framework
* [Buttercup.Protects](https://github.com/buttercup-php/protects) - Aggregate business rules protection library
* [Broadway](https://github.com/qandidate-labs/broadway) - Infrastructure and testing helpers for creating CQRS and event sourced applications.
* [Chief](https://github.com/adamnicholson/chief) - Command bus package for PHP
* [Tactician](https://github.com/thephpleague/tactician) - A small, pluggable command bus. Still in active development
* [Simplebus](https://github.com/SimpleBus) - Generic busses for either commands or events

## Food for thoughts
* [Mathias Verraes's Practical Event Sourcing presentation](http://joind.in/talk/view/10879)
* [Greg Young's CQRS documents](https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf)

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## License

All source code is licensed under the MIT License (MIT). Please see the [License File](LICENSE) for more information.


text:
"""Collection."""

# --- import --------------------------------------------------------------------------------------

import numpy as np

from .. import data as wt_data
from .. import exceptions as wt_exceptions
from .._group import Group

# --- define --------------------------------------------------------------------------------------

__all__ = ["Collection"]

# --- classes -------------------------------------------------------------------------------------

class Collection(Group):
    """Nestable Collection of Data objects."""

    class_name = "Collection"

    def __iter__(self):
        self.__n = 0
        return self

    def __len__(self):
        return len(self.item_names)

    def __next__(self):
        if self.__n < len(self):
            out = self.item_names[self.__n]
            self.__n += 1
        else:
            raise StopIteration
        return out

    def __repr__(self):
        return "<WrightTools.Collection '{0}' {1} at {2}>".format(
            self.natural_name, self.item_names, "::".join([self.filepath, self.name])
        )

    def __dir__(self) -> list:
        default = object.__dir__(self)
        return default + list(self._ipython_key_completions_())

    def _ipython_key_completions_(self) -> list:
        return list(self.item_names)

    def __getitem__(self, key):
        if isinstance(key, int):
            key = self.item_names[key]
        if key == "":
            return None
        return super().__getitem__(key)

    def __setitem__(self, key, value):
        raise NotImplementedError

    @property
    def _leaf(self):
        return self.natural_name

    def _print_branch(self, prefix, depth, verbose):
        for i, name in enumerate(self.item_names):
            item = self[name]
            if i + 1 == len(self.item_names):
                s = prefix + "└── {0}: {1}".format(i, item._leaf)
                p = prefix + "    "
            else:
                s = prefix + "├── {0}: {1}".format(i, item._leaf)
                p = prefix + "│   "
            print(s)
            if depth > 1 and hasattr(item, "_print_branch"):
                item._print_branch(p, depth=depth - 1, verbose=verbose)

    def create_collection(self, name="collection", position=None, **kwargs):
        """Create a new child colleciton.

        Parameters
        ----------
        name : string
            Unique identifier.
        position : integer (optional)
            Location to insert. Default is None (append).
        kwargs
            Additional arguments to child collection instantiation.

        Returns
        -------
        WrightTools Collection
            New child.
        """
        if name in self.item_names:
            wt_exceptions.ObjectExistsWarning.warn(name)
            return self[name]
        collection = Collection(
            filepath=self.filepath, parent=self.name, name=name, edit_local=True, **kwargs
        )
        if position is not None:
            self.attrs["item_names"] = np.insert(
                self.attrs["item_names"][:-1], position, collection.natural_name.encode()
            )
        setattr(self, name, collection)
        return collection

    def convert(self, units, convert_variables=False, verbose=True):
        """Convert units of a collection.
        Parameters
        ----------
        units: string
            Units to convert to.
        """

        for name in self.item_names:
            item = self[name]
            item.convert(units, convert_variables=convert_variables, verbose=verbose)

    def create_data(self, name="data", position=None, **kwargs):
        """Create a new child data.

        Parameters
        ----------
        name : string
            Unique identifier.
        position : integer (optional)
            Location to insert. Default is None (append).
        kwargs
            Additional arguments to child data instantiation.

        Returns
        -------
        WrightTools Data
            New child.
        """
        if name in self.item_names:
            wt_exceptions.ObjectExistsWarning.warn(name)
            return self[name]

        if name == "":
            data = None
            natural_name = "".encode()
        else:
            data = wt_data.Data(
                filepath=self.filepath, parent=self.name, name=name, edit_local=True, **kwargs
            )
            natural_name = data.natural_name.encode()
        if position is not None:
            self.attrs["item_names"] = np.insert(
                self.attrs["item_names"][:-1], position, natural_name
            )
        setattr(self, name, data)
        return data

    def index(self):
        """Index."""
        raise NotImplementedError

    def print_tree(self, depth=9, *, verbose=False):
        """Print a ascii-formatted tree representation of the collection contents.

        Parameters
        ----------
        depth : integer (optional)
            Number of layers to include in the tree. Default is 9.
        verbose : boolean (optional)
            Toggle inclusion of extra information. Default is True.
        """
        print("{0} ({1})".format(self.natural_name, self.filepath))
        self._print_branch("", depth=depth, verbose=verbose)

    def flush(self):
        """Ensure contents are written to file."""
        for name in self.item_names:
            item = self[name]
            item.flush()
        self.file.flush()