text:
.class final Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;
.super Landroid/os/AsyncTask;
.source "ActivityChooserModel.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/widget/ActivityChooserModel;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x12
    name = "PersistHistoryAsyncTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/Object;",
        "Ljava/lang/Void;",
        "Ljava/lang/Void;",
        ">;"
    }
.end annotation

# instance fields
.field final synthetic this$0:Landroid/widget/ActivityChooserModel;

# direct methods
.method private constructor <init>(Landroid/widget/ActivityChooserModel;)V
    .locals 0
    .parameter

    .prologue
    .line 1062
    iput-object p1, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

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

    return-void
.end method

.method synthetic constructor <init>(Landroid/widget/ActivityChooserModel;Landroid/widget/ActivityChooserModel$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 1062
    invoke-direct {p0, p1}, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;-><init>(Landroid/widget/ActivityChooserModel;)V

    return-void
.end method

# virtual methods
.method public bridge synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter "x0"

    .prologue
    .line 1062
    invoke-virtual {p0, p1}, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->doInBackground([Ljava/lang/Object;)Ljava/lang/Void;

    move-result-object v0

    return-object v0
.end method

.method public varargs doInBackground([Ljava/lang/Object;)Ljava/lang/Void;
    .locals 15
    .parameter "args"

    .prologue
    .line 1067
    const/4 v11, 0x0

    aget-object v2, p1, v11

    check-cast v2, Ljava/util/List;

    .line 1068
    .local v2, historicalRecords:Ljava/util/List;,"Ljava/util/List<Landroid/widget/ActivityChooserModel$HistoricalRecord;>;"
    const/4 v11, 0x1

    aget-object v3, p1, v11

    check-cast v3, Ljava/lang/String;

    .line 1070
    .local v3, hostoryFileName:Ljava/lang/String;
    const/4 v1, 0x0

    .line 1073
    .local v1, fos:Ljava/io/FileOutputStream;
    :try_start_0
    iget-object v11, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    #getter for: Landroid/widget/ActivityChooserModel;->mContext:Landroid/content/Context;
    invoke-static {v11}, Landroid/widget/ActivityChooserModel;->access$300(Landroid/widget/ActivityChooserModel;)Landroid/content/Context;

    move-result-object v11

    const/4 v12, 0x0

    invoke-virtual {v11, v3, v12}, Landroid/content/Context;->openFileOutput(Ljava/lang/String;I)Ljava/io/FileOutputStream;
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 1079
    invoke-static {}, Landroid/util/Xml;->newSerializer()Lorg/xmlpull/v1/XmlSerializer;

    move-result-object v10

    .line 1082
    .local v10, serializer:Lorg/xmlpull/v1/XmlSerializer;
    const/4 v11, 0x0

    :try_start_1
    invoke-interface {v10, v1, v11}, Lorg/xmlpull/v1/XmlSerializer;->setOutput(Ljava/io/OutputStream;Ljava/lang/String;)V

    .line 1083
    const-string v11, "UTF-8"

    const/4 v12, 0x1

    invoke-static {v12}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v12

    invoke-interface {v10, v11, v12}, Lorg/xmlpull/v1/XmlSerializer;->startDocument(Ljava/lang/String;Ljava/lang/Boolean;)V

    .line 1084
    const/4 v11, 0x0

    const-string v12, "historical-records"

    invoke-interface {v10, v11, v12}, Lorg/xmlpull/v1/XmlSerializer;->startTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 1086
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v9

    .line 1087
    .local v9, recordCount:I
    const/4 v4, 0x0

    .local v4, i:I
    :goto_0
    if-ge v4, v9, :cond_0

    .line 1088
    const/4 v11, 0x0

    invoke-interface {v2, v11}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Landroid/widget/ActivityChooserModel$HistoricalRecord;

    .line 1089
    .local v8, record:Landroid/widget/ActivityChooserModel$HistoricalRecord;
    const/4 v11, 0x0

    const-string v12, "historical-record"

    invoke-interface {v10, v11, v12}, Lorg/xmlpull/v1/XmlSerializer;->startTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 1090
    const/4 v11, 0x0

    const-string v12, "activity"

    iget-object v13, v8, Landroid/widget/ActivityChooserModel$HistoricalRecord;->activity:Landroid/content/ComponentName;

    invoke-virtual {v13}, Landroid/content/ComponentName;->flattenToString()Ljava/lang/String;

    move-result-object v13

    invoke-interface {v10, v11, v12, v13}, Lorg/xmlpull/v1/XmlSerializer;->attribute(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 1092
    const/4 v11, 0x0

    const-string v12, "time"

    iget-wide v13, v8, Landroid/widget/ActivityChooserModel$HistoricalRecord;->time:J

    invoke-static {v13, v14}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v13

    invoke-interface {v10, v11, v12, v13}, Lorg/xmlpull/v1/XmlSerializer;->attribute(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 1093
    const/4 v11, 0x0

    const-string v12, "weight"

    iget v13, v8, Landroid/widget/ActivityChooserModel$HistoricalRecord;->weight:F

    invoke-static {v13}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;

    move-result-object v13

    invoke-interface {v10, v11, v12, v13}, Lorg/xmlpull/v1/XmlSerializer;->attribute(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 1094
    const/4 v11, 0x0

    const-string v12, "historical-record"

    invoke-interface {v10, v11, v12}, Lorg/xmlpull/v1/XmlSerializer;->endTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_3
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_4

    .line 1087
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 1074
    .end local v4           #i:I
    .end local v8           #record:Landroid/widget/ActivityChooserModel$HistoricalRecord;
    .end local v9           #recordCount:I
    .end local v10           #serializer:Lorg/xmlpull/v1/XmlSerializer;
    :catch_0
    move-exception v0

    .line 1075
    .local v0, fnfe:Ljava/io/FileNotFoundException;
    invoke-static {}, Landroid/widget/ActivityChooserModel;->access$400()Ljava/lang/String;

    move-result-object v11

    new-instance v12, Ljava/lang/StringBuilder;

    invoke-direct {v12}, Ljava/lang/StringBuilder;-><init>()V

    const-string v13, "Error writing historical recrod file: "

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 1076
    const/4 v11, 0x0

    .line 1122
    .end local v0           #fnfe:Ljava/io/FileNotFoundException;
    :goto_1
    return-object v11

    .line 1100
    .restart local v4       #i:I
    .restart local v9       #recordCount:I
    .restart local v10       #serializer:Lorg/xmlpull/v1/XmlSerializer;
    :cond_0
    const/4 v11, 0x0

    :try_start_2
    const-string v12, "historical-records"

    invoke-interface {v10, v11, v12}, Lorg/xmlpull/v1/XmlSerializer;->endTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 1101
    invoke-interface {v10}, Lorg/xmlpull/v1/XmlSerializer;->endDocument()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_2 .. :try_end_2} :catch_1
    .catch Ljava/lang/IllegalStateException; {:try_start_2 .. :try_end_2} :catch_3
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_4

    .line 1113
    iget-object v11, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    const/4 v12, 0x1

    #setter for: Landroid/widget/ActivityChooserModel;->mCanReadHistoricalData:Z
    invoke-static {v11, v12}, Landroid/widget/ActivityChooserModel;->access$602(Landroid/widget/ActivityChooserModel;Z)Z

    .line 1114
    if-eqz v1, :cond_1

    .line 1116
    :try_start_3
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_2

    .line 1122
    .end local v4           #i:I
    .end local v9           #recordCount:I
    :cond_1
    :goto_2
    const/4 v11, 0x0

    goto :goto_1

    .line 1106
    :catch_1
    move-exception v5

    .line 1107
    .local v5, iae:Ljava/lang/IllegalArgumentException;
    :try_start_4
    invoke-static {}, Landroid/widget/ActivityChooserModel;->access$400()Ljava/lang/String;

    move-result-object v11

    new-instance v12, Ljava/lang/StringBuilder;

    invoke-direct {v12}, Ljava/lang/StringBuilder;-><init>()V

    const-string v13, "Error writing historical recrod file: "

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    iget-object v13, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    #getter for: Landroid/widget/ActivityChooserModel;->mHistoryFileName:Ljava/lang/String;
    invoke-static {v13}, Landroid/widget/ActivityChooserModel;->access$500(Landroid/widget/ActivityChooserModel;)Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12, v5}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 1113
    iget-object v11, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    const/4 v12, 0x1

    #setter for: Landroid/widget/ActivityChooserModel;->mCanReadHistoricalData:Z
    invoke-static {v11, v12}, Landroid/widget/ActivityChooserModel;->access$602(Landroid/widget/ActivityChooserModel;Z)Z

    .line 1114
    if-eqz v1, :cond_1

    .line 1116
    :try_start_5
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_2

    goto :goto_2

    .line 1117
    .end local v5           #iae:Ljava/lang/IllegalArgumentException;
    :catch_2
    move-exception v11

    goto :goto_2

    .line 1108
    :catch_3
    move-exception v7

    .line 1109
    .local v7, ise:Ljava/lang/IllegalStateException;
    :try_start_6
    invoke-static {}, Landroid/widget/ActivityChooserModel;->access$400()Ljava/lang/String;

    move-result-object v11

    new-instance v12, Ljava/lang/StringBuilder;

    invoke-direct {v12}, Ljava/lang/StringBuilder;-><init>()V

    const-string v13, "Error writing historical recrod file: "

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    iget-object v13, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    #getter for: Landroid/widget/ActivityChooserModel;->mHistoryFileName:Ljava/lang/String;
    invoke-static {v13}, Landroid/widget/ActivityChooserModel;->access$500(Landroid/widget/ActivityChooserModel;)Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_0

    .line 1113
    iget-object v11, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    const/4 v12, 0x1

    #setter for: Landroid/widget/ActivityChooserModel;->mCanReadHistoricalData:Z
    invoke-static {v11, v12}, Landroid/widget/ActivityChooserModel;->access$602(Landroid/widget/ActivityChooserModel;Z)Z

    .line 1114
    if-eqz v1, :cond_1

    .line 1116
    :try_start_7
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
    :try_end_7
    .catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_2

    goto :goto_2

    .line 1110
    .end local v7           #ise:Ljava/lang/IllegalStateException;
    :catch_4
    move-exception v6

    .line 1111
    .local v6, ioe:Ljava/io/IOException;
    :try_start_8
    invoke-static {}, Landroid/widget/ActivityChooserModel;->access$400()Ljava/lang/String;

    move-result-object v11

    new-instance v12, Ljava/lang/StringBuilder;

    invoke-direct {v12}, Ljava/lang/StringBuilder;-><init>()V

    const-string v13, "Error writing historical recrod file: "

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    iget-object v13, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    #getter for: Landroid/widget/ActivityChooserModel;->mHistoryFileName:Ljava/lang/String;
    invoke-static {v13}, Landroid/widget/ActivityChooserModel;->access$500(Landroid/widget/ActivityChooserModel;)Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_8
    .catchall {:try_start_8 .. :try_end_8} :catchall_0

    .line 1113
    iget-object v11, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    const/4 v12, 0x1

    #setter for: Landroid/widget/ActivityChooserModel;->mCanReadHistoricalData:Z
    invoke-static {v11, v12}, Landroid/widget/ActivityChooserModel;->access$602(Landroid/widget/ActivityChooserModel;Z)Z

    .line 1114
    if-eqz v1, :cond_1

    .line 1116
    :try_start_9
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
    :try_end_9
    .catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_2

    goto/16 :goto_2

    .line 1113
    .end local v6           #ioe:Ljava/io/IOException;
    :catchall_0
    move-exception v11

    iget-object v12, p0, Landroid/widget/ActivityChooserModel$PersistHistoryAsyncTask;->this$0:Landroid/widget/ActivityChooserModel;

    const/4 v13, 0x1

    #setter for: Landroid/widget/ActivityChooserModel;->mCanReadHistoricalData:Z
    invoke-static {v12, v13}, Landroid/widget/ActivityChooserModel;->access$602(Landroid/widget/ActivityChooserModel;Z)Z

    .line 1114
    if-eqz v1, :cond_2

    .line 1116
    :try_start_a
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
    :try_end_a
    .catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_5

    .line 1113
    :cond_2
    :goto_3
    throw v11

    .line 1117
    :catch_5
    move-exception v12

    goto :goto_3
.end method

redpajama_set_name: RedPajamaGithub


text:
/*
 * tests/test_testing.h
 * ------
 */

#ifndef TESTS_TEST_TESTING_H
#define TESTS_TEST_TESTING_H
#include "../base.h"
#include "testing.h"

#include "testing.h"

int test_testing_cli(int argc, char **argv);

extern unit_test_t testing_test;
extern unit_test_t *testing_tests[];

unit_test_result_t test_testing_run(unit_test_context_t *context);

/* ---------------------------------------------------------------- */

#endif /* ifndef TESTS_TEST_TESTING_H */


text:
/*
Created By: John Kadyszewski
if you want to use this code please give credit and link back to kadyszewski.com.
thank you.
 */
/*changelog*/
/*
--maded resume scalar(need to apply to the rest of the site)
--DOUBLE CHECK SCALARS.
 */

// Create the canvas
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
ctx.canvas.width = window.innerWidth;
ctx.canvas.height = window.innerHeight - 4;
ctx.canvas.zIndex = "0";
document.body.appendChild(canvas);

/*LOAD IMAGES*/
var aupdReady = false;
var aupdImage = new Image();
aupdImage.onload = function () {
	aupdReady = true;
};
aupdImage.src = "images/Arrow-Updown.png";

var abacReady = false;
var abacImage = new Image();
abacImage.onload = function () {
	abacReady = true;
};
abacImage.src = "images/Arrow-Back.png";

var aforReady = false;
var aforImage = new Image();
aforImage.onload = function () {
	aforReady = true;
};
aforImage.src = "images/Arrow-forward.png";
// Background image
var bgReady = false;
var bgImage = new Image();
bgImage.onload = function () {
	bgReady = true;
};
bgImage.src = "images/background.png";

//resume background
var bg2Ready = false;
var bg2Image = new Image();
bg2Image.onload = function () {
	bg2Ready = true;
};
bg2Image.src = "images/background3.png";

var logoReady = false;
var logoImage = new Image();
logoImage.onload = function () {
	logoReady = true;
};
logoImage.src = "images/logo.png";

//resume background
var bg3Ready = false;
var bg3Image = new Image();
bg3Image.onload = function () {
	bg3Ready = true;
};
bg3Image.src = "images/background2.png";

var bg4Ready = false;
var bg4Image = new Image();
bg4Image.onload = function () {
	bg4Ready = true;
};
bg4Image.src = "images/background5.png";

var homevaready = false;
var homeImage = new Image();
homeImage.onload = function () {
	homevaready = true;
};
homeImage.src = "images/home.png";

var musicReady = false;
var musicImage = new Image();
musicImage.onload = function () {
	musicReady = true;
};
musicImage.src = "images/music.png";

var arrowReady = false;
var arrowImage = new Image();
arrowImage.onload = function () {
	arrowReady = true;
};
arrowImage.src = "images/redarrow.png";

var notesReady = false;
var notesImage = new Image();
notesImage.onload = function () {
	notesReady = true;
};
notesImage.src = "images/notes.png";

var resumeReady = false;
var resumeImage = new Image();
resumeImage.onload = function () {
	resumeReady = true;
};
resumeImage.src = "images/resume.png";

var blogReady = false;
var blogImage = new Image();
blogImage.onload = function () {
	blogReady = true;
};
blogImage.src = "images/case.png";

var newsReady = false;
var newsImage = new Image();
newsImage.onload = function () {
	newsReady = true;
};
newsImage.src = "images/news.png";

/*variables*/
var spacingx = (ctx.canvas.width / 4);
var spacingy = (ctx.canvas.height / 4);
var menuvar = 0;
var defheight = 100;
var arrowx = ctx.canvas.width;
var logolift = ctx.canvas.height;
var homevar = 0;
var homex = 0;
var homey = 100;
var homey2 = homey + spacingy;
var homey3 = homey2 + spacingy;
var musicvar = 0;
var musicy = 100;
var musicy2 = musicy + spacingy;
var musicy3 = musicy2 + spacingy;
var musicy4 = musicy3 + spacingy;
var musicy5 = musicy4 + spacingy;
var musicy6 = musicy5 + spacingy;
var blogvar = 0;
var blogy = 100;
var blogy2 = blogy + spacingy;
var blogy3 = blogy2 + spacingy;
var blogy4 = blogy3 + spacingy;
var blogy5 = blogy4 + spacingy;
var blogy6 = blogy5 + spacingy;
var musicx = 0;
var notesx = 0;
var blogx = 0;
var biggie = 0;
var page = 0;
var resumelift = ctx.canvas.height * 1.3;
var noteslift = ctx.canvas.height * 1.3;
var homelift = ctx.canvas.height * 1.3;
var pagelift= ctx.canvas.height * 1.3;
var bloglift = ctx.canvas.width;
var bloglift2 = ctx.canvas.width;
var bloglift3 = ctx.canvas.width;
var bloglift4 = ctx.canvas.width;
var bloglift5 = ctx.canvas.width;
var bloglift6 = ctx.canvas.width;
var xstart = ctx.canvas.width / 5;
/*Sizes*/
var size1 = ctx.canvas.height / 20;
var size2 = ctx.canvas.height / 25;
var size3 = ctx.canvas.height / 30;
var size4 = ctx.canvas.height / 35;
/* Handle keyboard controls*/
var keysDown = {};

//keyboard  down listener
addEventListener("keydown", function (e) {
	keysDown[e.keyCode] = true;
}, false);
//keyboard up listener
addEventListener("keyup", function (e) {
	delete keysDown[e.keyCode];
}, false);
//load feeds from any blogfeed
google.load("feeds", "1");
var blogfeed = "http://kadyszewski.com/blog/feed/";
var redditfeed = "http://www.reddit.com/.rss";
var feedlimit = 5;
var blogtitles = new Array();
var blogdesc = new Array();
var reddittitles = new Array();
var redditdesc = new Array();

function strSplitOnLength(data, your_desired_width) {
	if (data.length <= 0)
		return []; // return an empty array

	var splitData = data.split(/([\s\n\r]+)/);
	var arr = [];
	var cnt = 0;
	for (var i = 0; i < splitData.length; ++i) {
		if (!arr[cnt])
			arr[cnt] = ''; //Instantiate array entry to empty string if null or undefined

		if (your_desired_width < (splitData[i].length + arr[cnt].length))
			cnt++;

		arr[cnt] += splitData[i];
	}

	return arr;
}
//crate feed reader for set up
function rssfeedsetup() {
	var blogpointer = new google.feeds.Feed(blogfeed); //Google Feed API method
	blogpointer.setNumEntries(feedlimit); //Google Feed API method
	blogpointer.setResultFormat(google.feeds.Feed.XML_FORMAT);
	blogpointer.load(displayfeed1); //Google Feed API method
	var redditpointer = new google.feeds.Feed(redditfeed); //Google Feed API method
	redditpointer.setNumEntries(feedlimit); //Google Feed API method
	redditpointer.setResultFormat(google.feeds.Feed.XML_FORMAT);
	redditpointer.load(displayfeed2); //Google Feed API method
}

function displayfeed1(result) {
	if (!result.error) {
		/*create item for each pulled*/
		var items = result.xmlDocument.getElementsByTagName('item');
		for (var i = 0; i < items.length; i++) {
			/*get from xml*/
			var item = items[i];
			blogtitles[i] = item.getElementsByTagName('title')[0].firstChild.nodeValue;
			blogdesc[i] = item.getElementsByTagName('content:encoded')[0].firstChild.nodeValue;
			/*remove html tags*/
			var div = document.createElement("div");
			div.innerHTML = blogdesc[i];
			blogdesc[i] = div.textContent || div.innerText || "";
		}
	} else {
		alert("Error fetching feeds!");
	}
}

function displayfeed2(result) {
	if (!result.error) {
		var items = result.xmlDocument.getElementsByTagName('item');
		for (var i = 0; i < items.length; i++) {
			var item = items[i];
			//reddittitles[i]=item.getElementsByTagName('title')[0].firstChild.nodeValue;
			//		redditdesc[i]=item.getElementsByTagName('description')[0].firstChild.nodeValue;
			var div = document.createElement("div");
			div.innerHTML = redditdesc[i];
			redditdesc[i] = div.textContent || div.innerText || "";
		}
	} else {
		alert("Error fetching feeds!");
	}
}

/* Update menu objects in response to keys*/
var update = function (modifier) {

	/*ESC key on page*/
	if (27 in keysDown)
	{
		page = 0;
		pagelift=pagelift= ctx.canvas.height * 1.3;
	}
	/*  Pagelift */
	/*CONTROLS ALTERNATIVE BACKGROUND*/
		if(page==1)
		{
			if(pagelift>0)
			{
				pagelift=pagelift-modifier*5;
			}
		}

	if(page==0)
	{
		/*Enter key on page*/
		if (menuvar == -2) {
			if (13 in keysDown)
			{
				page = 1;
			}
		}
		/*lest right key control*/
		if (37 in keysDown) { /* Player holding left*/
			if ((menuvar < 0) && ((biggie < (homex + modifier)) && biggie > homex - modifier)) {
				menuvar = menuvar + 1;
			}
		}
		if (39 in keysDown) { /* Player holding right*/
			if ((menuvar > -3) && (biggie < (homex + modifier) && biggie > homex - modifier)) {
				menuvar = menuvar - 1;
			}
		}
		/*left right key control*/

		/*blog key control*/
		if (menuvar == -3) {
			if (38 in keysDown) { /* Player holding up*/
				if ((blogvar < 0) && (blogie < (blogy + modifier) && blogie > blogy - modifier)) {
					blogvar = blogvar + 1;
				}
			}
			if (40 in keysDown) { /*Player holding down*/
				if ((blogvar > -5) && (blogie < (blogy + modifier) && blogie > blogy - modifier)) {
					blogvar = blogvar - 1;
				}
			}
		}
		/*blog key control end*/

		/*music key control*/
		if (menuvar == -1) {
			if (38 in keysDown) { /* Player holding up*/
				if ((musicvar < 0) && (musicie < (musicy + modifier) && musicie > musicy - modifier)) {
					musicvar = musicvar + 1;
				}
			}
			if (40 in keysDown) { /*Player holding down*/
				if ((musicvar > -5) && (musicie < (musicy + modifier) && musicie > musicy - modifier)) {
					musicvar = musicvar - 1;
				}
			}
		}
		/*music key control end*/

		/*home key control*/
		if (menuvar == 0) {
			if (38 in keysDown) { /* Player holding up*/
				if ((homevar < 0) && (homie < (homey + modifier) && homie > homey - modifier)) {
					homevar = homevar + 1;
				}
			}
			if (40 in keysDown) { /*Player holding down*/
				if ((homevar > -2) && (homie < (homey + modifier) && homie > homey - modifier)) {
					homevar = homevar - 1;
				}
			}
		}
		/*home key control end*/

		/*set icon spacing*/
		/*ONLY CHANGE IF ADD NEW ICONS*/
		biggie = (menuvar * spacingx + 100);/*NEED TO ALLOCATE CORRECT SPACING FOR 100*/
		homie = (homevar * spacingy + 100);
		musicie = (musicvar * spacingy + 100);
		blogie = (blogvar * spacingy + 100);
		if (biggie < homex) {
			homex = homex - modifier;
		}
		if (biggie > homex) {
			homex = homex + modifier;
		}
		musicx = homex + spacingx;
		notesx = musicx + spacingx;
		blogx = notesx + spacingx;
		if (menuvar == -3) {
			if (blogie < blogy) {
				blogy = blogy - modifier;
			}
			if (blogie > blogy) {
				blogy = blogy + modifier;
			}
			blogy2 = blogy + spacingy;
			blogy3 = blogy2 + spacingy;
			blogy4 = blogy3 + spacingy;
			blogy5 = blogy4 + spacingy;
			blogy6 = blogy5 + spacingy;
		}
		if (menuvar == -1) {
			if (musicie < musicy) {
				musicy = musicy - modifier;
			}
			if (musicie > musicy) {
				musicy = musicy + modifier;
			}
			musicy2 = musicy + spacingy;
			musicy3 = musicy2 + spacingy;
			musicy4 = musicy3 + spacingy;
			musicy5 = musicy4 + spacingy;
			musicy6 = musicy5 + spacingy;
		}
		if (menuvar == 0) {
			if (homie < homey) {
				homey = homey - modifier;
			}
			if (homie > homey) {
				homey = homey + modifier;
			}
			homey2 = homey + spacingy;
			homey3 = homey2 + spacingy;
		}
		/*end icon spacing*/

		/*home ****DISPLAY RED ARRAY AND KADYSZEWSKI LOGO*/
		if (menuvar == 0 && homevar == 0) {
			if (arrowx > ctx.canvas.width -130) {
				arrowx = arrowx - modifier;
			}
			if (arrowx < ctx.canvas.width -130) {
				arrowx = arrowx + modifier;
			}
			if (logolift > ctx.canvas.height * (5 / 8)) {
				logolift = logolift - modifier * 1.5;
			}
			if (logolift < ctx.canvas.height * (5 / 8)) {
				logolift = logolift + modifier * 1.5;
			}
		}
		if (menuvar != 0 || homevar != 0) {
			if (arrowx < ctx.canvas.width + 10) {
				arrowx = arrowx + modifier;
			}
			if (arrowx > ctx.canvas.width + 10) {
				arrowx = arrowx - modifier;
			}
			if (logolift < ctx.canvas.height + 70) {
				logolift = logolift + modifier * 2;
			}
			if (logolift > ctx.canvas.height + 70) {
				logolift = logolift - modifier * 2;
			}
		}
		/*home end*/

		/*resume ***SIMPLE TEXT DISPLAY****/
		if (menuvar == 0 && homevar == -2) {
			if (resumelift > ctx.canvas.height / 8) {
				resumelift = resumelift - modifier * 2;
			}
		}
		if (menuvar == 1 || menuvar == -1) {
			if (homevar == -2) {
				if (resumelift < ctx.canvas.height * 1.3) {
					resumelift = resumelift + modifier * 2;
				}
			}
		}
		if (homevar == -1 || homevar == -3) {
			if (resumelift < ctx.canvas.height * 1.3) {
				resumelift = resumelift + modifier * 2;
			}
		}
		/*resume end*/

		/*about me  ***SIMPLE TEXT DISPLAY****/
		if (menuvar == 0 && homevar == -1) {
			if (noteslift > ctx.canvas.height / 8) {
				noteslift = noteslift - modifier * 2;
			}
		}
		if (menuvar == 1 || menuvar == -1) {
			if (homevar == -1) {
				if (noteslift < ctx.canvas.height * 1.3) {
					noteslift = noteslift + modifier * 2;
				}
			}
		}
		if (homevar == 0 || homevar == -2) {
			if (noteslift < ctx.canvas.height * 1.3) {
				noteslift = noteslift + modifier * 2;
			}
		}
		/*about me end*/
		if (13 in keysDown) { /* Player holding enter*/
			if (menuvar == 0) {}
			if (menuvar == 1) {}
		}
	}
};

// Draw all things to the screen
var render = function () {
	if(page == 1)//overlay separate background for alternative display
	{
		if (bg3Ready) {
			for (var w = 0; w < ctx.canvas.width; w += bg3Image.width) {
				for (var h = 0; h < ctx.canvas.height; h += bg3Image.height) {
					ctx.drawImage(bg3Image, w, h+pagelift);
				}
			}
		}
	}
	else
	{
	/*Draw the background*/
	if (bg4Ready) {
		for (var w = 0; w < ctx.canvas.width; w += bg4Image.width) {
			for (var h = 0; h < ctx.canvas.height; h += bg4Image.height) {
				ctx.drawImage(bg4Image, w, h);
			}
		}
	}
	/*opacities x*/
	var musicxr = musicx / 100;
	var homexr = homex / 100;
	var notesxr = notesx / 100;
	var blogxr = blogx / 100;

	/*opacities y*/
	var musicyr = (musicy / 100);
	var musicy2r = (musicy2 / 100);
	var musicy3r = (musicy3 / 100);
	var musicy4r = (musicy4 / 100);
	var musicy5r = (musicy5 / 100);
	var musicy6r = (musicy6 / 100);
	var homeyr = (homey / 100);
	var homey2r = (homey2 / 100);
	var homey3r = (homey3 / 100);
	var blogyr = (blogy / 100);
	var blogy2r = (blogy2 / 100);
	var blogy3r = (blogy3 / 100);
	var blogy4r = (blogy4 / 100);
	var blogy5r = (blogy5 / 100);
	var blogy6r = (blogy6 / 100);

	/*opacities final*/
	var blogo=1.0 / blogxr / blogyr;
	var blogo2=1.0 / blogxr / blogy2r;
	var blogo3=1.0 / blogxr / blogy3r;
	var blogo4=1.0 / blogxr / blogy4r;
	var blogo5=1.0 / blogxr / blogy5r;
	var blogo6=1.0 / blogxr / blogy6r;
	var musico=1.0 / musicxr / musicyr;
	var musico2=1.0 / musicxr / musicy2r;
	var musico3=1.0 / musicxr / musicy3r;
	var musico4=1.0 / musicxr / musicy4r;
	var musico5=1.0 / musicxr / musicy5r;
	var musico6=1.0 / musicxr / musicy6r;

	/*text locators*/
	var blogtext = blogx+110;
	var musictext = musicx+110;
	var hometext = homex+110;

	/*blog*/
	ctx.fillStyle = "#B8B8B8 ";
	ctx.font = "bold 30px Rockwell";
	ctx.save();
	ctx.globalAlpha = blogo;
	ctx.drawImage(blogImage, blogx, blogy);
	ctx.fillText(blogtitles[0], blogtext, blogy + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = blogo2;
	ctx.drawImage(blogImage, blogx, blogy2);
	ctx.fillText(blogtitles[1], blogtext, blogy2 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = blogo3;
	ctx.drawImage(blogImage, blogx, blogy3);
	ctx.fillText(blogtitles[2], blogtext, blogy3 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = blogo4;
	ctx.drawImage(blogImage, blogx, blogy4)
	ctx.fillText(blogtitles[3], blogtext, blogy4 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = blogo5;
	ctx.drawImage(blogImage, blogx, blogy5);
	ctx.fillText(blogtitles[4], blogx + 110, blogy5 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = blogo6;
	ctx.drawImage(blogImage, blogx, blogy6);
	ctx.fillText("Go to blog homepage", blogx + 110, blogy6 + 55);
	ctx.restore();

	/*notes*/
	ctx.save();
	ctx.fillStyle = "#B8B8B8 ";
	ctx.font = "bold 30px Rockwell";
	ctx.globalAlpha = 1.0 / notesxr;
	ctx.drawImage(notesImage, notesx, defheight);
	ctx.fillText("page", notesx + 110, defheight + 55);
	ctx.restore();

	/*music*/
	ctx.save();
	ctx.fillStyle = "#B8B8B8 ";
	ctx.font = "bold 30px Rockwell";
	ctx.globalAlpha = musico;
	ctx.drawImage(musicImage, musicx, musicy);
	ctx.fillText("coming soon", musictext, musicy + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = musico2;
	ctx.drawImage(musicImage, musicx, musicy2);
	ctx.fillText("coming soon", musictext, musicy2 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = musico3;
	ctx.drawImage(musicImage, musicx, musicy3);
	ctx.fillText("coming soon", musictext, musicy3 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = musico4;
	ctx.drawImage(musicImage, musicx, musicy4);
	ctx.fillText("coming soon", musictext, musicy4 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = musico5;
	ctx.drawImage(musicImage, musicx, musicy5);
	ctx.fillText("coming soon", musictext, musicy5 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = musico6;
	ctx.drawImage(musicImage, musicx, musicy6);
	ctx.fillText("coming soon", musictext, musicy6 + 55);
	ctx.restore();

	/*home*/
	ctx.save();
	ctx.globalAlpha = 1.0 / homexr / homeyr;
	ctx.drawImage(homeImage, homex, homey);
	ctx.fillText("Home", hometext, homey + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = 1.0 / homexr / homey2r;
	ctx.drawImage(notesImage, homex, homey2);
	ctx.fillText("About", hometext, homey2 + 55);
	ctx.restore();
	ctx.save();
	ctx.globalAlpha = 1.0 / homexr / homey3r;
	ctx.drawImage(resumeImage, homex, homey3);
	ctx.fillText("Resume", hometext, homey3 + 55);
	ctx.restore();

	/*logo*/
	ctx.save();
	ctx.drawImage(logoImage, xstart, logolift);
	ctx.restore();

	/*redarrow*/
	ctx.save();
	ctx.drawImage(arrowImage, arrowx, ctx.canvas.height-250);
	ctx.restore();

	if ((menuvar == 0 || menuvar == -1 || menuvar == 1) && (homevar == -1 || homevar == 0 || homevar == -2)) {
		/*backround for text better just overlayed
		if (bg3Ready) {
		for (var w = 0; w < ctx.canvas.width-(ctx.canvas.width/2); w += bg3Image.width){
		for (var h = 0; h < ctx.canvas.height/2; h  += bg3Image.height){
		ctx.drawImage(bg3Image, w+ctx.canvas.width/4, h+noteslift);
		}
		}
		}
		 */
		text = noteslift;
		ctx.fillStyle = "#B8B8B8 ";
		ctx.font = "bold " + size1 + "px Rockwell";
		ctx.fillText("ABOUT", xstart, text);
		text += size1;

		ctx.font = "bold " + size2 + "px Rockwell";
		ctx.fillText("Kadyszewski.com", xstart, text);
		text += size2

		ctx.font = "bold " + size2 + "px Rockwell";
		ctx.fillText("Simple.Interface.Design", xstart, text);
		text += size2;

		ctx.font = "bold " + size4 + "px Rockwell";
		ctx.fillText("This is the personal homepage and website of John Kadyszewski.", xstart, text);
		text += size4;
		ctx.fillText("It was developed in an HTML5 canvas element and links out to", xstart, text);
		text += size4;
		ctx.fillText("my projects as well as my blog posts and the latest", xstart, text);
		text += size4;
		ctx.fillText("google news.", xstart, text);
	}
	if (menuvar == -3) {
		if (blogvar > -5) {
			ctx.fillStyle = "#B8B8B8 ";
			ctx.font = "bold +" + size4 + "px Rockwell";
			if (blogvar < 1) {
				var blogger = strSplitOnLength(blogdesc[Math.abs(blogvar)], ctx.canvas.width / 17);
				for (var i = 0; i < blogger.length; i++) {
					if (i > 0) {
						blogger[i] = blogger[i].replace("undefined", "");
					}
					ctx.fillText(blogger[i], xstart, ctx.canvas.height / 4 + (size4 * i));
				}
			}
		}
	}
	//place on the way
	if ((menuvar == 0 || menuvar == -1 || menuvar == 1) && (homevar == -1 || homevar == -3 || homevar == -2)) {
		/*background but better overlayed
		if (bg2Ready) {
		for (var w = 0; w < ctx.canvas.width-(ctx.canvas.width/2); w += bg2Image.width){
		for (var h = 0; h < ctx.canvas.height/2; h  += bg2Image.height){
		ctx.drawImage(bg2Image, w+ctx.canvas.width/4, h+resumelift);
		}
		}
		}
		 */
		text = resumelift;
		ctx.fillStyle = "#B8B8B8 ";
		ctx.font = "bold " + size1 + "px Rockwell";
		ctx.fillText("RESUME",  xstart, text);
		text += size1;

		ctx.font = "bold " + size2 + "px Rockwell";
		ctx.fillText("John Kadyszewski", xstart, text);
		text += size2;

		ctx.font = "bold " + size3 + "px Rockwell";
		ctx.fillText("Email for phone number", xstart, text);
		text += size3;

		ctx.fillText("sjkady@gmail.com", xstart, text);
		text += size2;

		ctx.font = "bold " + size2 + "px Rockwell";
		ctx.fillText("Education", xstart, text);
		text += size2

		ctx.font = "bold " + size3 + "px Rockwell";
		ctx.fillText("University of Mary Washington <> Fredericksburg, VA <> 2010-Present", xstart , text);
		text += size3;

		ctx.fillText("Major: Computer Science", xstart , text);
		text += size3;

		ctx.font = "bold " + size2 + "px Rockwell";
		ctx.fillText("Experience", xstart , text);
		text += size2;

		ctx.font = "bold " + size3 + "px Rockwell";
		ctx.fillText("UMW EAS Department Aide(2011-Present) <> Fredericksburg, VA", xstart , text);
		text += size3;

		ctx.font = "bold " + size4+ "px Rockwell";
		ctx.fillText("I currently work part-time at the university of Mary Washington for Enterprise", xstart , text);
		text += size4
		ctx.fillText("Application Services Department where I perform several duties. My main job is", xstart , text);
		text += size4
		ctx.fillText("development and maintenance of SQL reports for the school but I also have been ", xstart , text);
		text += size4
		ctx.fillText("involved in projects of web development for computers and mobile, graphic design,", xstart , text);
		text += size4
		ctx.fillText("and Visio markups.", xstart , text);
		text += size4

		ctx.font = "bold " + size3 + "px Rockwell";
		ctx.fillText("Chinese Food Delivery (2011-2013) <> McLean, VA", xstart , text);
		text += size3;

		ctx.font = "bold " + size4+ "px Rockwell";
		ctx.fillText("Worked as a delivery driver for wok and roll Chinese restaurant in McLean, VA ", xstart , text);
		text += size4;
		ctx.fillText("Delivered Chinese food in rush hour Northern VA traffic has helped me develop", xstart , text);
		text += size4;
		ctx.fillText("good patience and driving skills", xstart , text);
		text += size2;

		ctx.font = "bold " + size2 + "px Rockwell";
		ctx.fillText("Technology", xstart , text);
		text += size2;

		ctx.font = "bold " + size4+ "px Rockwell";
		ctx.fillText(">Java", xstart , text);
		text += size4;
		ctx.fillText(">SQL", xstart , text);
		text += size4;
		ctx.fillText(">Web Development(HTML, CSS, JavaScript, J Query, PHP)", xstart , text);
		text += size4;
		ctx.fillText(">C++ ", xstart , text);
		text += size4;
		ctx.fillText(">Python ", xstart , text);
		text += size4;
		ctx.fillText(">3D Graphics with OpenGL ", xstart , text);
		text += size4;
		ctx.fillText(">Microsoft office ", xstart , text);
		text += size4;
		ctx.fillText(">Image editing with GIMP or Photoshop ", xstart , text);
	}
	ctx.save();
	ctx.globalAlpha = 1.0;
	ctx.drawImage(abacImage, ctx.canvas.width - 150, ctx.canvas.height - 60);
	ctx.drawImage(aupdImage, ctx.canvas.width - 110, ctx.canvas.height - 60);
	ctx.drawImage(aforImage, ctx.canvas.width - 70, ctx.canvas.height - 60);
	ctx.restore();
	}
};
var main = function () {
	var now = Date.now();
	var delta = now - then; //time passed for frame adjustment.
	update(delta);
	render();
	then = now;
};
var then = Date.now();
var animater;//store the animation so it doesn't reallocate the variable
var start = function () {
	var element = document.getElementById("loading-image");
	element.outerHTML = "";
	delete element;
	animater = setInterval(main, 55);
};
window.onload = function () {
	rssfeedsetup();
	setTimeout(start, 1250);//timeout to make sure all the images load on time
}


text:
#include "pocl_cl.h"

CL_API_ENTRY cl_int CL_API_CALL
POname(clRetainCommandQueue)(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0
{
  POCL_RETAIN_OBJECT(command_queue);
  return CL_SUCCESS;
}
POsym(clRetainCommandQueue)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>de.hpi.bpt.chimera.jcomparser.jaxb Class Hierarchy</title>
<meta name="date" content="2016-07-19">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package de.hpi.bpt.chimera.jcomparser.jaxb

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

de.hpi.bpt.chimera.jcomparser.saving.AbstractControlNode

de.hpi.bpt.chimera.jcomparser.jaxb.AbstractDataControlNode

de.hpi.bpt.chimera.jcomparser.jaxb.BoundaryEvent

de.hpi.bpt.chimera.jcomparser.jaxb.EndEvent

de.hpi.bpt.chimera.jcomparser.jaxb.IntermediateCatchEvent

de.hpi.bpt.chimera.jcomparser.jaxb.IntermediateThrowEvent

de.hpi.bpt.chimera.jcomparser.jaxb.ReceiveTask

de.hpi.bpt.chimera.jcomparser.jaxb.SendTask

de.hpi.bpt.chimera.jcomparser.jaxb.StartEvent

de.hpi.bpt.chimera.jcomparser.jaxb.Task

de.hpi.bpt.chimera.jcomparser.jaxb.WebServiceTask

de.hpi.bpt.chimera.jcomparser.jaxb.EventBasedGateway

de.hpi.bpt.chimera.jcomparser.jaxb.ExclusiveGateway

de.hpi.bpt.chimera.jcomparser.jaxb.ParallelGateway

de.hpi.bpt.chimera.jcomparser.jaxb.BpmnProcessXml

de.hpi.bpt.chimera.jcomparser.jaxb.DataNode

de.hpi.bpt.chimera.jcomparser.jaxb.Edge

de.hpi.bpt.chimera.jcomparser.jaxb.DataInputAssociation

de.hpi.bpt.chimera.jcomparser.jaxb.DataOutputAssociation

de.hpi.bpt.chimera.jcomparser.jaxb.SequenceFlow

de.hpi.bpt.chimera.jcomparser.jaxb.FragmentXmlWrapper

de.hpi.bpt.chimera.jcomparser.jaxb.MessageDefinition

de.hpi.bpt.chimera.jcomparser.jaxb.TimerDefinition

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
"""
Инструменарий для упрощённого создания ActionPack`ов для зависимых моделей
"""

import objectpack

class SlavePack(objectpack.ObjectPack):
    """
    "Ведомый" набор действий. Используется чаще всего для грида внутри
    окна редактирования объекта, отображающего объеты,
    связанные с редактируемым
    """
    # parents - список полей в модели которые должны браться из контекста
    # например: parents = ['employer', 'subject']
    parents = []

    __parents_cached = None

    @property
    def _parents(self):
        """
        Возвращает структуру вида:
        [
            (id_param_name род.пака, род.поле),
            ...
        ]
        """
        if self.__parents_cached:
            return self.__parents_cached
        result = self.__parents_cached = []
        for parent in self.parents:
            f = self.model._meta.get_field(parent)
            # pack ищется в реестре "модель-pack", который должен
            pack = self._get_model_pack(f.rel.to.__name__)
            if pack:
                result.append((
                    pack.id_param_name,
                    parent
                ))
        return result

    def declare_context(self, action):
        """
        Возвращает декларацию контекста для экшна
        """
        result = super(SlavePack, self).declare_context(action)
        if action in (
            self.list_window_action,
            self.rows_action,
            self.edit_window_action,
            self.new_window_action,
            self.save_action
        ):
            # для экшнов декларируются id родителей
            result = result or {}
            for p in self._parents:
                result[p[0]] = {'type': 'int'}
        return result

    def _get_parents_dict(self, context, key_fmt='%s'):
        """
        Возвращает словарь из параметров контекста, представляющих родителей
        """
        return dict(
            (key_fmt % field_name, getattr(context, id_param_name))
            for id_param_name, field_name in self._parents
        )

    def save_row(self, obj, create_new, request, context):
        obj.__dict__.update(
            self._get_parents_dict(context, key_fmt='%s_id')
        )
        return super(SlavePack, self).save_row(
            obj, create_new, request, context)

    def get_rows_query(self, request, context):
        q = super(SlavePack, self).get_rows_query(request, context)
        return q.filter(**self._get_parents_dict(context))

    # SlavePack обычно не является основным для модели
    _is_primary_for_model = False


text:
package org.apache.hadoop.nfs.nfs3.response;

import org.apache.hadoop.oncrpc.XDR;
import org.apache.hadoop.oncrpc.security.Verifier;

/**
 * RENAME3 Response
 */
public class RENAME3Response extends NFS3Response {
  private final WccData fromDirWcc;
  private final WccData toDirWcc;

  public RENAME3Response(int status) {
    this(status, new WccData(null, null), new WccData(null, null));
  }

  public RENAME3Response(int status, WccData fromWccData, WccData toWccData) {
    super(status);
    this.fromDirWcc = fromWccData;
    this.toDirWcc = toWccData;
  }

  public WccData getFromDirWcc() {
    return fromDirWcc;
  }

  public WccData getToDirWcc() {
    return toDirWcc;
  }

  @Override
  public XDR writeHeaderAndResponse(XDR out, int xid, Verifier verifier) {
    super.writeHeaderAndResponse(out, xid, verifier);
    fromDirWcc.serialize(out);
    toDirWcc.serialize(out);
    return out;
  }
}


text:
'use strict';

describe('Service: columnGraphValues', function () {

  // load the service's module
  beforeEach(module('globiProtoApp'));

  // instantiate service
  var columnGraphValues;
  beforeEach(inject(function (_columnGraphValues_) {
    columnGraphValues = _columnGraphValues_;
  }));

  it('should do something', function () {
    expect(!!columnGraphValues).toBe(true);
  });

});


text:
The examples of RDB are organized in following directories:

* `quickstart/`: a simple SCUD Node.js style code to demonstrate how to use it.
* `spec/`: all code in [RDB spec](https://arthurhsu.github.io/rdb).


text:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="orgchart.xsl"?>
<chairman empID="emp3456" empdate="1976-03-21">
  <name>Kim Akers</name>
  <president empID="emp4390" empdate="1980-06-18">
    <name>Steve Masters</name>
    <division>Domestic</division>
    <groupvp empID="emp9801" empdate="1981-09-01">
      <!--first comment-->
      <name>Shelly Szymanski</name>
      <department>Sales</department>
      <director empID="emp5443" empdate="1993-04-19">
        <name>Cindy Durkin</name>
        <region>Northeast</region>
      </director>
      <director empID="emp2348" empdate="1990-06-02">
        <name>Michelle Votava</name>
        <region>Southeast</region>
      </director>
      <director empID="emp4322" empdate="1995-05-26">
        <name>John Tippett</name>
        <region>Southwest</region>
      </director>
      <director empID="emp4587" empdate="1990-12-20">
        <name>Alan Steiner</name>
        <region>Northwest</region>
      </director>
    </groupvp>
    <groupvp empID="emp4320" empdate="1978-11-09">
      <name>John Thorson</name>
      <department>Marketing</department>
    </groupvp>
    <groupvp empID="emp3961" empdate="1990-01-01">
      <name>Josh Barnhill</name>
      <department>Production</department>
    </groupvp>
  </president>
  <president empID="emp4238" empdate="1984-08-12">
    <name>Katie McAskill-White</name>
    <division>International</division>
    <groupvp empID="emp7216" empdate="1987-04-13">
      <name>Neil Charney</name>
      <department>Sales</department>
      <director empID="emp9032" empdate="1982-08-31">
        <name>Beth Silverberg</name>
        <region>Africa</region>
      </director>
      <director empID="emp7634" empdate="1994-02-12">
        <name>Lani Ota</name>
        <region>Asia</region>
      </director>
      <director empID="emp9032" empdate="1991-10-03">
        <name>Peter Porzuczek</name>
        <region>Europe</region>
      </director>
    </groupvp>
    <groupvp empID="emp3833" empdate="1991-05-15">
      <name>Marea Angela Castaneda</name>
      <department>Marketing</department>
    </groupvp>
  </president>
</chairman>


text:
"use strict";

// Expect module.
import {expect} from 'chai'

// Request module.
import request from 'request'

// HTTP.
import http from 'http'

// Source.
import * as auth from '../src/http-auth'

// Utils.
import * as utils from '../src/auth/utils'

// Digest auth.
describe('digest', function () {
    describe('nofile', function () {
        let server = undefined;

        before(function() {
            // Configure authentication.
            const digest = auth.digest({
                realm: "Simon Area."
            }, function(username, callback) {
                if (username === "simon") {
                    callback(utils.md5("simon:Simon Area.:smart"));
                } else if (username === "gevorg") {
                    callback(new Error("Error comes here"));
                } else {
                    callback();
                }
            });

            // Add error listener.
            digest.on('error', function() {
                console.log("Error thrown!");
            });

            // Creating new HTTP server.
            server = http.createServer(digest, function (req, res) {
                res.end(`Welcome to private area - ${req.user}!`);
            });

            // Start server.
            server.listen(1337);
        });

        after(function() {
            server.close();
        });

        it('error', function (done) {
            const callback = function (error, response, body) {
                expect(body).to.equal("Error comes here");
                done();
            };

            // Test request.
            request.get('http://127.0.0.1:1337', callback).auth('gevorg', 'gpass', false);
        });

        it('success', function (done) {
            const callback = function(error, response, body) {
                expect(body).to.equal("Welcome to private area - simon!");
                done();
            };

            // Test request.
            request.get('http://127.0.0.1:1337', callback).auth('simon', 'smart', false);
        });

        it('comma URI', function (done) {
            const callback = function(error, response, body) {
                expect(body).to.equal("Welcome to private area - simon!");
                done();
            };

            // Test request.
            request.get('http://127.0.0.1:1337/comma,/', callback).auth('simon', 'smart', false);
        });

        it('wrong password', function (done) {
            const callback = function(error, response, body) {
                expect(body).to.equal("401 Unauthorized");
                done();
            };

            // Test request.
            request.get('http://127.0.0.1:1337', callback).auth('simon', 'woolf', false);
        });

        it('wrong user', function (done) {
            const callback = function(error, response, body) {
                expect(body).to.equal("401 Unauthorized");
                done();
            };

            // Test request.
            request.get('http://127.0.0.1:1337', callback).auth('virgina', 'smart', false);
        });
    });
});


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

namespace MvcFlash.Sample.Models
{
    public class FlashImage
    {
        public string Alt { get; set; }
        public string Link { get; set; }
    }
}


text:
<?php namespace Fisharebest\Localization\Locale;

class LocaleNusSd extends LocaleNus {
}


text:
package CC130_OtherCollection_Properties;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

/*
 * ʹÓÃPropertiesÊä³öµ½Îļþ£¨ ×ÊÔ´ÅäÖÃÎļþ£©
 *1.store(OutputStream out,String comments)
 *	store(Writer writer,String comments)
  2.storeToXML(OutputStream os,String comments)
	storeToXML(OutputStream os,String comments,String encoding)

 */
public class Demo02 {

	public static void main(String[] args) throws FileNotFoundException, IOException {
		Properties pro =new Properties();
		//´æ´¢
		pro.setProperty("vero","Alicc");
		pro.setProperty("vnix","Alicc2");
		pro.setProperty("vvvv","Alicc3");
		pro.setProperty("veeee","Alicc4");

		//´æ´¢µ½e:/others(ʹÓþø¶Ô·¾¶)
//		pro.store(new FileOutputStream(new File("e:/others/db.properties")), "dbÅäÖÃ");
//		pro.storeToXML(new FileOutputStream(new File("e:/others/db.properties")), "dbÅäÖÃ");

		//´æ´¢µ½(ʹÓÃÏà¶Ô·¾¶£¬µ±Ç°¹¤³ÌÖÐ)
		pro.store(new FileOutputStream(new File("src/CC130_OtherCollection_Properties/db.properties")), "dbÅäÖÃ");
	}

}


text:
#import "FIRAuthDefaultUIDelegate.h"

#import <FirebaseCore/FIRAppEnvironmentUtil.h>

NS_ASSUME_NONNULL_BEGIN

@interface FIRAuthDefaultUIDelegate ()

/** @fn initWithViewController:
    @brief Initializes the instance with a view controller.
    @param viewController The view controller as the presenting view controller in @c
        FIRAuthUIDelegate.
    @return The initialized instance.
 */
- (instancetype)initWithViewController:(UIViewController *)viewController NS_DESIGNATED_INITIALIZER;

@end

@implementation FIRAuthDefaultUIDelegate {
  /** @var _viewController
      @brief The presenting view controller.
   */
  UIViewController *_viewController;
}

- (instancetype)initWithViewController:(UIViewController *)viewController {
  self = [super init];
  if (self) {
    _viewController = viewController;
  }
  return self;
}

- (void)presentViewController:(UIViewController *)viewControllerToPresent
                     animated:(BOOL)flag
                   completion:(nullable void (^)(void))completion {
  [_viewController presentViewController:viewControllerToPresent
                                animated:flag
                              completion:completion];
}

- (void)dismissViewControllerAnimated:(BOOL)flag completion:(nullable void (^)(void))completion {
  [_viewController dismissViewControllerAnimated:flag completion:completion];
}

+ (id<FIRAuthUIDelegate>)defaultUIDelegate {
  // iOS App extensions should not call [UIApplication sharedApplication], even if UIApplication
  // responds to it.
  static Class applicationClass = nil;
  if (![FIRAppEnvironmentUtil isAppExtension]) {
    Class cls = NSClassFromString(@"UIApplication");
    if (cls && [cls respondsToSelector:NSSelectorFromString(@"sharedApplication")]) {
      applicationClass = cls;
    }
  }
  UIApplication *application = [applicationClass sharedApplication];
  UIViewController *topViewController = application.keyWindow.rootViewController;
  while (true){
    if (topViewController.presentedViewController) {
      topViewController = topViewController.presentedViewController;
    } else if ([topViewController isKindOfClass:[UINavigationController class]]) {
      UINavigationController *nav = (UINavigationController *)topViewController;
      topViewController = nav.topViewController;
    } else if ([topViewController isKindOfClass:[UITabBarController class]]) {
      UITabBarController *tab = (UITabBarController *)topViewController;
      topViewController = tab.selectedViewController;
    } else {
      break;
    }
  }
  return [[FIRAuthDefaultUIDelegate alloc] initWithViewController:topViewController];
}

@end

NS_ASSUME_NONNULL_END


text:
#ifndef SINGA_NEURALNET_LOSS_LAYER_H_
#define SINGA_NEURALNET_LOSS_LAYER_H_

#include "neuralnet/layer.h"

/**
 * \file this file includes the declarations of layers that inherit the base
 * LossLayer for measuring the objective training loss.
 */
namespace singa {
/**
 * Squared Euclidean loss as 0.5 ||predict - ground_truth||^2.
 */
class EuclideanLossLayer : public LossLayer {
 public:
  void ComputeFeature(int flag, Metric* perf) override;
  void ComputeGradient(int flag, Metric* perf) override;
};

/**
 * Cross-entropy loss applied to the probabilities after Softmax.
 */
class SoftmaxLossLayer : public LossLayer {
 public:
  void Setup(const LayerProto& proto, int npartitions) override;
  void ComputeFeature(int flag, Metric* perf) override;
  void ComputeGradient(int flag, Metric* perf) override;

  /**
   * softmax is not recommendeded for partition because it requires the whole
   * src layer for normalization.
   */
  ConnectionType src_neuron_connection(int k) const override {
    // CHECK_LT(k, srclayers_.size());
    return kOneToAll;
  }

 private:
  int batchsize_;
  int dim_;
  float scale_;
  int topk_;
};

}  // namespace singa

#endif  // SINGA_NEURALNET_LOSS_LAYER_H_


text:
module CI
  module Reporter
    class Cucumber
      VERSION = "1.0.0"
    end
  end
end


text:
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six

# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
    import builtins as __builtin__

    long = int
elif six.PY2:
    import __builtin__

from . import neighbor

class neighbors(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/ipv6/neighbors. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Enclosing container for list of IPv6 neighbors
  """
    __slots__ = ("_path_helper", "_extmethods", "__neighbor")

    _yang_name = "neighbors"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__neighbor = YANGDynClass(
            base=YANGListType(
                "ip",
                neighbor.neighbor,
                yang_name="neighbor",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="ip",
                extensions=None,
            ),
            is_container="list",
            yang_name="neighbor",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="list",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "interfaces",
                "interface",
                "subinterfaces",
                "subinterface",
                "ipv6",
                "neighbors",
            ]

    def _get_neighbor(self):
        """
    Getter method for neighbor, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/neighbors/neighbor (list)

    YANG Description: List of IPv6 neighbors
    """
        return self.__neighbor

    def _set_neighbor(self, v, load=False):
        """
    Setter method for neighbor, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/neighbors/neighbor (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_neighbor is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_neighbor() directly.

    YANG Description: List of IPv6 neighbors
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType(
                    "ip",
                    neighbor.neighbor,
                    yang_name="neighbor",
                    parent=self,
                    is_container="list",
                    user_ordered=False,
                    path_helper=self._path_helper,
                    yang_keys="ip",
                    extensions=None,
                ),
                is_container="list",
                yang_name="neighbor",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/interfaces/ip",
                defining_module="openconfig-if-ip",
                yang_type="list",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """neighbor must be of a type compatible with list""",
                    "defined-type": "list",
                    "generated-type": """YANGDynClass(base=YANGListType("ip",neighbor.neighbor, yang_name="neighbor", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ip', extensions=None), is_container='list', yang_name="neighbor", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='list', is_config=True)""",
                }
            )

        self.__neighbor = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_neighbor(self):
        self.__neighbor = YANGDynClass(
            base=YANGListType(
                "ip",
                neighbor.neighbor,
                yang_name="neighbor",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="ip",
                extensions=None,
            ),
            is_container="list",
            yang_name="neighbor",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="list",
            is_config=True,
        )

    neighbor = __builtin__.property(_get_neighbor, _set_neighbor)

    _pyangbind_elements = OrderedDict([("neighbor", neighbor)])


text:
+++
title = "Mi experiencia en la GameJam 2017 "
categories = ["dev"]
mainclass = "dev"
author = "alex"
description = "Hace unas semanas participé en mi primera GameJam. Nunca había programado un juego así que tenía curiosidad y fue todo un reto para mi. Teníamos 48 horas para presentar un prototipo mínimo. Nuestro equipo decidió usar el motor Godot. En total estábamos cuatro personas: @Cristina, @ElenoideArt, @JJ Ramos y yo."
image = "gamejam17-unlimitosis.jpg"
date = "2017-04-11T09:53:42+02:00"
lastmod = "2017-10-06T11:22:46+01:00"
url = "/gamejam-2017-unlimitosis"
[amp]
    elements = ["amp-youtube"]
+++

Hace unas semanas participé en mi primera __GameJam__. Nunca había programado un juego así que tenía curiosidad y fue todo un reto para mi. Teníamos 48 horas para presentar un prototipo mínimo. Nuestro equipo decidió usar el motor __Godot__. En total estábamos cuatro personas: [@Cristina](/author/cristina/), @ElenoideArt, @JJ Ramos y yo.

# Descripción del juego

Unlimitosis

@ElenoideArt fue nuestra diseñadora y también es __bióloga__, así que pensamos en un juego en el cual aparecen células en la pantalla y eventualmente se vuelve _cancerígenas_, el jugador debe eliminarlas antes de que se reproduzcan. A continuaión muestro una grabación del juego en acción:

<amp-youtube
    data-videoid="LeyDyRMDmQ4"
    layout="responsive"
    sizes="(min-width: 800px) 800px, 100vw"
    width="800" height="600">
</amp-youtube>

Como puedes ver, el juego es bastante sencillo, pero bueno, ninguno sabíamos hacer juegos el día de antes de la __GameJam__. Si quieres mejorar, probar o jugar, el código está en Repo Unlimitosis.

# Documentación

Para desarrollar el juego nos bastó con la documentación de _Godot_, extensa y bien explicada. También existe un repositorio GitHub con montones de ejemplos.

# Prueba el juego

Gracias a __JJ Ramos__ tenemos una versión web del juego, puedes probarla en juanjoseramos.com/unlimitosis/.


text:
using System;
using System.Data;

namespace PCSComUtils.Admin.DS
{
	[Serializable]
	public class Sys_Role_ControlGroupVO
	{
		private int mRole_ControlGroupID;
		private int mRoleID;
		private int mControlGroupID;

		public int Role_ControlGroupID
		{
			set { mRole_ControlGroupID = value; }
			get { return mRole_ControlGroupID; }
		}
		public int RoleID
		{
			set { mRoleID = value; }
			get { return mRoleID; }
		}
		public int ControlGroupID
		{
			set { mControlGroupID = value; }
			get { return mControlGroupID; }
		}
	}
}


text:
package com.morcinek.android.codegenerator.plugin.ui;

public interface StringResources {

    String CREATOR_BEAN_LABEL = "Bean";
    String PACKAGE_LABEL = "Package";
    String SOURCE_PATH_LABEL = "Source Path";
    String TITLE_FORMAT_TEXT = "Code generated from: '%s'";
    String COPY_ACTION_LABEL = "Copy Code To Clipboard";
    String CREATE_ACTION_LABEL = "Create File";

    String OVERRIDE_DIALOG_TITLE = "File Already Exists";
    String OVERRIDE_DIALOG_MESSAGE = "File '%s/%s' already exists.\nDo you want to override file content with generated code.";
    String OVERRIDE_DIALOG_YES_TEXT = "Override";
    String OVERRIDE_DIALOG_NO_TEXT = "Cancel";

    String MISSING_SOURCE_PATH_DIALOG_MESSAGE = "You need to select 'Source Path' in which the file will be created.\nSelect one from the project's source roots.";
    String MISSING_SOURCE_PATH_DIALOG_TITLE = "Missing Source Path";

    String RESET_TO_DEFAULT_ACTION_DESCRIPTION = "Reset templates to Defaults";
    String RESET_TO_DEFAULT_ACTION_TITLE = "Reset to Defaults";
}


text:
(function($) {
  var lastId = 0;
  var createiFrame = function(id) {
    return $('<iframe name="'+id+'" />')
      .attr({
        id: id,
        name: id,
        width: 0,
        height: 0
      })
      .css('display', 'none')
      .appendTo('body');
  };

  $.fn.framejax = function(opts) {
    opts = opts || {};

    var validate = opts.validate || function() {
      return true;
    };

    return this.each(function() {
      var el = $(this);
      if (el[0].tagName != 'FORM') {
        throw new Error('all selectors must be form tags');
      }

      var submit = function() {
        var id = '__framejax__' + lastId++;
        var iframe = createiFrame(id);

        iframe.on('load', function() {
          var $body = $(this).contents().find('body');
          var results = $body.html();
          var eventName = 'framejax.success';

          el.trigger('complete', results);

          if (!validate($(this))) {
            eventName = 'framejax.error';
          }
          el.trigger(eventName, [iframe, $body]);

          //cleanup
          iframe.remove();
        });

        el.attr('target', id);
      };

      el.on('submit', submit);
      el.on('framejaxSubmit', submit);
    });
  };
})(window.jQuery);


text:
var app = angular.module('appindex',['ui.mask']);
app.controller('controllerIndex',function($scope ,$http){
	$scope.games = [];

		$http.get('/Game')
		.then(function(response){
			$scope.games = [];
			 var count = Object.keys(response.data).length

			 for(var i = 0; i < count; i++){
				 var json = response.data[i];
				 $scope.games.push({cod:json.codGame,nome:json.nomeGame,preco: json.precoGame,categoria:json.categoriaGame,url:json.url});

			 }
		},function(response){

		});

;
$scope.showGameCategoriaPC = function(){

	$http.get('/GameCategoria/PC')
	.then(function(response){
		console.log(response);
		 var count = Object.keys(response.data).length
		 $scope.qtd_obj= count;
		 console.log("QTD" + $scope.qtd_obj);
		 $scope.games = [];

		 for(var i = 0; i < count; i++){
			 var json = response.data[i];
			 $scope.games.push({cod:json.codGame,nome:json.nomeGame,preco: json.precoGame,categoria:json.categoriaGame,url:json.url});
		 }
	});
}
$scope.showGameCategoriaXbox360 = function(){

	$http.get('/GameCategoria/Xbox 360')
	.then(function(response){
		console.log(response);
		 var count = Object.keys(response.data).length
		 $scope.qtd_obj= count;
		 console.log("QTD" + $scope.qtd_obj);
		 $scope.games = [];
		 for(var i = 0; i < count; i++){
			 var json = response.data[i];
			 $scope.games.push({cod:json.codGame,nome:json.nomeGame,preco: json.precoGame,categoria:json.categoriaGame,url:json.url});
		 }
	});
}
$scope.showGameCategoriaXboxOne = function(){

	$http.get('/GameCategoria/Xbox One')
	.then(function(response){
		console.log(response);
		 var count = Object.keys(response.data).length
		 $scope.games = [];
		 $scope.qtd_obj= count;
		 console.log("QTD" + $scope.qtd_obj);
		 for(var i = 0; i < count; i++){
			 var json = response.data[i];
			 $scope.games.push({cod:json.codGame,nome:json.nomeGame,preco: json.precoGame,categoria:json.categoriaGame,url:json.url});
		 }
	});
}
$scope.showGameCategoriaP4 = function(){

	$http.get('/GameCategoria/Playstation4')
	.then(function(response){
		console.log(response);
		 var count = Object.keys(response.data).length
		 $scope.qtd_obj= count;
		 console.log("QTD" + $scope.qtd_obj);
		 $scope.games = [];
		 for(var i = 0; i < count; i++){
			 var json = response.data[i];
			 $scope.games.push({cod:json.codGame,nome:json.nomeGame,preco: json.precoGame,categoria:json.categoriaGame,url:json.url});
		 }
	});
}

});


text:
<?php

namespace Symfony\Component\Yaml\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Yaml\Yaml;

class YamlTest extends TestCase
{
    public function testParseAndDump()
    {
        $data = ['lorem' => 'ipsum', 'dolor' => 'sit'];
        $yml = Yaml::dump($data);
        $parsed = Yaml::parse($yml);
        $this->assertEquals($data, $parsed);
    }

    public function testZeroIndentationThrowsException()
    {
        $this->expectException('InvalidArgumentException');
        $this->expectExceptionMessage('The indentation must be greater than zero');
        Yaml::dump(['lorem' => 'ipsum', 'dolor' => 'sit'], 2, 0);
    }

    public function testNegativeIndentationThrowsException()
    {
        $this->expectException('InvalidArgumentException');
        $this->expectExceptionMessage('The indentation must be greater than zero');
        Yaml::dump(['lorem' => 'ipsum', 'dolor' => 'sit'], 2, -4);
    }
}


text:
package org.apache.hadoop.hive.ql.parse.repl.metric.event;

import org.apache.hadoop.hive.ql.exec.repl.util.SnapshotUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Class for defining the different stages of replication.
 */
public class Stage {
  private String name;
  private Status status;
  private long startTime;
  private long endTime;
  private Map<String, Metric> metrics = new HashMap<>();
  private String errorLogPath;
  private SnapshotUtils.ReplSnapshotCount replSnapshotCount = new SnapshotUtils.ReplSnapshotCount();
  private String replStats;

  public Stage() {

  }

  public Stage(String name, Status status, long startTime) {
    this.name = name;
    this.status = status;
    this.startTime = startTime;
  }

  public Stage(Stage stage) {
    this.name = stage.name;
    this.status = stage.status;
    this.startTime = stage.startTime;
    this.endTime = stage.endTime;
    for (Metric metric : stage.metrics.values()) {
      this.metrics.put(metric.getName(), new Metric(metric));
    }
    this.errorLogPath = stage.errorLogPath;
    this.replSnapshotCount = stage.replSnapshotCount;
    this.replStats = stage.replStats;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Status getStatus() {
    return status;
  }

  public void setStatus(Status status) {
    this.status = status;
  }

  public long getStartTime() {
    return startTime;
  }

  public void setStartTime(long startTime) {
    this.startTime = startTime;
  }

  public long getEndTime() {
    return endTime;
  }

  public void setEndTime(long endTime) {
    this.endTime = endTime;
  }

  public void addMetric(Metric metric) {
    this.metrics.put(metric.getName(), metric);
  }

  public Metric getMetricByName(String name) {
    return this.metrics.get(name);
  }

  public List<Metric> getMetrics() {
    return new ArrayList<>(metrics.values());
  }

  public String getErrorLogPath() {
    return errorLogPath;
  }

  public void setErrorLogPath(String errorLogPath) {
    this.errorLogPath = errorLogPath;
  }

  public void setReplSnapshotsCount(SnapshotUtils.ReplSnapshotCount replSnapshotCount) {
    this.replSnapshotCount = replSnapshotCount;
  }

  public SnapshotUtils.ReplSnapshotCount getReplSnapshotCount() {
    return replSnapshotCount;
  }

  public String getReplStats() {
    return replStats;
  }

  public void setReplStats(String replStats) {
    this.replStats = replStats;
  }

}


text:
import Vue from 'vue';
import loadingVue from './loading.vue';
import merge from 'element-ui/src/utils/merge';

const LoadingConstructor = Vue.extend(loadingVue);

const defaults = {
  text: null,
  fullscreen: true,
  body: false,
  lock: false,
  customClass: ''
};

let fullscreenLoading;

LoadingConstructor.prototype.originalPosition = '';
LoadingConstructor.prototype.originalOverflow = '';

LoadingConstructor.prototype.close = function() {
  if (this.fullscreen && this.originalOverflow !== 'hidden') {
    document.body.style.overflow = this.originalOverflow;
  }
  if (this.fullscreen || this.body) {
    document.body.style.position = this.originalPosition;
  } else {
    this.target.style.position = this.originalPosition;
  }
  if (this.fullscreen) {
    fullscreenLoading = undefined;
  }
  this.$on('after-leave', _ => {
    this.$el &&
    this.$el.parentNode &&
    this.$el.parentNode.removeChild(this.$el);
    this.$destroy();
  });
  this.visible = false;
};

const addStyle = (options, parent, instance) => {
  let maskStyle = {};
  if (options.fullscreen) {
    instance.originalPosition = document.body.style.position;
    instance.originalOverflow = document.body.style.overflow;
  } else if (options.body) {
    instance.originalPosition = document.body.style.position;
    ['top', 'left'].forEach(property => {
      let scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
      maskStyle[property] = options.target.getBoundingClientRect()[property] +
        document.body[scroll] +
        document.documentElement[scroll] +
        'px';
    });
    ['height', 'width'].forEach(property => {
      maskStyle[property] = options.target.getBoundingClientRect()[property] + 'px';
    });
  } else {
    instance.originalPosition = parent.style.position;
  }
  Object.keys(maskStyle).forEach(property => {
    instance.$el.style[property] = maskStyle[property];
  });
};

const Loading = (options = {}) => {
  if (Vue.prototype.$isServer) return;
  options = merge({}, defaults, options);
  if (typeof options.target === 'string') {
    options.target = document.querySelector(options.target);
  }
  options.target = options.target || document.body;
  if (options.target !== document.body) {
    options.fullscreen = false;
  } else {
    options.body = true;
  }
  if (options.fullscreen && fullscreenLoading) {
    return fullscreenLoading;
  }

  let parent = options.body ? document.body : options.target;
  let instance = new LoadingConstructor({
    el: document.createElement('div'),
    data: options
  });

  addStyle(options, parent, instance);
  if (instance.originalPosition !== 'absolute') {
    parent.style.position = 'relative';
  }
  if (options.fullscreen && options.lock) {
    parent.style.overflow = 'hidden';
  }
  parent.appendChild(instance.$el);
  Vue.nextTick(() => {
    instance.visible = true;
  });
  if (options.fullscreen) {
    fullscreenLoading = instance;
  }
  return instance;
};

export default Loading;


text:
import {
  Logger,
  Plugin,
  PluginConfig,
  PluginNames,
  Stats,
  TracerBase,
} from '@opencensus/core';
import * as fs from 'fs';
import * as path from 'path';
import * as hook from 'require-in-the-middle';
import { Constants } from '../constants';

enum HookState {
  UNINITIALIZED,
  ENABLED,
  DISABLED,
}

/**
 * The PluginLoader class can load instrumentation plugins that
 * use a patch mechanism to enable automatic tracing for
 * specific target modules.
 */
export class PluginLoader {
  /** The tracer */
  private tracer: TracerBase;
  /** logger */
  private logger: Logger;
  /** The stats */
  private stats?: Stats;
  /** A list of loaded plugins. */
  plugins: Plugin[] = [];
  /**
   * A field that tracks whether the r-i-t-m hook has been loaded for the
   * first time, as well as whether the hook body is enabled or not.
   */
  private hookState = HookState.UNINITIALIZED;

  /**
   * Constructs a new PluginLoader instance.
   * @param tracer The tracer.
   */
  constructor(logger: Logger, tracer: TracerBase, stats?: Stats) {
    this.tracer = tracer;
    this.logger = logger;
    this.stats = stats;
  }

  /**
   * Gets the default package name for a target module. The default package
   * name uses the default scope and a default prefix.
   * @param moduleName The module name.
   * @returns The default name for that package.
   */
  private static defaultPackageName(moduleName: string): string {
    return `${Constants.OPENCENSUS_SCOPE}/${Constants.DEFAULT_PLUGIN_PACKAGE_NAME_PREFIX}-${moduleName}`;
  }

  /**
   * Returns a PluginNames object, build from a string array of target modules
   * names, using the defaultPackageName.
   * @param modulesToPatch A list of modules to patch.
   * @returns Plugin names.
   */
  static defaultPluginsFromArray(modulesToPatch: string[]): PluginNames {
    const plugins = modulesToPatch.reduce(
      (plugins: PluginNames, moduleName: string) => {
        plugins[moduleName] = PluginLoader.defaultPackageName(moduleName);
        return plugins;
      },
      {} as PluginNames
    );
    return plugins;
  }

  /**
   * Gets the package version.
   * @param name Name.
   * @param basedir The base directory.
   */
  private getPackageVersion(name: string, basedir: string) {
    let version = null;
    if (basedir) {
      const pkgJson = path.join(basedir, 'package.json');
      try {
        version = JSON.parse(fs.readFileSync(pkgJson).toString()).version;
      } catch (e) {
        this.logger.error(
          'could not get version of %s module: %s',
          name,
          e.message
        );
      }
    } else {
      version = process.versions.node;
    }
    return version;
  }

  /**
   * Loads a list of plugins (using a map of the target module name
   * and its instrumentation plugin package name). Each plugin module
   * should implement the core Plugin interface and export an instance
   * named as "plugin". This function will attach a hook to be called
   * the first time the module is loaded.
   * @param pluginList A list of plugins.
   */
  loadPlugins(pluginList: PluginNames) {
    if (this.hookState === HookState.UNINITIALIZED) {
      const modulesToHook = Object.keys(pluginList);

      // Do not hook require when no module is provided. In this case it is
      // not necessary. With skipping this step we lower our footprint in
      // customer applications and require-in-the-middle won't show up in CPU
      // frames.
      if (modulesToHook.length === 0) {
        this.hookState = HookState.DISABLED;
        return;
      }

      hook(modulesToHook, (exports, name, basedir) => {
        if (this.hookState !== HookState.ENABLED) {
          return exports;
        }
        const plugin = pluginList[name];
        const version = this.getPackageVersion(name, basedir as string);
        this.logger.info('trying loading %s.%s', name, version);
        if (!version) {
          return exports;
        }
        this.logger.debug('applying patch to %s@%s module', name, version);

        let moduleName;
        let moduleConfig: PluginConfig = {};
        if (typeof plugin === 'string') {
          moduleName = plugin;
        } else {
          moduleConfig = plugin.config;
          moduleName = plugin.module;
        }
        this.logger.debug('using package %s to patch %s', moduleName, name);

        // Expecting a plugin from module;
        try {
          const plugin: Plugin = require(moduleName as string).plugin;
          this.plugins.push(plugin);
          return plugin.enable(
            exports,
            this.tracer,
            version,
            moduleConfig,
            basedir,
            this.stats
          );
        } catch (e) {
          this.logger.error(
            'could not load plugin %s of module %s. Error: %s',
            moduleName,
            name,
            e.message
          );
          return exports;
        }
      });
    }
    this.hookState = HookState.ENABLED;
  }

  /** Unloads plugins. */
  unloadPlugins() {
    for (const plugin of this.plugins) {
      plugin.disable();
    }
    this.plugins = [];
    this.hookState = HookState.DISABLED;
  }

  /**
   * Adds a search path for plugin modules. Intended for testing purposes only.
   * @param searchPath The path to add.
   */
  static set searchPathForTest(searchPath: string) {
    module.paths.push(searchPath);
  }
}


text:
/**
 * @file ethloopControl.c
 * @provides ethloopControl
 *
 * $Id: ethloopControl.c 2077 2009-09-24 23:58:54Z mschul $
 */
/* Embedded Xinu, Copyright (C) 2009.  All rights reserved. */

#include <stddef.h>
#include <bufpool.h>
#include <device.h>
#include <ethernet.h>
#include <ethloop.h>
#include <interrupt.h>
#include <network.h>
#include <stdlib.h>

/**
 * Control function for ethloop devices.
 * @param devptr ethloop device table entry
 * @param func control function to execute
 * @param arg1 first argument for the control function
 * @param arg2 second argument for the control function
 * @return the result of the control function
 */
devcall ethloopControl(device *devptr, int func, long arg1, long arg2)
{
    struct ethloop *elpptr;
    struct netaddr *addr;
    uchar old;
    irqmask im;
    char *buf;
    char *hold;
    int holdlen;

    elpptr = &elooptab[devptr->minor];

    im = disable();
    if (ELOOP_STATE_ALLOC != elpptr->state)
    {
        restore(im);
        return SYSERR;
    }

    switch (func)
    {
/* Get link header length. */
    case NET_GET_LINKHDRLEN:
        restore(im);
        return ETH_HDR_LEN;

/* Get MAC address from card. */
    case NET_GET_HWADDR:
        restore(im);
        addr = (struct netaddr *)arg1;
        addr->type = NETADDR_ETHERNET;
        addr->len = ETH_ADDR_LEN;
        addr->addr[0] = 0xAA;
        addr->addr[1] = 0xBB;
        addr->addr[2] = 0xCC;
        addr->addr[3] = 0xDD;
        addr->addr[4] = 0xEE;
        addr->addr[5] = 0xFF;
        break;

/* Get broadcast MAC address. */
    case NET_GET_HWBRC:
        restore(im);
        addr = (struct netaddr *)arg1;
        addr->type = NETADDR_ETHERNET;
        addr->len = ETH_ADDR_LEN;
        addr->addr[0] = 0xFF;
        addr->addr[1] = 0xFF;
        addr->addr[2] = 0xFF;
        addr->addr[3] = 0xFF;
        addr->addr[4] = 0xFF;
        addr->addr[5] = 0xFF;
        break;

/* Get MTU. */
    case NET_GET_MTU:
        restore(im);
        return ELOOP_MTU;

/* Get next packet off hold queue */
    case ELOOP_CTRL_GETHOLD:
        buf = (char *)arg1;
        /* Wait for held packet */
        wait(elpptr->hsem);
        /* Get and clear held packet */
        hold = elpptr->hold;
        holdlen = elpptr->holdlen;
        elpptr->hold = NULL;
        elpptr->holdlen = 0;
        restore(im);
        /* Copy held packet to buffer */
        if (arg2 < holdlen)
        {
            holdlen = arg2;
        }
        memcpy(buf, hold, holdlen);
        /* Free hold buffer */
        buffree(hold);
        return holdlen;

/* Set flags */
    case ELOOP_CTRL_SETFLAG:
        old = elpptr->flags & arg1;
        elpptr->flags |= (arg1);
        restore(im);
        return old;

/* Clear flags */
    case ELOOP_CTRL_CLRFLAG:
        old = elpptr->flags & arg1;
        elpptr->flags &= ~(arg1);
        restore(im);
        return old;

    default:
        restore(im);
        return SYSERR;
    }
    restore(im);
    return OK;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <!-- %l lowers performance -->
      <!--<pattern>%d [%t] %-5p %l%n  %m%n</pattern>-->
      <pattern>%d [%t] %-5p %m%n</pattern>
    </encoder>
  </appender>

  <logger name="org.jbpm" level="info"/>
  <logger name="org.kie.smoke" level="debug"/>
  <logger name="org.kie.services.client" level="debug" />

  <root level="info">
    <appender-ref ref="consoleAppender" />
  </root>

</configuration>


text:
from __future__ import absolute_import

import pkg_resources

try:
    __version__ = pkg_resources.get_distribution("google-cloud-logging").version
except pkg_resources.DistributionNotFound:
    __version__ = None

from google.cloud.logging_v2.client import Client
from google.cloud.logging_v2.entries import logger_name_from_path
from google.cloud.logging_v2.entries import LogEntry
from google.cloud.logging_v2.entries import TextEntry
from google.cloud.logging_v2.entries import StructEntry
from google.cloud.logging_v2.entries import ProtobufEntry
from google.cloud.logging_v2 import handlers
from google.cloud.logging_v2.logger import Logger
from google.cloud.logging_v2.logger import Batch
from google.cloud.logging_v2.metric import Metric
from google.cloud.logging_v2.resource import Resource
from google.cloud.logging_v2.sink import Sink
from google.cloud.logging_v2 import types

ASCENDING = "timestamp asc"
"""Query string to order by ascending timestamps."""
DESCENDING = "timestamp desc"
"""Query string to order by decending timestamps."""
_instrumentation_emitted = False
"""Flag for whether instrumentation info has been emitted"""

__all__ = (
    "__version__",
    "ASCENDING",
    "Batch",
    "Client",
    "DESCENDING",
    "handlers",
    "logger_name_from_path",
    "Logger",
    "LogEntry",
    "Metric",
    "ProtobufEntry",
    "Resource",
    "Sink",
    "StructEntry",
    "TextEntry",
    "types",
)


text:
![Licence](https://img.shields.io/github/license/tasmaniski/laminas-config-helper)
![PHP version](https://img.shields.io/packagist/php-v/tasmaniski/laminas-config-helper)

```json
IMPORTANT NOTE:
If you find this package useful,
please click on a star button and let me know,
so I will gladly continue with the updates.
```

# Laminas MVC - Config Helper

Simple and small lib for reading a config array in all Controllers and all Views files.

## Instalation

Add in your **composer.json** file:

```json
{
    "require": {
        "tasmaniski/laminas-config-helper": "^3.0"
    }
}
```
After running: `composer update`
You need to register new module. Add in file **config/application.config.php**:

```
'modules' => array(
    '...',
    'ConfigHelper'
),
```

## Use
You can use it **in any of your controllers or view** files (including layout.phtml).
First you have to add key in any of your config files (config/autoload/\*) eg. **"key_from_config"**

```
//read specific key registred in your config file.
$keyFromConfig = $this->configHelp('key_from_config');

// or in new version of PHP
$keyFromConfig = $this->configHelp()->key_from_config;
$keyFromConfig = $this->configHelp()['key_from_config']; // only for 5.4+

// this will read whole config
$config = $this->configHelp(); // return config object Laminas\Config\Config
echo $config->key_from_config;
```


text:
    <form action="" method="post" enctype="multipart/form-data">

            <?php echo $this->alert->flash(['error', 'success']); ?>

 Kayıt Ekle

                    <?php echo bsFormText('title', 'Başlık', ['required' => true]) ?>
                    <?php echo bsFormText('icon', 'İkon', ['required' => true]) ?>

İkon tam class ismi yazılmalı. Örnek: "fa fa-facebook". Font-awesome için tıklayın.

                    <?php echo bsFormText('link', 'Bağlantı', ['required' => true]) ?>

                    <button class="btn btn-success" type="submit">Gönder</button>
                    <button class="btn btn-success" type="submit" name="redirect" value="records">Kaydet ve Listeye Dön</button>
                    <a class="btn btn-default" href="<?php echo moduleUri('records') ?>">Vazgeç

 Yayımla

                    <?php echo bsFormDropdown('status', 'Durum', ['options' => ['published' => 'Yayında', 'unpublished' => 'Yayında Değil']]) ?>

    </form>


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Gui2D.SpriteController.SingleSprite.SingleSpriteGrouping.misc;

import Gui2D.SpriteController.SingleSprite.SingleSpriteGrouping.Abstract_sprite;

/**
 *
 * @author Mads
 */
public class Cave_Spikes extends Abstract_sprite {

    /**
     * Sets the Cave_Spikes sprite
     */
    @Override
    public void setSprite() {
        super.getSprite().setSpritePosX(853);
        super.getSprite().setSpritePosY(163);
        super.getSprite().setSprite_width(32);
        super.getSprite().setSprite_height(32);
        super.getSprite().setWidth(32);
        super.getSprite().setHeight(32);
    }
}


text:
from typing import List
from utils import message_parsing
from .constants import PERMISSIONS
import discord

class Context:
    """
    Custom object that get's passed to commands.
    Not intended to be created manually.
    """
    def __init__(self, msg: discord.Message, amethyst: discord.Client):
        cleaned = message_parsing.parse_prefixes(msg.content, amethyst.config['AMETHYST_PREFIXES'])
        self.msg = msg
        self.cmd = message_parsing.get_cmd(cleaned)
        self.suffix, self.args = message_parsing.get_args(cleaned)

    async def _send(self, content, dest, *, embed=None, file=None, files=None):
        """Internal send function, not actually ment to be used by anyone."""
        if dest == 'channel':
            return await self.msg.channel.send(content, embed=embed, file=file, files=files)
        elif dest == 'author':
            return await self.msg.author.send(content, embed=embed, file=file, files=files)
        else:
            raise ValueError('Destination is not `channel` or `author`.')

    async def send(self, content: str=None,
                   *, dest: str='channel',
                   embed: discord.Embed=None, file: discord.File=None,
                   files: List[discord.File]=None) -> discord.Message:
        """Sends a message to the context origin, can either be the channel or author."""
        if content is None and not embed and not file and not files:
            raise TypeError('No content and no attachments.')
        elif content:
            # Escape bad mentions
            content = str(content).replace('@everyone', '@\u200Beveryone').replace('@here', '@\u200Bhere')

        msg = None

        # Splitting messages if they are larger than 2000 chars.
        # Also properly does codeblocks.
        # (Could be done nicer but eh)
        if content and len(content) > 2000:
            if content.find('```') == -1 or content.find('```', content.find('```') + 3) == -1:
                await self._send(content[:2000], dest, embed=embed, file=file, files=files)
                await self.send(content[2000:], dest=dest)
            elif content.find('```', content.find('```') + 3) + 2 < 2000:
                await self._send(content[:content.find('```', content.find('```') + 3) + 3], dest,
                                 embed=embed, file=file, files=files)
                await self.send(content[content.find('```', content.find('```') + 3) + 3:], dest=dest)
            else:
                start_block = content[content.find('```'):content.find('\n', content.find('```')) + 1]

                if content.find('\n', content.find('```')) == content.rfind('\n', 0, 2000):
                    split_cont = content[:1996] + '\n```'
                    content = start_block + content[1996:]
                else:
                    split_cont = content[:content.rfind('\n', 0, content.rfind('\n', 0, 2000) + 1)][:1996] + '\n```'
                    content = start_block + content[len(split_cont) - 4:]

                await self.send(split_cont + content, dest=dest, embed=embed, file=file, files=files)
        else:
            msg = await self._send(content, dest, embed=embed, file=file, files=files)

        return msg

    def is_dm(self) -> bool:
        """Check if the channel for the context is a DM or not."""
        return isinstance(self.msg.channel, discord.DMChannel)

    def has_permission(self, permission: str, who: str='self') -> bool:
        """Check if someone in context has a permission."""
        if who not in ['self', 'author']:
            raise ValueError('Invalid value for `who` (must be `self` or `author`).')

        if permission not in PERMISSIONS:
            return False

        if who == 'self':
            return getattr(self.msg.channel.permissions_for(self.msg.guild.me), permission)
        elif who == 'author':
            return getattr(self.msg.channel.permissions_for(self.msg.author), permission)

    def typing(self):
        """d.py `async with` shortcut for sending typing to a channel."""
        return self.msg.channel.typing()