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

namespace L2PAPIClientPortable.DataModel
{
    #region OAuth-DataTypes

    /// <summary>
    /// The basic response on starting an authorization process (Call to /code )
    /// </summary>
    public class OAuthRequestData
    {
        public string status { get; set; }
        public string device_code { get; set; }
        public int expires_in { get; set; }
        public int interval { get; set; }
        public string verification_url { get; set; }
        public string user_code { get; set; }
    }

    /// <summary>
    /// The response on a authorization token request. (Call to /token )
    /// </summary>
    public class OAuthTokenRequestData
    {
        public string status { get; set; }
        public string access_token { get; set; }
        public string token_type { get; set; }
        public int expires_in { get; set; }
        public string refresh_token { get; set; }
        public string error { get; set; }
    }

    /// <summary>
    /// The datatype that is send to the Token endpoint for checking authorization status
    /// </summary>
    public class OAuthTokenRequestSendData
    {
        public string client_id { get; set; }
        public string code { get; set; }
        public string grant_type { get; set; }
    }

    /// <summary>
    /// The response to the TokenInfo request (/tokeninfo)
    /// </summary>
    public class OAuthTokenInfo
    {
        public string status { get; set; }
        public string audience { get; set; }
        public string scope { get; set; }
        public int expires_in { get; set; }
        public string state { get; set; }
    }

    #endregion

    #region L2P API-DataTypes (answers)

    /// <summary>
    /// Basic Datatype. Stores the status of the request and eventual Error-Details
    /// </summary>
    public class L2PBaseData
    {
        public string errorDescription;
        public string errorId;
        public bool status;
    }

    public class L2PBaseActionResponse : L2PBaseData
    {
        public string comment;
    }

    /// <summary>
    /// Representation of a Course Room in L2P
    ///
    /// REMARK: for now, status and courseStatus are disabled because the API will change at that point
    /// </summary>
    public class L2PCourseInfoData : L2PBaseData
    {
        public string uniqueid { get; set; }
        public string semester { get; set; }
        public string courseTitle { get; set; }
        public string description { get; set; }
        public string url { get; set; }
        //public bool status { get; set; }
        public string courseStatus { get; set; }
        public int itemId { get; set; }
    }

    public class L2PCourseInfoSetData : L2PBaseData
    {
        public List<L2PCourseInfoData> dataset { get; set; }
    }

    /// <summary>
    /// Representation of a Ping
    /// </summary>
    public class L2PPingData : L2PBaseData
    {
        //public bool status { get; set; }
        public string comment { get; set; }
    }

    /// <summary>
    /// Representation of the user Role in a Course room
    /// </summary>
    public class L2PRole : L2PBaseData
    {
        public string role { get; set; }
    }

    public class L2PWikiElement
    {
        public int itemId;
        public string url;
        public string authors;
        public string editor;
        public List<int> versionIds;
        public long lastModified;
        public string title;
        public string body;
    }

    public class L2PWikiList : L2PBaseData
    {
        public List<L2PWikiElement> dataSet;
    }

    public class L2PgwsRequest
    {
        public int itemId;
        public string groupName;
        public string comment;
    }

    public class L2PgwsElement
    {
        public string systemGeneratedAlias;
        public int groupId;
        public List<String> members;
        public int memberCount;
        public string workspaceUrl;
        public string description;
        public string name;
    }

    public class L2PgwsMyGroupWorkspace : L2PBaseData
    {
        public List<L2PgwsRequest> invitationFromOtherUsers;
        public List<L2PgwsRequest> requestFromOtherUsers;
        public List<L2PgwsRequest> requestToOtherGroups;
        public List<L2PgwsElement> dataSet;
    }

    public class L2PgwsInvite : L2PBaseRequestData
    {
        public string emails;
        public string systemGeneratedAlias;
        public string comment;
    }

    public class L2PMediaLibraryElement
    {
        public string sourceDirectory;
        public string thumbnailUrl;
        public string name;
        public int itemId;
        public int parentFolderId;
        public bool isDirectory;
        public string selfUrl;
        public object fileInformation;
        public long created;
        public long lastModified;
    }

    public class L2PMediaLibraryList : L2PBaseData
    {
        public List<L2PMediaLibraryElement> dataSet;
    }

    public class L2PLearningMaterialElement
    {
        public string sourceDirectory;
        public int itemId;
        public string name;
        public int parentFolderId;
        public bool isDirectory;
        public string selfUrl;
        public object fileInformation;
        public long created;
        public long lastModified;
        public List<long> relatedLectureDates;
        public bool byMe;
    }

    public class L2PLearningMaterialList : L2PBaseData
    {
        public List<L2PLearningMaterialElement> dataSet;
    }

    public class L2PHyperlinkElement
    {
        public int itemId;
        public string url;
        public string notes;
        public string description;
        public long created;
        public long lastModified;
    }

    public class L2PHyperlinkList : L2PBaseData
    {
        public List<L2PHyperlinkElement> dataSet;
    }

    public class L2PAttachmentElement
    {
        public string downloadUrl;
        public int itemId;
        public string fileSize;
        public long modifiedTimestamp;
        public string fileName;
    }

    public class L2PEmailElement
    {
        public string from;
        public int itemId;
        public long modifiedTimestamp;
        public long created;
        public List<L2PAttachmentElement> attachments;
        public string recipients;
        public string cc;
        public string body;
        public string subject;
        public string replyTo;
    }

    public class L2PEmailList : L2PBaseData
    {
        public List<L2PEmailElement> dataSet;
    }

    public class L2PDiscussionItemElement
    {
        public string from;
        public bool byMe;
        public long modifiedTimestamp;
        public long created;
        public int selfId;
        public int replyToId;
        public int parentDiscussionId;
        public string subject;
        public string body;
    }

    public class L2PDiscussionItemList : L2PBaseData
    {
        public List<L2PDiscussionItemElement> dataSet;
    }

    public class L2PCourseEvent
    {
        public string createdBy;
        public string modifiedBy;
        public string courseID;
        public int itemID;
        // Yes, it is a typo in the API
        public bool isRecurringItem;
        public string title;
        public string contentType;
        public string location;
        public long eventDate;
        public long endDate;
        public bool allDay;
        public string description;
        public string category;
        public long created;
        public long lastModified;
    }

    public class L2PCourseEventList : L2PBaseData
    {
        public List<L2PCourseEvent> dataSet;
    }

    public class L2PAvailableGroups : L2PBaseData
    {
        public List<L2PgwsElement> dataSet;
    }

    public class L2PAssignmentElement
    {
        public int itemId;
        public string title;
        public string description;
        public double totalPoint;
        public long dueDate;
        public long assignmentPublishDate;
        public bool groupSubmissionAllowed;
        public List<L2PAttachmentElement> assignmentDocuments;
        public object correction;
        public L2PAssignmentSolution solution;
        public List<L2PAttachmentElement> SampleSolutionDocuments;
    }

    public class L2PAssignmentCorrection
    {
        public List<L2PAttachmentElement> correctionDocuments;
        public long creationTimestamp;
        public long modifiedTimestamp;
        public int itemid;
        public double obtainedPoint;
        public string tutorComment;
    }

    public class L2PAssignmentSolution
    {
        public bool Status;
        public long creationTimestamp;
        public int itemId;
        public long modifiedTimestamp;
        public string solutionDirectory;
        public List<L2PAttachmentElement> solutionDocuments;
        public string studentComment;
        public List<string> submittedByStudents;
    }

    public class L2PAssignmentList : L2PBaseData
    {
        public List<L2PAssignmentElement> dataSet;
    }

    public class L2PAnnouncementElement
    {
        public List<L2PAttachmentElement> attachments;
        public long modifiedTimestamp;
        public int itemId;
        public string attachmentDirectory;
        public string title;
        public string body;
        public long expireTime;
        public long created;
    }

    public class L2PAnnouncementList : L2PBaseData
    {
        public List<L2PAnnouncementElement> dataSet;
    }

    public class L2PLiteratureSetDataType : L2PBaseData
    {
        public List<L2PLiteratureViewDataType> dataSet;
    }

    public class L2PLiteratureElementDataType
    {
        public string state;
        public string availability;
        public int itemID;
        public long modified;
        public long created;
        public string author;
        public string editor;
        public string literatureCategory;
        //public List<FileInformationDataType> attachments;
        public List<object> attachments;
        public string title;
        public string authors;
        public string year;
        public string url;
        public string publisher;
        public string relevance;
        public string address;
        public string booktitle;
        public string comments;
        public string doi;
        public string edition;
        public string fromPage;
        public string isxn;
        public string journalName;
        public string number;
        public string role;
        public string series;
        public string toPage;
        public string type;
        public string volume;
        public string urlComment;
        public string contentType;
    }

    public class L2PLiteratureViewDataType : L2PBaseData
    {
        public List<L2PLiteratureElementDataType> dataset;
    }

    public class L2PCountViewDataType : L2PBaseData
    {
        public int count;
    }

    public class L2PViewAllCountDataType : L2PBaseData
    {
        public int DiscussionItems;
        public int Hyperlinks;
        public int Announcements;
        public int LearningMaterials;
        public int Wikis;
        public int SharedDocuments;
        public int MediaLibraryitems;
        public int LiteratureItems;
        public string failed;
    }

    public class L2PViewActiveFeaturesDataType : L2PBaseData
    {
        public List<string> active;
        public List<string> inactive;
    }

    public class L2PWhatsNewDataType : L2PBaseData
    {
        public List<L2PAnnouncementElement> announcements;
        public List<L2PAssignmentElement> assignments;
        public List<L2PDiscussionItemElement> discussionItems;
        public List<L2PEmailElement> emails;
        public List<L2PHyperlinkElement> hyperlinks;
        public List<L2PLiteratureElementDataType> literature;
        public List<L2PLearningMaterialElement> learningMaterials;
        public List<L2PMediaLibraryElement> mediaLibraries;
        public List<L2PLearningMaterialElement> sharedDocuments;
        public List<L2PWikiElement> wikis;
    }

    public class L2PWhatsNewExtendedDataType : L2PWhatsNewDataType
    {
        public string cid;
    }

    public class L2PWhatsAllNewDataType : L2PBaseData
    {
        public List<L2PWhatsNewExtendedDataType> dataset;
    }

    public class L2PLearningObjectElement
    {
        public string title;
        public int itemId;
        public string description;
        public long created;
        public long lastModified;
        public List<L2PLiteratureElementDataType> relatedLiterature;
        public List<L2PLearningMaterialElement> relatedLearningMaterials;
        public List<L2PMediaLibraryElement> relatedMediaElements;
        public List<L2PHyperlinkElement> relatedHyperlinks;
        public List<long> relatedLectureDates;
    }

    public class L2PLearningObjectViewDataType : L2PBaseData
    {
        public List<L2PLearningObjectElement> dataset;
    }

    public class L2PExamResultDataType
    {
        public string matNr;
        public string firstname;
        public string lastname;
        public string grade;
        public string freiVermerk;
        public string pversuch;
        public string pvermerk;
        public bool isPublished;
        public string studentUser;
        //public Dictionary<string, string> customFields;
        public customKVList customFields;
    }

    public class L2PExamResultViewDataType : L2PBaseData
    {
        public List<L2PExamResultDataType> dataset;
    }

    public class L2PGradeBookViewDataType
    {
        public string student;
        public customKVList fields;
    }

    public class L2PGradeBookResultViewDataType : L2PBaseData
    {
        public List<L2PGradeBookViewDataType> dataSet;
    }

    public class L2PGradeViewDataType
    {
        public string grade;
        public int count;
    }

    public class L2PGradeDistributionViewDataType : L2PBaseData
    {
        public List<L2PGradeViewDataType> dataset;
    }

    #endregion

    public class customKVPair
    {
        public string Key;
        public string Value;
    }

    public class customKVList
    {
        public List<customKVPair> pairs;
        public customKVList() { pairs = new List<customKVPair>(); }
        public Dictionary<string, string> ToDictionary()
        {
            Dictionary<string, string> dict = new Dictionary<string, string>();
            foreach (var item in pairs)
            {
                dict.Add(item.Key, item.Value);
            }
            return dict;
        }
    }

    #region Responses for Requests (not view-Calls)

    /// <summary>
    /// The Response for adding Add-Calls
    /// </summary>
    public class L2PAddUpdateResponse : L2PGenericRequestResponse
    {
        public int itemId;
        public string itemUrl;
        public long modifiedTimestamp;
        public long creationTimestamp;
        public string attachmentFolderPath;
    }

    /// <summary>
    /// The response for Generic Calls
    /// </summary>
    public class L2PGenericRequestResponse : L2PBaseData
    {
        public string comment;
    }

    public class L2PCreateFolderResponse : L2PGenericRequestResponse
    {
        public string sourceDirectory;
        public int itemId;
        public long modifiedTimestamp;
        public string name;
        public string selfUrl;
    }

    public class L2PSolutionDocument
    {
        public string downloadUrl;
        public int itemId;
        public string fileSize;
        public long modifiedTimestamp;
        public string fileName;
    }

    public class L2PProvideAssignmentSolutionResponse : L2PGenericRequestResponse
    {
        public long creationTimestamp;
        public long modifiedTimestamp;
        public string studentComment;
        public List<L2PSolutionDocument> solutionDocuments;
        public string solutionDirectory;
        public List<String> submittedByStudents;
        public int itemId;
    }

    public class L2PRegisterResponse : L2PBaseData
    {
        public bool Status;
    }

    #endregion

    #region L2P request DataTypes

    public class L2PBaseRequestData
    {
        public override string ToString()
        {
            // If you do not want to use Newtonsoft, create JSON object in a different way
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }

    public class L2PAssignmentSolutionRequest : L2PBaseRequestData
    {
        public string comment;
    }

    public class L2PAddAnnouncementRequest : L2PBaseRequestData
    {
        public string body;
        public long expiretime;
        public string title;
    }

    public class L2PAddAssignmentRequest : L2PBaseRequestData
    {
        public long duedate;
        public bool groupsubmissionallowed;
        public double totalmarks;
        public string description;
        public string title;
    }

    public class L2PAddCourseEventRequest : L2PBaseRequestData
    {
        public string category;
        public string description;
        public bool allDay;
        public string location;
        public long endDate;
        public long eventDate;
        public string contentType;
        public string title;
    }

    public class L2PAddDiscussionThreadRequest : L2PBaseRequestData
    {
        public string subject;
        public string body;
    }

    public class L2PAddDiscussionThreadReplyRequest : L2PBaseRequestData
    {
        public string subject;
        public string body;
    }

    public class L2PAddEmailRequest : L2PBaseRequestData
    {
        public string recipients;
        public string cc;
        public string body;
        public string subject;
        public string replyTo;
        public List<L2PUploadRequest> attachmentsToUpload;
        //public bool replyTo;
    }

    public class L2PAddHyperlinkRequest : L2PBaseRequestData
    {
        public string url;
        public string notes;
        public string description;
    }

    public class L2PAddWikiRequest : L2PBaseRequestData
    {
        public string title;
        public string body;
    }

    public class L2PUploadRequest : L2PBaseRequestData
    {
        public string fileName;
        // A base64 encoded stream
        public string stream;
    }

    public class L2PLiteratureAddRequest : L2PBaseRequestData
    {
        public string title;
        public string authors;
        public string year;
        public string url;
        public string publisher;
        public string relevance;
        public string address;
        public string booktitle;
        public string comments;
        public string doi;
        public string edition;
        public string fromPage;
        public string isxn;
        public string journalName;
        public string number;
        public string role;
        public string series;
        public string toPage;
        public string type;
        public string volume;
        public string urlComment;
        public string contentType;

    }

    public class L2PRegisterRequest : L2PBaseRequestData
    {
        public string groupName;
        public string uid;
    }

    public class L2PLearningObjectAddDataType : L2PBaseRequestData
    {
        public string title;
        public string description;
        public List<int> literature;
        public List<int> materials;
        public List<int> hyperlinks;
        public int relatedMedia;
    }

    #endregion
}


text:
import { operators } from "./IOperator";

interface ILexicalPointer {
    index: number;
}
export enum LexicalTokenType {
    Identifier,
    String,
    StringTemplate,
    Number,
    Regexp,
    Keyword,
    Operator,
    Block,
    Breaker
}
export interface ILexicalToken {
    data: string | number;
    type: LexicalTokenType;
}
export class LexicalAnalyzer {
    public static *parse(input: string): IterableIterator<ILexicalToken> {
        const pointer: ILexicalPointer = {
            index: -1
        };
        const length = input.length;
        pointer.index++;
        let char: string;
        let lastToken: ILexicalToken;
        do {
            char = input[pointer.index];

            if (char <= " ") {
                pointer.index++;
                continue;
            }
            else if ((char >= "A" && char <= "Z") || (char >= "a" && char <= "z")
                || char === "_" || char === "$") {
                lastToken = analyzeLexicalIdentifier(pointer, input);
                yield lastToken;
            }
            else if (char === "(" || char === "[" || char === "%"
                || (char !== "," && char >= "*" && char < "/") || (char >= "<" && char <= "?")
                || char === "&" || char === "|" || char === "~" || char === "^" || char === "!") {
                lastToken = analyzeLexicalOperator(pointer, input);
                yield lastToken;
            }
            else if (char === "'" || char === "\"") {
                lastToken = analyzeLexicalString(pointer, input);
                yield lastToken;
            }
            else if (char >= "0" && char <= "9") {
                lastToken = analyzeLexicalNumber(pointer, input);
                yield lastToken;
            }
            else if (char === "{") {
                lastToken = {
                    data: char,
                    type: LexicalTokenType.Block
                };
                yield lastToken;
                pointer.index++;
            }
            else if (char === "`") {
                lastToken = analyzeLexicalTemplateLiteral(pointer, input);
                yield lastToken;
            }
            else if ((["\n", ";", ",", ":", "}", "]", ")"]).indexOf(char) >= 0) {
                lastToken = {
                    data: char,
                    type: LexicalTokenType.Breaker
                };
                yield lastToken;
                pointer.index++;
            }
            else if (char === "/") {
                const char2 = input[pointer.index + 1];
                if (char2 === "*") {
                    analyzeLexicalComment(pointer, input, true);
                }
                else if (char2 === "/") {
                    analyzeLexicalComment(pointer, input, false);
                }
                else {
                    if (!lastToken || lastToken.type > LexicalTokenType.Regexp) {
                        lastToken = analyzeRegexp(pointer, input);
                        yield lastToken;
                    }
                    else {
                        lastToken = analyzeLexicalOperator(pointer, input);
                        yield lastToken;
                    }
                }
            }
        } while (pointer.index < length);
    }
}

const keywordOperators = operators.where((o) => o.identifier >= "a" && o.identifier <= "z" && o.identifier !== "function").select((o) => o.identifier);
keywordOperators.enableCache = true;
const keywords = ["abstract", "arguments", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "do", "double", "else", "enum", "eval", "export", "extends", "final", "finally", "for", "goto", "if", "implements", "import", "interface", "let", "long", "native", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "var", "volatile", "while", "with"];

function analyzeLexicalIdentifier(pointer: ILexicalPointer, input: string): ILexicalToken {
    const start = pointer.index;
    let char: string;
    do {
        pointer.index++;
        char = input[pointer.index];
    } while (
        (char >= "A" && char <= "Z") || (char >= "a" && char <= "z") ||
        (char >= "0" && char <= "9") || char === "_" || char === "$");

    const data = input.slice(start, pointer.index);
    const type = keywordOperators.contains(data) ? LexicalTokenType.Operator :
        keywords.contains(data) ? LexicalTokenType.Keyword : LexicalTokenType.Identifier;

    return {
        data: data,
        type: type
    };
}
function analyzeLexicalString(pointer: ILexicalPointer, input: string): ILexicalToken {
    const stopper = input[pointer.index++];
    let data = "";
    for (; ;) {
        const char = input[pointer.index++];
        if (char === "\\") {
            data += input[pointer.index++];
        }
        else if (char === stopper) {
            break;
        }
        else {
            data += char;
        }
    }
    return {
        data: data,
        type: LexicalTokenType.String
    };
}
function analyzeLexicalTemplateLiteral(pointer: ILexicalPointer, input: string): ILexicalToken {
    const res = analyzeLexicalString(pointer, input);
    res.type = LexicalTokenType.StringTemplate;
    return res;
}
function analyzeLexicalNumber(pointer: ILexicalPointer, input: string): ILexicalToken {
    const start = pointer.index;
    let char: string;
    do {
        pointer.index++;
        char = input[pointer.index];
    } while ((char >= "0" && char <= "9") || char === ".");
    const data = input.slice(start, pointer.index);
    return {
        data: data,
        type: LexicalTokenType.Number
    };
}
function analyzeRegexp(pointer: ILexicalPointer, input: string): ILexicalToken {
    const start = pointer.index;
    let isFoundEnd = false;
    let char: string;
    do {
        if (!isFoundEnd) {
            isFoundEnd = char === "/";
        }
        char = input[++pointer.index];
        if (char === "\\") {
            char = input[pointer.index += 2];
        }
    } while (
        !isFoundEnd || char === "i" || char === "g"
        || char === "m" || char === "u" || char === "y"
    );
    const data = input.slice(start, pointer.index);
    return {
        data: data,
        type: LexicalTokenType.Regexp
    };
}
function analyzeLexicalComment(pointer: ILexicalPointer, input: string, isBlock = false) {
    pointer.index += 2;
    let char: string;
    do {
        char = input[pointer.index++];
        if (isBlock) {
            if (char === "*") {
                char = input[pointer.index++];
                if (char === "/") {
                    break;
                }
            }
        }
        else if (char === "\n") {
            break;
        }
    } while (true);
}
function analyzeLexicalOperator(pointer: ILexicalPointer, input: string): ILexicalToken {
    const start = pointer.index;
    let char = input[pointer.index++];
    if (["(", "[", "?"].indexOf(char) < 0) {
        char = input[pointer.index];
        if (["=", ".", "+", "-", "*", "&", "|", ">", "<"].indexOf(char) >= 0) {
            char = input[++pointer.index];
            if (["=", ">", "."].indexOf(char) >= 0) {
                char = input[++pointer.index];
                if (char === "=") {
                    pointer.index++;
                }
            }
        }
    }
    const data = input.slice(start, pointer.index);
    return {
        type: LexicalTokenType.Operator,
        data: data
    };
}

redpajama_set_name: RedPajamaGithub


text:
package com.marcelmika.lims.api.events.conversation;

import com.marcelmika.lims.api.events.RequestEvent;
import com.marcelmika.lims.api.entity.BuddyDetails;

/**
 * @author Ing. Marcel Mika
 * @link http://marcelmika.com
 * Date: 3/4/14
 * Time: 9:41 PM
 */
public class GetOpenedConversationsRequestEvent extends RequestEvent {

    private BuddyDetails buddyDetails;

    public GetOpenedConversationsRequestEvent(BuddyDetails buddyDetails) {
        this.buddyDetails = buddyDetails;
    }

    public BuddyDetails getBuddyDetails() {
        return buddyDetails;
    }
}


text:
import { NgModule } from '@angular/core';

import { SharedModule } from '../shared/shared.module';
import { AboutComponent } from './about.component';
import { AboutRoutingModule } from './about-routing.module';
import { ContactModule } from './contact/contact.module';

@NgModule({
  imports: [
    SharedModule,
    AboutRoutingModule,
    ContactModule
  ],
  declarations: [
    AboutComponent
  ]
})
export class AboutModule {

}


text:
/*
    Document   : style
    Created on : Sep 22, 2013, 2:42:02 PM
    Author     : LEENGUYEN
    Description:
        Purpose of the stylesheet follows.
*/
@import url('reset.css');
@import url('bootstrap-theme.css');
@import url('bootstrap-theme.min.css');
@import url('bootstrap.min.css');
@import url('popup-login.css');

@import url('home.css');
@import url('home.css');@import url('boostrap.css');@import url('boostrap.min.css');@import url('boostrap-theme.css');@import url('boostrap-theme.min.css');@import url('antimetion.css');
@import url('tango/skin.css');
@import url('slideshow.css');
@import url('idangerous.swiper.css');
@import url('idangerous.swiper.3dflow.css');
@import url('cart.css');
@import url('tabs.css');
@import url('contact.css');
@import url('product.css');
@import url('detail_product.css');
@import url('elastislide.css');
@import url('jquery.jqzoom.css');
@import url('add_style.css');
@import url('jquery.mCustomScrollbar.css');
@import url('user.css');
@import url('widthdrawal.css');
@import url('profile.css');
@import url('notice.css');
@font-face{
    font-family: OpenSans-Light;
    src: url('OpenSans-Light.ttf')
}
@font-face{
    font-family: OpenSans-Bold;
    src: url('OpenSans-Bold.ttf')
}
@font-face{
    font-family: OpenSans-Italic;
    src: url('OpenSans-Italic.ttf')
}
@font-face{
    font-family: OpenSans-Regular;
    src: url('OpenSans-Regular.ttf')
}


text:
/// <reference path="fourslash.ts" />

////module TestModule {
////    var localVariable = "";
////    export var exportedVaribale = 0;
////
////    function localFunction() { }
////    export function exportedFunction() { }
////
////    class localClass { }
////    export class exportedClass { }
////
////    interface localInterface {}
////    export interface exportedInterface {}
////
////    module localModule {
////        export var x = 0;
////    }
////    export module exportedModule {
////        export var x = 0;
////    }
////
////    var v = /*valueReference*/ 0;
////    var t :/*typeReference*/;
////}
////
////// Add some new items to the module
////module TestModule {
////    var localVariable2 = "";
////    export var exportedVaribale2 = 0;
////
////    function localFunction2() { }
////    export function exportedFunction2() { }
////
////    class localClass2 { }
////    export class exportedClass2 { }
////
////    interface localInterface2 {}
////    export interface exportedInterface2 {}
////
////    module localModule2 {
////        export var x = 0;
////    }
////    export module exportedModule2 {
////        export var x = 0;
////    }
////}
////var globalVar: string = "";
////function globalFunction() { }
////
////class TestClass {
////    property: number;
////    method() { }
////    staticMethod() { }
////    testMethod(param: number) {
////        var localVar = 0;
////        function localFunction() {};
////        /*insideMethod*/
////    }
////}

goTo.marker("valueReference");
verify.completionListContains("localVariable");
verify.completionListContains("exportedVaribale");

verify.completionListContains("localFunction");
verify.completionListContains("exportedFunction");

verify.completionListContains("localClass");
verify.completionListContains("exportedClass");

verify.completionListContains("localModule");
verify.completionListContains("exportedModule");

verify.completionListContains("exportedVaribale2");
verify.completionListContains("exportedFunction2");
verify.completionListContains("exportedClass2");
verify.completionListContains("exportedModule2");

goTo.marker("typeReference");
verify.completionListContains("localInterface");
verify.completionListContains("exportedInterface");

verify.completionListContains("localClass");
verify.completionListContains("exportedClass");

verify.not.completionListContains("localModule");
verify.not.completionListContains("exportedModule");

verify.completionListContains("exportedClass2");
verify.not.completionListContains("exportedModule2");

goTo.marker("insideMethod");
verify.not.completionListContains("property");
verify.not.completionListContains("testMethod");
verify.not.completionListContains("staticMethod");

verify.completionListContains("globalVar");
verify.completionListContains("globalFunction");

verify.completionListContains("param");
verify.completionListContains("localVar");
verify.completionListContains("localFunction");


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TRX_Merger.TrxModel;
using TRX_Merger.Utilities;

namespace TRX_Merger
{
    public static class TestRunMerger
    {

        public static TestRun MergeTRXsAndSave(List<string> trxFiles, string outputFile)
        {
            Console.WriteLine("Deserializing trx files:");
            List<TestRun> runs = new List<TestRun>();
            foreach (var trx in trxFiles)
            {
                Console.WriteLine(trx);
                runs.Add(TRXSerializationUtils.DeserializeTRX(trx));
            }

            Console.WriteLine("Combining deserialized trx files...");
            var combinedTestRun = MergeTestRuns(runs);

            Console.WriteLine("Saving result...");
            var savedFile = TRXSerializationUtils.SerializeAndSaveTestRun(combinedTestRun, outputFile);

            Console.WriteLine("Operation completed:");
            Console.WriteLine("\tCombined trx files: " + trxFiles.Count);
            Console.WriteLine("\tResult trx file: " + savedFile);

            return combinedTestRun;
        }

        private static TestRun MergeTestRuns(List<TestRun> testRuns)
        {
            string name = testRuns[0].Name;
            string runUser = testRuns[0].RunUser;

            string startString = "";
            DateTime startDate = DateTime.MaxValue;

            string endString = "";
            DateTime endDate = DateTime.MinValue;

            List<UnitTestResult> allResults = new List<UnitTestResult>();
            List<UnitTest> allTestDefinitions = new List<UnitTest>();
            List<TestEntry> allTestEntries = new List<TestEntry>();
            List<TestList> allTestLists = new List<TestList>();

            var resultSummary = new ResultSummary
            {
                Counters = new Counters(),
                RunInfos = new List<RunInfo>(),
            };
            bool resultSummaryPassed = true;

            foreach (var tr in testRuns)
            {
                allResults = allResults.Concat(tr.Results).ToList();
                allTestDefinitions = allTestDefinitions.Concat(tr.TestDefinitions).ToList();
                allTestEntries = allTestEntries.Concat(tr.TestEntries).ToList();
                allTestLists = allTestLists.Concat(tr.TestLists).ToList();

                DateTime currStart = DateTime.Parse(tr.Times.Start);
                if (currStart < startDate)
                {
                    startDate = currStart;
                    startString = tr.Times.Start;
                }

                DateTime currEnd = DateTime.Parse(tr.Times.Finish);
                if (currEnd > endDate)
                {
                    endDate = currEnd;
                    endString = tr.Times.Finish;
                }

                resultSummaryPassed &= tr.ResultSummary.Outcome == "Passed";
                resultSummary.RunInfos = resultSummary.RunInfos.Concat(tr.ResultSummary.RunInfos).ToList();
                resultSummary.Counters.Aborted += tr.ResultSummary.Counters.Aborted;
                resultSummary.Counters.Completed += tr.ResultSummary.Counters.Completed;
                resultSummary.Counters.Disconnected += tr.ResultSummary.Counters.Disconnected;
                resultSummary.Counters.Еxecuted += tr.ResultSummary.Counters.Еxecuted;
                resultSummary.Counters.Failed += tr.ResultSummary.Counters.Failed;
                resultSummary.Counters.Inconclusive += tr.ResultSummary.Counters.Inconclusive;
                resultSummary.Counters.InProgress += tr.ResultSummary.Counters.InProgress;
                resultSummary.Counters.NotExecuted += tr.ResultSummary.Counters.NotExecuted;
                resultSummary.Counters.NotRunnable += tr.ResultSummary.Counters.NotRunnable;
                resultSummary.Counters.Passed += tr.ResultSummary.Counters.Passed;
                resultSummary.Counters.PassedButRunAborted += tr.ResultSummary.Counters.PassedButRunAborted;
                resultSummary.Counters.Pending += tr.ResultSummary.Counters.Pending;
                resultSummary.Counters.Timeout += tr.ResultSummary.Counters.Timeout;
                resultSummary.Counters.Total += tr.ResultSummary.Counters.Total;
                resultSummary.Counters.Warning += tr.ResultSummary.Counters.Warning;

            }

            resultSummary.Outcome = resultSummaryPassed ? "Passed" : "Failed";

            return new TestRun
            {
                Id = Guid.NewGuid().ToString(),
                Name = name,
                RunUser = runUser,
                Times = new Times
                {
                    Start = startString,
                    Queuing = startString,
                    Creation = startString,
                    Finish = endString,
                },
                Results = allResults,
                TestDefinitions = allTestDefinitions,
                TestEntries = allTestEntries,
                TestLists = allTestLists,
                ResultSummary = resultSummary,
            };
        }

    }
}


text:
package com.mechdome.maps.google;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MapStyleOptions;

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.List;

/**
 * This shows how to style a map with JSON.
 */
public class StyledMapDemoActivity extends AppCompatActivity implements OnMapReadyCallback {

    private GoogleMap mMap = null;

    private static final String TAG = StyledMapDemoActivity.class.getSimpleName();

    private static final String SELECTED_STYLE = "selected_style";

    // Stores the ID of the currently selected style, so that we can re-apply it when
    // the activity restores state, for example when the device changes orientation.
    private int mSelectedStyleId = R.string.style_label_default;

    // These are simply the string resource IDs for each of the style names. We use them
    // as identifiers when choosing which style to apply.
    private int mStyleIds[] = {
            R.string.style_label_retro,
            R.string.style_label_night,
            R.string.style_label_grayscale,
            R.string.style_label_no_pois_no_transit,
            R.string.style_label_default,
    };

    private static final LatLng SYDNEY = new LatLng(-33.8688, 151.2093);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null) {
            mSelectedStyleId = savedInstanceState.getInt(SELECTED_STYLE);
        }
        setContentView(R.layout.styled_map_demo);

        SupportMapFragment mapFragment =
                (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
        // add back arrow to toolbar
        if (getSupportActionBar() != null){
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            getSupportActionBar().setDisplayShowHomeEnabled(true);
        }

    }

    @Override
    public boolean onSupportNavigateUp() {
        onBackPressed();
        return true;
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        // Store the selected map style, so we can assign it when the activity resumes.
        outState.putInt(SELECTED_STYLE, mSelectedStyleId);
        super.onSaveInstanceState(outState);
    }

    @Override
    public void onMapReady(GoogleMap map) {
        mMap = map;
        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(SYDNEY, 14));
        setSelectedStyle();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.styled_map, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == R.id.menu_style_choose) {
            showStylesDialog();
        } else if (item.getItemId() == android.R.id.home) {
            this.finish();
            return true;
        }
        return true;
    }

    /**
     * Shows a dialog listing the styles to choose from, and applies the selected
     * style when chosen.
     */
    private void showStylesDialog() {
        // mStyleIds stores each style's resource ID, and we extract the names here, rather
        // than using an XML array resource which AlertDialog.Builder.setItems() can also
        // accept. We do this since using an array resource would mean we would not have
        // constant values we can switch/case on, when choosing which style to apply.
        List<String> styleNames = new ArrayList<>();
        for (int style : mStyleIds) {
            styleNames.add(getString(style));
        }

        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(getString(R.string.style_choose));
        builder.setItems(styleNames.toArray(new CharSequence[styleNames.size()]),
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        mSelectedStyleId = mStyleIds[which];
                        String msg = getString(R.string.style_set_to, getString(mSelectedStyleId));
                        Toast.makeText(getBaseContext(), msg, Toast.LENGTH_SHORT).show();
                        Log.d(TAG, msg);
                        setSelectedStyle();
                    }
                });
        builder.show();
    }

    /**
     * Creates a {@link MapStyleOptions} object via loadRawResourceStyle() (or via the
     * constructor with a JSON String), then sets it on the {@link GoogleMap} instance,
     * via the setMapStyle() method.
     */
    private void setSelectedStyle() {
        MapStyleOptions style;
        switch (mSelectedStyleId) {
            case R.string.style_label_retro:
                // Sets the retro style via raw resource JSON.
                style = MapStyleOptions.loadRawResourceStyle(this, R.raw.mapstyle_retro);
                break;
            case R.string.style_label_night:
                // Sets the night style via raw resource JSON.
                style = MapStyleOptions.loadRawResourceStyle(this, R.raw.mapstyle_night);
                break;
            case R.string.style_label_grayscale:
                // Sets the grayscale style via raw resource JSON.
                style = MapStyleOptions.loadRawResourceStyle(this, R.raw.mapstyle_grayscale);
                break;
            case R.string.style_label_no_pois_no_transit:
                // Sets the no POIs or transit style via JSON string.
                style = new MapStyleOptions("[" +
                        "  {" +
                        "    \"featureType\":\"poi.business\"," +
                        "    \"elementType\":\"all\"," +
                        "    \"stylers\":[" +
                        "      {" +
                        "        \"visibility\":\"off\"" +
                        "      }" +
                        "    ]" +
                        "  }," +
                        "  {" +
                        "    \"featureType\":\"transit\"," +
                        "    \"elementType\":\"all\"," +
                        "    \"stylers\":[" +
                        "      {" +
                        "        \"visibility\":\"off\"" +
                        "      }" +
                        "    ]" +
                        "  }" +
                        "]");
                break;
            case R.string.style_label_default:
                // Removes previously set style, by setting it to null.
                style = null;
                break;
            default:
                return;
        }
        mMap.setMapStyle(style);
    }

}


text:
<doctype html />

Privacy Policy

Last updated: 4/12/2016.

  We won't share or sell your personal info, contact info, or anything else ever no matter what.

Contact Us

If you have any questions about this, please contact us.


text:
package com.google.debugging.sourcemap;

import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.debugging.sourcemap.Base64VLQ.CharIterator;
import com.google.debugging.sourcemap.proto.Mapping.OriginalMapping;
import com.google.debugging.sourcemap.proto.Mapping.OriginalMapping.Builder;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Class for parsing version 3 of the SourceMap format, as produced by the
 * Closure Compiler, etc.
 * http://code.google.com/p/closure-compiler/wiki/SourceMaps
 * @author johnlenz@google.com (John Lenz)
 */
public class SourceMapConsumerV3 implements SourceMapConsumer,
    SourceMappingReversable {
  static final int UNMAPPED = -1;

  private String[] sources;
  private String[] names;
  private int lineCount;
  // Slots in the lines list will be null if the line does not have any entries.
  private ArrayList<ArrayList<Entry>> lines = null;
  /** originalFile path ==> original line ==> target mappings */
  private Map<String, Map<Integer, Collection<OriginalMapping>>>
      reverseSourceMapping;
  private String sourceRoot;
  private Map<String, Object> extensions = Maps.newLinkedHashMap();

  public SourceMapConsumerV3() {

  }

  static class DefaultSourceMapSupplier implements SourceMapSupplier {
    @Override
    public String getSourceMap(String url) {
      return null;
    }
  }

  /**
   * Parses the given contents containing a source map.
   */
  @Override
  public void parse(String contents) throws SourceMapParseException {
    parse(contents, null);
  }

  /**
   * Parses the given contents containing a source map.
   */
  public void parse(String contents, SourceMapSupplier sectionSupplier)
      throws SourceMapParseException {
    try {
      JsonObject sourceMapRoot = new Gson().fromJson(contents, JsonObject.class);
      parse(sourceMapRoot, sectionSupplier);
    } catch (JsonParseException ex) {
      throw new SourceMapParseException("JSON parse exception: " + ex);
    }
  }

  /**
   * Parses the given contents containing a source map.
   */
  public void parse(JsonObject sourceMapRoot) throws SourceMapParseException {
    parse(sourceMapRoot, null);
  }

  /**
   * Parses the given contents containing a source map.
   */
  public void parse(JsonObject sourceMapRoot, SourceMapSupplier sectionSupplier)
      throws SourceMapParseException {
    try {
      // Check basic assertions about the format.
      int version = sourceMapRoot.get("version").getAsInt();
      if (version != 3) {
        throw new SourceMapParseException("Unknown version: " + version);
      }

      if (sourceMapRoot.has("file")
          && sourceMapRoot.get("file").getAsString().isEmpty()) {
        throw new SourceMapParseException("File entry is empty");
      }

      if (sourceMapRoot.has("sections")) {
        // Looks like a index map, try to parse it that way.
        parseMetaMap(sourceMapRoot, sectionSupplier);
        return;
      }

      lineCount = sourceMapRoot.has("lineCount")
          ? sourceMapRoot.get("lineCount").getAsInt() : -1;
      String lineMap = sourceMapRoot.get("mappings").getAsString();

      sources = getJavaStringArray(sourceMapRoot.get("sources").getAsJsonArray());
      names = getJavaStringArray(sourceMapRoot.get("names").getAsJsonArray());

      if (lineCount >= 0) {
        lines = Lists.newArrayListWithCapacity(lineCount);
      } else {
        lines = Lists.newArrayList();
      }

      if (sourceMapRoot.has("sourceRoot")) {
        sourceRoot = sourceMapRoot.get("sourceRoot").getAsString();
      }

      for (Map.Entry<String, JsonElement> entry : sourceMapRoot.entrySet()) {
        if (entry.getKey().startsWith("x_")) {
          extensions.put(entry.getKey(), entry.getValue());
        }
      }

      new MappingBuilder(lineMap).build();
    } catch (JsonParseException ex) {
      throw new SourceMapParseException("JSON parse exception: " + ex);
    }
  }

  /**
   * @param sourceMapRoot
   * @throws SourceMapParseException
   */
  private void parseMetaMap(
      JsonObject sourceMapRoot, SourceMapSupplier sectionSupplier)
      throws SourceMapParseException {
    if (sectionSupplier == null) {
      sectionSupplier = new DefaultSourceMapSupplier();
    }

    try {
      // Check basic assertions about the format.
      int version = sourceMapRoot.get("version").getAsInt();
      if (version != 3) {
        throw new SourceMapParseException("Unknown version: " + version);
      }

      String file = sourceMapRoot.get("file").getAsString();
      if (file.isEmpty()) {
        throw new SourceMapParseException("File entry is missing or empty");
      }

      if (sourceMapRoot.has("lineCount")
          || sourceMapRoot.has("mappings")
          || sourceMapRoot.has("sources")
          || sourceMapRoot.has("names")) {
        throw new SourceMapParseException("Invalid map format");
      }

      SourceMapGeneratorV3 generator = new SourceMapGeneratorV3();
      JsonArray sections = sourceMapRoot.get("sections").getAsJsonArray();
      for (int i = 0, count = sections.size(); i < count; i++) {
        JsonObject section = sections.get(i).getAsJsonObject();
        if (section.has("map") && section.has("url")) {
          throw new SourceMapParseException(
              "Invalid map format: section may not have both 'map' and 'url'");
        }
        JsonObject offset = section.get("offset").getAsJsonObject();
        int line = offset.get("line").getAsInt();
        int column =  offset.get("column").getAsInt();
        String mapSectionContents;
        if (section.has("url")) {
          String url = section.get("url").getAsString();
          mapSectionContents = sectionSupplier.getSourceMap(url);
          if (mapSectionContents == null) {
            throw new SourceMapParseException("Unable to retrieve: " + url);
          }
        } else if (section.has("map")) {
          mapSectionContents = section.get("map").toString();
        } else {
          throw new SourceMapParseException(
              "Invalid map format: section must have either 'map' or 'url'");
        }
        generator.mergeMapSection(line, column, mapSectionContents);
      }

      StringBuilder sb = new StringBuilder();
      try {
        generator.appendTo(sb, file);
      } catch (IOException e) {
        // Can't happen.
        throw new RuntimeException(e);
      }

      parse(sb.toString());
    } catch (IOException ex) {
      throw new SourceMapParseException("IO exception: " + ex);
    } catch (JsonParseException ex) {
      throw new SourceMapParseException("JSON parse exception: " + ex);
    }
  }

  @Override
  public OriginalMapping getMappingForLine(int lineNumber, int column) {
    // Normalize the line and column numbers to 0.
    lineNumber--;
    column--;

    if (lineNumber < 0 || lineNumber >= lines.size()) {
      return null;
    }

    Preconditions.checkState(lineNumber >= 0);
    Preconditions.checkState(column >= 0);

    // If the line is empty return the previous mapping.
    if (lines.get(lineNumber) == null) {
      return getPreviousMapping(lineNumber);
    }

    ArrayList<Entry> entries = lines.get(lineNumber);
    // No empty lists.
    Preconditions.checkState(!entries.isEmpty());
    if (entries.get(0).getGeneratedColumn() > column) {
      return getPreviousMapping(lineNumber);
    }

    int index = search(entries, column, 0, entries.size() - 1);
    Preconditions.checkState(index >= 0, "unexpected:%s", index);
    return getOriginalMappingForEntry(entries.get(index));
  }

  @Override
  public Collection<String> getOriginalSources() {
    return Arrays.asList(sources);
  }

  @Override
  public Collection<OriginalMapping> getReverseMapping(String originalFile,
      int line, int column) {
    // TODO(user): This implementation currently does not make use of the column
    // parameter.

    // Synchronization needs to be handled by callers.
    if (reverseSourceMapping == null) {
      createReverseMapping();
    }

    Map<Integer, Collection<OriginalMapping>> sourceLineToCollectionMap =
        reverseSourceMapping.get(originalFile);

    if (sourceLineToCollectionMap == null) {
      return Collections.emptyList();
    } else {
      Collection<OriginalMapping> mappings =
          sourceLineToCollectionMap.get(line);

      if (mappings == null) {
        return Collections.emptyList();
      } else {
        return mappings;
      }
    }
  }

  public String getSourceRoot(){
    return this.sourceRoot;
  }

  /**
   * Returns all extensions and their values (which can be any json value)
   * in a Map object.
   *
   * @return The extension list
   */
  public Map<String, Object> getExtensions(){
    return this.extensions;
  }

  private String[] getJavaStringArray(JsonArray array) throws JsonParseException {
    int len = array.size();
    String[] result = new String[len];
    for (int i = 0; i < len; i++) {
      result[i] = array.get(i).getAsString();
    }
    return result;
  }

  private class MappingBuilder {
    private static final int MAX_ENTRY_VALUES = 5;
    private final StringCharIterator content;
    private int line = 0;
    private int previousCol = 0;
    private int previousSrcId = 0;
    private int previousSrcLine = 0;
    private int previousSrcColumn = 0;
    private int previousNameId = 0;

    MappingBuilder(String lineMap) {
      this.content = new StringCharIterator(lineMap);
    }

    void build() {
      int [] temp = new int[MAX_ENTRY_VALUES];
      ArrayList<Entry> entries = new ArrayList<>();
      while (content.hasNext()) {
        // ';' denotes a new line.
        if (tryConsumeToken(';')) {
          // The line is complete, store the result
          completeLine(entries);
          if (!entries.isEmpty()) {
            // A new array list for the next line.
            entries = new ArrayList<>();
          }
        } else {
          // grab the next entry for the current line.
          int entryValues = 0;
          while (!entryComplete()) {
            temp[entryValues] = nextValue();
            entryValues++;
          }
          Entry entry = decodeEntry(temp, entryValues);

          validateEntry(entry);
          entries.add(entry);

          // Consume the separating token, if there is one.
          tryConsumeToken(',');
        }
      }

      // Some source map generator (e.g.UglifyJS) generates lines without
      // a trailing line separator. So add the rest of the content.
      if (!entries.isEmpty()) {
        completeLine(entries);
      }
    }

    private void completeLine(ArrayList<Entry> entries) {
      // The line is complete, store the result for the line,
      // null if the line is empty.
      if (!entries.isEmpty()) {
        lines.add(entries);
      } else {
        lines.add(null);
      }
      line++;
      previousCol = 0;
    }

    /**
     * Sanity check the entry.
     */
    private void validateEntry(Entry entry) {
      Preconditions.checkState((lineCount < 0) || (line < lineCount),
          "line=%s, lineCount=%s", line, lineCount);
      Preconditions.checkState(entry.getSourceFileId() == UNMAPPED
          || entry.getSourceFileId() < sources.length);
      Preconditions.checkState(entry.getNameId() == UNMAPPED
          || entry.getNameId() < names.length);
    }

    /**
     * Decodes the next entry, using the previous encountered values to
     * decode the relative values.
     *
     * @param vals An array of integers that represent values in the entry.
     * @param entryValues The number of entries in the array.
     * @return The entry object.
     */
    private Entry decodeEntry(int[] vals, int entryValues) {
      Entry entry;
      switch (entryValues) {
        // The first values, if present are in the following order:
        //   0: the starting column in the current line of the generated file
        //   1: the id of the original source file
        //   2: the starting line in the original source
        //   3: the starting column in the original source
        //   4: the id of the original symbol name
        // The values are relative to the last encountered value for that field.
        // Note: the previously column value for the generated file is reset
        // to '0' when a new line is encountered.  This is done in the 'build'
        // method.

        case 1:
          // An unmapped section of the generated file.
          entry = new UnmappedEntry(
              vals[0] + previousCol);
          // Set the values see for the next entry.
          previousCol = entry.getGeneratedColumn();
          return entry;

        case 4:
          // A mapped section of the generated file.
          entry = new UnnamedEntry(
              vals[0] + previousCol,
              vals[1] + previousSrcId,
              vals[2] + previousSrcLine,
              vals[3] + previousSrcColumn);
          // Set the values see for the next entry.
          previousCol = entry.getGeneratedColumn();
          previousSrcId = entry.getSourceFileId();
          previousSrcLine = entry.getSourceLine();
          previousSrcColumn = entry.getSourceColumn();
          return entry;

        case 5:
          // A mapped section of the generated file, that has an associated
          // name.
          entry = new NamedEntry(
              vals[0] + previousCol,
              vals[1] + previousSrcId,
              vals[2] + previousSrcLine,
              vals[3] + previousSrcColumn,
              vals[4] + previousNameId);
          // Set the values see for the next entry.
          previousCol = entry.getGeneratedColumn();
          previousSrcId = entry.getSourceFileId();
          previousSrcLine = entry.getSourceLine();
          previousSrcColumn = entry.getSourceColumn();
          previousNameId = entry.getNameId();
          return entry;

        default:
          throw new IllegalStateException(
              "Unexpected number of values for entry:" + entryValues);
      }
    }

    private boolean tryConsumeToken(char token) {
      if (content.hasNext() && content.peek() == token) {
        // consume the comma
        content.next();
        return true;
      }
      return false;
    }

    private boolean entryComplete() {
      if (!content.hasNext()) {
        return true;
      }

      char c = content.peek();
      return (c == ';' || c == ',');
    }

    private int nextValue() {
      return Base64VLQ.decode(content);
    }
  }

  /**
   * Perform a binary search on the array to find a section that covers
   * the target column.
   */
  private int search(ArrayList<Entry> entries, int target, int start, int end) {
    while (true) {
      int mid = ((end - start) / 2) + start;
      int compare = compareEntry(entries, mid, target);
      if (compare == 0) {
        return mid;
      } else if (compare < 0) {
        // it is in the upper half
        start = mid + 1;
        if (start > end) {
          return end;
        }
      } else {
        // it is in the lower half
        end = mid - 1;
        if (end < start) {
          return end;
        }
      }
    }
  }

  /**
   * Compare an array entry's column value to the target column value.
   */
  private int compareEntry(ArrayList<Entry> entries, int entry, int target) {
    return entries.get(entry).getGeneratedColumn() - target;
  }

  /**
   * Returns the mapping entry that proceeds the supplied line or null if no
   * such entry exists.
   */
  private OriginalMapping getPreviousMapping(int lineNumber) {
    do {
      if (lineNumber == 0) {
        return null;
      }
      lineNumber--;
    } while (lines.get(lineNumber) == null);
    ArrayList<Entry> entries = lines.get(lineNumber);
    return getOriginalMappingForEntry(entries.get(entries.size() - 1));
  }

  /**
   * Creates an "OriginalMapping" object for the given entry object.
   */
  private OriginalMapping getOriginalMappingForEntry(Entry entry) {
    if (entry.getSourceFileId() == UNMAPPED) {
      return null;
    } else {
      // Adjust the line/column here to be start at 1.
      Builder x = OriginalMapping.newBuilder()
        .setOriginalFile(sources[entry.getSourceFileId()])
        .setLineNumber(entry.getSourceLine() + 1)
        .setColumnPosition(entry.getSourceColumn() + 1);
      if (entry.getNameId() != UNMAPPED) {
        x.setIdentifier(names[entry.getNameId()]);
      }
      return x.build();
    }
  }

  /**
   * Reverse the source map; the created mapping will allow us to quickly go
   * from a source file and line number to a collection of target
   * OriginalMappings.
   */
  private void createReverseMapping() {
    reverseSourceMapping = new HashMap<>();

    for (int targetLine = 0; targetLine < lines.size(); targetLine++) {
      ArrayList<Entry> entries = lines.get(targetLine);

      if (entries != null) {
        for (Entry entry : entries) {
          if (entry.getSourceFileId() != UNMAPPED
              && entry.getSourceLine() != UNMAPPED) {
            String originalFile = sources[entry.getSourceFileId()];

            if (!reverseSourceMapping.containsKey(originalFile)) {
              reverseSourceMapping.put(originalFile,
                  new HashMap<Integer, Collection<OriginalMapping>>());
            }

            Map<Integer, Collection<OriginalMapping>> lineToCollectionMap =
                reverseSourceMapping.get(originalFile);

            int sourceLine = entry.getSourceLine();

            if (!lineToCollectionMap.containsKey(sourceLine)) {
              lineToCollectionMap.put(sourceLine,
                  new ArrayList<OriginalMapping>(1));
            }

            Collection<OriginalMapping> mappings =
                lineToCollectionMap.get(sourceLine);

            Builder builder = OriginalMapping.newBuilder().setLineNumber(
                targetLine).setColumnPosition(entry.getGeneratedColumn());

            mappings.add(builder.build());
          }
        }
      }
    }
  }

  /**
   * A implementation of the Base64VLQ CharIterator used for decoding the
   * mappings encoded in the JSON string.
   */
  private static class StringCharIterator implements CharIterator {
    final String content;
    final int length;
    int current = 0;

    StringCharIterator(String content) {
      this.content = content;
      this.length = content.length();
    }

    @Override
    public char next() {
      return content.charAt(current++);
    }

    char peek() {
      return content.charAt(current);
    }

    @Override
    public boolean hasNext() {
      return current < length;
    }
  }

  /**
   * Represents a mapping entry in the source map.
   */
  private interface Entry {
    int getGeneratedColumn();
    int getSourceFileId();
    int getSourceLine();
    int getSourceColumn();
    int getNameId();
  }

  /**
   * This class represents a portion of the generated file, that is not mapped
   * to a section in the original source.
   */
  private static class UnmappedEntry implements Entry {
    private final int column;

    UnmappedEntry(int column) {
      this.column = column;
    }

    @Override
    public int getGeneratedColumn() {
      return column;
    }

    @Override
    public int getSourceFileId() {
      return UNMAPPED;
    }

    @Override
    public int getSourceLine() {
      return UNMAPPED;
    }

    @Override
    public int getSourceColumn() {
      return UNMAPPED;
    }

    @Override
    public int getNameId() {
      return UNMAPPED;
    }
  }

  /**
   * This class represents a portion of the generated file, that is mapped
   * to a section in the original source.
   */
  private static class UnnamedEntry extends UnmappedEntry {
    private final int srcFile;
    private final int srcLine;
    private final int srcColumn;

    UnnamedEntry(int column, int srcFile, int srcLine, int srcColumn) {
      super(column);
      this.srcFile = srcFile;
      this.srcLine = srcLine;
      this.srcColumn = srcColumn;
    }

    @Override
    public int getSourceFileId() {
      return srcFile;
    }

    @Override
    public int getSourceLine() {
      return srcLine;
    }

    @Override
    public int getSourceColumn() {
      return srcColumn;
    }

    @Override
    public int getNameId() {
      return UNMAPPED;
    }
  }

  /**
   * This class represents a portion of the generated file, that is mapped
   * to a section in the original source, and is associated with a name.
   */
  private static class NamedEntry extends UnnamedEntry {
    private final int name;

    NamedEntry(int column, int srcFile, int srcLine, int srcColumn, int name) {
      super(column, srcFile, srcLine, srcColumn);
      this.name = name;
    }

    @Override
    public int getNameId() {
      return name;
    }
  }

  public static interface EntryVisitor {
    void visit(String sourceName,
               String symbolName,
               FilePosition sourceStartPosition,
               FilePosition startPosition,
               FilePosition endPosition);
  }

  public void visitMappings(EntryVisitor visitor) {
    boolean pending = false;
    String sourceName = null;
    String symbolName = null;
    FilePosition sourceStartPosition = null;
    FilePosition startPosition = null;

    final int lineCount = lines.size();
    for (int i = 0; i < lineCount; i++) {
      ArrayList<Entry> line = lines.get(i);
      if (line != null) {
        final int entryCount = line.size();
        for (int j = 0; j < entryCount; j++) {
          Entry entry = line.get(j);
          if (pending) {
            FilePosition endPosition = new FilePosition(
                i, entry.getGeneratedColumn());
            visitor.visit(
                sourceName,
                symbolName,
                sourceStartPosition,
                startPosition,
                endPosition);
            pending = false;
          }

          if (entry.getSourceFileId() != UNMAPPED) {
            pending = true;
            sourceName = sources[entry.getSourceFileId()];
            symbolName = (entry.getNameId() != UNMAPPED)
                ? names[entry.getNameId()] : null;
            sourceStartPosition = new FilePosition(
                entry.getSourceLine(), entry.getSourceColumn());
            startPosition = new FilePosition(
                i, entry.getGeneratedColumn());
          }
        }
      }
    }
  }
}


text:
ActiveRecord::Schema.define(:version => 20130913004605) do

  create_table "enrollments", :force => true do |t|
    t.integer  "opentrip_id"
    t.integer  "participant_id"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
  end

  add_index "enrollments", ["opentrip_id", "participant_id"], :name => "index_enrollments_on_opentrip_id_and_participant_id", :unique => true
  add_index "enrollments", ["opentrip_id"], :name => "index_enrollments_on_opentrip_id"
  add_index "enrollments", ["participant_id"], :name => "index_enrollments_on_participant_id"

  create_table "microposts", :force => true do |t|
    t.string   "content"
    t.integer  "user_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "microposts", ["user_id", "created_at"], :name => "index_microposts_on_user_id_and_created_at"

  create_table "pois", :force => true do |t|
    t.string   "name"
    t.float    "latitude"
    t.float    "longitude"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "relationships", :force => true do |t|
    t.integer  "follower_id"
    t.integer  "followed_id"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  add_index "relationships", ["followed_id"], :name => "index_relationships_on_followed_id"
  add_index "relationships", ["follower_id", "followed_id"], :name => "index_relationships_on_follower_id_and_followed_id", :unique => true
  add_index "relationships", ["follower_id"], :name => "index_relationships_on_follower_id"

  create_table "trip_areas", :force => true do |t|
    t.string   "name"
    t.string   "description"
    t.spatial  "center_point", :limit => {:srid=>4326, :type=>"point", :geographic=>true}
    t.integer  "zoom_level"
    t.integer  "user_id"
    t.datetime "created_at",                                                               :null => false
    t.datetime "updated_at",                                                               :null => false
  end

  add_index "trip_areas", ["user_id", "created_at"], :name => "index_trip_areas_on_user_id_and_created_at"

  create_table "trips", :force => true do |t|
    t.string   "name"
    t.string   "description"
    t.spatial  "center",      :limit => {:srid=>4326, :type=>"point", :geographic=>true}
    t.integer  "zoom"
    t.integer  "user_id"
    t.datetime "created_at",                                                              :null => false
    t.datetime "updated_at",                                                              :null => false
  end

  add_index "trips", ["user_id"], :name => "index_trips_on_user_id"

  create_table "users", :force => true do |t|
    t.string   "name"
    t.string   "email"
    t.datetime "created_at",                         :null => false
    t.datetime "updated_at",                         :null => false
    t.string   "password_digest"
    t.string   "remember_token"
    t.boolean  "admin",           :default => false
  end

  add_index "users", ["email"], :name => "index_users_on_email", :unique => true
  add_index "users", ["remember_token"], :name => "index_users_on_remember_token"

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5">
	<AutoCommandBar name="" id="-1"/>
	<ChildItems>
		<UsualGroup name="СписокКомпоновщикНастроекПользовательскиеНастройки" id="1">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Группа пользовательских настроек</v8:content>
				</v8:item>
			</Title>
			<VerticalStretch>false</VerticalStretch>
			<Group>Vertical</Group>
			<ShowTitle>false</ShowTitle>
			<ExtendedTooltip name="СписокКомпоновщикНастроекПользовательскиеНастройкиРасширеннаяПодсказка" id="2"/>
		</UsualGroup>
		<Table name="Список" id="3">
			<Representation>List</Representation>
			<CommandBarLocation>None</CommandBarLocation>
			<DefaultItem>true</DefaultItem>
			<UseAlternationRowColor>true</UseAlternationRowColor>
			<InitialTreeView>ExpandTopLevel</InitialTreeView>
			<EnableStartDrag>true</EnableStartDrag>
			<DataPath>Список</DataPath>
			<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
			<AutoRefresh>false</AutoRefresh>
			<AutoRefreshPeriod>60</AutoRefreshPeriod>
			<Period>
				<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
				<v8:startDate>0001-01-01T00:00:00</v8:startDate>
				<v8:endDate>0001-01-01T00:00:00</v8:endDate>
			</Period>
			<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
			<RestoreCurrentRow>false</RestoreCurrentRow>
			<TopLevelParent xsi:nil="true"/>
			<ShowRoot>true</ShowRoot>
			<AllowRootChoice>false</AllowRootChoice>
			<UpdateOnDataChange>Auto</UpdateOnDataChange>
			<UserSettingsGroup>СписокКомпоновщикНастроекПользовательскиеНастройки</UserSettingsGroup>
			<ContextMenu name="СписокКонтекстноеМеню" id="4"/>
			<AutoCommandBar name="СписокКоманднаяПанель" id="5">
				<Autofill>false</Autofill>
			</AutoCommandBar>
			<ExtendedTooltip name="СписокРасширеннаяПодсказка" id="6"/>
			<SearchStringAddition name="СписокСтрокаПоиска" id="7">
				<AdditionSource>
					<Item>Список</Item>
					<Type>SearchStringRepresentation</Type>
				</AdditionSource>
				<ContextMenu name="СписокСтрокаПоискаКонтекстноеМеню" id="8"/>
				<ExtendedTooltip name="СписокСтрокаПоискаРасширеннаяПодсказка" id="9"/>
			</SearchStringAddition>
			<ViewStatusAddition name="СписокСостояниеПросмотра" id="10">
				<AdditionSource>
					<Item>Список</Item>
					<Type>ViewStatusRepresentation</Type>
				</AdditionSource>
				<ContextMenu name="СписокСостояниеПросмотраКонтекстноеМеню" id="11"/>
				<ExtendedTooltip name="СписокСостояниеПросмотраРасширеннаяПодсказка" id="12"/>
			</ViewStatusAddition>
			<SearchControlAddition name="СписокУправлениеПоиском" id="13">
				<AdditionSource>
					<Item>Список</Item>
					<Type>SearchControl</Type>
				</AdditionSource>
				<ContextMenu name="СписокУправлениеПоискомКонтекстноеМеню" id="14"/>
				<ExtendedTooltip name="СписокУправлениеПоискомРасширеннаяПодсказка" id="15"/>
			</SearchControlAddition>
			<ChildItems>
				<LabelField name="Хранилище" id="16">
					<DataPath>Список.Хранилище</DataPath>
					<DefaultItem>true</DefaultItem>
					<ContextMenu name="ХранилищеКонтекстноеМеню" id="17"/>
					<ExtendedTooltip name="ХранилищеРасширеннаяПодсказка" id="18"/>
				</LabelField>
				<CheckBoxField name="Выгружается" id="19">
					<DataPath>Список.Выгружается</DataPath>
					<DefaultItem>true</DefaultItem>
					<CheckBoxType>Auto</CheckBoxType>
					<ContextMenu name="ВыгружаетсяКонтекстноеМеню" id="20"/>
					<ExtendedTooltip name="ВыгружаетсяРасширеннаяПодсказка" id="21"/>
				</CheckBoxField>
				<CheckBoxField name="ЕстьОшибкиВыгрузки" id="22">
					<DataPath>Список.ЕстьОшибкиВыгрузки</DataPath>
					<DefaultItem>true</DefaultItem>
					<CheckBoxType>Auto</CheckBoxType>
					<ContextMenu name="ЕстьОшибкиВыгрузкиКонтекстноеМеню" id="23"/>
					<ExtendedTooltip name="ЕстьОшибкиВыгрузкиРасширеннаяПодсказка" id="24"/>
				</CheckBoxField>
				<LabelField name="ТекстОшибки" id="25">
					<DataPath>Список.ТекстОшибки</DataPath>
					<DefaultItem>true</DefaultItem>
					<ContextMenu name="ТекстОшибкиКонтекстноеМеню" id="26"/>
					<ExtendedTooltip name="ТекстОшибкиРасширеннаяПодсказка" id="27"/>
				</LabelField>
			</ChildItems>
		</Table>
	</ChildItems>
	<Attributes>
		<Attribute name="Список" id="1">
			<Type>
				<v8:Type>cfg:DynamicList</v8:Type>
			</Type>
			<MainAttribute>true</MainAttribute>
			<Settings xsi:type="DynamicList">
				<ManualQuery>false</ManualQuery>
				<DynamicDataRead>true</DynamicDataRead>
				<MainTable>InformationRegister.СтатусыВыгрузки</MainTable>
				<ListSettings>
					<dcsset:filter>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>dfcece9d-5077-440b-b6b3-45a5cb4538eb</dcsset:userSettingID>
					</dcsset:filter>
					<dcsset:order>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>88619765-ccb3-46c6-ac52-38e9c992ebd4</dcsset:userSettingID>
					</dcsset:order>
					<dcsset:conditionalAppearance>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>b75fecce-942b-4aed-abc9-e6a02e460fb3</dcsset:userSettingID>
					</dcsset:conditionalAppearance>
					<dcsset:itemsViewMode>Normal</dcsset:itemsViewMode>
					<dcsset:itemsUserSettingID>911b6018-f537-43e8-a417-da56b22f9aec</dcsset:itemsUserSettingID>
				</ListSettings>
			</Settings>
		</Attribute>
	</Attributes>
</Form>


text:
package companyregistry.domain.beneficiary;

/**
 * @author dokuboyejo
 *
 */
public class Beneficiary {

	private Long id;
	private String firstName;
	private String lastName;

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}
	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param firstName
	 *            the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * @param lastName
	 *            the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

}


text:
<?php

use yii\helpers\Html;
use app\models\DrGateways;
use kartik\form\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\detail\DetailView;

/**
 * @var yii\web\View $this
 * @var app\models\DrCarriers $model
 * @var yii\widgets\ActiveForm $form
 */
?>

<div class="dr-carriers-form">

    <?php
        $inputStyle = "padding-left: 20px; padding-right: 20px; padding-top: 2px; padding-bottom: 10px;";

        $gateways_list = ArrayHelper::map(DrGateways::find()->all(), 'id', 'address');

        // Define Form Widget Columns
        $formColumns = [
            'carrierid'=>['attribute'=>'carrierid', 'type'=> DetailView::INPUT_TEXT, 'inputContainer' => ['style' => $inputStyle]],
            'gwlist'=>['attribute'=>'gwlist', 'items' => $gateways_list, 'type'=> DetailView::INPUT_DROPDOWN_LIST, 'inputContainer' => ['style' => $inputStyle]],
            'flags'=>['attribute'=>'flags', 'type'=> DetailView::INPUT_TEXT, 'inputContainer' => ['style' => $inputStyle]],
            'state'=>['attribute'=>'state', 'type'=> DetailView::INPUT_TEXT, 'inputContainer' => ['style' => $inputStyle]],
            'attrs'=>['attribute'=>'attrs', 'type'=> DetailView::INPUT_TEXT, 'inputContainer' => ['style' => $inputStyle]],
            'description'=>['attribute'=>'description', 'type'=> DetailView::INPUT_TEXTAREA, 'inputContainer' => ['style' => $inputStyle]],
        ];

        $form = ActiveForm::begin([
            'type' => ActiveForm::TYPE_HORIZONTAL,
            'fullSpan' => 12,
        ]);

        echo DetailView::widget([
            'model' => $model,
            'condensed'=> true,
            'hover' => true,
            'mode' => DetailView::MODE_EDIT,
            'panel' => [
                'heading'=>'Domain # ' .$model->carrierid,
                'type'=>DetailView::TYPE_INFO,
            ],
            'attributes' => $formColumns
        ]);

        //echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);

        ActiveForm::end();
    ?>

</div>


text:
<?php

namespace Bizhub\Impersonate\Middleware;

use Auth;
use Closure;

class CheckIfImpersonating
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if($request->session()->has('impersonate')) {
            Auth::onceUsingId($request->session()->get('impersonate'));
        }

        return $next($request);
    }
}


text:
class ShopProductFeatures < ActiveRecord::Migration
  def self.up

    create_table :shop_product_features do |t|
      t.integer :shop_product_id
      t.string  :shop_feature_handler
      t.integer :position, :default => 0
      t.text :feature_options
      t.boolean :price_callback, :default => false
      t.boolean :purchase_callback, :default => false
      t.boolean :stock_callback, :default => false
      t.boolean :shipping_callback, :default => false
      t.boolean :rendering_callback, :default => false
      t.boolean :other_callback, :default => false
    end

    add_column :shop_products, :price_callbacks, :integer, :default => 0
    add_column :shop_products, :purchase_callbacks, :integer, :default => 0
    add_column :shop_products, :stock_callbacks, :integer, :default => 0
    add_column :shop_products, :shipping_callbacks, :integer, :default => 0
    add_column :shop_products, :rendering_callbacks, :integer, :default => 0
    add_column :shop_products, :other_callbacks, :integer, :default => 0

    add_index :shop_product_features, [:shop_product_id, :position ], :name => 'product'
  end

  def self.down
    drop_table :shop_product_features

    remove_column :shop_products, :price_callbacks
    remove_column :shop_products, :purchase_callbacks
    remove_column :shop_products, :stock_callbacks
    remove_column :shop_products, :shipping_callbacks
    remove_column :shop_products, :rendering_callbacks
    remove_column :shop_products, :other_callbacks
  end

end


text:
![Build](https://github.com/mistraltechnologies/smogen/workflows/Build/badge.svg)
[![Version](https://img.shields.io/jetbrains/plugin/v/7469.svg)](https://plugins.jetbrains.com/plugin/7469)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/7469.svg)](https://plugins.jetbrains.com/plugin/7469)

Generates a companion matcher class for a selected Java class based on the SMOG library extension to Hamcrest.

The SMOG library supports property matching on object graphs. For more details, see the project page
at GitHub

This plugin is also hosted at GitHub

## Usage

This plugin adds a Generate Matcher menu option to the Code menu in IntelliJ IDEA.

It generates matcher classes that can be used as Hamcrest matchers.

The generated class has a dependency on the supporting SMOG library, hosted at https://github.com/mistraltechnologies/smog
and available from Maven Central.

The menu option is enabled when a Java class is selected.

After selecting the menu option, a dialog is provided to specify parameters relating to how the new matcher will be generated.

Confirming the dialog causes the new class to be generated.
If the class already exists, you are given the option to overwrite the existing class or abort.

## Installation

- Using IDE built-in plugin system:

  Preferences > Plugins > Marketplace > Search for "smogen" >
  Install Plugin

- Manually:

  Download the [latest release](https://github.com/mistraltechnologies/smogen/releases/latest) and install it manually using
  Preferences > Plugins > ⚙ > Install plugin from disk...

## Template ToDo list
- [x] Create a new [IntelliJ Platform Plugin Template][template] project.
- [x] Verify the [pluginGroup](/gradle.properties), [plugin ID](/src/main/resources/META-INF/plugin.xml) and [sources package](/src/main/kotlin).
- [x] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html).
- [x] [Publish a plugin manually](https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/publishing_plugin.html) for the first time.
- [x] Set the Plugin ID in the above README badges.
- [x] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html).
- [x] Click the Watch button on the top of the [IntelliJ Platform Plugin Template][template] to be notified about releases containing new features and fixes.

## Release Publishing

``export PUBLISH_TOKEN=<jetbrains token>``

``./gradlew publishPlugin``

---
Plugin based on the [IntelliJ Platform Plugin Template][template].

[template]: https://github.com/JetBrains/intellij-platform-plugin-template


text:
import bottle
import networkx
import networkx.readwrite.json_graph

import json
import os

@bottle.route('/dependencies')
def dependencies():
    # In reality, this has do some parsing of Plink Makefiles and
    # the Debian package metadata to get a real idea of the dependencies.
    pass

@bottle.route('/messagequeue-port')
def messagequeue_port():
    pass

class ConcourseShim(object):
    # Concourse UI can display multiple groups of pipelines. They are listed
    # in a row along the top of the window. We assume there's just one group,
    # for now.
    _default_group = "builds"

    def _pipeline(self, pipeline_name, job_names):
        '''Return Concourse-compatible JSON for a single Pipeline.

        A Pipeline contains multiple Jobs. I'm not really sure how
        Groups fit in, but we only have 1 anyway.

        '''
        return dict(
            name=pipeline_name,
            url='/pipelines/%s' % pipeline_name,
            paused=False,
            groups=[
                dict(
                    name=self._default_group,
                    jobs=job_names,
                )
            ])

    def _job(self, pipeline_name, job_name, dependee_jobs):
        '''Return Concourse-compatible JSON for a single Job instance.

        A Job (or task) is some work that needs to be done. Compiling some
        source code is a Job, for example.

        '''
        def source_resource():
            return dict(name="input", resource="input")

        def output_resource(input_names):
            if len(input_names) > 0:
                return dict(name="output", resource="output", passed=input_names)
            else:
                return dict(name="output", resource="output")

        inputs = [source_resource()]

        if dependee_jobs:
            inputs.append(output_resource(dependee_jobs))

        return dict(
            name=job_name,
            url='/pipelines/%s/jobs/%s' % (pipeline_name, job_name),
            next_build=None,
            finished_build=None,
            inputs=inputs,
            outputs=[output_resource([])],
            groups=[self._default_group]
        )

    def _resource(self, pipeline_name, resource_name, resource_type):
        '''Return Concourse-compatible JSON for a single Resource instance.

        A Resource is a generic input or output thing, such as a Git repository
        that provides source code, or a package repository that contains build
        output.

        When using only the UI of Concourse, resources aren't that interesting.

        '''
        return dict(
            name=resource_name,
            type=resource_type,
            groups=[],
            url="/pipelines/%s/resources/%s" % (pipeline_name, resource_name),
        )

    def pipelines(self):
        # Return a single pipeline called "main", containing all jobs.
        nodes = self.build_graph.nodes(data=True)
        all_job_names = [node_data['name'] for node_id, node_data in nodes]
        pipeline = self._pipeline("main", all_job_names)
        return json.dumps(pipeline)

    def pipeline_jobs(self, pipeline):
        # List all the jobs we know about.
        jobs = []
        for job_node_id, job_node_data in self.build_graph.nodes(data=True):
            job_name = job_node_data['name']

            # sorry
            input_edges = self.build_graph.in_edges(job_node_id)
            input_node_ids = [edge[0] for edge in input_edges]
            input_job_names = [self.build_graph.node[i]['name'] for i in
                                input_node_ids]

            job = self._job(pipeline, job_name, input_job_names)
            jobs.append(job)

        return json.dumps(jobs)

    def pipeline_resources(self, pipeline):
        resources = [self._resource(pipeline, name, type)
                     for name, type in
                     [("input", "git"), ("output", "github-release")]]
        return json.dumps(resources)

    def __init__(self, build_graph_node_link_data):
        self.build_graph = networkx.readwrite.json_graph.node_link_graph(
            build_graph_node_link_data)

        self.app = bottle.Bottle()
        self.app.route('/pipelines')(self.pipelines)
        self.app.route('/pipelines/<pipeline>/jobs')(self.pipeline_jobs)
        self.app.route('/pipelines/<pipeline>/resources')(self.pipeline_resources)

def main():
    GRAPH = 'build-graph.json'

    HOST = os.environ.get('HOST', '0.0.0.0')
    PORT = os.environ.get('PORT', 8080)

    with open(GRAPH) as f:
        build_graph = json.load(f)

    concourse_shim = ConcourseShim(build_graph)

    # API requests under /api/v1/ go to the Concourse shim
    root = bottle.Bottle()
    root.mount('/api/v1', concourse_shim.app)

    # Avoid 404 errors in these cases.
    @root.route('/')
    @root.route('/demo')
    @root.route('/demo/')
    def index_redirect():
        return bottle.redirect('/demo/index.html')

    # Everything else is treated as a file path, in the parent directory
    # (so we can get at Concourse ATC's files inside the ../atc/ submodule.
    @root.route('/<filepath:path>')
    def serve_file(filepath):
        return bottle.static_file(filepath, root='..')

    bottle.run(root, host=HOST, port=PORT)

main()


text:
/* Generated by ./xlat/gen.sh from ./xlat/pr_tsc.in; do not edit. */

static const struct xlat pr_tsc[] = {
#if !(defined(PR_TSC_ENABLE) || (defined(HAVE_DECL_PR_TSC_ENABLE) && HAVE_DECL_PR_TSC_ENABLE))
# define PR_TSC_ENABLE 1
#endif
 XLAT(PR_TSC_ENABLE),
#if !(defined(PR_TSC_SIGSEGV) || (defined(HAVE_DECL_PR_TSC_SIGSEGV) && HAVE_DECL_PR_TSC_SIGSEGV))
# define PR_TSC_SIGSEGV 2
#endif
 XLAT(PR_TSC_SIGSEGV),
 XLAT_END
};


text:
/**/
#include <stdio.h>
int main()
  {
   double A, B, C, D, grade;
   printf("Enter thresholds for A, B, C, D\nin that order, decreasing percentages > ");
   scanf("%lf%lf%lf%lf", &A,&B,&C,&D);
   printf("Thank you. Now enter student score (percent) >");
   scanf("%lf", &grade);
   if (grade>=A)
        printf("Student has an A grade\n");
   else if (grade>=B && grade<A)
        printf("Student has an B grade\n");
   else if (grade>=C && grade<B)
        printf("Student has an C grade\n");
   else if (grade>=D && grade<C)
        printf("Student has an D grade\n");
   else if (grade<D)
        printf("Student has an F grade\n");
   return 0;
  }


text:
```bash
:help keyword # open help for keyword
:o file       # open file
:saveas file  # save file as
:close        # close current pane
```

## Cursor movement
```bash
h        # move cursor left
j        # move cursor down
k        # move cursor up
l        # move cursor right
H        # move to top of screen
M        # move to middle of screen
L        # move to bottom of screen
w        # jump forwards to the start of a word
W        # jump forwards to the start of a word (words can contain punctuation)
e        # jump forwards to the end of a word
E        # jump forwards to the end of a word (words can contain punctuation)
b        # jump backwards to the start of a word
B        # jump backwards to the start of a word (words can contain punctuation)
%        # move to matching character (default supported pairs: '()','{}','[]'
0        # jump to the start of the line
^        # jump to the first non-blank character of the line
$        # jump to the end of the line
g_       # jump to the last non-blank character of the line
gg       # go to the first line of the document
G        # go to the last line of the document
5G       # go to line 5
fx       # jump to next occurrence of character x
tx       # jump to before next occurrence of character x
Fx       # jump to previous occurrence of character x
Tx       # jump to after precious occurrence of character x
;        # repeat previous f, t, F or T movement
,        # repeat previous f, t, F or T movement, backwards
}        # jump to next paragraph (or function/block, when editing code)
{        # jump to previous paragraph (or function/block, when editing code)
zz       # center cursor on screen
Ctrl + e # move screen down one line (without moving cursor)
Ctrl + y # move screen up one line (without moving cursor)
Ctrl + b # move back one full screen
Ctrl + f # move forward one full screen
Ctrl + d # move forward 1/2 a screen
Ctrl + u # move back 1/2 a screen
```

## Insert mode - inserting/appending text
```bash
i        # insert before the cursor
I        # insert at the beginning of the line
a        # insert (append) after the cursor
A        # insert (append) at the end of the line
o        # append (open) a new line below the current line
O        # append (open) a new line above the current line
ea       # insert (append) at the end of the word
Esc      # exit insert mode
```

## Editing
```bash
r        # replace a single character
J        # join lione below to the current one
gJ       # join line below to the current one without space in between
cc       # change (replace) entire line
cw       # change (replace) to the start of the next word
ciw      # change (replace) entire word
ce       # change (replace) to the end of the next word
cb       # change (replace) to the start of the previous word
c0       # change (replace) to the start of the line
c$       # change (replace) to the end of the line
s        # delete character and substitute text
S        # delete line and substitute text (same as cc)
xp       # transpose two letters (delete and paste)
.        # repeat last command
u        # undo
Ctrl + r # redo
```

## Marking text (visual mode)
```bash
v        # start visual mode, mark lines, then do a command (like y-yank)
V        # start linewise visual mode
o        # move to other end of marked area
O        # move to other corner of block
aw       # mark a word
ab       # a block with ()
aB       # a block with {}
ib       # inner block with ()
iB       # inner block with {}
Esc      # exit visual mode
Ctrl + v # start visual block mode
```

## Visual commands
```bash
>       # shift text right
<       # shift text left
y       # yank (copy) marked text
d       # delete marked text
~       # switch case
```

## Registers
```bash
:reg    # show registers content
"xy     # yank into register x
"xp     # paste contents of register x
```

## Marks
```bash
:marks  # list of marks
ma      # set current position for mark A
`a      # jump to position of mark A
y`a     # yank text to position of mark A
```

## Macros
```bash
qa      # record macro a
q       # stop recording macro
@a      # run macro a
@@      # rerun last run macro
```

## Cut and paste
```bash
yy       # yank (copy) a line
2yy      # yank (copy) 2 lines
yw       # yank (copy) the characters of the word from the cursor position to the start of the next word
y$       # yank (copy) to end of line
p        # put (paste) the clipboard after cursor
P        # put (paste) before cursor
dd       # delete (cut) a line
2dd      # delete (cut) 2 lines
dw       # delete (cut) the characters of the word from the cursor position to the start of the next word
D        # delete (cut) to the end of the line
d$       # delete (cut) to the end of the line
d^       # delete (cut) to the first non-blank character of the line
d0       # delete (cut) to the begining of the line
x        # delete (cut) character
```

## Search and replace
```bash
/pattern       # search for pattern
?pattern       # search backward for pattern
\vpattern      # 'very magic' pattern: non-alphanumeric characters are interpreted as special regex symbols (no escaping needed)
n              # repeat search in same direction
N              # repeat search in opposite direction
:%s/old/new/g  # replace all old with new throughout file
:%s/old/new/gc # replace all old with new throughout file with confirmations
:noh           # remove highlighting of search matches
```

## Search in multiple files
```bash
:vimgrep /pattern/ {file} # search for pattern in multiple files
:cn                       # jump to the next match
:cp                       # jump to the previous match
:copen                    # open a window containing the list of matches
```

## Exiting
```bash
:w              # write (save) the file, but don't exit
:w !sudo tee %  # write out the current file using sudo
:wq or :x or ZZ # write (save) and quit
:q              # quit (fails if there are unsaved changes)
:q! or ZQ       # quit and throw away unsaved changes
:wqa            # write (save) and quit on all tabs
```

## Working with multiple files
```bash
:e file       # edit a file in a new buffer
:bnext or :bn # go to the next buffer
:bprev or :bp # go to the previous buffer
:bd           # delete a buffer (close a file)
:ls           # list all open buffers
:sp file      # open a file in a new buffer and split window
:vsp file     # open a file in a new buffer and vertically split window
Ctrl + ws     # split window
Ctrl + ww     # switch windows
Ctrl + wq     # quit a window
Ctrl + wv     # split window vertically
Ctrl + wh     # move cursor to the left window (vertical split)
Ctrl + wl     # move cursor to the right window (vertical split)
Ctrl + wj     # move cursor to the window below (horizontal split)
Ctrl + wk     # move cursor to the window above (horizontal split)
```

## Tabs
```bash
:tabnew or :tabnew file # open a file in a new tab
Ctrl + wT               # move the current split window into its own tab
gt or :tabnext or :tabn # move to the next tab
gT or :tabprev or :tabp # move to the previous tab
<number>gt              # move to tab <number>
:tabmove <number>       # move current tab to the <number>th position (indexed from 0)
:tabclose or :tabc      # close the current tab and all its windows
:tabonly or :tabo       # close all tabs except for the current one
:tabdo command          # run the command on all tabs (e.g. :tabdo q - closes all opened tabs)
```


text:
namespace MyStik.TimeTable.Data.Migrations
{
    using System.CodeDom.Compiler;
    using System.Data.Entity.Migrations;
    using System.Data.Entity.Migrations.Infrastructure;
    using System.Resources;

    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
    public sealed partial class CurriculumV4 : IMigrationMetadata
    {
        private readonly ResourceManager Resources = new ResourceManager(typeof(CurriculumV4));

        string IMigrationMetadata.Id
        {
            get { return "201802131606435_CurriculumV4"; }
        }

        string IMigrationMetadata.Source
        {
            get { return null; }
        }

        string IMigrationMetadata.Target
        {
            get { return Resources.GetString("Target"); }
        }
    }
}