text:
.class public Lcom/tencent/qrom/internal/view/menu/ActionMenu;
.super Ljava/lang/Object;
.source "ActionMenu.java"

# interfaces
.implements Landroid/view/Menu;

# instance fields
.field private mContext:Landroid/content/Context;

.field private mIsQwerty:Z

.field private mItems:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;",
            ">;"
        }
    .end annotation
.end field

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

    .prologue
    .line 47
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 48
    iput-object p1, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mContext:Landroid/content/Context;

    .line 49
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 50
    return-void
.end method

.method private findItemIndex(I)I
    .locals 4
    .param p1, "id"    # I

    .prologue
    .line 134
    iget-object v2, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 135
    .local v2, "items":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;>;"
    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v1

    .line 136
    .local v1, "itemCount":I
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-ge v0, v1, :cond_1

    .line 137
    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    invoke-virtual {v3}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->getItemId()I

    move-result v3

    if-ne v3, p1, :cond_0

    .line 142
    .end local v0    # "i":I
    :goto_1
    return v0

    .line 136
    .restart local v0    # "i":I
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 142
    :cond_1
    const/4 v0, -0x1

    goto :goto_1
.end method

.method private findItemWithShortcut(ILandroid/view/KeyEvent;)Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    .locals 6
    .param p1, "keyCode"    # I
    .param p2, "event"    # Landroid/view/KeyEvent;

    .prologue
    .line 168
    iget-boolean v4, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mIsQwerty:Z

    .line 169
    .local v4, "qwerty":Z
    iget-object v3, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 170
    .local v3, "items":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;>;"
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v2

    .line 172
    .local v2, "itemCount":I
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-ge v0, v2, :cond_2

    .line 173
    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    .line 174
    .local v1, "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    if-eqz v4, :cond_0

    invoke-virtual {v1}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->getAlphabeticShortcut()C

    move-result v5

    .line 176
    .local v5, "shortcut":C
    :goto_1
    if-ne p1, v5, :cond_1

    .line 180
    .end local v1    # "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    .end local v5    # "shortcut":C
    :goto_2
    return-object v1

    .line 174
    .restart local v1    # "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    :cond_0
    invoke-virtual {v1}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->getNumericShortcut()C

    move-result v5

    goto :goto_1

    .line 172
    .restart local v5    # "shortcut":C
    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 180
    .end local v1    # "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    .end local v5    # "shortcut":C
    :cond_2
    const/4 v1, 0x0

    goto :goto_2
.end method

# virtual methods
.method public add(I)Landroid/view/MenuItem;
    .locals 1
    .param p1, "titleRes"    # I

    .prologue
    const/4 v0, 0x0

    .line 61
    invoke-virtual {p0, v0, v0, v0, p1}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->add(IIII)Landroid/view/MenuItem;

    move-result-object v0

    return-object v0
.end method

.method public add(IIII)Landroid/view/MenuItem;
    .locals 1
    .param p1, "groupId"    # I
    .param p2, "itemId"    # I
    .param p3, "order"    # I
    .param p4, "titleRes"    # I

    .prologue
    .line 65
    iget-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0, p4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, p1, p2, p3, v0}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v0

    return-object v0
.end method

.method public add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;
    .locals 7
    .param p1, "groupId"    # I
    .param p2, "itemId"    # I
    .param p3, "order"    # I
    .param p4, "title"    # Ljava/lang/CharSequence;

    .prologue
    .line 69
    new-instance v0, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    invoke-virtual {p0}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->getContext()Landroid/content/Context;

    move-result-object v1

    const/4 v4, 0x0

    move v2, p1

    move v3, p2

    move v5, p3

    move-object v6, p4

    invoke-direct/range {v0 .. v6}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;-><init>(Landroid/content/Context;IIIILjava/lang/CharSequence;)V

    .line 71
    .local v0, "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    iget-object v1, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    invoke-virtual {v1, p3, v0}, Ljava/util/ArrayList;->add(ILjava/lang/Object;)V

    .line 72
    return-object v0
.end method

.method public add(Ljava/lang/CharSequence;)Landroid/view/MenuItem;
    .locals 1
    .param p1, "title"    # Ljava/lang/CharSequence;

    .prologue
    const/4 v0, 0x0

    .line 57
    invoke-virtual {p0, v0, v0, v0, p1}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v0

    return-object v0
.end method

.method public addIntentOptions(IIILandroid/content/ComponentName;[Landroid/content/Intent;Landroid/content/Intent;I[Landroid/view/MenuItem;)I
    .locals 13
    .param p1, "groupId"    # I
    .param p2, "itemId"    # I
    .param p3, "order"    # I
    .param p4, "caller"    # Landroid/content/ComponentName;
    .param p5, "specifics"    # [Landroid/content/Intent;
    .param p6, "intent"    # Landroid/content/Intent;
    .param p7, "flags"    # I
    .param p8, "outSpecificItems"    # [Landroid/view/MenuItem;

    .prologue
    .line 78
    iget-object v10, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mContext:Landroid/content/Context;

    invoke-virtual {v10}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v7

    .line 79
    .local v7, "pm":Landroid/content/pm/PackageManager;
    const/4 v10, 0x0

    move-object/from16 v0, p4

    move-object/from16 v1, p5

    move-object/from16 v2, p6

    invoke-virtual {v7, v0, v1, v2, v10}, Landroid/content/pm/PackageManager;->queryIntentActivityOptions(Landroid/content/ComponentName;[Landroid/content/Intent;Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v6

    .line 81
    .local v6, "lri":Ljava/util/List;, "Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
    if-eqz v6, :cond_2

    invoke-interface {v6}, Ljava/util/List;->size()I

    move-result v3

    .line 83
    .local v3, "N":I
    :goto_0
    and-int/lit8 v10, p7, 0x1

    if-nez v10, :cond_0

    .line 84
    invoke-virtual {p0, p1}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->removeGroup(I)V

    .line 87
    :cond_0
    const/4 v4, 0x0

    .local v4, "i":I
    :goto_1
    if-ge v4, v3, :cond_4

    .line 88
    invoke-interface {v6, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Landroid/content/pm/ResolveInfo;

    .line 89
    .local v8, "ri":Landroid/content/pm/ResolveInfo;
    new-instance v9, Landroid/content/Intent;

    iget v10, v8, Landroid/content/pm/ResolveInfo;->specificIndex:I

    if-gez v10, :cond_3

    move-object/from16 v10, p6

    :goto_2
    invoke-direct {v9, v10}, Landroid/content/Intent;-><init>(Landroid/content/Intent;)V

    .line 91
    .local v9, "rintent":Landroid/content/Intent;
    new-instance v10, Landroid/content/ComponentName;

    iget-object v11, v8, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    iget-object v11, v11, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget-object v11, v11, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    iget-object v12, v8, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    iget-object v12, v12, Landroid/content/pm/ActivityInfo;->name:Ljava/lang/String;

    invoke-direct {v10, v11, v12}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v9, v10}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    .line 94
    invoke-virtual {v8, v7}, Landroid/content/pm/ResolveInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v10

    move/from16 v0, p3

    invoke-virtual {p0, p1, p2, v0, v10}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->add(IIILjava/lang/CharSequence;)Landroid/view/MenuItem;

    move-result-object v10

    invoke-virtual {v8, v7}, Landroid/content/pm/ResolveInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v11

    invoke-interface {v10, v11}, Landroid/view/MenuItem;->setIcon(Landroid/graphics/drawable/Drawable;)Landroid/view/MenuItem;

    move-result-object v10

    invoke-interface {v10, v9}, Landroid/view/MenuItem;->setIntent(Landroid/content/Intent;)Landroid/view/MenuItem;

    move-result-object v5

    .line 97
    .local v5, "item":Landroid/view/MenuItem;
    if-eqz p8, :cond_1

    iget v10, v8, Landroid/content/pm/ResolveInfo;->specificIndex:I

    if-ltz v10, :cond_1

    .line 98
    iget v10, v8, Landroid/content/pm/ResolveInfo;->specificIndex:I

    aput-object v5, p8, v10

    .line 87
    :cond_1
    add-int/lit8 v4, v4, 0x1

    goto :goto_1

    .line 81
    .end local v3    # "N":I
    .end local v4    # "i":I
    .end local v5    # "item":Landroid/view/MenuItem;
    .end local v8    # "ri":Landroid/content/pm/ResolveInfo;
    .end local v9    # "rintent":Landroid/content/Intent;
    :cond_2
    const/4 v3, 0x0

    goto :goto_0

    .line 89
    .restart local v3    # "N":I
    .restart local v4    # "i":I
    .restart local v8    # "ri":Landroid/content/pm/ResolveInfo;
    :cond_3
    iget v10, v8, Landroid/content/pm/ResolveInfo;->specificIndex:I

    aget-object v10, p5, v10

    goto :goto_2

    .line 102
    .end local v8    # "ri":Landroid/content/pm/ResolveInfo;
    :cond_4
    return v3
.end method

.method public addSubMenu(I)Landroid/view/SubMenu;
    .locals 1
    .param p1, "titleRes"    # I

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

    return-object v0
.end method

.method public addSubMenu(IIII)Landroid/view/SubMenu;
    .locals 1
    .param p1, "groupId"    # I
    .param p2, "itemId"    # I
    .param p3, "order"    # I
    .param p4, "titleRes"    # I

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

    return-object v0
.end method

.method public addSubMenu(IIILjava/lang/CharSequence;)Landroid/view/SubMenu;
    .locals 1
    .param p1, "groupId"    # I
    .param p2, "itemId"    # I
    .param p3, "order"    # I
    .param p4, "title"    # Ljava/lang/CharSequence;

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

    return-object v0
.end method

.method public addSubMenu(Ljava/lang/CharSequence;)Landroid/view/SubMenu;
    .locals 1
    .param p1, "title"    # Ljava/lang/CharSequence;

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

    return-object v0
.end method

.method public clear()V
    .locals 1

    .prologue
    .line 127
    iget-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 128
    return-void
.end method

.method public close()V
    .locals 0

    .prologue
    .line 131
    return-void
.end method

.method public findItem(I)Landroid/view/MenuItem;
    .locals 2
    .param p1, "id"    # I

    .prologue
    .line 146
    iget-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    invoke-direct {p0, p1}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->findItemIndex(I)I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/MenuItem;

    return-object v0
.end method

.method public getContext()Landroid/content/Context;
    .locals 1

    .prologue
    .line 53
    iget-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method public getItem(I)Landroid/view/MenuItem;
    .locals 1
    .param p1, "index"    # I

    .prologue
    .line 150
    iget-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/MenuItem;

    return-object v0
.end method

.method public hasVisibleItems()Z
    .locals 4

    .prologue
    .line 154
    iget-object v2, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 155
    .local v2, "items":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;>;"
    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v1

    .line 157
    .local v1, "itemCount":I
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-ge v0, v1, :cond_1

    .line 158
    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    invoke-virtual {v3}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->isVisible()Z

    move-result v3

    if-eqz v3, :cond_0

    .line 159
    const/4 v3, 0x1

    .line 163
    :goto_1
    return v3

    .line 157
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 163
    :cond_1
    const/4 v3, 0x0

    goto :goto_1
.end method

.method public isShortcutKey(ILandroid/view/KeyEvent;)Z
    .locals 1
    .param p1, "keyCode"    # I
    .param p2, "event"    # Landroid/view/KeyEvent;

    .prologue
    .line 184
    invoke-direct {p0, p1, p2}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->findItemWithShortcut(ILandroid/view/KeyEvent;)Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    move-result-object v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public performIdentifierAction(II)Z
    .locals 2
    .param p1, "id"    # I
    .param p2, "flags"    # I

    .prologue
    .line 188
    invoke-direct {p0, p1}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->findItemIndex(I)I

    move-result v0

    .line 189
    .local v0, "index":I
    if-gez v0, :cond_0

    .line 190
    const/4 v1, 0x0

    .line 193
    :goto_0
    return v1

    :cond_0
    iget-object v1, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    invoke-virtual {v1}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->invoke()Z

    move-result v1

    goto :goto_0
.end method

.method public performShortcut(ILandroid/view/KeyEvent;I)Z
    .locals 2
    .param p1, "keyCode"    # I
    .param p2, "event"    # Landroid/view/KeyEvent;
    .param p3, "flags"    # I

    .prologue
    .line 197
    invoke-direct {p0, p1, p2}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->findItemWithShortcut(ILandroid/view/KeyEvent;)Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    move-result-object v0

    .line 198
    .local v0, "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    if-nez v0, :cond_0

    .line 199
    const/4 v1, 0x0

    .line 202
    :goto_0
    return v1

    :cond_0
    invoke-virtual {v0}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->invoke()Z

    move-result v1

    goto :goto_0
.end method

.method public removeGroup(I)V
    .locals 4
    .param p1, "groupId"    # I

    .prologue
    .line 206
    iget-object v2, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 207
    .local v2, "items":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;>;"
    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v1

    .line 208
    .local v1, "itemCount":I
    const/4 v0, 0x0

    .line 209
    .local v0, "i":I
    :goto_0
    if-ge v0, v1, :cond_1

    .line 210
    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    invoke-virtual {v3}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->getGroupId()I

    move-result v3

    if-ne v3, p1, :cond_0

    .line 211
    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    .line 212
    add-int/lit8 v1, v1, -0x1

    goto :goto_0

    .line 214
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 217
    :cond_1
    return-void
.end method

.method public removeItem(I)V
    .locals 2
    .param p1, "id"    # I

    .prologue
    .line 220
    iget-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    invoke-direct {p0, p1}, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->findItemIndex(I)I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    .line 221
    return-void
.end method

.method public setGroupCheckable(IZZ)V
    .locals 5
    .param p1, "group"    # I
    .param p2, "checkable"    # Z
    .param p3, "exclusive"    # Z

    .prologue
    .line 225
    iget-object v3, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 226
    .local v3, "items":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;>;"
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v2

    .line 228
    .local v2, "itemCount":I
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-ge v0, v2, :cond_1

    .line 229
    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    .line 230
    .local v1, "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    invoke-virtual {v1}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->getGroupId()I

    move-result v4

    if-ne v4, p1, :cond_0

    .line 231
    invoke-virtual {v1, p2}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->setCheckable(Z)Landroid/view/MenuItem;

    .line 232
    invoke-virtual {v1, p3}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->setExclusiveCheckable(Z)Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    .line 228
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 235
    .end local v1    # "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    :cond_1
    return-void
.end method

.method public setGroupEnabled(IZ)V
    .locals 5
    .param p1, "group"    # I
    .param p2, "enabled"    # Z

    .prologue
    .line 238
    iget-object v3, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 239
    .local v3, "items":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;>;"
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v2

    .line 241
    .local v2, "itemCount":I
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-ge v0, v2, :cond_1

    .line 242
    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    .line 243
    .local v1, "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    invoke-virtual {v1}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->getGroupId()I

    move-result v4

    if-ne v4, p1, :cond_0

    .line 244
    invoke-virtual {v1, p2}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->setEnabled(Z)Landroid/view/MenuItem;

    .line 241
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 247
    .end local v1    # "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    :cond_1
    return-void
.end method

.method public setGroupVisible(IZ)V
    .locals 5
    .param p1, "group"    # I
    .param p2, "visible"    # Z

    .prologue
    .line 250
    iget-object v3, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    .line 251
    .local v3, "items":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;>;"
    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v2

    .line 253
    .local v2, "itemCount":I
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-ge v0, v2, :cond_1

    .line 254
    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;

    .line 255
    .local v1, "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    invoke-virtual {v1}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->getGroupId()I

    move-result v4

    if-ne v4, p1, :cond_0

    .line 256
    invoke-virtual {v1, p2}, Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 253
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 259
    .end local v1    # "item":Lcom/tencent/qrom/internal/view/menu/ActionMenuItem;
    :cond_1
    return-void
.end method

.method public setQwertyMode(Z)V
    .locals 0
    .param p1, "isQwerty"    # Z

    .prologue
    .line 262
    iput-boolean p1, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mIsQwerty:Z

    .line 263
    return-void
.end method

.method public size()I
    .locals 1

    .prologue
    .line 266
    iget-object v0, p0, Lcom/tencent/qrom/internal/view/menu/ActionMenu;->mItems:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method


text:
"""Monitor tracing events on chrome via chrome remote debugging."""

import itertools
import logging
import operator

import clovis_constants
import devtools_monitor

class TracingTrack(devtools_monitor.Track):
  """Grabs and processes trace event messages.

  See https://goo.gl/Qabkqk for details on the protocol.
  """
  def __init__(self, connection, categories, fetch_stream=False):
    """Initialize this TracingTrack.

    Args:
      connection: a DevToolsConnection.
      categories: ([str] or None) If set, a list of categories to enable or
                  disable in Chrome tracing. Categories prefixed with '-' are
                  disabled.
      fetch_stream: if true, use a websocket stream to fetch tracing data rather
        than dataCollected events. It appears based on very limited testing that
        a stream is slower than the default reporting as dataCollected events.
    """
    super(TracingTrack, self).__init__(connection)
    if connection:
      connection.RegisterListener('Tracing.dataCollected', self)

    self._categories = set(categories)
    params = {}
    params['categories'] = ','.join(self._categories)
    if fetch_stream:
      params['transferMode'] = 'ReturnAsStream'

    if connection:
      connection.SyncRequestNoResponse('Tracing.start', params)

    self._events = []
    self._base_msec = None
    self._interval_tree = None
    self._main_frame_id = None

  def Handle(self, method, event):
    for e in event['params']['value']:
      event = Event(e)
      self._events.append(event)
      if self._base_msec is None or event.start_msec < self._base_msec:
        self._base_msec = event.start_msec
    # Invalidate our index rather than trying to be fancy and incrementally
    # update.
    self._interval_tree = None

  def Categories(self):
    """Returns the set of categories in this trace."""
    return self._categories

  def GetFirstEventMillis(self):
    """Find the canonical start time for this track.

    Returns:
      The millisecond timestamp of the first request.
    """
    return self._base_msec

  def GetEvents(self):
    """Returns a list of tracing.Event. Not sorted."""
    return self._events

  def GetMatchingEvents(self, category, name):
    """Gets events matching |category| and |name|."""
    return [e for e in self.GetEvents() if e.Matches(category, name)]

  def GetMatchingMainFrameEvents(self, category, name):
    """Gets events matching |category| and |name| that occur in the main frame.

    Events without a 'frame' key in their |args| are discarded.
    """
    matching_events = self.GetMatchingEvents(category, name)
    return [e for e in matching_events
        if 'frame' in e.args and e.args['frame'] == self.GetMainFrameID()]

  def GetMainFrameRoutingID(self):
    """Returns the main frame routing ID."""
    for event in self.GetMatchingEvents(
        'navigation', 'RenderFrameImpl::OnNavigate'):
      return event.args['id']
    assert False

  def GetMainFrameID(self):
    """Returns the main frame ID."""
    if not self._main_frame_id:
      navigation_start_events = self.GetMatchingEvents(
          'blink.user_timing', 'navigationStart')
      first_event = min(navigation_start_events, key=lambda e: e.start_msec)
      self._main_frame_id = first_event.args['frame']

    return self._main_frame_id

  def SetMainFrameID(self, frame_id):
    """Set the main frame ID. Normally this is used only for testing."""
    self._main_frame_id = frame_id

  def EventsAt(self, msec):
    """Gets events active at a timestamp.

    Args:
      msec: tracing milliseconds to query. Tracing milliseconds appears to be
        since chrome startup (ie, arbitrary epoch).

    Returns:
      List of events active at that timestamp. Instantaneous (ie, instant,
      sample and counter) events are never included. Event end times are
      exclusive, so that an event ending at the usec parameter will not be
      returned.
    """
    self._IndexEvents()
    return self._interval_tree.EventsAt(msec)

  def Filter(self, pid=None, tid=None, categories=None):
    """Returns a new TracingTrack with a subset of the events.

    Args:
      pid: (int or None) Selects events from this PID.
      tid: (int or None) Selects events from this TID.
      categories: (set([str]) or None) Selects events belonging to one of the
                  categories.
    """
    events = self._events
    if pid is not None:
      events = filter(lambda e : e.tracing_event['pid'] == pid, events)
    if tid is not None:
      events = filter(lambda e : e.tracing_event['tid'] == tid, events)
    if categories is not None:
      events = filter(
          lambda e : set(e.category.split(',')).intersection(categories),
          events)
    tracing_track = TracingTrack(None, clovis_constants.DEFAULT_CATEGORIES)
    tracing_track._events = events
    tracing_track._categories = self._categories
    if categories is not None:
      tracing_track._categories = self._categories.intersection(categories)
    return tracing_track

  def ToJsonDict(self):
    return {'categories': list(self._categories),
            'events': [e.ToJsonDict() for e in self._events]}

  @classmethod
  def FromJsonDict(cls, json_dict):
    if not json_dict:
      return None
    assert 'events' in json_dict
    events = [Event(e) for e in json_dict['events']]
    tracing_track = TracingTrack(None, clovis_constants.DEFAULT_CATEGORIES)
    tracing_track._categories = set(json_dict.get('categories', []))
    tracing_track._events = events
    tracing_track._base_msec = events[0].start_msec if events else 0
    for e in events[1:]:
      if e.type == 'M':
        continue  # No timestamp for metadata events.
      assert e.start_msec > 0
      if e.start_msec < tracing_track._base_msec:
        tracing_track._base_msec = e.start_msec
    return tracing_track

  def OverlappingEvents(self, start_msec, end_msec):
    self._IndexEvents()
    return self._interval_tree.OverlappingEvents(start_msec, end_msec)

  def EventsEndingBetween(self, start_msec, end_msec):
    """Gets the list of events ending within an interval.

    Args:
      start_msec: the start of the range to query, in milliseconds, inclusive.
      end_msec: the end of the range to query, in milliseconds, inclusive.

    Returns:
      See OverlappingEvents() above.
    """
    overlapping_events = self.OverlappingEvents(start_msec, end_msec)
    return [e for e in overlapping_events
            if start_msec <= e.end_msec <= end_msec]

  def EventFromStep(self, step_event):
    """Returns the Event associated with a step event, or None.

    Args:
      step_event: (Event) Step event.

    Returns:
      an Event that matches the step event, or None.
    """
    self._IndexEvents()
    assert 'step' in step_event.args and step_event.tracing_event['ph'] == 'T'
    candidates = self._interval_tree.EventsAt(step_event.start_msec)
    for event in candidates:
      # IDs are only unique within a process (often they are pointers).
      if (event.pid == step_event.pid and event.tracing_event['ph'] != 'T'
          and event.name == step_event.name and event.id == step_event.id):
        return event
    return None

  def _IndexEvents(self, strict=False):
    if self._interval_tree:
      return
    complete_events = []
    spanning_events = self._SpanningEvents()
    for event in self._events:
      if not event.IsIndexable():
        continue
      if event.IsComplete():
        complete_events.append(event)
        continue
      matched_event = spanning_events.Match(event, strict)
      if matched_event is not None:
        complete_events.append(matched_event)
    self._interval_tree = _IntervalTree.FromEvents(complete_events)

    if strict and spanning_events.HasPending():
      raise devtools_monitor.DevToolsConnectionException(
          'Pending spanning events: %s' %
          '\n'.join([str(e) for e in spanning_events.PendingEvents()]))

  def _GetEvents(self):
    self._IndexEvents()
    return self._interval_tree.GetEvents()

  def HasLoadingSucceeded(self):
    """Returns whether the loading has succeed at recording time."""
    main_frame_id = self.GetMainFrameRoutingID()
    for event in self.GetMatchingEvents(
        'navigation', 'RenderFrameImpl::didFailProvisionalLoad'):
      if event.args['id'] == main_frame_id:
        return False
    for event in self.GetMatchingEvents(
        'navigation', 'RenderFrameImpl::didFailLoad'):
      if event.args['id'] == main_frame_id:
        return False
    return True

  class _SpanningEvents(object):
    def __init__(self):
      self._duration_stack = []
      self._async_stacks = {}
      self._objects = {}
      self._MATCH_HANDLER = {
          'B': self._DurationBegin,
          'E': self._DurationEnd,
          'b': self._AsyncStart,
          'e': self._AsyncEnd,
          'S': self._AsyncStart,
          'F': self._AsyncEnd,
          'N': self._ObjectCreated,
          'D': self._ObjectDestroyed,
          'M': self._Ignore,
          'X': self._Ignore,
          'R': self._Ignore,
          'p': self._Ignore,
          '(': self._Ignore, # Context events.
          ')': self._Ignore, # Ditto.
          None: self._Ignore,
          }

    def Match(self, event, strict=False):
      return self._MATCH_HANDLER.get(
          event.type, self._Unsupported)(event, strict)

    def HasPending(self):
      return (self._duration_stack or
              self._async_stacks or
              self._objects)

    def PendingEvents(self):
      return itertools.chain(
          (e for e in self._duration_stack),
          (o for o in self._objects),
          itertools.chain.from_iterable((
              (e for e in s) for s in self._async_stacks.itervalues())))

    def _AsyncKey(self, event, _):
      return (event.tracing_event['cat'], event.id)

    def _Ignore(self, _event, _):
      return None

    def _Unsupported(self, event, _):
      raise devtools_monitor.DevToolsConnectionException(
          'Unsupported spanning event type: %s' % event)

    def _DurationBegin(self, event, _):
      self._duration_stack.append(event)
      return None

    def _DurationEnd(self, event, _):
      if not self._duration_stack:
        raise devtools_monitor.DevToolsConnectionException(
            'Unmatched duration end: %s' % event)
      start = self._duration_stack.pop()
      start.SetClose(event)
      return start

    def _AsyncStart(self, event, strict):
      key = self._AsyncKey(event, strict)
      self._async_stacks.setdefault(key, []).append(event)
      return None

    def _AsyncEnd(self, event, strict):
      key = self._AsyncKey(event, strict)
      if key not in self._async_stacks:
        message = 'Unmatched async end %s: %s' % (key, event)
        if strict:
          raise devtools_monitor.DevToolsConnectionException(message)
        else:
          logging.warning(message)
        return None
      stack = self._async_stacks[key]
      start = stack.pop()
      if not stack:
        del self._async_stacks[key]
      start.SetClose(event)
      return start

    def _ObjectCreated(self, event, _):
      # The tracing event format has object deletion timestamps being exclusive,
      # that is the timestamp for a deletion my equal that of the next create at
      # the same address. This asserts that does not happen in practice as it is
      # inconvenient to handle that correctly here.
      if event.id in self._objects:
        raise devtools_monitor.DevToolsConnectionException(
            'Multiple objects at same address: %s, %s' %
            (event, self._objects[event.id]))
      self._objects[event.id] = event
      return None

    def _ObjectDestroyed(self, event, _):
      if event.id not in self._objects:
        raise devtools_monitor.DevToolsConnectionException(
            'Missing object creation for %s' % event)
      start = self._objects[event.id]
      del self._objects[event.id]
      start.SetClose(event)
      return start

class Event(object):
  """Wraps a tracing event."""
  CLOSING_EVENTS = {'E': 'B',
                    'e': 'b',
                    'F': 'S',
                    'D': 'N'}
  __slots__ = ('_tracing_event', 'start_msec', 'end_msec', '_synthetic')
  def __init__(self, tracing_event, synthetic=False):
    """Creates Event.

    Intended to be created only by TracingTrack.

    Args:
      tracing_event: JSON tracing event, as defined in https://goo.gl/Qabkqk.
      synthetic: True if the event is synthetic. This is only used for indexing
        internal to TracingTrack.
    """
    if not synthetic and tracing_event['ph'] in ['s', 't', 'f']:
      raise devtools_monitor.DevToolsConnectionException(
          'Unsupported event: %s' % tracing_event)

    self._tracing_event = tracing_event
    # Note tracing event times are in microseconds.
    self.start_msec = tracing_event['ts'] / 1000.0
    self.end_msec = None
    self._synthetic = synthetic
    if self.type == 'X':
      # Some events don't have a duration.
      duration = (tracing_event['dur']
                  if 'dur' in tracing_event else tracing_event['tdur'])
      self.end_msec = self.start_msec + duration / 1000.0

  @property
  def type(self):
    if self._synthetic:
      return None
    return self._tracing_event['ph']

  @property
  def category(self):
    return self._tracing_event['cat']

  @property
  def pid(self):
    return self._tracing_event['pid']

  @property
  def args(self):
    return self._tracing_event.get('args', {})

  @property
  def id(self):
    return self._tracing_event.get('id')

  @property
  def name(self):
    return self._tracing_event['name']

  @property
  def tracing_event(self):
    return self._tracing_event

  @property
  def synthetic(self):
    return self._synthetic

  def __str__(self):
    return ''.join([str(self._tracing_event),
                    '[%s,%s]' % (self.start_msec, self.end_msec)])

  def Matches(self, category, name):
    """Match tracing events.

    Args:
      category: a tracing category (event['cat']).
      name: the tracing event name (event['name']).

    Returns:
      True if the event matches and False otherwise.
    """
    if name != self.name:
      return False
    categories = self.category.split(',')
    return category in categories

  def IsIndexable(self):
    """True iff the event can be indexed by time."""
    return self._synthetic or self.type not in [
        'I', 'P', 'c', 'C',
        'n', 'T', 'p',  # TODO(mattcary): ?? instant types of async events.
        'O',            # TODO(mattcary): ?? object snapshot
        'M'             # Metadata
        ]

  def IsComplete(self):
    return self.type == 'X'

  def Synthesize(self):
    """Expand into synthetic events.

    Returns:
      A list of events, possibly some synthetic, whose start times are all
      interesting for purposes of indexing. If the event is not indexable the
      set may be empty.
    """
    if not self.IsIndexable():
      return []
    if self.IsComplete():
      # Tracing event timestamps are microseconds!
      return [self, Event({'ts': self.end_msec * 1000}, synthetic=True)]
    return [self]

  def SetClose(self, closing):
    """Close a spanning event.

    Args:
      closing: The closing event.

    Raises:
      devtools_monitor.DevToolsConnectionException if closing can't property
      close this event.
    """
    if self.type != self.CLOSING_EVENTS.get(closing.type):
      raise devtools_monitor.DevToolsConnectionException(
        'Bad closing: %s --> %s' % (self, closing))
    if self.type in ['b', 'S'] and (
        self.tracing_event['cat'] != closing.tracing_event['cat'] or
        self.id != closing.id):
      raise devtools_monitor.DevToolsConnectionException(
        'Bad async closing: %s --> %s' % (self, closing))
    self.end_msec = closing.start_msec
    if 'args' in closing.tracing_event:
      self.tracing_event.setdefault(
          'args', {}).update(closing.tracing_event['args'])

  def ToJsonDict(self):
    return self._tracing_event

  @classmethod
  def FromJsonDict(cls, json_dict):
    return Event(json_dict)

class _IntervalTree(object):
  """Simple interval tree. This is not an optimal one, as the split is done with
  an equal number of events on each side, according to start time.
  """
  _TRESHOLD = 100
  def __init__(self, start, end, events):
    """Builds an interval tree.

    Args:
      start: start timestamp of this node, in ms.
      end: end timestamp covered by this node, in ms.
      events: Iterable of objects having start_msec and end_msec fields. Has to
              be sorted by start_msec.
    """
    self.start = start
    self.end = end
    self._events = events
    self._left = self._right = None
    if len(self._events) > self._TRESHOLD:
      self._Divide()

  @classmethod
  def FromEvents(cls, events):
    """Returns an IntervalTree instance from a list of events."""
    filtered_events = [e for e in events
                       if e.start_msec is not None and e.end_msec is not None]
    filtered_events.sort(key=operator.attrgetter('start_msec'))
    start = min(event.start_msec for event in filtered_events)
    end = max(event.end_msec for event in filtered_events)
    return _IntervalTree(start, end, filtered_events)

  def OverlappingEvents(self, start, end):
    """Returns a set of events overlapping with [start, end)."""
    if min(end, self.end) - max(start, self.start) <= 0:
      return set()
    elif self._IsLeaf():
      result = set()
      for event in self._events:
        if self._Overlaps(event, start, end):
          result.add(event)
      return result
    else:
      return (self._left.OverlappingEvents(start, end)
              | self._right.OverlappingEvents(start, end))

  def EventsAt(self, timestamp):
    result = set()
    if self._IsLeaf():
      for event in self._events:
        if event.start_msec <= timestamp < event.end_msec:
          result.add(event)
    else:
      if self._left.start <= timestamp < self._left.end:
        result |= self._left.EventsAt(timestamp)
      if self._right.start <= timestamp < self._right.end:
        result |= self._right.EventsAt(timestamp)
    return result

  def GetEvents(self):
    return self._events

  def _Divide(self):
    middle = len(self._events) / 2
    left_events = self._events[:middle]
    right_events = self._events[middle:]
    left_end = max(e.end_msec for e in left_events)
    right_start = min(e.start_msec for e in right_events)
    self._left = _IntervalTree(self.start, left_end, left_events)
    self._right = _IntervalTree(right_start, self.end, right_events)

  def _IsLeaf(self):
    return self._left is None

  @classmethod
  def _Overlaps(cls, event, start, end):
    return (min(end, event.end_msec) - max(start, event.start_msec) > 0
            or start <= event.start_msec < end)  # For instant events.

redpajama_set_name: RedPajamaGithub


text:
<?php
	$old_username = array(
        'name'          => 'old_username',
        'id'            => 'old_username',
        'value'         => ''
    );

	$new_username = array(
        'name'          => 'new_username',
        'id'            => 'new_username',
        'value'         => ''
    );

    $attributes = array(
        'style' => 'color: #999;font-size:0.95em;display: block;font-weight: 500;'
    );

?>

Changing username

	<?php echo validation_errors(); ?>
	<?php echo form_open('Users/change_username'); ?>
	<?php echo form_label('Old username*', 'old_username', $attributes); ?>
	<?php echo form_input($old_username); ?>
	<?php echo form_label('New username*', 'new_username', $attributes); ?>
	<?php echo form_input($new_username); ?>
	<?php echo form_submit('submit', 'Change'); ?>
	<?php echo form_close(); ?>


text:
package individual.leobert.uilib.vlayoutext.core;

/**
 *
Package: individual.leobert.uilib.vlayoutext

 *
Project: UiLib

 *
Classname: IDataProvider

 *
Description: TODO

 * Created by leobert on 2017/6/29.
 */

public interface IDataProvider<ID> {
    ID getItemDataByPosition(int position);
    int getItemDataCount();
}


text:
'use strict'

var fs = require('fs');
var path = require('path');
var bcrypt = require('bcrypt-nodejs');
var User = require('../models/user');
var jwt = require('../services/jwt');

function pruebas (req,res) {
    res.status(200).send({
        message: 'Probando el controlador de usuario'
    })

}

function saveUser (req,res) {
    var user = new User();

    var params = req.body;

    console.log(params);
    user.name = params.name;
    user.surname = params.surname;
    user.email = params.email;
    user.role = 'ROLE_USER';
    user.image = 'null';

    if(params.password){
        //Encriptar y guardar dato
        bcrypt.hash(params.password,null,null,function (err,hash) {
           user.password = hash;
           if(user.name != null && user.name != null && user.name != null){
               //Guardar el usuario
               user.save((err,userStored) => {
                 if(err){
                     res.status(500).send({message: 'Error al guardar el usuario'});
                 }  else{
                     if(!userStored){
                         res.status(404).send({message: 'No se ha registrado el usuario'});
                     } else{
                         res.status(200).send({user: userStored});

                       }

                   }
               });

           }else{
               //
               res.status(200).send({message: 'Introduce todos los campos obligatorios'});
           }
        });

    } else {
        res.status(500).send({message:'Introduce la contraseña'});
    }
}

function loginUser(req,res){

    var params = req.body;

    var email = params.email;
    var password = params.password;

    User.findOne({email: email.toLowerCase()}, (err,user) => {
        if(err){
            res.status(500).send({message: 'Error en la peticion'});
        }else {
            if(!user){
        res.status(404).send({message: 'El usuario no existe'});
    }else{
        bcrypt.compare(password,user.password,function(err,check){
            if(check){
                //devolver los datos del usuario loggeado
                if(params.gethash){
                    //token de jwt
                    res.status(200).send({
                        token: jwt.createToken(user)
                    });

                }else{
                    res.status(200).send({user});
                }

            }else{
                res.status(404).send({message: 'El usuario ha podido loggearse'});
            }
        });
    }

        }
    });

}

function updateUser(req,res){

    var userId = req.params.id;
    var update = req.body;

    if (userId != req.user.sub){

      return  res.status(500).send({message: 'Sin permisos para actualizar el usuario'});
    }

    User.findByIdAndUpdate(userId,update,(err,userUpdated) => {
        if(err){

            res.status(500).send({message: 'Error al actualizar el usuario'});

        }else{
            if(!userUpdated){

                res.status(404).send({message: 'No se ha podido actualizar el usuario'});

            }else {

                res.status(200).send({user: userUpdated});

            }

        }
    });

}

function uploadImage(req,res){
    var userID = req.params.id;
    var file_name = 'No subido ...';

    if(req.files){

        var file_path = req.files.image.path;

        var file_split = file_path.split("\/");

        var file_name = file_split[2];

        var ext_split = file_name.split('\.');

        var file_ext = ext_split[1];

        //console.log(ext_split);

        if(file_ext == 'png' || file_ext == 'jpg' || file_ext == 'gif'){

            User.findByIdAndUpdate(userID,{image: file_name},(err,userUpdated) =>{

                if(!userUpdated){

                    res.status(404).send({message: 'No se ha podido actualizar el usuario'});

                }else {

                    res.status(200).send({image: file_name,user: userUpdated});

                }

            });
        }else{
            res.status(200).send({message: 'Extension del archivo no soportada'});

        }
    }else{
        res.status(200).send({message: 'No se ha subido una imagen'});
    }
}

function getImageFile(req,res){

    var imageFile = req.params.imageFile;
    var path_file = './uploads/users/'+imageFile;
    fs.exists(path_file, function(exists){
        if(exists){
            res.sendFile(path.resolve(path_file));
        }else {
            res.status(200).send({message: 'No existe la imagen'});
        }
    });
}

module.exports = {
  pruebas,
  saveUser,
  loginUser,
  updateUser,
    uploadImage,
    getImageFile

};


text:
<?php
require __DIR__ . "/../src/Flow/Bitwiser/AbstractBitwiser.php";

use Flow\Bitwiser\AbstractBitwiser;

class BitwiserTest extends PHPUnit_Framework_TestCase
{

    public function testBitwiser()
    {
        $fooBitwiser = new FooBitwiser();

        $fooBitwiser->add(FooBitwiser::OPTION_A);

        $this->assertEquals(1, $fooBitwiser->getState());

        $fooBitwiser->add(FooBitwiser::OPTION_B);

        $this->assertEquals(3, $fooBitwiser->getState());

        $fooBitwiser->add(FooBitwiser::OPTION_C);

        $this->assertEquals(7, $fooBitwiser->getState());
        $this->assertEquals(true, $fooBitwiser->has(FooBitwiser::OPTION_C));

        $fooBitwiser->remove(FooBitwiser::OPTION_B);

        $this->assertEquals(5, $fooBitwiser->getState());
        $this->assertEquals(true, $fooBitwiser->hasNot(FooBitwiser::OPTION_B));

        $valueState = $fooBitwiser->state(false);
        $namedState = $fooBitwiser->state();

        $this->assertEquals(
            array(FooBitwiser::OPTION_A => true, FooBitwiser::OPTION_B => false, FooBitwiser::OPTION_C => true),
            $valueState
        );

        $this->assertEquals(
            array('OPTION_A' => true, 'OPTION_B' => false, 'OPTION_C' => true),
            $namedState
        );

    }

    public function testBitwiserReference()
    {
        $self = $this;
        $state = 7;

        $fooBitwiser = new FooBitwiser($state);

        $fooBitwiser->remove(FooBitwiser::OPTION_B);

        $this->assertEquals($state, $fooBitwiser->getState());
    }

    public function testBitwiserCallback()
    {
        $self = $this;
        $state = 7;

        // Test Closure style callable
        $fooBitwiser = new FooBitwiser($state, function (FooBitwiser $bitwiser) use ($self) {
            $self->setState($bitwiser);
        });

        $fooBitwiser->remove(FooBitwiser::OPTION_B);

        $this->assertEquals($fooBitwiser->getState(), 5);
        $this->assertEquals($fooBitwiser->getState(), $self->state);

        // Test array style callable
        $fooBitwiser = new FooBitwiser($state, array($this, 'setState'));

        $fooBitwiser->remove(FooBitwiser::OPTION_A);

        $this->assertEquals(4, $this->state);
        $this->assertEquals($this->state, $fooBitwiser->getState());
    }

    public function setState($bitwiser)
    {
        $this->state = $bitwiser->getState();
    }
}

class FooBitwiser extends AbstractBitwiser
{
    const OPTION_A = 0;
    const OPTION_B = 1;
    const OPTION_C = 2;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_gravity="bottom"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:focusable="true">

    <LinearLayout android:id="@+id/layout_id"
        android:layout_width="wrap_content"
    	android:layout_height="wrap_content"
        android:layout_marginLeft="9dp"
    	android:layout_marginRight="9dp"
    	android:layout_marginTop="7dp"
    	android:layout_marginBottom="7dp"
    	android:focusable="true">

    <ImageView
  		android:id="@+id/wallpaper_image"
		android:scaleType="centerCrop"
    	android:layout_width="@dimen/wallpaper_chooser_grid_width"
    	android:layout_height="@dimen/wallpaper_chooser_grid_height"
    	android:focusable="true"/>
    	</LinearLayout>

</FrameLayout>


text: nuget pack ExpressWalker.nuspec


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FDAMM_RA
{
    class GlobalServParam
    {
        /// <summary>
        ///Максимальное количество отображаемых записей в таблице
        /// </summary>
        public int RowMaxCount = 250;
        public int PointMaxCount = 490;

        /// <summary>
        /// Текущее количество строчек в таблице
        /// </summary>
        public int rowNum = 0;

        public static int modelDimention = 12;
        //public static int polnuy_razmer = 53;

        //Начальный размер оси Х
        public int XAxisMin = 0;
        public int XAxisMax = 51;

        //Текущий размер оси Х
        public int CurrentXAxisMin = 0;
        public int CurrentXAxisMax = 51;

        // Устанавливаем по умолчанию интервал по оси Y
        public int YAxisMin = -50;
        public int YAxisMax = 50;
    }
}


text:
//
//  main.c
//  test-cJSON
//
//  Created by nst on 06/08/16.
//  Copyright © 2016 Nicolas Seriot. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include "cJSON.h"

typedef enum testStatus {ERROR, PASS, FAIL} TestStatus;

/* Parse text to JSON, then render back to text, and print! */
TestStatus parseData(char *data, int printParsingResults) {
    cJSON *json=cJSON_Parse(data);
    if (!json) {
//        if (printParsingResults) {
//            printf("Error before: [%s]\n",cJSON_GetErrorPtr());
//        }
        return FAIL;
    }

    char *out=cJSON_Print(json);
    cJSON_Delete(json);
    if (printParsingResults) {
        printf("--  in: %s\n", data);
        printf("-- out: %s\n", out);
    }
    free(out);
    return PASS;
}

/* Read a file, parse, render back, etc. */
TestStatus testFile(const char *filename, int printParsingResults) {

    FILE *f=fopen(filename,"rb");
    if(f == NULL) { return ERROR; };
    fseek(f,0,SEEK_END);
    long len=ftell(f);
    fseek(f,0,SEEK_SET);
    char *data=(char*)malloc(len+1);
    fread(data,1,len,f);
    data[len]='\0';
    fclose(f);
    TestStatus status = parseData(data, printParsingResults);
    free(data);
    return status;
}

int main(int argc, const char * argv[]) {

    const char* path = argv[1];

    int printParsingResults = 0;

    int result = testFile(path, printParsingResults);

    if (result == PASS) {
        return 0;
    } else {
        return 1;
    }
}


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.TextInputWithButton = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _textInput = require("../../../form/input/text-input");

const TextInputWithButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
  let {
    buttonValue,
    modifier,
    buttonProps,
    inputValue,
    inset,
    ...others
  } = _ref;
  return /*#__PURE__*/_react.default.createElement(_textInput.TextInput, (0, _extends2.default)({
    ref: ref || null
  }, others, {
    value: inputValue,
    has: "button",
    buttonIsInset: inset,
    buttonProps: {
      modifier: modifier,
      children: buttonValue,
      ...buttonProps
    }
  }));
});

exports.TextInputWithButton = TextInputWithButton;
TextInputWithButton.propTypes = {
  inset: _propTypes.default.bool,
  modifier: _propTypes.default.string,
  buttonValue: _propTypes.default.node,
  buttonProps: _propTypes.default.object,
  inputValue: _propTypes.default.string
};
TextInputWithButton.defaultProps = {
  buttonValue: 'Button',
  buttonProps: {
    disabled: false
  },
  modifier: 'beryllium',
  inset: false
};


text:
#region License
//
// Author: Dotan Nahum <dotan@paracode.com>
// Copyright (c) 2009-2010, Dotan Nahum, Paracode.
//
// Licensed under the Apache License, Version 2.0.
// See LICENSE.txt for details.
//
#endregion
using System;
using System.Web;

namespace Nina.Filters.Meta
{
    public class LastModifiedFilter : IFilter
    {
        private DateTime _value;

        public LastModifiedFilter(DateTime value)
        {
            _value = value;
        }

        public bool Execute(HttpContext c)
        {
            c.Response.AppendHeader("Last-Modified", _value.ToString("r"));

            var modString = c.Request.Headers["If-Modified-Since"];
            if(!string.IsNullOrEmpty(modString))
            {
                DateTime ifModified;
                if(DateTime.TryParse(modString, out ifModified))
                {
                    if(_value - ifModified > TimeSpan.FromSeconds(1))
                    {
                        c.Response.StatusCode = 304;
                        c.Response.SuppressContent = true;
                        c.Response.ClearContent();
                        c.ApplicationInstance.CompleteRequest();

                        //HttpContext.Current.Response.End();
                        return false;
                    }
                }
            }

            return true;
        }
    }
}


text:
/* global exports, validators */
exports.schemaHelper('lowercase', function (val, isTrue) {
    if (isTrue && validators.isString(val)) {
        val = val.toLowerCase();
    }
    return val;
});


text:
package org.ogcs.netty;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;

/**
 * Data Transport Protocol.
 * Every protocol must be implement the {@link #newChannelInitializer()} method.
 * this method use to initialize the {@link Channel}'s handlers.
 * <pre>
 *      <lang desc="zh-cn">
 *      数据传输协议接口. 实现{@link #newChannelInitializer()}接口用于初始化{@link Channel}的handler.
 *      </lang>
 * </pre>
 *
 * @author TinyZ
 * @version 2015.10.22
 * @since 1.0
 */
public interface Protocol<T extends Channel> {

    /**
     * @return New Channel Initializer.
     */
    ChannelInitializer<T> newChannelInitializer();
}


text:
/*************************
*   Precompiled Header   *
**************************/
#include "precomp_base.h"

/**********************
*   System Includes   *
***********************/

/*************************
*   3rd Party Includes   *
**************************/

/***************************
*   Game Engine Includes   *
****************************/
#include "AETimer.h"

//Always include last
#include "Memory\MemLeaks.h"

/********************
*   Function Defs   *
*********************/
AETimer::AETimer()
{
    //Get seconds per count
    __int64 cntsPerSec = 0;
    QueryPerformanceFrequency((LARGE_INTEGER*)&cntsPerSec);

    m_SecondPerCount = 1.0f / (float)cntsPerSec;
}

AETimer::~AETimer()
{
}

double AETimer::GetLapTime(bool updatePrevTime)
{
    __int64 currentTimeStamp = 0;

    QueryPerformanceCounter((LARGE_INTEGER*)&currentTimeStamp);

    double elapsedTime = ((currentTimeStamp - m_PrevTime) * m_SecondPerCount);

#if defined(AE_TIME_STEP_LOCK)

    //If we are debugging and we are inspecting a break point
    //it is very likely that elapsed time will be more than a sec
    //we do not want our engine to go faster than that, so do not
    //let it pass a sec
    if(elapsedTime > 1.0)
    {
        elapsedTime = 1.0;
    }

#endif

    if(updatePrevTime)
    {
        m_PrevTime = currentTimeStamp;
    }

    return elapsedTime;
}

void AETimer::Update()
{
    m_TimerParams.m_ElapsedTimePression         = GetLapTime(true);
    m_TimerParams.m_ElapsedTime                 = (float)m_TimerParams.m_ElapsedTimePression;

    m_TimerParams.m_TotalElapsedTimePression    += m_TimerParams.m_ElapsedTimePression;
    m_TimerParams.m_TotalElapsedTime            = (float)m_TimerParams.m_TotalElapsedTimePression;
}

void AETimer::PostUpdate()
{
    m_TimerParams.m_PreviousCallTimePression    = GetLapTime(false);
    m_TimerParams.m_PreviousCallTime            = (float)m_TimerParams.m_PreviousCallTimePression;
}


text:
@interface UIDevice (AdditionalInfo)

+ (NSString*) MAC;
+ (NSString*) deviceModelName;
+ (NSString *)clientInfo:(NSString *)fromID version:(NSString *)version userAgent:(NSString*)userAgent;

@end


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SAC Effects: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

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

SAC Effects
    v1.0

Reverb Member List

This is the complete list of members for Reverb, including all inherited members.

apply(float **input, float **output, int samples, std::vector< SACBitstream::ChannelType::channeltype > channels)	Reverb

combfilter(float *input, float *output, int samples, bool addition, float *a, float *b, int order, float a_delay, float b_delay, int delay)	Reverb

feedforwardfilter(float *input, float *output, int samples, bool addition, float gain, float original, int delay)	Reverb

lowpassfeedbackfilter(float *input, float *output, int samples, bool addition, float gain, float rs, float d, int delay)	Reverb

Reverb()	Reverb

schroederdiffusionfilter(float *input, float *output, int samples, bool addition, float gain, float g, int delay)	Reverb

schroederfilter(float *input, float *output, int samples, bool addition, float gain, float g, int delay)	Reverb

Generated by

     1.8.13


text:
body, html, select {
  margin:0;
  padding:0;
  color:#666666;
  background:#CCCCCC;
}
#wrap {
	width:960px;
	margin:0 auto;
	margin-bottom: 20px;
}
#main, div#right-side {
	padding: 0px 10px;
}
#header {
	padding: 10px;
	text-align: center;
}
#header h1 {
	padding-bottom: 10px;
	margin-bottom: 10px;
	border-bottom: 1px solid;
}
#header h1 a {
	text-decoration: none;
}
textarea#description {
	width: 700px;
	height: 20px;
	text-align: center;
	font-size: 15px;
}
div#permalink_section {
	white-space: pre-wrap; /* css-3 */
	white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
	white-space: -pre-wrap; /* Opera 4-6 */
	white-space: -o-pre-wrap; /* Opera 7 */
	word-wrap:break-word;
	font-size: 14px;
	font-style:italic;
}
div#permalink_section a {
	font-style:normal;
}
#main {
	float:left;
	width:500px;
}
div#right-side {
	float:right;
	width:420px;
}
a, a:visited {
	color:#666666;
}
a:hover {
	text-decoration:none;
}
#examples, #counterexamples {
	margin: 20 0px;
}
li {
	margin-bottom: 10px;
	word-wrap:break-word;
}
input {
	margin-bottom: 4px;
}
h1 { font-size: 30px; }
h2 {
	font-size: 20px;
	margin-top: 20px;
	margin-bottom: 10px;
	font-style:italic;
}
ol {
	list-style-type: decimal;
	margin-left: 20px;
	margin-bottom: 10px;
}
ul#footer {
	width:290px;
	border-top: 1px dotted;
	margin-top: 40px;
	padding-top: 10px;
	text-align: center;
}
ul#footer li {
	display: inline;
	padding-right: 10px;
}

div#examples span.ok { color: green; }
div#examples span.ok span.matched{ background-color: LawnGreen; }
div#examples span.submatches { color: black; font-style:italic; }
div#examples span.not_ok { color: red; }
div#counterexamples span.ok { color: red; }
div#counterexamples span.ok span.matched{ background-color: Coral; }
div#counterexamples span.not_ok { color: green; }
p#regexp_focus_shortcut { font-style: italic; margin-top: 0px; margin-left: 10px; }
p#invalid_regexp { color: red; margin-bottom: 2px; margin-left: 10px; }

h3 {
	text-align: center;
	margin-bottom: 5px;
	text-decoration: underline;
}
table {
	margin-bottom: 10px;
}
td {
	padding: 2px 4px;
}
tr.odd {
	background-color:#999999;
}
td:first-child {
	width: 180px;
}
td:last-child {
	width: 230px;
}
div#extra {
	text-align: center;
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Article extends MY_Controller{
	public function __construct() {
        parent::__construct();
        $this->load->model('Channel_model', 'channelmodel');
        $this->load->model('Article_model', 'articlemodel');
        $this->load->model('Common_model', 'commonmodel');

    }

    /**
     * 加载列表
	 * @author ldw
	 * @version 1.0
	 * @copyright joyrunning.cc
     */
    public function index(){
    	$channelId = $this->input->get('channelId');
    	$admin = $this->getAdmin();
        $data = array('tree' => self::getTree($admin['currentWebsite']['id']), 'list' => array());
        $data['channelModel'] = $this->commonmodel->queryList('ty_channel_model', array('is_disabled' => 1));

     	$data['channelId'] = $channelId;

        $per_page = $this->input->get('per_page');
        if(!is_numeric($per_page))
            $per_page = 0;
        $data['per_page'] = $per_page;
        $where = array();
        $sql = "from ty_article where is_del='N' and website_id=" . $admin['currentWebsite']['id'];
        if(!empty($channelId)){
            $sql = $sql . " and (channel_id=" . intval($channelId) . " or channel_id in(select id from ty_channel where parent_id=" . intval($channelId) . "))";
        }
        $query = $this->db->query("select count(1) cnt " . $sql);
        $rs = $query->row_array();
        $total_rows = $rs['cnt'];//总记录数

        $sql = $sql . " order by sort desc, create_time desc limit " . $per_page . "," . config_item('page_size');
        $query = $this->db->query("select * " . $sql);
        $rs = $query->result_array();

        foreach ($rs as $key=>$value) {
            $value['channel'] = $this->channelmodel->get($value['channel_id']);
            $value['creater'] = $this->commonmodel->get('ty_admin', $value['creater']);
            $rs[$key] = $value;
        }

        $data['list'] = $rs;

        $this->load->library('pagination');
        $config = config_item('paginationConfig');
        $config['base_url'] = site_url('admin/article/index') . '?channelId=' . $channelId;
        $config['total_rows'] = $total_rows;
        $config['page_query_string'] = TRUE;
        $this->pagination->initialize($config);
        $data['pagination'] = $this->pagination->create_links();

    	$this->load->view('/admin/article', $data);
    }

    /**
     * 获得栏目tree
     * @param  [type] $channelId [description]
     * @return [type]            [description]
     * @author ldw
     * @version 1.0
     * @copyright joyrunning.cc
     */
    private function getTree($currentWebsiteId){
        $this->load->library('tree');
        $where = array('website_id' => $currentWebsiteId, 'display'=>'Y');
        $channelList = $this->channelmodel->queryAll($where);
         if(!empty($channelList))
           return $data['tree'] = $this->tree->makeTree($channelList);
        else
            return array();
    }

    /**
     * 去添加页面
     * @param  [type] $pageType [description]
     * @return [type]           [description]
     * @author ldw
     * @version 1.0
     * @copyright joyrunning.cc
     */
    public function add(){
        $admin = $this->getAdmin();
        $data['tree'] = self::getTree($admin['currentWebsite']['id']);
        $this->load->view('admin/article-add', $data);
    }

    /**
     * 去修改页面
     * @param  [type] $id
     * @return [type]
     * @author ldw
     * @version 1.0
     * @copyright joyrunning.cc
     */
    public function upd($id){
        if(empty($id))
            show_404();
        $admin = $this->getAdmin();
        $data['tree'] = self::getTree($admin['currentWebsite']['id']);
        $article = $this->articlemodel->get($id);
        $article['channel'] = $this->channelmodel->get($article['channel_id']);
        $data['article'] = $article;

        $this->load->view('admin/article-modify', $data);
    }

    /**
     * 保存
     * @return [type] [description]
     * @author ldw
     * @version 1.0
     * @copyright joyrunning.cc
     */
    public function save(){
        if($this->isPost()){
            $admin = $this->getAdmin();
            $channel_id = $this->input->post('channel_id');
            $title = $this->input->post('title');
            $sort = $this->input->post('sort');
            $content = $this->input->post('content', FALSE);
            $status = $this->input->post('status');
            $cover = $this->input->post('cover');
            $summary = $this->input->post('summary');
            $source_form = $this->input->post('source_form');
            $sort = $this->input->post('sort');
            $create_time = $this->input->post('create_time');
            if(empty($create_time))
                $create_time = date('Y-m-d H:i:s');

            $article = array(
                'title' => $title,
                'channel_id' => $channel_id,
                'content' => $content,
                'summary' => $summary,
                'source_form' => $source_form,
                'website_id' => $admin['currentWebsite']['id'],
                'status' => $status,
                'create_time' => $create_time,
                'sort' => $sort,
                'creater' => $admin['id']
            );
             // 保存图片
            if(!empty($cover)){
                $this->load->helper('file');
                $cover = copy_file('/'.$cover, '/cover/'.date('Ymd'));
                $article['cover'] = $cover;
            } else {
                $article['cover'] = '/cover/default.jpg';
            }
            $this->articlemodel->add($article);
            $this->renderJson(200, '保存成功');
        }
        $this->renderJson(101, '保存失败!');
    }

    /**
     * 修改
     * @return [type] [description]
     * @author ldw
     * @version 1.0
     * @copyright joyrunning.cc
     */
    public function modify(){
        if($this->isPost()){
            $admin = $this->getAdmin();
            $id = $this->input->post('id');
            $article = $this->articlemodel->get($id);

            $channel_id = $this->input->post('channel_id');
            $title = $this->input->post('title');
            $sort = $this->input->post('sort');
            $content = $this->input->post('content', FALSE);
            $status = $this->input->post('status');
            $cover = $this->input->post('cover');
            $summary = $this->input->post('summary');
            $source_form = $this->input->post('source_form');
            $sort = $this->input->post('sort');
            $create_time = $this->input->post('create_time');
            if(empty($create_time))
                $create_time = date('Y-m-d H:i:s');

            $article['title'] = $title;
            $article['channel_id'] = $channel_id;
            $article['content'] = $content;
            $article['summary'] = $summary;
            $article['source_form'] = $source_form;
            $article['status'] = $status;
            $article['sort'] = $sort;
            $article['create_time'] = $create_time;
             // 保存图片
            if(!empty($cover)){
                $this->load->helper('file');
                $cover = copy_file('/'.$cover, '/cover/'.date('Ymd'));
                $article['cover'] = $cover;
            }
            $this->articlemodel->update($article, array('id' => $id));
            $this->renderJson(200, '保存成功');
        }
        $this->renderJson(101, '保存失败!');
    }

    /**
     * 删除
     * @return [type] [description]
     * @author ldw
     * @version 1.0
     * @copyright joyrunning.cc
     */
    public function del(){
        if($this->isPost()){
            $id = $this->input->post('id');
            $this->articlemodel->delById($id);
            $this->renderJson(200, '删除成功');
        }
        $this->renderJson(404, '参数有误');
    }

    /**
     * 推荐到集团主页
     * 只能一个站点推荐一条内容
     * @return [type] [description]
     * @author ldw
     * @version 1.0
     * @copyright joyrunning.cc
     */
    public function recommend(){
        if($this->isPost()){
            $admin = $this->getAdmin();
            $currentWebsiteId = $admin['currentWebsite']['id'];
            $id = $this->input->post('id');
            $recommend = $this->commonmodel->queryList('ty_article_recommend', array('website_id' => $currentWebsiteId), 1);
            if($recommend){
		$this->commonmodel->delById('ty_article_recommend', $recommend['id']);
            }
	    $recommend = array('article_id'=>$id, 'website_id'=>$currentWebsiteId);
            $this->commonmodel->add('ty_article_recommend', $recommend);

            $this->renderJson(200, '推荐成功');
        }
        $this->renderJson(404, '推荐失败');
    }
}
?>


text:
<?php

// Protect from unauthorized access
defined('F0F_INCLUDED') or die;

/**
 * Row selection checkbox
 *
 * @package  FrameworkOnFramework
 * @since    2.0
 */
class F0FFormHeaderRowselect extends F0FFormHeader
{
	/**
	 * Get the header
	 *
	 * @return  string  The header HTML
	 */
	protected function getHeader()
	{
		return '<input type="checkbox" name="checkall-toggle" value="" title="'
			. JText::_('JGLOBAL_CHECK_ALL')
			. '" onclick="Joomla.checkAll(this)" />';
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<result code="done" />


text:
'use strict';

function Preferences() {
  this.version = '1.0.0';
};

Preferences.create = function(opts) {
  opts = opts || {};

  var x = new Preferences();

  x.createdOn = Math.floor(Date.now() / 1000);
  x.walletId = opts.walletId;
  x.copayerId = opts.copayerId;
  x.email = opts.email;
  x.language = opts.language;
  x.unit = opts.unit;
  return x;
};

Preferences.fromObj = function(obj) {
  var x = new Preferences();

  x.createdOn = obj.createdOn;
  x.walletId = obj.walletId;
  x.copayerId = obj.copayerId;
  x.email = obj.email;
  x.language = obj.language;
  x.unit = obj.unit;
  return x;
};

module.exports = Preferences;


text:
namespace ash {

class UserContext;

// Executes a chain of operations that update the user's configured password
// auth factor from the old to the new value.
class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_LOGIN_AUTH) PasswordUpdateFlow {
 public:
  PasswordUpdateFlow();
  PasswordUpdateFlow(const PasswordUpdateFlow&) = delete;
  PasswordUpdateFlow& operator=(const PasswordUpdateFlow&) = delete;
  ~PasswordUpdateFlow();

  // Starts the auth factor update operations.
  // `user_context` should contain the new credential; it should have no
  // AuthSessionId. On completion, either `success_callback` or `error_callback`
  // is called.
  void Start(std::unique_ptr<UserContext> user_context,
             const std::string& old_password,
             AuthSuccessCallback success_callback,
             AuthErrorCallback error_callback);

 private:
  void ContinueWithAuthSession(const std::string& old_password,
                               AuthSuccessCallback success_callback,
                               AuthErrorCallback error_callback,
                               bool user_exists,
                               std::unique_ptr<UserContext> user_context,
                               absl::optional<AuthenticationError> error);

  AuthPerformer auth_performer_;
  AuthFactorEditor auth_factor_editor_;
  base::WeakPtrFactory<PasswordUpdateFlow> weak_factory_{this};
};

}  // namespace ash

#endif  // CHROMEOS_ASH_COMPONENTS_LOGIN_AUTH_PASSWORD_UPDATE_FLOW_H_


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.09.07 at 08:01:35 PM IST
//

package com.mozu.qbintegration.model.qbmodel.allgen;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for CustomSummaryReportQueryRqType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="CustomSummaryReportQueryRqType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <group ref="{}CustomSummaryReportQuery"/>
 *       </sequence>
 *       <attribute name="requestID" type="{}STRTYPE" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomSummaryReportQueryRqType", propOrder = {
    "customSummaryReportType",
    "displayReport",
    "reportPeriod",
    "reportDateMacro",
    "reportAccountFilter",
    "reportEntityFilter",
    "reportItemFilter",
    "reportClassFilter",
    "reportTxnTypeFilter",
    "reportModifiedDateRangeFilter",
    "reportModifiedDateRangeMacro",
    "reportDetailLevelFilter",
    "reportPostingStatusFilter",
    "summarizeColumnsBy",
    "summarizeRowsBy",
    "includeSubcolumns",
    "reportCalendar",
    "returnRows",
    "returnColumns",
    "reportBasis"
})
public class CustomSummaryReportQueryRqType {

    @XmlElement(name = "CustomSummaryReportType", required = true)
    protected String customSummaryReportType;
    @XmlElement(name = "DisplayReport")
    protected String displayReport;
    @XmlElement(name = "ReportPeriod")
    protected ReportPeriod reportPeriod;
    @XmlElement(name = "ReportDateMacro")
    protected String reportDateMacro;
    @XmlElement(name = "ReportAccountFilter")
    protected ReportAccountFilter reportAccountFilter;
    @XmlElement(name = "ReportEntityFilter")
    protected ReportEntityFilter reportEntityFilter;
    @XmlElement(name = "ReportItemFilter")
    protected ReportItemFilter reportItemFilter;
    @XmlElement(name = "ReportClassFilter")
    protected ReportClassFilter reportClassFilter;
    @XmlElement(name = "ReportTxnTypeFilter")
    protected ReportTxnTypeFilter reportTxnTypeFilter;
    @XmlElement(name = "ReportModifiedDateRangeFilter")
    protected ReportModifiedDateRangeFilter reportModifiedDateRangeFilter;
    @XmlElement(name = "ReportModifiedDateRangeMacro")
    protected String reportModifiedDateRangeMacro;
    @XmlElement(name = "ReportDetailLevelFilter", defaultValue = "All")
    protected String reportDetailLevelFilter;
    @XmlElement(name = "ReportPostingStatusFilter")
    protected String reportPostingStatusFilter;
    @XmlElement(name = "SummarizeColumnsBy", required = true)
    protected String summarizeColumnsBy;
    @XmlElement(name = "SummarizeRowsBy", required = true)
    protected String summarizeRowsBy;
    @XmlElement(name = "IncludeSubcolumns")
    protected String includeSubcolumns;
    @XmlElement(name = "ReportCalendar")
    protected String reportCalendar;
    @XmlElement(name = "ReturnRows")
    protected String returnRows;
    @XmlElement(name = "ReturnColumns")
    protected String returnColumns;
    @XmlElement(name = "ReportBasis", defaultValue = "None")
    protected String reportBasis;
    @XmlAttribute(name = "requestID")
    protected String requestID;

    /**
     * Gets the value of the customSummaryReportType property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getCustomSummaryReportType() {
        return customSummaryReportType;
    }

    /**
     * Sets the value of the customSummaryReportType property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setCustomSummaryReportType(String value) {
        this.customSummaryReportType = value;
    }

    /**
     * Gets the value of the displayReport property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDisplayReport() {
        return displayReport;
    }

    /**
     * Sets the value of the displayReport property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDisplayReport(String value) {
        this.displayReport = value;
    }

    /**
     * Gets the value of the reportPeriod property.
     *
     * @return
     *     possible object is
     *     {@link ReportPeriod }
     *
     */
    public ReportPeriod getReportPeriod() {
        return reportPeriod;
    }

    /**
     * Sets the value of the reportPeriod property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportPeriod }
     *
     */
    public void setReportPeriod(ReportPeriod value) {
        this.reportPeriod = value;
    }

    /**
     * Gets the value of the reportDateMacro property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportDateMacro() {
        return reportDateMacro;
    }

    /**
     * Sets the value of the reportDateMacro property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportDateMacro(String value) {
        this.reportDateMacro = value;
    }

    /**
     * Gets the value of the reportAccountFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportAccountFilter }
     *
     */
    public ReportAccountFilter getReportAccountFilter() {
        return reportAccountFilter;
    }

    /**
     * Sets the value of the reportAccountFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportAccountFilter }
     *
     */
    public void setReportAccountFilter(ReportAccountFilter value) {
        this.reportAccountFilter = value;
    }

    /**
     * Gets the value of the reportEntityFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportEntityFilter }
     *
     */
    public ReportEntityFilter getReportEntityFilter() {
        return reportEntityFilter;
    }

    /**
     * Sets the value of the reportEntityFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportEntityFilter }
     *
     */
    public void setReportEntityFilter(ReportEntityFilter value) {
        this.reportEntityFilter = value;
    }

    /**
     * Gets the value of the reportItemFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportItemFilter }
     *
     */
    public ReportItemFilter getReportItemFilter() {
        return reportItemFilter;
    }

    /**
     * Sets the value of the reportItemFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportItemFilter }
     *
     */
    public void setReportItemFilter(ReportItemFilter value) {
        this.reportItemFilter = value;
    }

    /**
     * Gets the value of the reportClassFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportClassFilter }
     *
     */
    public ReportClassFilter getReportClassFilter() {
        return reportClassFilter;
    }

    /**
     * Sets the value of the reportClassFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportClassFilter }
     *
     */
    public void setReportClassFilter(ReportClassFilter value) {
        this.reportClassFilter = value;
    }

    /**
     * Gets the value of the reportTxnTypeFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportTxnTypeFilter }
     *
     */
    public ReportTxnTypeFilter getReportTxnTypeFilter() {
        return reportTxnTypeFilter;
    }

    /**
     * Sets the value of the reportTxnTypeFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportTxnTypeFilter }
     *
     */
    public void setReportTxnTypeFilter(ReportTxnTypeFilter value) {
        this.reportTxnTypeFilter = value;
    }

    /**
     * Gets the value of the reportModifiedDateRangeFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportModifiedDateRangeFilter }
     *
     */
    public ReportModifiedDateRangeFilter getReportModifiedDateRangeFilter() {
        return reportModifiedDateRangeFilter;
    }

    /**
     * Sets the value of the reportModifiedDateRangeFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportModifiedDateRangeFilter }
     *
     */
    public void setReportModifiedDateRangeFilter(ReportModifiedDateRangeFilter value) {
        this.reportModifiedDateRangeFilter = value;
    }

    /**
     * Gets the value of the reportModifiedDateRangeMacro property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportModifiedDateRangeMacro() {
        return reportModifiedDateRangeMacro;
    }

    /**
     * Sets the value of the reportModifiedDateRangeMacro property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportModifiedDateRangeMacro(String value) {
        this.reportModifiedDateRangeMacro = value;
    }

    /**
     * Gets the value of the reportDetailLevelFilter property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportDetailLevelFilter() {
        return reportDetailLevelFilter;
    }

    /**
     * Sets the value of the reportDetailLevelFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportDetailLevelFilter(String value) {
        this.reportDetailLevelFilter = value;
    }

    /**
     * Gets the value of the reportPostingStatusFilter property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportPostingStatusFilter() {
        return reportPostingStatusFilter;
    }

    /**
     * Sets the value of the reportPostingStatusFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportPostingStatusFilter(String value) {
        this.reportPostingStatusFilter = value;
    }

    /**
     * Gets the value of the summarizeColumnsBy property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSummarizeColumnsBy() {
        return summarizeColumnsBy;
    }

    /**
     * Sets the value of the summarizeColumnsBy property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSummarizeColumnsBy(String value) {
        this.summarizeColumnsBy = value;
    }

    /**
     * Gets the value of the summarizeRowsBy property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSummarizeRowsBy() {
        return summarizeRowsBy;
    }

    /**
     * Sets the value of the summarizeRowsBy property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSummarizeRowsBy(String value) {
        this.summarizeRowsBy = value;
    }

    /**
     * Gets the value of the includeSubcolumns property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIncludeSubcolumns() {
        return includeSubcolumns;
    }

    /**
     * Sets the value of the includeSubcolumns property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIncludeSubcolumns(String value) {
        this.includeSubcolumns = value;
    }

    /**
     * Gets the value of the reportCalendar property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportCalendar() {
        return reportCalendar;
    }

    /**
     * Sets the value of the reportCalendar property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportCalendar(String value) {
        this.reportCalendar = value;
    }

    /**
     * Gets the value of the returnRows property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReturnRows() {
        return returnRows;
    }

    /**
     * Sets the value of the returnRows property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReturnRows(String value) {
        this.returnRows = value;
    }

    /**
     * Gets the value of the returnColumns property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReturnColumns() {
        return returnColumns;
    }

    /**
     * Sets the value of the returnColumns property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReturnColumns(String value) {
        this.returnColumns = value;
    }

    /**
     * Gets the value of the reportBasis property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportBasis() {
        return reportBasis;
    }

    /**
     * Sets the value of the reportBasis property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportBasis(String value) {
        this.reportBasis = value;
    }

    /**
     * Gets the value of the requestID property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRequestID() {
        return requestID;
    }

    /**
     * Sets the value of the requestID property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRequestID(String value) {
        this.requestID = value;
    }

}


text:
"use strict";
const fs = require('jsdoc/fs');
const outdir = env.opts.destination;
const template = require('jsdoc/template');
const mdParser = require('marked');
const localizations = require('./localizations');
const parseExample = require('./parse-example');
const resolveLinksRecursively = require('./resolve-links-recursively');
const getGithubSourceLink = require('./get-github-source-link');

module.exports.publish = function(data, opts) {
	const origData = data().get();
	const result = {
		classes: {},
		typedefs: [],
		binders: null
	};
	let variation = 0;

	origData.forEach(function(item, index) {
		if(item.kind === 'package') {
			return;
		}

		item.githubSourceLink = getGithubSourceLink(__dirname, item);

		delete item.meta;
		delete item.___id;
		delete item.___s;
		delete item.tags;

		if (item.kind == 'class') {
			result.classes[item.longname] = item;

			item.staticMembers = {
				member: [],
				function: []
			};

			item.instanceMembers = {
				member: [],
				function: []
			};
		}

		if (index && item.name === origData[index - 1].name) {
			variation++;
			origData[index - variation]
				&& (origData[index - variation].variations = origData[index - variation].variations || []).push(item);
		} else {
			variation = 0;
		}

		resolveLinksRecursively(item);

		if (item.kind === 'typedef') {
			result.typedefs.push(item);
			if(item.properties) {
				item.properties.forEach((property) => {
					property.description = mdParser(property.description);
				});
			}
		}

		item.see = item.see || [];
		item.properties = item.properties || [];

		item.description = item.description || item.classdesc || '';
		item.description = mdParser(item.description.replace(/"/g, '"'));

		item.summary = item.summary ? mdParser(item.summary) : '';

		item.examples = item.examples ? item.examples.map(parseExample) : [];

		if(item.returns && item.returns.length) {
			const { description } = item.returns[0];
			item.returns[0].description = description ? mdParser(description) : ''
		}

		if (item.name === 'binders') {
			result.binders = item;
			item.members = [];
		}

		// getting rif od HTML
		item.summary_plain = item.summary ? item.summary.replace(/(<([^>]+)>)/ig, "") : '';
	});

	result.classes.Seemple.binders = result.binders;

	origData.forEach(function(item) {
		var _class,
			members;
		if (_class = result.classes[item.memberof]) {
			members = _class[item.scope + 'Members'] = _class[item.scope + 'Members'] || {};
			if (item.kind !== 'class') {
				(members[item.kind] = members[item.kind] || []).push(item);
				item.params = item.params || item.properties || [];
				item.params.forEach(function(item) {
					item.description = mdParser((item.description || '').replace(/"/g, '"'));
				})
			}
		}

		if (item.memberof === 'Seemple.binders') {
			result.binders.members.push(item);

			item.params = item.params || item.properties || [];
			item.params.forEach(function(item) {
				item.description = mdParser((item.description || '').replace(/"/g, '"'));
			});
		}
	});

	var templatePath = opts.template,
		view = new template.Template(templatePath + '/tmpl');

	fs.mkPath(outdir);

	view.lang = localizations[result.classes.Seemple.lang];

	for(var className in result.classes) {
		var _class = result.classes[className];
		var sortFunction = function(a, b) {
			return a.longname < b.longname ? -1 : 1;
		};

		_class.instanceMembers.member.sort(sortFunction);
		_class.instanceMembers.function.sort(sortFunction);
		_class.staticMembers.member.sort(sortFunction);
		_class.staticMembers.function.sort(sortFunction);
	}

	// resorting classes
	result.classes = {
		'Seemple': result.classes['Seemple'],
		'Seemple.Object': result.classes['Seemple.Object'],
		'Seemple.Array': result.classes['Seemple.Array']
	};

	fs.writeFileSync(env.opts.destination + '/doc_menu.html', view.render('menu.html', result), 'utf8');
	fs.writeFileSync(env.opts.destination + '/doc_content.html', view.render('content.html', result), 'utf8');
};


text:
namespace WhereDidTheMoneyGo.AttachedProperties
{
    using System;
    using System.Collections.Generic;
    using System.Threading.Tasks;
    using Windows.UI.Xaml;

    public class AnimationsProperties
    {
        public static bool GetShowHideValue(DependencyObject obj)
        {
            return (bool)obj.GetValue(ShowHideProperty);
        }

        public static void SetShowHideValue(DependencyObject obj, bool value)
        {
            obj.SetValue(ShowHideProperty, value);
        }

        // Using a DependencyProperty as the backing store for MyProperty.
        // This enables animation, styling, binding, etc...

        public static readonly DependencyProperty ShowHideProperty =
            DependencyProperty.RegisterAttached("ShowHide",
                                                typeof(bool),
                                                typeof(UIElement),
                                                new PropertyMetadata(true, new PropertyChangedCallback(HandleShowHideChange)));

        //TODO: Validate If the user is a idiot, and presses the button 6000 times/second to brake the animation
        private static void HandleShowHideChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var element = d as UIElement;
            if (element == null)
            {
                return;
            }

            var timer = new DispatcherTimer();
            if (element.Opacity >= 1 && element.Visibility == Visibility.Visible)
            {
                timer.Tick += (sender, args) =>
                {
                    if (element.Opacity <= 0)
                    {
                        timer.Stop();
                        element.Visibility = Visibility.Collapsed;
                        return;
                    }
                    element.Opacity -= 0.1;

                };
                timer.Interval = TimeSpan.FromMilliseconds(15);
                timer.Start();
            }
            else
            {
                element.Opacity = 0.1;
                element.Visibility = Visibility.Visible;
                timer.Tick += (sender, args) =>
                {
                    if (element.Opacity >= 1)
                    {
                        timer.Stop();
                        return;
                    }
                    element.Opacity += 0.1;

                };
                timer.Interval = TimeSpan.FromMilliseconds(15);
                timer.Start();
            }
        }
    }
}