text:
export enum FAIconName {
    glass,
    music,
    search,
    envelopeAlt,
    heart,
    star,
    starEmpty,
    user,
    film,
    thLarge,
    th,
    thList,
    ok,
    remove,
    zoomIn,
    zoomOut,
    powerOff,
    off,
    signal,
    gear,
    cog,
    trash,
    home,
    fileAlt,
    time,
    road,
    downloadAlt,
    download,
    upload,
    inbox,
    playCircle,
    rotateRight,
    repeat,
    refresh,
    listAlt,
    lock,
    flag,
    headphones,
    volumeOff,
    volumeDown,
    volumeUp,
    qrcode,
    barcode,
    tag,
    tags,
    book,
    bookmark,
    print,
    camera,
    font,
    bold,
    italic,
    textHeight,
    textWidth,
    alignLeft,
    alignCenter,
    alignRight,
    alignJustify,
    list,
    indentLeft,
    indentRight,
    facetimeVideo,
    picture,
    pencil,
    mapMarker,
    adjust,
    tint,
    edit,
    share,
    check,
    move,
    stepBackward,
    fastBackward,
    backward,
    play,
    pause,
    stop,
    forward,
    fastForward,
    stepForward,
    eject,
    chevronLeft,
    chevronRight,
    plusSign,
    minusSign,
    removeSign,
    okSign,
    questionSign,
    infoSign,
    screenshot,
    removeCircle,
    okCircle,
    banCircle,
    arrowLeft,
    arrowRight,
    arrowUp,
    arrowDown,
    mailForward,
    shareAlt,
    resizeFull,
    resizeSmall,
    plus,
    minus,
    asterisk,
    exclamationSign,
    gift,
    leaf,
    fire,
    eyeOpen,
    eyeClose,
    warningSign,
    plane,
    calendar,
    random,
    comment,
    magnet,
    chevronUp,
    chevronDown,
    retweet,
    shoppingCart,
    folderClose,
    folderOpen,
    resizeVertical,
    resizeHorizontal,
    barChart,
    twitterSign,
    facebookSign,
    cameraRetro,
    key,
    gears,
    cogs,
    comments,
    thumbsUpAlt,
    thumbsDownAlt,
    starHalf,
    heartEmpty,
    signout,
    linkedinSign,
    pushpin,
    externalLink,
    signin,
    trophy,
    githubSign,
    uploadAlt,
    lemon,
    phone,
    unchecked,
    checkEmpty,
    bookmarkEmpty,
    phoneSign,
    twitter,
    facebook,
    github,
    unlock,
    creditCard,
    rss,
    hdd,
    bullhorn,
    bell,
    certificate,
    handRight,
    handLeft,
    handUp,
    handDown,
    circleArrowLeft,
    circleArrowRight,
    circleArrowUp,
    circleArrowDown,
    globe,
    wrench,
    tasks,
    filter,
    briefcase,
    fullscreen,
    group,
    link,
    cloud,
    beaker,
    cut,
    copy,
    paperclip,
    paperClip,
    save,
    signBlank,
    reorder,
    listUl,
    listOl,
    strikethrough,
    underline,
    table,
    magic,
    truck,
    pinterest,
    pinterestSign,
    googlePlusSign,
    googlePlus,
    money,
    caretDown,
    caretUp,
    caretLeft,
    caretRight,
    columns,
    sort,
    sortDown,
    sortUp,
    envelope,
    linkedin,
    rotateLeft,
    undo,
    legal,
    dashboard,
    commentAlt,
    commentsAlt,
    bolt,
    sitemap,
    umbrella,
    paste,
    lightbulb,
    exchange,
    cloudDownload,
    cloudUpload,
    userMd,
    stethoscope,
    suitcase,
    bellAlt,
    coffee,
    food,
    fileTextAlt,
    building,
    hospital,
    ambulance,
    medkit,
    fighterJet,
    beer,
    hSign,
    plusSignAlt,
    doubleAngleLeft,
    doubleAngleRight,
    doubleAngleUp,
    doubleAngleDown,
    angleLeft,
    angleRight,
    angleUp,
    angleDown,
    desktop,
    laptop,
    tablet,
    mobilePhone,
    circleBlank,
    quoteLeft,
    quoteRight,
    spinner,
    circle,
    mailReply,
    reply,
    githubAlt,
    folderCloseAlt,
    folderOpenAlt,
    expandAlt,
    collapseAlt,
    smile,
    frown,
    meh,
    gamepad,
    keyboard,
    flagAlt,
    flagCheckered,
    terminal,
    code,
    replyAll,
    mailReplyAll,
    starHalfFull,
    starHalfEmpty,
    locationArrow,
    crop,
    codeFork,
    unlink,
    question,
    info,
    exclamation,
    superscript,
    subscript,
    eraser,
    puzzlePiece,
    microphone,
    microphoneOff,
    shield,
    calendarEmpty,
    fireExtinguisher,
    rocket,
    maxcdn,
    chevronSignLeft,
    chevronSignRight,
    chevronSignUp,
    chevronSignDown,
    html5,
    css3,
    anchor,
    unlockAlt,
    bullseye,
    ellipsisHorizontal,
    ellipsisVertical,
    rssSign,
    playSign,
    ticket,
    minusSignAlt,
    checkMinus,
    levelUp,
    levelDown,
    checkSign,
    editSign,
    externalLinkSign,
    shareSign,
    compass,
    collapse,
    collapseTop,
    expand,
    euro,
    eur,
    gbp,
    dollar,
    usd,
    rupee,
    inr,
    yen,
    jpy,
    renminbi,
    cny,
    won,
    krw,
    bitcoin,
    btc,
    file,
    fileText,
    sortByAlphabet,
    sortByAlphabetAlt,
    sortByAttributes,
    sortByAttributesAlt,
    sortByOrder,
    sortByOrderAlt,
    thumbsUp,
    thumbsDown,
    youtubeSign,
    youtube,
    xing,
    xingSign,
    youtubePlay,
    dropbox,
    stackexchange,
    instagram,
    flickr,
    adn,
    bitbucket,
    bitbucketSign,
    tumblr,
    tumblrSign,
    longArrowDown,
    longArrowUp,
    longArrowLeft,
    longArrowRight,
    apple,
    windows,
    android,
    linux,
    dribbble,
    skype,
    foursquare,
    trello,
    female,
    male,
    gittip,
    sun,
    moon,
    archive,
    bug,
    vk,
    weibo,
    renren,
    copyright,
    at,
    infoCircle,
}

export function toFontAwesomeCharCode(iconName:FAIconName) {
    switch (iconName) {
        case FAIconName.glass: return "\uf000";
        case FAIconName.music: return "\uf001";
        case FAIconName.search: return "\uf002";
        case FAIconName.envelopeAlt: return "\uf003";
        case FAIconName.heart: return "\uf004";
        case FAIconName.star: return "\uf005";
        case FAIconName.starEmpty: return "\uf006";
        case FAIconName.user: return "\uf007";
        case FAIconName.film: return "\uf008";
        case FAIconName.thLarge: return "\uf009";
        case FAIconName.th: return "\uf00a";
        case FAIconName.thList: return "\uf00b";
        case FAIconName.ok: return "\uf00c";
        case FAIconName.remove: return "\uf00d";
        case FAIconName.zoomIn: return "\uf00e";
        case FAIconName.zoomOut: return "\uf010";
        case FAIconName.powerOff:
        case FAIconName.off: return "\uf011";
        case FAIconName.signal: return "\uf012";
        case FAIconName.gear:
        case FAIconName.cog: return "\uf013";
        case FAIconName.trash: return "\uf014";
        case FAIconName.home: return "\uf015";
        case FAIconName.fileAlt: return "\uf016";
        case FAIconName.time: return "\uf017";
        case FAIconName.road: return "\uf018";
        case FAIconName.downloadAlt: return "\uf019";
        case FAIconName.download: return "\uf01a";
        case FAIconName.upload: return "\uf01b";
        case FAIconName.inbox: return "\uf01c";
        case FAIconName.playCircle: return "\uf01d";
        case FAIconName.rotateRight:
        case FAIconName.repeat: return "\uf01e";
        case FAIconName.refresh: return "\uf021";
        case FAIconName.listAlt: return "\uf022";
        case FAIconName.lock: return "\uf023";
        case FAIconName.flag: return "\uf024";
        case FAIconName.headphones: return "\uf025";
        case FAIconName.volumeOff: return "\uf026";
        case FAIconName.volumeDown: return "\uf027";
        case FAIconName.volumeUp: return "\uf028";
        case FAIconName.qrcode: return "\uf029";
        case FAIconName.barcode: return "\uf02a";
        case FAIconName.tag: return "\uf02b";
        case FAIconName.tags: return "\uf02c";
        case FAIconName.book: return "\uf02d";
        case FAIconName.bookmark: return "\uf02e";
        case FAIconName.print: return "\uf02f";
        case FAIconName.camera: return "\uf030";
        case FAIconName.font: return "\uf031";
        case FAIconName.bold: return "\uf032";
        case FAIconName.italic: return "\uf033";
        case FAIconName.textHeight: return "\uf034";
        case FAIconName.textWidth: return "\uf035";
        case FAIconName.alignLeft: return "\uf036";
        case FAIconName.alignCenter: return "\uf037";
        case FAIconName.alignRight: return "\uf038";
        case FAIconName.alignJustify: return "\uf039";
        case FAIconName.list: return "\uf03a";
        case FAIconName.indentLeft: return "\uf03b";
        case FAIconName.indentRight: return "\uf03c";
        case FAIconName.facetimeVideo: return "\uf03d";
        case FAIconName.picture: return "\uf03e";
        case FAIconName.pencil: return "\uf040";
        case FAIconName.mapMarker: return "\uf041";
        case FAIconName.adjust: return "\uf042";
        case FAIconName.tint: return "\uf043";
        case FAIconName.edit: return "\uf044";
        case FAIconName.share: return "\uf045";
        case FAIconName.check: return "\uf046";
        case FAIconName.move: return "\uf047";
        case FAIconName.stepBackward: return "\uf048";
        case FAIconName.fastBackward: return "\uf049";
        case FAIconName.backward: return "\uf04a";
        case FAIconName.play: return "\uf04b";
        case FAIconName.pause: return "\uf04c";
        case FAIconName.stop: return "\uf04d";
        case FAIconName.forward: return "\uf04e";
        case FAIconName.fastForward: return "\uf050";
        case FAIconName.stepForward: return "\uf051";
        case FAIconName.eject: return "\uf052";
        case FAIconName.chevronLeft: return "\uf053";
        case FAIconName.chevronRight: return "\uf054";
        case FAIconName.plusSign: return "\uf055";
        case FAIconName.minusSign: return "\uf056";
        case FAIconName.removeSign: return "\uf057";
        case FAIconName.okSign: return "\uf058";
        case FAIconName.questionSign: return "\uf059";
        case FAIconName.infoSign: return "\uf05a";
        case FAIconName.screenshot: return "\uf05b";
        case FAIconName.removeCircle: return "\uf05c";
        case FAIconName.okCircle: return "\uf05d";
        case FAIconName.banCircle: return "\uf05e";
        case FAIconName.arrowLeft: return "\uf060";
        case FAIconName.arrowRight: return "\uf061";
        case FAIconName.arrowUp: return "\uf062";
        case FAIconName.arrowDown: return "\uf063";
        case FAIconName.mailForward:
        case FAIconName.shareAlt: return "\uf064";
        case FAIconName.resizeFull: return "\uf065";
        case FAIconName.resizeSmall: return "\uf066";
        case FAIconName.plus: return "\uf067";
        case FAIconName.minus: return "\uf068";
        case FAIconName.asterisk: return "\uf069";
        case FAIconName.exclamationSign: return "\uf06a";
        case FAIconName.gift: return "\uf06b";
        case FAIconName.leaf: return "\uf06c";
        case FAIconName.fire: return "\uf06d";
        case FAIconName.eyeOpen: return "\uf06e";
        case FAIconName.eyeClose: return "\uf070";
        case FAIconName.warningSign: return "\uf071";
        case FAIconName.plane: return "\uf072";
        case FAIconName.calendar: return "\uf073";
        case FAIconName.random: return "\uf074";
        case FAIconName.comment: return "\uf075";
        case FAIconName.magnet: return "\uf076";
        case FAIconName.chevronUp: return "\uf077";
        case FAIconName.chevronDown: return "\uf078";
        case FAIconName.retweet: return "\uf079";
        case FAIconName.shoppingCart: return "\uf07a";
        case FAIconName.folderClose: return "\uf07b";
        case FAIconName.folderOpen: return "\uf07c";
        case FAIconName.resizeVertical: return "\uf07d";
        case FAIconName.resizeHorizontal: return "\uf07e";
        case FAIconName.barChart: return "\uf080";
        case FAIconName.twitterSign: return "\uf081";
        case FAIconName.facebookSign: return "\uf082";
        case FAIconName.cameraRetro: return "\uf083";
        case FAIconName.key: return "\uf084";
        case FAIconName.gears:
        case FAIconName.cogs: return "\uf085";
        case FAIconName.comments: return "\uf086";
        case FAIconName.thumbsUpAlt: return "\uf087";
        case FAIconName.thumbsDownAlt: return "\uf088";
        case FAIconName.starHalf: return "\uf089";
        case FAIconName.heartEmpty: return "\uf08a";
        case FAIconName.signout: return "\uf08b";
        case FAIconName.linkedinSign: return "\uf08c";
        case FAIconName.pushpin: return "\uf08d";
        case FAIconName.externalLink: return "\uf08e";
        case FAIconName.signin: return "\uf090";
        case FAIconName.trophy: return "\uf091";
        case FAIconName.githubSign: return "\uf092";
        case FAIconName.uploadAlt: return "\uf093";
        case FAIconName.lemon: return "\uf094";
        case FAIconName.phone: return "\uf095";
        case FAIconName.unchecked:
        case FAIconName.checkEmpty: return "\uf096";
        case FAIconName.bookmarkEmpty: return "\uf097";
        case FAIconName.phoneSign: return "\uf098";
        case FAIconName.twitter: return "\uf099";
        case FAIconName.facebook: return "\uf09a";
        case FAIconName.github: return "\uf09b";
        case FAIconName.unlock: return "\uf09c";
        case FAIconName.creditCard: return "\uf09d";
        case FAIconName.rss: return "\uf09e";
        case FAIconName.hdd: return "\uf0a0";
        case FAIconName.bullhorn: return "\uf0a1";
        case FAIconName.bell: return "\uf0a2";
        case FAIconName.certificate: return "\uf0a3";
        case FAIconName.handRight: return "\uf0a4";
        case FAIconName.handLeft: return "\uf0a5";
        case FAIconName.handUp: return "\uf0a6";
        case FAIconName.handDown: return "\uf0a7";
        case FAIconName.circleArrowLeft: return "\uf0a8";
        case FAIconName.circleArrowRight: return "\uf0a9";
        case FAIconName.circleArrowUp: return "\uf0aa";
        case FAIconName.circleArrowDown: return "\uf0ab";
        case FAIconName.globe: return "\uf0ac";
        case FAIconName.wrench: return "\uf0ad";
        case FAIconName.tasks: return "\uf0ae";
        case FAIconName.filter: return "\uf0b0";
        case FAIconName.briefcase: return "\uf0b1";
        case FAIconName.fullscreen: return "\uf0b2";
        case FAIconName.group: return "\uf0c0";
        case FAIconName.link: return "\uf0c1";
        case FAIconName.cloud: return "\uf0c2";
        case FAIconName.beaker: return "\uf0c3";
        case FAIconName.cut: return "\uf0c4";
        case FAIconName.copy: return "\uf0c5";
        case FAIconName.paperclip:
        case FAIconName.paperClip: return "\uf0c6";
        case FAIconName.save: return "\uf0c7";
        case FAIconName.signBlank: return "\uf0c8";
        case FAIconName.reorder: return "\uf0c9";
        case FAIconName.listUl: return "\uf0ca";
        case FAIconName.listOl: return "\uf0cb";
        case FAIconName.strikethrough: return "\uf0cc";
        case FAIconName.underline: return "\uf0cd";
        case FAIconName.table: return "\uf0ce";
        case FAIconName.magic: return "\uf0d0";
        case FAIconName.truck: return "\uf0d1";
        case FAIconName.pinterest: return "\uf0d2";
        case FAIconName.pinterestSign: return "\uf0d3";
        case FAIconName.googlePlusSign: return "\uf0d4";
        case FAIconName.googlePlus: return "\uf0d5";
        case FAIconName.money: return "\uf0d6";
        case FAIconName.caretDown: return "\uf0d7";
        case FAIconName.caretUp: return "\uf0d8";
        case FAIconName.caretLeft: return "\uf0d9";
        case FAIconName.caretRight: return "\uf0da";
        case FAIconName.columns: return "\uf0db";
        case FAIconName.sort: return "\uf0dc";
        case FAIconName.sortDown: return "\uf0dd";
        case FAIconName.sortUp: return "\uf0de";
        case FAIconName.envelope: return "\uf0e0";
        case FAIconName.linkedin: return "\uf0e1";
        case FAIconName.rotateLeft:
        case FAIconName.undo: return "\uf0e2";
        case FAIconName.legal: return "\uf0e3";
        case FAIconName.dashboard: return "\uf0e4";
        case FAIconName.commentAlt: return "\uf0e5";
        case FAIconName.commentsAlt: return "\uf0e6";
        case FAIconName.bolt: return "\uf0e7";
        case FAIconName.sitemap: return "\uf0e8";
        case FAIconName.umbrella: return "\uf0e9";
        case FAIconName.paste: return "\uf0ea";
        case FAIconName.lightbulb: return "\uf0eb";
        case FAIconName.exchange: return "\uf0ec";
        case FAIconName.cloudDownload: return "\uf0ed";
        case FAIconName.cloudUpload: return "\uf0ee";
        case FAIconName.userMd: return "\uf0f0";
        case FAIconName.stethoscope: return "\uf0f1";
        case FAIconName.suitcase: return "\uf0f2";
        case FAIconName.bellAlt: return "\uf0f3";
        case FAIconName.coffee: return "\uf0f4";
        case FAIconName.food: return "\uf0f5";
        case FAIconName.fileTextAlt: return "\uf0f6";
        case FAIconName.building: return "\uf0f7";
        case FAIconName.hospital: return "\uf0f8";
        case FAIconName.ambulance: return "\uf0f9";
        case FAIconName.medkit: return "\uf0fa";
        case FAIconName.fighterJet: return "\uf0fb";
        case FAIconName.beer: return "\uf0fc";
        case FAIconName.hSign: return "\uf0fd";
        case FAIconName.plusSignAlt: return "\uf0fe";
        case FAIconName.doubleAngleLeft: return "\uf100";
        case FAIconName.doubleAngleRight: return "\uf101";
        case FAIconName.doubleAngleUp: return "\uf102";
        case FAIconName.doubleAngleDown: return "\uf103";
        case FAIconName.angleLeft: return "\uf104";
        case FAIconName.angleRight: return "\uf105";
        case FAIconName.angleUp: return "\uf106";
        case FAIconName.angleDown: return "\uf107";
        case FAIconName.desktop: return "\uf108";
        case FAIconName.laptop: return "\uf109";
        case FAIconName.tablet: return "\uf10a";
        case FAIconName.mobilePhone: return "\uf10b";
        case FAIconName.circleBlank: return "\uf10c";
        case FAIconName.quoteLeft: return "\uf10d";
        case FAIconName.quoteRight: return "\uf10e";
        case FAIconName.spinner: return "\uf110";
        case FAIconName.circle: return "\uf111";
        case FAIconName.mailReply:
        case FAIconName.reply: return "\uf112";
        case FAIconName.githubAlt: return "\uf113";
        case FAIconName.folderCloseAlt: return "\uf114";
        case FAIconName.folderOpenAlt: return "\uf115";
        case FAIconName.expandAlt: return "\uf116";
        case FAIconName.collapseAlt: return "\uf117";
        case FAIconName.smile: return "\uf118";
        case FAIconName.frown: return "\uf119";
        case FAIconName.meh: return "\uf11a";
        case FAIconName.gamepad: return "\uf11b";
        case FAIconName.keyboard: return "\uf11c";
        case FAIconName.flagAlt: return "\uf11d";
        case FAIconName.flagCheckered: return "\uf11e";
        case FAIconName.terminal: return "\uf120";
        case FAIconName.code: return "\uf121";
        case FAIconName.replyAll: return "\uf122";
        case FAIconName.mailReplyAll: return "\uf122";
        case FAIconName.starHalfFull:
        case FAIconName.starHalfEmpty: return "\uf123";
        case FAIconName.locationArrow: return "\uf124";
        case FAIconName.crop: return "\uf125";
        case FAIconName.codeFork: return "\uf126";
        case FAIconName.unlink: return "\uf127";
        case FAIconName.question: return "\uf128";
        case FAIconName.info: return "\uf129";
        case FAIconName.exclamation: return "\uf12a";
        case FAIconName.superscript: return "\uf12b";
        case FAIconName.subscript: return "\uf12c";
        case FAIconName.eraser: return "\uf12d";
        case FAIconName.puzzlePiece: return "\uf12e";
        case FAIconName.microphone: return "\uf130";
        case FAIconName.microphoneOff: return "\uf131";
        case FAIconName.shield: return "\uf132";
        case FAIconName.calendarEmpty: return "\uf133";
        case FAIconName.fireExtinguisher: return "\uf134";
        case FAIconName.rocket: return "\uf135";
        case FAIconName.maxcdn: return "\uf136";
        case FAIconName.chevronSignLeft: return "\uf137";
        case FAIconName.chevronSignRight: return "\uf138";
        case FAIconName.chevronSignUp: return "\uf139";
        case FAIconName.chevronSignDown: return "\uf13a";
        case FAIconName.html5: return "\uf13b";
        case FAIconName.css3: return "\uf13c";
        case FAIconName.anchor: return "\uf13d";
        case FAIconName.unlockAlt: return "\uf13e";
        case FAIconName.bullseye: return "\uf140";
        case FAIconName.ellipsisHorizontal: return "\uf141";
        case FAIconName.ellipsisVertical: return "\uf142";
        case FAIconName.rssSign: return "\uf143";
        case FAIconName.playSign: return "\uf144";
        case FAIconName.ticket: return "\uf145";
        case FAIconName.minusSignAlt: return "\uf146";
        case FAIconName.checkMinus: return "\uf147";
        case FAIconName.levelUp: return "\uf148";
        case FAIconName.levelDown: return "\uf149";
        case FAIconName.checkSign: return "\uf14a";
        case FAIconName.editSign: return "\uf14b";
        case FAIconName.externalLinkSign: return "\uf14c";
        case FAIconName.shareSign: return "\uf14d";
        case FAIconName.compass: return "\uf14e";
        case FAIconName.collapse: return "\uf150";
        case FAIconName.collapseTop: return "\uf151";
        case FAIconName.expand: return "\uf152";
        case FAIconName.euro:
        case FAIconName.eur: return "\uf153";
        case FAIconName.gbp: return "\uf154";
        case FAIconName.dollar:
        case FAIconName.usd: return "\uf155";
        case FAIconName.rupee:
        case FAIconName.inr: return "\uf156";
        case FAIconName.yen:
        case FAIconName.jpy: return "\uf157";
        case FAIconName.renminbi:
        case FAIconName.cny: return "\uf158";
        case FAIconName.won:
        case FAIconName.krw: return "\uf159";
        case FAIconName.bitcoin:
        case FAIconName.btc: return "\uf15a";
        case FAIconName.file: return "\uf15b";
        case FAIconName.fileText: return "\uf15c";
        case FAIconName.sortByAlphabet: return "\uf15d";
        case FAIconName.sortByAlphabetAlt: return "\uf15e";
        case FAIconName.sortByAttributes: return "\uf160";
        case FAIconName.sortByAttributesAlt: return "\uf161";
        case FAIconName.sortByOrder: return "\uf162";
        case FAIconName.sortByOrderAlt: return "\uf163";
        case FAIconName.thumbsUp: return "\uf164";
        case FAIconName.thumbsDown: return "\uf165";
        case FAIconName.youtubeSign: return "\uf166";
        case FAIconName.youtube: return "\uf167";
        case FAIconName.xing: return "\uf168";
        case FAIconName.xingSign: return "\uf169";
        case FAIconName.youtubePlay: return "\uf16a";
        case FAIconName.dropbox: return "\uf16b";
        case FAIconName.stackexchange: return "\uf16c";
        case FAIconName.instagram: return "\uf16d";
        case FAIconName.flickr: return "\uf16e";
        case FAIconName.adn: return "\uf170";
        case FAIconName.bitbucket: return "\uf171";
        case FAIconName.bitbucketSign: return "\uf172";
        case FAIconName.tumblr: return "\uf173";
        case FAIconName.tumblrSign: return "\uf174";
        case FAIconName.longArrowDown: return "\uf175";
        case FAIconName.longArrowUp: return "\uf176";
        case FAIconName.longArrowLeft: return "\uf177";
        case FAIconName.longArrowRight: return "\uf178";
        case FAIconName.apple: return "\uf179";
        case FAIconName.windows: return "\uf17a";
        case FAIconName.android: return "\uf17b";
        case FAIconName.linux: return "\uf17c";
        case FAIconName.dribbble: return "\uf17d";
        case FAIconName.skype: return "\uf17e";
        case FAIconName.foursquare: return "\uf180";
        case FAIconName.trello: return "\uf181";
        case FAIconName.female: return "\uf182";
        case FAIconName.male: return "\uf183";
        case FAIconName.gittip: return "\uf184";
        case FAIconName.sun: return "\uf185";
        case FAIconName.moon: return "\uf186";
        case FAIconName.archive: return "\uf187";
        case FAIconName.bug: return "\uf188";
        case FAIconName.vk: return "\uf189";
        case FAIconName.weibo: return "\uf18a";
        case FAIconName.renren: return "\uf18b";
        case FAIconName.copyright: return "\uf1f9";
        case FAIconName.at: return "\uf1fa";
        case FAIconName.infoCircle: return  '\uf05a';
    }
}


text:
(function(root, factory) {
  if(typeof define === 'function' && define.amd) {
    // AMD (Register as an anonymous module)
    define('utils/browser',['jquery', 'underscore', 'utils/querystring'], factory);
  } else if(typeof exports === 'object') {
    // Node/CommonJS
    module.exports = factory(require('jquery'), require('underscore'), require('utils/querystring'));
  } else {
    // Browser globals
    root.Browser = factory(jQuery, _, Querystring); // eslint-disable-line no-undef
  }
}(this, function($, _, Querystring) {
  var Browser = {
    ua: navigator.userAgent.toLowerCase(),
    name: navigator.appName.toLowerCase(),
    version: parseFloat(navigator.appVersion),

    oldIE: false,
    ie8: false,
    ie9: false,
    ie11: false,
    ie: false,

    osx: false,
    win: false,
    win7: false,
    ios: false,
    ipad: false,
    android: false,
    touch: false,

    safari: false,
    firefox: false,
    facebook: false,
    facebook_ios: false,

    hls: false,
    hls_live: false,

    mobiledevice: false,
    tabletdevice: false,

    app: false,
    apptype: {
      ipad: false,
      iphone: false,
      ios: false,
      android: false,
      version: 0
    },

    performChecks: function() {
      this.checkOldIE();
      this.checkHLSDevice();
      this.checkInApp();
      this.checkMobileTabletDevice();

      if(this.ua.match('firefox')) {
        this.firefox = true;
      }
      if(this.ua.match('win')) {
        this.win = true;

        // check windows version
        if(this.ua.match('nt 6.1')) {
          this.win7 = true;
        }

        // check for ie11
        if(this.ua.match('trident/7.0')) {
          this.ie11 = true;
        }
      }
      if(this.ua.match('fbios')) {
        this.facebook = true;
        if(this.ios) {
          this.facebook_ios = true;
        }
      }
    },

    checkOldIE: function() {
      var klass = document.getElementsByTagName('html')[0].className;
      if(klass.match('ie8') !== null) {
        this.oldIE = true;
        this.ie8 = true;
      }
      if(klass.match('ie9') !== null) {
        this.oldIE = true;
        this.ie9 = true;
      }

      // IE10+ ignore conditional comments, need to check useragent string
      // IE11 drops MSIE designation, uses appName Netscape, userAgent Trident combination
      this.ie = (this.name === 'microsoft internet explorer' && this.ua.search('msie') > -1) || (this.name === 'netscape' && this.ua.search('trident') > -1);
      if(this.ie) {
        $('html').addClass('ie');
      }
    },

    checkHLSDevice: function() {
      var match, ver;

      // iOS devices handle HLS natively
      if(this.ua.match(/ip(a|o)d/) || this.ua.match('iphone')) {
        this.ios = true;
        this.hls = true;
        this.hls_live = true;
      }

      // Mac Safari versions support HLS
      // Requires Safari 7+ to support live stream HLS
      if(this.ua.match('safari') && !this.ua.match('chrome') && this.ua.match('mac')) {
        this.osx = true;
        this.safari = true;
        this.hls = true;
        match = this.ua.match(/version\/([\d.]*)/);
        if(match !== null && match[1] !== '') {
          ver = parseFloat(match[1]);
          if(ver >= 7) {
            this.hls_live = true;
          }
        }
      }

      // Android 4+ supports HLS natively
      match = this.ua.match(/android ([\d.]+)/);
      if(match && match[0]) {
        this.android = true;
        this.version = parseFloat(match[1]);
        if(this.version > 4) {
          this.hls = true;
          this.hls_live = true;
        }
      }
    },

    checkMobileTabletDevice: function() {
      if(this.ua.match(/iphone/i)) {
        this.mobiledevice = true;
      }

      if(this.ua.match(/ipad/i)) {
        this.mobiledevice = true;
        this.tabletdevice = true;
        this.ipad = true;
      }

      if(this.ua.match(/touch/i)) {
        this.mobiledevice = true;
        this.tabletdevice = true;
        this.touch = true;
      }

      if(this.ua.match(/android/i) || this.ua.match(/silk/i)) {
        this.mobiledevice = true;
        this.tabletdevice = true;
      }
    },

    checkInApp: function() {
      var match,
          params = Querystring.params;
      var klass = [];
      if(params.app !== undefined) {
        this.app = true;
        klass.push('app');
      }
      if(params.ios !== undefined) {
        this.app = true;
        this.apptype.ios = true;
        klass.push('app');
        klass.push('ios');
      }
      if(params.ipad !== undefined) {
        this.app = true;
        this.apptype.ipad = true;
        this.apptype.ios = true;
        klass.push('app');
        klass.push('ios');
        klass.push('ipad');
      }
      if(params.iphone !== undefined) {
        this.app = true;
        this.apptype.iphone = true;
        this.apptype.ios = true;
        klass.push('app');
        klass.push('ios');
        klass.push('iphone');
      }
      if(params.android !== undefined || this.ua.match('ibm_events_android_apk')) {
        this.app = true;
        this.apptype.android = true;
        klass.push('app');
        klass.push('android');

        match = this.ua.match(/android ([\d.]+)/);
        if(match) {
          this.apptype.version = parseFloat(match[1]);
        }
      }

      klass = _.uniq(klass).join(' ');
      $('html').addClass(klass);
    }
  };

  return Browser;
}));

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="blog,python,django,developer">
    <meta name="author" content="Derek Stegelman">

    <title>Derek.Stegelman.Com  | Work Technology</title>

    <link rel="stylesheet" href='http://derek.stegelman.com/assets/bootstrap/css/bootstrap.min.css'>
    <link rel="stylesheet" href='http://derek.stegelman.com/assets/css/main.min.css'>
    <link href='https://fonts.googleapis.com/css?family=Raleway:200italic,200' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href='http://derek.stegelman.com/assets/font-awesome/css/font-awesome.min.css'>
    <link href='assets/css/prisim.min.css' rel='stylesheet' />

      <link href="http://derek.stegelman.com/categories/work-technology/index.xml" rel="alternate" type="application/rss+xml" title="Derek.Stegelman.Com" />
      <link href="http://derek.stegelman.com/categories/work-technology/index.xml" rel="feed" type="application/rss+xml" title="Derek.Stegelman.Com" />

    <meta property="og:title" content="Work Technology" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://derek.stegelman.com/categories/work-technology/" />

<meta property="og:updated_time" content="2014-06-16T00:00:00+00:00"/>

<meta itemprop="name" content="Work Technology">
<meta itemprop="description" content="">

<meta name="twitter:card" content="summary"/><meta name="twitter:title" content="Work Technology"/>
<meta name="twitter:description" content=""/>

Derek Stegelman

                Writing

                Technical Writing

              Thoughts

                About

Below you will find pages that utilize the taxonomy term "Work Technology"

    Posts

        Everyone Writes Shitty Code

      In any team environment, a developer may have to adapt another’s code. When they fail to understand it, they condemn it. This attitude isn’t helpful, in fact it’s hurtful.
Everyone’s probably done it. I certainly have. It’s easy, simple and others won’t hesitate to either agree with you or to straight up egg you on in your quest to vilify and codem the previous developer. Sometimes, you might actually be right, and the code really is shit; but just remember that everyone writes shitty code.

                                    Colophon

                                    Talks

                                    Hire

                                    Rocketry

                                    Essays

                                    Contact


text:
package tyfrontier.cleanarchitecturesample.data.cache;

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

import javax.inject.Inject;

import io.realm.RealmObject;
import rx.Observable;

public class MockCacheService implements CacheService {

    List<Object> cache = new ArrayList<>();

    @Inject
    public MockCacheService() {
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> void set(final Class<E> clazz, T model) {
        cache.add(model);
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> Observable<List<T>> get(final Class<E> clazz) {
        if (cache.size() == 0) {
            return Observable.empty();
        }
        return Observable.from((Iterable<T>) cache).toList();
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> long count(Class<E> clazz) {
        return cache.size();
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> void deleteAll(Class<E> clazz) {
        cache.clear();
    }
}


text:
title: "Maanantain tunnille"
tags: läksyt rub1.2
---

Kertaa substantiivien taivutus tunnilla jaetun monisteen avulla. Eli lue ja opiskele!

Jos olit poissa, kertaa sama asia kirjan sivuilta 136-141.


text:
package telegram

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"path"
	"sync/atomic"

	"github.com/pkg/errors"
)

type Service struct {
	configValue atomic.Value
	logger      *log.Logger
}

func NewService(c Config, l *log.Logger) *Service {
	s := &Service{
		logger: l,
	}
	s.configValue.Store(c)
	return s
}

func (s *Service) Open() error {
	return nil
}

func (s *Service) Close() error {
	return nil
}

func (s *Service) config() Config {
	return s.configValue.Load().(Config)
}

func (s *Service) Update(newConfig []interface{}) error {
	if l := len(newConfig); l != 1 {
		return fmt.Errorf("expected only one new config object, got %d", l)
	}
	if c, ok := newConfig[0].(Config); !ok {
		return fmt.Errorf("expected config object to be of type %T, got %T", c, newConfig[0])
	} else {
		s.configValue.Store(c)
	}
	return nil
}

func (s *Service) Global() bool {
	c := s.config()
	return c.Global
}
func (s *Service) StateChangesOnly() bool {
	c := s.config()
	return c.StateChangesOnly
}

type testOptions struct {
	ChatId                string `json:"chat-id"`
	ParseMode             string `json:"parse-mode"`
	Message               string `json:"message"`
	DisableWebPagePreview bool   `json:"disable-web-page-preview"`
	DisableNotification   bool   `json:"disable-notification"`
}

func (s *Service) TestOptions() interface{} {
	c := s.config()
	return &testOptions{
		ChatId:                c.ChatId,
		ParseMode:             c.ParseMode,
		Message:               "test telegram message",
		DisableWebPagePreview: c.DisableWebPagePreview,
		DisableNotification:   c.DisableNotification,
	}
}

func (s *Service) Test(options interface{}) error {
	o, ok := options.(*testOptions)
	if !ok {
		return fmt.Errorf("unexpected options type %T", options)
	}
	return s.Alert(
		o.ChatId,
		o.ParseMode,
		o.Message,
		o.DisableWebPagePreview,
		o.DisableNotification,
	)
}

func (s *Service) Alert(chatId, parseMode, message string, disableWebPagePreview, disableNotification bool) error {
	url, post, err := s.preparePost(chatId, parseMode, message, disableWebPagePreview, disableNotification)
	if err != nil {
		return err
	}

	resp, err := http.Post(url, "application/json", post)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		body, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			return err
		}
		type response struct {
			Description string `json:"description"`
			ErrorCode   int    `json:"error_code"`
			Ok          bool   `json:"ok"`
		}
		res := &response{}

		err = json.Unmarshal(body, res)

		if err != nil {
			return fmt.Errorf("failed to understand Telegram response (err: %s). code: %d content: %s", err.Error(), resp.StatusCode, string(body))
		}
		return fmt.Errorf("sendMessage error (%d) description: %s", res.ErrorCode, res.Description)

	}
	return nil
}

func (s *Service) preparePost(chatId, parseMode, message string, disableWebPagePreview, disableNotification bool) (string, io.Reader, error) {
	c := s.config()

	if !c.Enabled {
		return "", nil, errors.New("service is not enabled")
	}
	if chatId == "" {
		chatId = c.ChatId
	}

	if parseMode == "" {
		parseMode = c.ParseMode
	}

	if parseMode != "" && parseMode != "Markdown" && parseMode != "HTML" {
		return "", nil, fmt.Errorf("parseMode %s is not valid, please use 'Markdown' or 'HTML'", parseMode)
	}

	postData := make(map[string]interface{})
	postData["chat_id"] = chatId
	postData["text"] = message

	if parseMode != "" {
		postData["parse_mode"] = parseMode
	}

	if disableWebPagePreview || c.DisableWebPagePreview {
		postData["disable_web_page_preview"] = true
	}

	if disableNotification || c.DisableNotification {
		postData["disable_notification"] = true
	}

	var post bytes.Buffer
	enc := json.NewEncoder(&post)
	err := enc.Encode(postData)
	if err != nil {
		return "", nil, err
	}

	u, err := url.Parse(c.URL)
	if err != nil {
		return "", nil, errors.Wrap(err, "invalid URL")
	}
	u.Path = path.Join(u.Path+c.Token, "sendMessage")
	return u.String(), &post, nil
}


text:
(function(){
  var matched = location.hash.match(/errorLines=([\d,]+)/);
  if (matched) return;

  function adjust() {
    window.scrollBy(0, -55);
    var el = document.querySelector('.inner-link-active');
    if (el) el.classList.remove('inner-link-active');

    var el = document.querySelector(location.hash);
    if (el) el.classList.add('inner-link-active');
  }

  window.addEventListener('hashchange', adjust);

  if (location.hash) {
    setTimeout(adjust, 0);
  }
})();


text:
package org.spongepowered.despector.decompiler.method.graph.data.opcode;

import org.spongepowered.despector.decompiler.method.graph.data.block.BlockSection;
import org.spongepowered.despector.decompiler.method.graph.data.block.InlineBlockSection;

/**
 * An opcode block containing a simple sequence of opcodes with no control flow
 * logic.
 */
public class BodyOpcodeBlock extends OpcodeBlock {

    public BodyOpcodeBlock(int start, int end) {
        super(start, end);
    }

    @Override
    public BlockSection toBlockSection() {
        return new InlineBlockSection(this);
    }

    @Override
    public String getDebugHeader() {
        return "Body: " + this.start_pc + "-" + this.end_pc + " (target: " + (this.target != null ? this.target.getStart() : -1) + ")";
    }

}


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

using Xamarin.Forms;
using Xamarin.Auth.XamarinForms;

using Xamarin.Auth;

using ComicBook;
using ComicBook.Utilities;

namespace ComicBook
{
    public partial class ProvidersSamplesPage
    {

        protected void Google()
        {
            authenticator
                 = new Xamarin.Auth.OAuth2Authenticator
                 (
                     clientId:
                         new Func<string>
                            (
                                () =>
                                {
                                    string retval_client_id = "oops something is wrong!";

                                    // some people are sending the same AppID for google and other providers
                                    // not sure, but google (and others) might check AppID for Native/Installed apps
                                    // Android and iOS against UserAgent in request from
                                    // CustomTabs and SFSafariViewContorller
                                    // TODO: send deliberately wrong AppID and note behaviour for the future
                                    // fitbit does not care - server side setup is quite liberal
                                    switch (Xamarin.Forms.Device.RuntimePlatform)
                                    {
                                        case "Android":
                                            retval_client_id = "1093596514437-d3rpjj7clslhdg3uv365qpodsl5tq4fn.apps.googleusercontent.com";
                                            break;
                                        case "iOS":
                                            retval_client_id = "1093596514437-cajdhnien8cpenof8rrdlphdrboo56jh.apps.googleusercontent.com";
                                            break;
                                        case "Windows":
                                            retval_client_id = "1093596514437-t7ocfv5tqaskkd53llpfi3dtdvk4t35h.apps.googleusercontent.com";
                                            break;
                                    }
                                    return retval_client_id;
                                }
                           ).Invoke(),
                    clientSecret: null,   // null or ""
                    authorizeUrl: new Uri("https://accounts.google.com/o/oauth2/auth"),
                    accessTokenUrl: new Uri("https://www.googleapis.com/oauth2/v4/token"),
                    redirectUrl:
                        new Func<Uri>
                            (
                                () =>
                                {

                                    string uri = null;

                                    // some people are sending the same AppID for google and other providers
                                    // not sure, but google (and others) might check AppID for Native/Installed apps
                                    // Android and iOS against UserAgent in request from
                                    // CustomTabs and SFSafariViewContorller
                                    // TODO: send deliberately wrong AppID and note behaviour for the future
                                    // fitbit does not care - server side setup is quite liberal
                                    switch (Xamarin.Forms.Device.RuntimePlatform)
                                    {
                                        case "Android":
                                            uri =
                                                "com.xamarin.traditional.standard.samples.oauth.providers.android:/oauth2redirect"
                                                //"com.googleusercontent.apps.1093596514437-d3rpjj7clslhdg3uv365qpodsl5tq4fn:/oauth2redirect"
                                                ;
                                            break;
                                        case "iOS":
                                            uri =
                                                "com.xamarin.traditional.standard.samples.oauth.providers.ios:/oauth2redirect"
                                                //"com.googleusercontent.apps.1093596514437-cajdhnien8cpenof8rrdlphdrboo56jh:/oauth2redirect"
                                                ;
                                            break;
                                        case "Windows":
                                            uri =
                                                "com.xamarin.auth.windows:/oauth2redirect"
                                                //"com.googleusercontent.apps.1093596514437-cajdhnien8cpenof8rrdlphdrboo56jh:/oauth2redirect"
                                                ;
                                            break;
                                    }

                                    return new Uri(uri);
                                }
                             ).Invoke(),
                     scope:
                          //"profile"
                          "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.login"
                          ,
                     getUsernameAsync: null,
                     isUsingNativeUI: Settings.IsUsingNativeUI
                 )
                 {
                     AllowCancel = true,
                 };

            authenticator.Completed +=
                (s, ea) =>
                    {
                        StringBuilder sb = new StringBuilder();

                        if (ea.Account != null && ea.Account.Properties != null)
                        {
                            sb.Append("Token = ").AppendLine($"{ea.Account.Properties["access_token"]}");
                        }
                        else
                        {
                            sb.Append("Not authenticated ").AppendLine($"Account.Properties does not exist");
                        }

                        DisplayAlert
                                (
                                    "Authentication Results",
                                    sb.ToString(),
                                    "OK"
                                );

                        return;
                    };

            authenticator.Error +=
                (s, ea) =>
                    {
                        StringBuilder sb = new StringBuilder();
                        sb.Append("Error = ").AppendLine($"{ea.Message}");

                        DisplayAlert
                                (
                                    "Authentication Error",
                                    sb.ToString(),
                                    "OK"
                                );
                        return;
                    };

            // after initialization (creation and event subscribing) exposing local object
            AuthenticationState.Authenticator = authenticator;

            this.PresentUILoginScreen(authenticator);

            return;
        }

    }
}


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js
 * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict new'ed Function constructor)
 * @noStrict
 */

function f() { return gNonStrict();};
(function () {"use strict"; return new Function("return f();")(); })();

function gNonStrict() {
    return gNonStrict.caller;
}


text:
namespace ar {
namespace internal {

///
/// Constructs a file.
///
/// @param[in] path Path to the file in a filesystem.
///
FilesystemFile::FilesystemFile(const std::string& path):
	path{path}, name{fileNameFromPath(path)} {}

///
/// Constructs a file with a custom name.
///
/// @param[in] path Path to the file in a filesystem.
/// @param[in] name Name to be used as the file's name.
///
FilesystemFile::FilesystemFile(const std::string& path,
		const std::string& name):
	path{path}, name{name} {}

FilesystemFile::~FilesystemFile() = default;

std::string FilesystemFile::getName() const {
	return name;
}

std::string FilesystemFile::getContent() {
	return readFile(path);
}

void FilesystemFile::saveCopyTo(const std::string& directoryPath) {
	saveCopyTo(directoryPath, name);
}

void FilesystemFile::saveCopyTo(const std::string& directoryPath,
		const std::string& name) {
	copyFile(path, joinPaths(directoryPath, name));
}

} // namespace internal
} // namespace ar


text:
package com.mindorks.demo.swipe;

import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import com.mindorks.demo.R;
import com.mindorks.placeholderview.SwipeDirection;
import com.mindorks.placeholderview.annotations.Click;
import com.mindorks.placeholderview.annotations.Layout;
import com.mindorks.placeholderview.annotations.NonReusable;
import com.mindorks.placeholderview.annotations.Resolve;
import com.mindorks.placeholderview.annotations.View;
import com.mindorks.placeholderview.annotations.swipe.SwipeCancelState;
import com.mindorks.placeholderview.annotations.swipe.SwipeInDirectional;
import com.mindorks.placeholderview.annotations.swipe.SwipeOutDirectional;
import com.mindorks.placeholderview.annotations.swipe.SwipeTouch;
import com.mindorks.placeholderview.annotations.swipe.SwipingDirection;

/**
 * Created by janisharali on 09/08/17.
 */

@NonReusable
@Layout(R.layout.tinder_card_view)
public class TinderDirectionalCard {

    private static int count;

    @View(R.id.profileImageView)
    ImageView profileImageView;

    @View(R.id.nameAgeTxt)
    TextView nameAgeTxt;

    @View(R.id.locationNameTxt)
    TextView locationNameTxt;

    @Click(R.id.profileImageView)
    public void onClick() {
        Log.d("DEBUG", "profileImageView");
    }

    @Resolve
    public void onResolve() {
        nameAgeTxt.setText("Name " + count++);
    }

    @SwipeOutDirectional
    public void onSwipeOutDirectional(SwipeDirection direction) {
        Log.d("DEBUG", "SwipeOutDirectional " + direction.name());
    }

    @SwipeCancelState
    public void onSwipeCancelState() {
        Log.d("DEBUG", "onSwipeCancelState");
    }

    @SwipeInDirectional
    public void onSwipeInDirectional(SwipeDirection direction) {
        Log.d("DEBUG", "SwipeInDirectional " + direction.name());
    }

    @SwipingDirection
    public void onSwipingDirection(SwipeDirection direction) {
        Log.d("DEBUG", "SwipingDirection " + direction.name());
    }

    @SwipeTouch
    public void onSwipeTouch(float xStart, float yStart, float xCurrent, float yCurrent) {
        Log.d("DEBUG", "onSwipeTouch "
                + " xStart : " + xStart
                + " yStart : " + yStart
                + " xCurrent : " + xCurrent
                + " yCurrent : " + yCurrent
                + " distance : "
                + Math.sqrt(Math.pow(xCurrent - xStart, 2) + (Math.pow(yCurrent - yStart, 2)))
        );
    }
}


text:
.class Lcom/android/server/net/NetworkStatsRecorder$CombiningRewriter;
.super Ljava/lang/Object;
.source "NetworkStatsRecorder.java"

# interfaces
.implements Lcom/android/internal/util/FileRotator$Rewriter;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/net/NetworkStatsRecorder;
.end annotation

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

# instance fields
.field private final mCollection:Lcom/android/server/net/NetworkStatsCollection;

# direct methods
.method public constructor <init>(Lcom/android/server/net/NetworkStatsCollection;)V
    .locals 1
    .parameter "collection"

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

    .line 286
    const-string v0, "missing NetworkStatsCollection"

    invoke-static {p1, v0}, Lcom/android/internal/util/Preconditions;->checkNotNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/android/server/net/NetworkStatsCollection;

    iput-object v0, p0, Lcom/android/server/net/NetworkStatsRecorder$CombiningRewriter;->mCollection:Lcom/android/server/net/NetworkStatsCollection;

    .line 287
    return-void
.end method

# virtual methods
.method public read(Ljava/io/InputStream;)V
    .locals 1
    .parameter "in"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 296
    iget-object v0, p0, Lcom/android/server/net/NetworkStatsRecorder$CombiningRewriter;->mCollection:Lcom/android/server/net/NetworkStatsCollection;

    invoke-virtual {v0, p1}, Lcom/android/server/net/NetworkStatsCollection;->read(Ljava/io/InputStream;)V

    .line 297
    return-void
.end method

.method public reset()V
    .locals 0

    .prologue
    .line 292
    return-void
.end method

.method public shouldWrite()Z
    .locals 1

    .prologue
    .line 301
    const/4 v0, 0x1

    return v0
.end method

.method public write(Ljava/io/OutputStream;)V
    .locals 2
    .parameter "out"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 306
    iget-object v0, p0, Lcom/android/server/net/NetworkStatsRecorder$CombiningRewriter;->mCollection:Lcom/android/server/net/NetworkStatsCollection;

    new-instance v1, Ljava/io/DataOutputStream;

    invoke-direct {v1, p1}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V

    invoke-virtual {v0, v1}, Lcom/android/server/net/NetworkStatsCollection;->write(Ljava/io/DataOutputStream;)V

    .line 307
    iget-object v0, p0, Lcom/android/server/net/NetworkStatsRecorder$CombiningRewriter;->mCollection:Lcom/android/server/net/NetworkStatsCollection;

    invoke-virtual {v0}, Lcom/android/server/net/NetworkStatsCollection;->reset()V

    .line 308
    return-void
.end method


text:
<!-- DO NOT EDIT: This document was generated by Puppet Strings -->

## Table of Contents

**Classes**

_Public Classes_

* [`caddy`](#caddy): Main class, includes all other classes.

_Private Classes_

* `caddy::config`: This class handles the Caddy config.
* `caddy::install`: This class handles the Caddy archive.
* `caddy::service`: This class handles the Caddy service.

**Defined types**

* [`caddy::vhost`](#caddyvhost): This defined type handles the Caddy virtual hosts.

## Classes

### caddy

Main class, includes all other classes.

#### Examples

##### Basic usage

```puppet
include caddy
```

##### Install customised version of Caddy

```puppet
class { 'caddy':
  caddy_features => 'http.git,http.filter,http.ipfilter',
}
```

##### Install specific version of Caddy

```puppet
class { 'caddy':
  version        => '1.0.3',
  install_method => 'github',
}
```

#### Parameters

The following parameters are available in the `caddy` class.

##### `version`

Data type: `String[1]`

Which version is used.

Default value: '1.0.4'

##### `install_method`

Data type: `Optional[Enum['github']]`

Which source is used.

Default value: `undef`

##### `install_path`

Data type: `Stdlib::Absolutepath`

Directory where the Caddy binary is stored.

Default value: '/opt/caddy'

##### `caddy_user`

Data type: `String[1]`

The user used by the Caddy process.

Default value: 'caddy'

##### `caddy_group`

Data type: `String[1]`

The group used by the Caddy process.

Default value: 'caddy'

##### `caddy_shell`

Data type: `Stdlib::Absolutepath`

Which shell is used.

Default value: '/sbin/nologin'

##### `caddy_log_dir`

Data type: `Stdlib::Absolutepath`

Directory where the log files are stored.

Default value: '/var/log/caddy'

##### `caddy_tmp_dir`

Data type: `Stdlib::Absolutepath`

Directory where the Caddy archive is stored.

Default value: '/tmp'

##### `caddy_home`

Data type: `Stdlib::Absolutepath`

Directory where the Caddy data is stored.

Default value: '/var/lib/caddy'

##### `caddy_ssl_dir`

Data type: `Stdlib::Absolutepath`

Directory where Let's Encrypt certificates are stored.

Default value: "/etc/ssl/caddy"

##### `caddy_license`

Data type: `Enum['personal', 'commercial']`

Whether a personal or commercial license is used.

Default value: 'personal'

##### `caddy_telemetry`

Data type: `Enum['on','off']`

Whether telemetry data should be collected.

Default value: 'off'

##### `caddy_features`

Data type: `String[1]`

A list of features the Caddy binary should support.

Default value: 'http.git,http.filter,http.ipfilter'

##### `caddy_http_port`

Data type: `Stdlib::Port`

Which port for HTTP is used.

Default value: 80

##### `caddy_https_port`

Data type: `Stdlib::Port`

Which port for HTTPS is used.

Default value: 443

##### `caddy_architecture`

Data type: `String[1]`

A temporary variable, required for the download URL.

Default value: $facts['os']['architecture']

##### `caddy_account_id`

Data type: `Optional[String[1]]`

The account ID, required for the commercial license.

Default value: `undef`

##### `caddy_api_key`

Data type: `Optional[String[1]]`

The API key, required for the commercial license.

Default value: `undef`

##### `systemd_limit_processes`

Data type: `Integer[0]`

The number of processes.

Default value: 64

##### `systemd_private_devices`

Data type: `Boolean`

Whether the process has access to physical devices.

Default value: `true`

##### `systemd_capability_bounding_set`

Data type: `Optional[String[1]]`

Controls which capabilities to include in the capability bounding set for the executed process.

Default value: `undef`

##### `systemd_ambient_capabilities`

Data type: `Optional[String[1]]`

Controls which capabilities to include in the ambient capability set for the executed process.

Default value: `undef`

##### `systemd_no_new_privileges`

Data type: `Optional[Boolean]`

Whether the process and all its children can gain new privileges through execve().

Default value: `undef`

## Defined types

### caddy::vhost

This defined type handles the Caddy virtual hosts.

#### Examples

##### Configure virtual host, based on source

```puppet
caddy::vhost { 'example1':
  source => 'puppet:///modules/caddy/etc/caddy/config/example1.conf',
}
```

##### Configure virtual host, based on content

```puppet
caddy::vhost { 'example2:
  content => 'localhost:2015',
}
```

#### Parameters

The following parameters are available in the `caddy::vhost` defined type.

##### `source`

Data type: `Optional[Stdlib::Filesource]`

Default value: `undef`

##### `content`

Data type: `Optional[String]`

Default value: `undef`


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for C:\wamp\www\phpmvc\kmom06/src/TConfigure.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="../css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/style.css" rel="stylesheet">

C:\wamp\www\phpmvc\kmom06

src

TConfigure.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

           0.00% covered (danger)

0.00%

0 / 1

           0.00% covered (danger)

0.00%

0 / 1

      CRAP

           0.00% covered (danger)

0.00%

0 / 9

      TConfigure

           0.00% covered (danger)

0.00%

0 / 1

           0.00% covered (danger)

0.00%

0 / 1

      12

           0.00% covered (danger)

0.00%

0 / 9

       configure

           0.00% covered (danger)

0.00%

0 / 1

      12

           0.00% covered (danger)

0.00%

0 / 9

1
	<?php

2

3
	namespace Anax;

4

5
	/**

6
	 * Trait implementing reading from config-file and storing options in $this->config.

7
	 *

8
	 */

9
	trait TConfigure

10
	{

11

12
	    /**

13
	     * Properties

14
	     *

15
	     */

16
	    private $config = [];  // Store all config as an array

17

18

19

20
	    /**

21
	     * Read configuration from file or array'.

22
	     *

23
	     * @param array/string $what is an array with key/value config options or a file

24
	     *      to be included which returns such an array.

25
	     * @return $this for chaining.

26
	     */

27
	    public function configure($what)

28
	    {

29
	        if (is_array($what)) {

30
	            $options = $what;

31
	        } elseif (is_readable($what)) {

32
	            $options = include $what;

33
	        } else {

34
	            throw new Exception("Configure item '" . htmlentities($what)

35
	                . "' is not an array nor a readable file.");

36
	        }

37

38
	        $this->config = array_merge($this->config, $options);

39
	        return $this->config;

40
	    }

41
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 2.2.4 using PHP 5.5.12 and PHPUnit 4.8.24 at Fri Apr 22 12:24:36 CEST 2016.


text:
package sqlite3

import (
	"context"
	"database/sql"

	"github.com/matrix-org/dendrite/federationapi/storage/tables"
	"github.com/matrix-org/gomatrixserverlib"
)

const notaryServerKeysJSONSchema = `
CREATE TABLE IF NOT EXISTS federationsender_notary_server_keys_json (
    notary_id INTEGER PRIMARY KEY AUTOINCREMENT,
	response_json TEXT NOT NULL,
	server_name TEXT NOT NULL,
	valid_until BIGINT NOT NULL
);
`

const insertServerKeysJSONSQL = "" +
	"INSERT INTO federationsender_notary_server_keys_json (response_json, server_name, valid_until) VALUES ($1, $2, $3)" +
	" RETURNING notary_id"

type notaryServerKeysStatements struct {
	db                       *sql.DB
	insertServerKeysJSONStmt *sql.Stmt
}

func NewSQLiteNotaryServerKeysTable(db *sql.DB) (s *notaryServerKeysStatements, err error) {
	s = &notaryServerKeysStatements{
		db: db,
	}
	_, err = db.Exec(notaryServerKeysJSONSchema)
	if err != nil {
		return
	}

	if s.insertServerKeysJSONStmt, err = db.Prepare(insertServerKeysJSONSQL); err != nil {
		return
	}
	return
}

func (s *notaryServerKeysStatements) InsertJSONResponse(
	ctx context.Context, txn *sql.Tx, keyQueryResponseJSON gomatrixserverlib.ServerKeys, serverName gomatrixserverlib.ServerName, validUntil gomatrixserverlib.Timestamp,
) (tables.NotaryID, error) {
	var notaryID tables.NotaryID
	return notaryID, txn.Stmt(s.insertServerKeysJSONStmt).QueryRowContext(ctx, string(keyQueryResponseJSON.Raw), serverName, validUntil).Scan(&notaryID)
}


text:
package com.intellij.tasks.actions;

import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.options.binding.BindControl;
import com.intellij.openapi.options.binding.ControlBinder;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.tasks.*;
import com.intellij.tasks.impl.TaskManagerImpl;
import com.intellij.tasks.impl.TaskStateCombo;
import com.intellij.tasks.impl.TaskUtil;
import com.intellij.tasks.ui.TaskDialogPanel;
import com.intellij.tasks.ui.TaskDialogPanelProvider;
import com.intellij.ui.components.JBCheckBox;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.List;

/**
 * @author Dmitry Avdeev
 */
public class OpenTaskDialog extends DialogWrapper {
  private final static Logger LOG = Logger.getInstance("#com.intellij.tasks.actions.SimpleOpenTaskDialog");
  private static final String UPDATE_STATE_ENABLED = "tasks.open.task.update.state.enabled";

  private JPanel myPanel;
  @BindControl(value = "clearContext", instant = true)
  private JCheckBox myClearContext;
  private JLabel myTaskNameLabel;
  private JBCheckBox myUpdateState;
  private TaskStateCombo myTaskStateCombo;
  private JPanel myAdditionalPanel;

  private final Project myProject;
  private final Task myTask;
  private final List<TaskDialogPanel> myPanels;

  public OpenTaskDialog(@NotNull final Project project, @NotNull final Task task) {
    super(project, false);
    myProject = project;
    myTask = task;
    setTitle("Open Task");
    myTaskNameLabel.setText(TaskUtil.getTrimmedSummary(task));
    myTaskNameLabel.setIcon(task.getIcon());

    TaskManagerImpl taskManager = (TaskManagerImpl)TaskManager.getManager(myProject);
    ControlBinder binder = new ControlBinder(taskManager.getState());
    binder.bindAnnotations(this);
    binder.reset();

    if (!TaskStateCombo.stateUpdatesSupportedFor(task)) {
      myUpdateState.setVisible(false);
      myTaskStateCombo.setVisible(false);
    }
    final boolean stateUpdatesEnabled = PropertiesComponent.getInstance(project).getBoolean(UPDATE_STATE_ENABLED, true);
    myUpdateState.setSelected(stateUpdatesEnabled);
    myUpdateState.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        final boolean selected = myUpdateState.isSelected();
        PropertiesComponent.getInstance(project).setValue(UPDATE_STATE_ENABLED, String.valueOf(selected));
        updateFields();
        if (selected) {
          myTaskStateCombo.scheduleUpdateOnce();
        }
      }
    });

    TaskManagerImpl.Config state = taskManager.getState();
    myClearContext.setSelected(state.clearContext);

    updateFields();
    if (myUpdateState.isSelected()) {
      myTaskStateCombo.scheduleUpdateOnce();
    }

    myAdditionalPanel.setLayout(new BoxLayout(myAdditionalPanel, BoxLayout.Y_AXIS));
    myPanels = TaskDialogPanelProvider.getOpenTaskPanels(project, task);
    for (TaskDialogPanel panel : myPanels) {
      myAdditionalPanel.add(panel.getPanel());
    }
    init();
  }

  private void updateFields() {
    myTaskStateCombo.setEnabled(myUpdateState.isSelected());
  }

  @Override
  protected void doOKAction() {
    createTask();
    super.doOKAction();
  }

  public void createTask() {
    final TaskManagerImpl taskManager = (TaskManagerImpl)TaskManager.getManager(myProject);

    if (myUpdateState.isSelected()) {
      final CustomTaskState taskState = myTaskStateCombo.getSelectedState();
      final TaskRepository repository = myTask.getRepository();
      if (repository != null && taskState != null) {
        try {
          repository.setTaskState(myTask, taskState);
          repository.setPreferredOpenTaskState(taskState);
        }
        catch (Exception ex) {
          Messages.showErrorDialog(myProject, ex.getMessage(), "Cannot Set State For Issue");
          LOG.warn(ex);
        }
      }
    }
    taskManager.activateTask(myTask, isClearContext());
    if (myTask.getType() == TaskType.EXCEPTION && AnalyzeTaskStacktraceAction.hasTexts(myTask)) {
      AnalyzeTaskStacktraceAction.analyzeStacktrace(myTask, myProject);
    }

    for (TaskDialogPanel panel : myPanels) {
      panel.commit();
    }
  }

  private boolean isClearContext() {
    return myClearContext.isSelected();
  }

  @NonNls
  protected String getDimensionServiceKey() {
    return "SimpleOpenTaskDialog";
  }

  @Override
  public JComponent getPreferredFocusedComponent() {
    if (myTaskStateCombo.isVisible() && myTaskStateCombo.isEnabled()){
      return myTaskStateCombo.getComboBox();
    }
    return null;
  }

  @Nullable
  @Override
  protected ValidationInfo doValidate() {
    for (TaskDialogPanel panel : myPanels) {
      ValidationInfo validate = panel.validate();
      if (validate != null) return validate;
    }
    return null;
  }

  protected JComponent createCenterPanel() {
    return myPanel;
  }

  private void createUIComponents() {
    myTaskStateCombo = new TaskStateCombo(myProject, myTask) {
      @Nullable
      @Override
      protected CustomTaskState getPreferredState(@NotNull TaskRepository repository, @NotNull Collection<CustomTaskState> available) {
        return repository.getPreferredOpenTaskState();
      }
    };
  }
}


text:
Sublime Text 支持安装 Package,极大扩展了 Sublime Text 的功能。

1. Install package control

   Tools > Command Palette, type "Install package control"

2. Install babel plugin

   Tools > Command Palette, type "install package", search "babel"

3. Set syntax

   Tools > Command Palette, type "ssjs", select "JavaScript (babel)"

## Uninstall the Package for Sublime Text

1. Select `Preferences` > `Package Control`

2. Select `Remove Package`

## Best of All

* [Sublimerge](https://www.sublimerge.com/)
  对比、合并工具。

--------------------------------------------------------------------------------

* [ref1](https://stackoverflow.com/a/37154784)

* [ref2](https://medium.com/@adrianli/setting-up-sublime-text-3-for-reactjs-3bf6baceb73a)
* [Uninstall the Package for Sublime Text](http://docs.telerik.com/platform/appbuilder/development-tools/running-appbuilder/running-the-sp/uninstall-sp)

[Origami](https://github.com/SublimeText/Origami)
分隔窗口为任意大小。


text:
var WebSocket    = require('ws');
var Packet       = require('./packet.js');
var servers      = require('./servers.js');
var EventEmitter = require('events').EventEmitter;

function Client(client_name) {
    //you can change this values
    this.client_name      = client_name; //name used for log
    this.debug            = 1;           //debug level, 0-5 (5 will output extremely lot of data)
    this.inactive_destroy = 5*60*1000;   //time in ms when to destroy inactive balls
    this.inactive_check   = 10*1000;     //time in ms when to search inactive balls
    this.spawn_interval   = 200;	 //time in ms for respawn interval. 0 to disable (if your custom server don't have spawn problems)
    this.spawn_attempts   = 25;		 //how much attempts to spawn before give up (official servers do have unstable spawn problems)

    //don't change things below if you don't understand what you're doing

    this.tick_counter      = 0;    //number of ticks (packet ID 16 counter)
    this.inactive_interval = 0;    //ID of setInterval()
    this.balls             = {};   //all balls
    this.my_balls          = [];   //IDs of my balls
    this.score             = 0;    //my score
    this.leaders           = [];   //IDs of leaders in FFA mode
    this.teams_scores      = [];   //scores of teams in Teams mode
    this.facebook_key      = '';   //facebook key. Check README.md how to get it
    this.spawn_attempt     = 0;    //attempt to spawn
    this.spawn_interval_id = 0;    //ID of setInterval()

    if(this.debug >= 1)
        this.log('client created');
}

Client.prototype = {
    connect: function(server, key) {
        var headers = {
            'Origin': 'http://agar.io'
        };

        this.ws            = new WebSocket(server, null, {headers: headers});
        this.ws.binaryType = "arraybuffer";
        this.ws.onopen     = this.onConnect.bind(this);
        this.ws.onmessage  = this.onMessage.bind(this);
        this.ws.onclose    = this.onDisconnect.bind(this);
        this.ws.onerror    = this.onError.bind(this);
        this.server        = server;
        this.key           = key;

        if(this.debug >= 1) {
            if(!key) this.log('[warning] You did not specified "key" for Client.connect(server, key)\n' +
                '          If server will not accept you, this may be the problem');
            this.log('connecting...');
        }

        this.emit('connecting');
    },

    disconnect: function() {
        if(this.debug >= 1)
            this.log('disconnect() called');

        this.ws.close();
    },

    onConnect: function() {
        var client = this;

        if(this.debug >= 1)
            this.log('connected to server');

        this.inactive_interval = setInterval(this.detsroyInactive.bind(this), this.inactive_check);

        var buf = new Buffer(5);
        buf.writeUInt8(254, 0);
        buf.writeUInt32LE(5, 1);
        this.send(buf);

        buf = new Buffer(5);
        buf.writeUInt8(255, 0);
        buf.writeUInt32LE(154669603, 1);
        this.send(buf);

        if(this.key) {
            buf = new Buffer(1 + this.key.length);
            buf.writeUInt8(80, 0);
            for (var i=1;i<=this.key.length;++i) {
                buf.writeUInt8(this.key.charCodeAt(i-1), i);
            }
            this.send(buf);
        }
        if(this.facebook_key) {
            buf = new Buffer(1 + this.facebook_key.length);
            buf.writeUInt8(81, 0);
            for (i=1;i<=this.facebook_key.length;++i) {
                buf.writeUInt8(this.facebook_key.charCodeAt(i-1), i);
            }
            this.send(buf);
        }

        if(client.debug >= 2)
            client.log('emit connected event');
        client.emit('connected');
    },

    onError: function(e) {
        if(this.debug >= 1)
            this.log('connection error: ' + e);

        this.emit('connectionError', e);
        this.reset();
    },

    onDisconnect: function() {
        if(this.debug >= 1)
            this.log('disconnected');

        this.emit('disconnect');
        this.reset();
    },

    onMessage: function(e) {
        var packet    = new Packet(e);
        var packet_id = packet.readUInt8();
        var processor = this.processors[packet_id];
        if(!processor) return this.log('[warning] unknown packet ID(' + packet_id + '): ' + packet.toString());

        if(this.debug >= 4)
            this.log('RECV packet ID=' + packet_id + ' LEN=' + packet.length);
        if(this.debug >= 5)
            this.log('dump: ' + packet.toString());

        this.emit('message', packet);
        processor(this, packet);
    },

    send: function(buf) {
        if(this.debug >= 4)
            this.log('SEND packet ID=' + buf.readUInt8(0) + ' LEN=' + buf.length);

        if(this.debug >= 5)
            this.log('dump: ' + (new Packet(buf).toString()));

        try {
            this.ws.send(buf);
        }catch(e){
            this.onError(e);
        }
    },

    reset: function() {
        if(this.debug >= 3)
            this.log('reset()');

        clearInterval(this.inactive_interval);
        clearInterval(this.spawn_interval_id);
        this.spawn_interval_id = 0;
        this.leaders           = [];
        this.teams_scores      = [];
        this.my_balls          = [];
        this.spawn_attempt     = 0;

        for(var k in this.balls) if(this.balls.hasOwnProperty(k)) this.balls[k].destroy({'reason':'reset'});
        this.emit('reset');
    },

    detsroyInactive: function() {
        var time = (+new Date);

        if(this.debug >= 3)
            this.log('destroying inactive balls');

        for(var k in this.balls) {
            if(!this.balls.hasOwnProperty(k)) continue;
            var ball = this.balls[k];
            if(time - ball.last_update < this.inactive_destroy) continue;
            if(ball.visible) continue;

            if(this.debug >= 3)
                this.log('destroying inactive ' + ball);

            ball.destroy({reason: 'inactive'});
        }
    },

    processors: {
        //tick
        '16': function(client, packet) {
            var eaters_count = packet.readUInt16LE();

            client.tick_counter++;

            //reading eat events
            for(var i=0;i<eaters_count;i++) {
                var eater_id = packet.readUInt32LE();
                var eaten_id = packet.readUInt32LE();

                if(client.debug >= 4)
                    client.log(eater_id + ' ate ' + eaten_id + ' (' + client.balls[eater_id] + '>' + client.balls[eaten_id] + ')');

                if(!client.balls[eater_id]) new Ball(client, eater_id);
                client.balls[eater_id].update();
                if(client.balls[eaten_id]) client.balls[eaten_id].destroy({'reason':'eaten', 'by':eater_id});

                client.emit('somebodyAteSomething', eater_id, eaten_id);
            }

            //reading actions of balls
            while(1) {
                var is_virus = false;
                var ball_id;
                var coordinate_x;
                var coordinate_y;
                var size;
                var color;
                var nick = null;

                ball_id = packet.readUInt32LE();
                if(ball_id == 0) break;
                coordinate_x = packet.readSInt32LE();
                coordinate_y = packet.readSInt32LE();
                size = packet.readSInt16LE();

                var color_R = packet.readUInt8();
                var color_G = packet.readUInt8();
                var color_B = packet.readUInt8();

                color = (color_R << 16 | color_G << 8 | color_B).toString(16);
                color = '#' + ('000000' + color).substr(-6);

                var opt = packet.readUInt8();
                is_virus = !!(opt & 1);

                //reserved for future use?
                if (opt & 2) {
                    packet.offset += 4;
                }
                if (opt & 4) {
                    packet.offset += 8;
                }
                if (opt & 8) {
                    packet.offset += 16;
                }

                while(1) {
                    var char = packet.readUInt16LE();
                    if(char == 0) break;
                    if(!nick) nick = '';
                    nick += String.fromCharCode(char);
                }

                var ball = client.balls[ball_id] || new Ball(client, ball_id);
                ball.color = color;
                ball.virus = is_virus;
                ball.setCords(coordinate_x, coordinate_y);
                ball.setSize(size);
                if(nick) ball.setName(nick);
                ball.update_tick = client.tick_counter;
                ball.appear();
                ball.update();

                if(client.debug >= 5)
                    client.log('action: ball_id=' + ball_id + ' coordinate_x=' + coordinate_x + ' coordinate_y=' + coordinate_y + ' size=' + size + ' is_virus=' + is_virus + ' nick=' + nick);

                client.emit('ballAction', ball_id, coordinate_x, coordinate_y, size, is_virus, nick);
            }

            var balls_on_screen_count = packet.readUInt32LE();

            //disappear events
            for(i=0;i<balls_on_screen_count;i++) {
                ball_id = packet.readUInt32LE();

                ball = client.balls[ball_id] || new Ball(client, ball_id);
                ball.update_tick = client.tick_counter;
                ball.update();
                if(ball.mine) {
                    ball.destroy({reason: 'merge'});
                    client.emit('merge', ball.id);
                }else{
                    ball.disappear();
                }
            }
        },

        //update spectating coordinates in "spectate" mode
        '17': function(client, packet) {
            var x    = packet.readFloat32LE();
            var y    = packet.readFloat32LE();
            var zoom = packet.readFloat32LE();

            if(client.debug >= 4)
                client.log('spectate FOV update: x=' + x + ' y=' + y + ' zoom=' + zoom);

            client.emit('spectateFieldUpdate', x, y, zoom);
        },

        '20': function() {
            //i dont know what this is
            //in original code it clears our balls array, but i never saw this packet
        },

        //new ID of your ball (when you join or press space)
        '32': function(client, packet) {
            var ball_id = packet.readUInt32LE();
            var ball    = client.balls[ball_id] || new Ball(client, ball_id);
            ball.mine   = true;
            if(!client.my_balls.length) client.score = 0;
            client.my_balls.push(ball_id);

            if(client.debug >= 2)
                client.log('my new ball: ' + ball_id);

            if(client.spawn_interval_id) {
                if(client.debug >= 4)
                    client.log('detected new ball, disabling spawn() interval');
                client.spawn_attempt = 0;
                clearInterval(client.spawn_interval_id);
                client.spawn_interval_id = 0;
            }

            client.emit('myNewBall', ball_id);
        },

        //leaderboard update in FFA mode
        '49': function(client, packet) {
            var users = [];
            var count = packet.readUInt32LE();

            for(var i=0;i<count;i++) {
                var id = packet.readUInt32LE();

                var name = '';
                while(1) {
                    var char = packet.readUInt16LE();
                    if(char == 0) break;
                    name += String.fromCharCode(char);
                }

                users.push(id);
                var ball = client.balls[id] || new Ball(client, id);
                if(name) ball.setName(name);
                ball.update();
            }

            if(JSON.stringify(client.leaders) == JSON.stringify(users)) return;
            var old_leaders = client.leaders;
            client.leaders  = users;

            if(client.debug >= 2)
                client.log('leaders update: ' + JSON.stringify(users));

            client.emit('leaderBoardUpdate', old_leaders, users);
        },

        //teams scored update in teams mode
        '50': function(client, packet) {
            var teams_count  = packet.readUInt32LE();
            var teams_scores = [];

            for (var i=0;i<teams_count;++i) {
                teams_scores.push(packet.readFloat32LE());
            }

            if(JSON.stringify(client.teams_scores) == JSON.stringify(teams_scores)) return;
            var old_scores = client.teams_scores;

            if(client.debug >= 2)
                client.log('teams scores update: ' + JSON.stringify(teams_scores));

            client.teams_scores = teams_scores;

            client.emit('teamsScoresUpdate', old_scores, teams_scores);
        },

        //map size load
        '64': function(client, packet) {
            var min_x = packet.readFloat64LE();
            var min_y = packet.readFloat64LE();
            var max_x = packet.readFloat64LE();
            var max_y = packet.readFloat64LE();

            if(client.debug >= 2)
                client.log('map size: ' + [min_x, min_y, max_x, max_y].join(','));

            client.emit('mapSizeLoad', min_x, min_y, max_x, max_y);
        },

        //another unknown backet
        '72': function() {
            //packet is sent by server but not used in original code
        },

        '81': function(client, packet) {
            var level       = packet.readUInt32LE();
            var curernt_exp = packet.readUInt32LE();
            var need_exp    = packet.readUInt32LE();

            if(client.debug >= 2)
                client.log('experience update: ' + [level, curernt_exp, need_exp].join(','));

            client.emit('experienceUpdate', level, curernt_exp, need_exp);
        },

        '240': function(client, packet) {
            packet.offset += 4;
            var packet_id = packet.readUInt8();
            var processor = client.processors[packet_id];
            if(!processor) return client.log('[warning] unknown packet ID(240->' + packet_id + '): ' + packet.toString());
            processor(client, packet);
        },

        //somebody won, end of the game (server restart)
        '254': function(client) {
            if(client.debug >= 1)
                client.log(client.balls[client.leaders[0]] + ' WON THE GAME! Server going for restart');

            client.emit('winner', client.leaders[0]);
        }
    },

    updateScore: function() {
        var potential_score = 0;
        for (var i=0;i<this.my_balls.length;i++) {
            var ball_id = this.my_balls[i];
            var ball    = this.balls[ball_id];
            potential_score += Math.pow(ball.size, 2);
        }
        var old_score = this.score;
        var new_score = Math.max(this.score, Math.floor(potential_score / 100));

        if (this.score == new_score) return;
        this.score = new_score;
        this.emit('scoreUpdate', old_score, new_score);

        if(this.debug >= 2)
            this.log('score: ' + new_score);

    },

    log: function(msg) {
        console.log(this.client_name + ': ' + msg);
    },

    //functions that you can call to control your balls

    //spawn ball
    spawn: function(name) {
	if(this.debug >= 3)
            this.log('spawn() called, name=' + name);

        var buf = new Buffer(1 + 2*name.length);
        buf.writeUInt8(0, 0);
        for (var i=0;i<name.length;i++) {
            buf.writeUInt16LE(name.charCodeAt(i), 1 + i*2);
        }
        this.send(buf);

        //fix for unstable spawn on official servers
        if(!this.spawn_attempt && this.spawn_interval) {
            if(this.debug >= 4)
                this.log('Starting spawn() interval');

            var that = this;
            this.spawn_attempt = 1;
            this.spawn_interval_id = setInterval(function() {
                if(that.debug >= 4)
                    that.log('spawn() interval tick, attempt ' + that.spawn_attempt + '/' + that.spawn_attempts);

                if(that.spawn_attempt >= that.spawn_attempts) {
                    if(that.debug >= 1)
                        that.log('[warning] spawn() interval gave up! Disconnecting from server!');
                    that.spawn_attempt = 0;
                    clearInterval(that.spawn_interval_id);
                    that.spawn_interval_id = 0;
                    that.disconnect();
                    return;
                }
                that.spawn_attempt++;
                that.spawn(name);
            }, that.spawn_interval);
        }
    },

    //activate spectate mode
    spectate: function() {
        var buf = new Buffer([1]);
        this.send(buf);
    },

    moveTo: function(x, y) {
        var buf = new Buffer(13);
        buf.writeUInt8(16, 0);
        buf.writeInt32LE(Math.round(x), 1);
        buf.writeInt32LE(Math.round(y), 5);
        buf.writeUInt32LE(0, 9);
        this.send(buf);
    },

    //split your balls
    //they will split in direction that you have set with moveTo()
    split: function() {
        var buf = new Buffer([17]);
        this.send(buf);
    },

    //eject some mass
    //mass will eject in direction that you have set with moveTo()
    eject: function() {
        var buf = new Buffer([21]);
        this.send(buf);
    }
};

function Ball(client, id) {
    if(client.balls[id]) return client.balls[id];

    this.id    = id;
    this.name  = null;
    this.x     = 0;
    this.y     = 0;
    this.size  = 0;
    this.mass  = 0;
    this.virus = false;
    this.mine  = false;

    this.client      = client;
    this.destroyed   = false;
    this.visible     = false;
    this.last_update = (+new Date);
    this.update_tick = 0;

    client.balls[id] = this;
    return this;
}
Ball.prototype = {
    destroy: function(reason) {
        this.destroyed = reason;
        delete this.client.balls[this.id];
        var mine_ball_index = this.client.my_balls.indexOf(this.id);
        if(mine_ball_index > -1) {
            this.client.my_balls.splice(mine_ball_index, 1);
            this.client.emit('mineBallDestroy', this.id, reason);
            if(!this.client.my_balls.length) this.client.emit('lostMyBalls');
        }

        this.emit('destroy', reason);
        this.client.emit('ballDestroy', this.id, reason);
    },

    setCords: function(new_x, new_y) {
        if(this.x == new_x && this.y == new_y) return;
        var old_x = this.x;
        var old_y = this.y;
        this.x    = new_x;
        this.y    = new_y;

        if(!old_x && !old_y) return;
        this.emit('move', old_x, old_y, new_x, new_y);
        this.client.emit('ballMove', this.id, old_x, old_y, new_x, new_y);
    },

    setSize: function(new_size) {
        if(this.size == new_size) return;
        var old_size = this.size;
        this.size    = new_size;
        this.mass    = parseInt(Math.pow(new_size/10, 2));

        if(!old_size) return;
        this.emit('resize', old_size, new_size);
        this.client.emit('ballResize', this.id, old_size, new_size);
        if(this.mine) this.client.updateScore();
    },

    setName: function(name) {
        if(this.name == name) return;
        var old_name = this.name;
        this.name    = name;

        this.emit('rename', old_name, name);
        this.client.emit('ballRename', this.id, old_name, name);
    },

    update: function() {
        var old_time     = this.last_update;
        this.last_update = (+new Date);

        this.emit('update', old_time, this.last_update);
        this.client.emit('ballUpdate', this.id, old_time, this.last_update);
    },

    appear: function() {
        if(this.visible) return;
        this.visible = true;
        this.emit('appear');
        this.client.emit('ballAppear', this.id);

        if(this.mine) this.client.updateScore();
    },

    disappear: function() {
        if(!this.visible) return;
        this.visible = false;
        this.emit('disappear');
        this.client.emit('ballDisppear', this.id);
    },

    toString: function() {
        if(this.name) return this.id + '(' + this.name + ')';
        return this.id.toString();
    }
};

// Inherit from EventEmitter
for (var key in EventEmitter.prototype) {
    if(!EventEmitter.prototype.hasOwnProperty(key)) continue;
    Client.prototype[key] = Ball.prototype[key] = EventEmitter.prototype[key];
}

Client.servers = servers;
Client.Ball    = Ball;
module.exports = Client;


text:
'use strict';

const assert   = require('assert');
const fs       = require('fs');
const Mongoose = require('mongoose');
const path     = require('path');

const fileName    = path.join(__dirname, 'fixtures', 'lorem.jpg');
const fileBase    = path.basename(fileName);
const fileContent = fs.readFileSync(fileName);

const file = TEST.N.models.core.File;

describe('File model test', function () {

  it('createReadStream()', async function () {
    let id = await file.put(fileName, { metadata: { origName: fileBase } });

    let chunks = [];

    await new Promise(resolve => {
      file.createReadStream(id)
        .on('data', data => { chunks.push(data); })
        .on('end', () => resolve());
    });

    assert.deepEqual(Buffer.concat(chunks), fileContent);

    await file.remove(id);
  });

  it('put(file) + remove()', async function () {
    let id = await file.put(fileName, { metadata: { origName: fileBase } });

    let i = await file.getInfo(id);

    assert.equal(i.contentType, 'image/jpeg');
    assert.equal(i.metadata.origName, 'lorem.jpg');
    assert.equal(i.filename, id.toHexString());

    await file.remove(id);
  });

  it('put(file) + remove(all)', async function () {
    let origId = new Mongoose.Types.ObjectId();

    // Put file
    let f1Id = await file.put(fileName, { _id: origId, metadata: { origName: fileBase } });

    // Put file's preview
    let f2Id = await file.put(fileName, { filename: origId + '_sm', metadata: { origName: fileBase } });

    // Check file exists
    let i = await file.getInfo(f1Id);

    assert.equal(i.contentType, 'image/jpeg');

    // Check preview exists
    i = await file.getInfo(f2Id);

    assert.equal(i.contentType, 'image/jpeg');

    // Remove file + preview
    await file.remove(f1Id, true);

    // Check file not exists
    i = await file.getInfo(f1Id);

    assert.equal(i, null);

    // Check preview not exists
    i = await file.getInfo(f2Id);

    assert.equal(i, null);
  });

  it('remove for not existing file', async function () {
    await file.remove('012345678901234567890123'); // by _id
    await file.remove('not_existing_file.txt');
  });

  it('remove(all) for not existing file', async function () {
    await file.remove('012345678901234567890123', true); // by _id
    await file.remove('not_existing_file.txt', true);
  });

  it('put(stream)', async function () {
    let stream = fs.createReadStream(fileName);

    let id = await file.put(stream, { metadata: { origName: fileBase } });

    let i = await file.getInfo(id);

    assert.equal(i.contentType, 'image/jpeg');
    assert.equal(i.metadata.origName, 'lorem.jpg');
    assert.equal(i.filename, id.toHexString());

    await file.remove(id);
  });

  it('put(buffer)', async function () {
    let id = await file.put(fileContent, { metadata: { origName: fileBase } });

    let i = await file.getInfo(id);

    assert.equal(i.contentType, 'image/jpeg');
    assert.equal(i.metadata.origName, 'lorem.jpg');
    assert.equal(i.filename, id.toHexString());

    await file.remove(id);
  });
});


text:
Objects

<%include file="member_list.html" args="item_list=data.member_proxies, platform_count=len(data.platforms)"/>


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>CanvasAnimator</title>
	<link rel="stylesheet" href="./css/style.css">

Animated Canvas

		<canvas id="animatedCanvas"></canvas>

start

stop

restart

pause frame

previous frame

next frame

pause set

previous set

next set


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:statusBarColor">#26000000</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>


text:
#ifdef INTEL_MKL

#include <algorithm>
#include <vector>
#include "tensorflow/core/framework/numeric_op.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/kernels/ops_util.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/util/tensor_format.h"

#include "third_party/mkl/include/mkl_dnn.h"
#include "third_party/mkl/include/mkl_dnn_types.h"
#include "tensorflow/core/util/mkl_util.h"

namespace tensorflow {
typedef Eigen::ThreadPoolDevice CPUDevice;

///////////////////////////////////////////////////////////
//               Op kernel
///////////////////////////////////////////////////////////

template <typename Device, typename T>
class MklToTfOp : public OpKernel {
 public:
  explicit MklToTfOp(OpKernelConstruction* context) : OpKernel(context) {
    OP_REQUIRES_OK(context, context->GetAttr("data_format", &data_format_str));
    OP_REQUIRES_OK(context, context->GetAttr("T", &op_data_type));
  }

  void Compute(OpKernelContext* context) override {
    // 1. Check that input tensor is in MKL format.
    const Tensor& input_tensor = MklGetInput(context, 0);
    MklShape input_shape;
    GetMklShape(context, 0, &input_shape);

    // if input is already in Tf format, then just copy input tensor to output.
    if (!input_shape.IsMklTensor()) {
      context->set_output(0, input_tensor);
      VLOG(1) << "MKLToTFConversion: No conversion needed, "
              << "copying input to output";
      return;
    }

    // Check that input data type is same as operator data type and that it is
    // same as output data type.
    DataType input_data_type = input_type(0);
    DataType output_data_type = output_type(0);
    CHECK_EQ(op_data_type, input_data_type);
    CHECK_EQ(op_data_type, output_data_type);

    TensorShape output_shape;
    for (size_t i = 0; i < input_shape.GetDimension(); i++) {
      // Outermost to innermost dimension
      output_shape.AddDim(input_shape.GetSizes()[input_shape.tf_dim_idx(i)]);
    }

    // Allocate output tensor.
    Tensor* output_tensor = NULL;
    OP_REQUIRES_OK(context,
                   context->allocate_output(0, output_shape, &output_tensor));

    // 3. Get input and output layout pointers.
    dnnLayout_t output_layout =
        static_cast<dnnLayout_t>(input_shape.GetTfLayout());

    // 4. Execute DNNConversion.
    void* input_buffer =
        static_cast<void*>(const_cast<T*>(input_tensor.flat<T>().data()));
    void* output_buffer =
        static_cast<void*>(const_cast<T*>(output_tensor->flat<T>().data()));
    input_shape.GetConvertedFlatData(output_layout, input_buffer,
                                     output_buffer);

    VLOG(1) << "MKLToTFConversion complete successfully.";
  }

 private:
  /// Data format of the operation
  string data_format_str;

  /// Data type of the operation
  DataType op_data_type;
};

///////////////////////////////////////////////////////////
//               Register kernel
///////////////////////////////////////////////////////////

#define REGISTER_CPU(T)                                             \
  REGISTER_KERNEL_BUILDER(Name("MklToTf")                           \
                              .Device(DEVICE_CPU)                   \
                              .TypeConstraint<T>("T")               \
                              .Label(mkl_op_registry::kMklOpLabel), \
                          MklToTfOp<CPUDevice, T>);

TF_CALL_float(REGISTER_CPU);
#undef REGISTER_CPU
}  // namespace tensorflow
#endif /* INTEL_MKL */


text:
package com.sequenceiq.cloudbreak.orchestrator.host;

import java.util.Map;
import java.util.Optional;
import java.util.Set;

import org.apache.commons.collections4.MapUtils;

import com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig;
import com.sequenceiq.cloudbreak.orchestrator.state.ExitCriteriaModel;

public class OrchestratorStateParams implements Cloneable {

    private String state;

    private GatewayConfig primaryGatewayConfig;

    private Set<String> targetHostNames;

    private ExitCriteriaModel exitCriteriaModel;

    private OrchestratorStateRetryParams stateRetryParams;

    private Map<String, Object> stateParams = Map.of();

    private boolean concurrent;

    private String errorMessage = "";

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public GatewayConfig getPrimaryGatewayConfig() {
        return primaryGatewayConfig;
    }

    public void setPrimaryGatewayConfig(GatewayConfig primaryGatewayConfig) {
        this.primaryGatewayConfig = primaryGatewayConfig;
    }

    public Set<String> getTargetHostNames() {
        return targetHostNames;
    }

    public void setTargetHostNames(Set<String> targetHostNames) {
        this.targetHostNames = targetHostNames;
    }

    public ExitCriteriaModel getExitCriteriaModel() {
        return exitCriteriaModel;
    }

    public void setExitCriteriaModel(ExitCriteriaModel exitCriteriaModel) {
        this.exitCriteriaModel = exitCriteriaModel;
    }

    public Optional<OrchestratorStateRetryParams> getStateRetryParams() {
        return Optional.ofNullable(stateRetryParams);
    }

    public void setStateRetryParams(OrchestratorStateRetryParams stateRetryParams) {
        this.stateRetryParams = stateRetryParams;
    }

    public Map<String, Object> getStateParams() {
        return stateParams;
    }

    public void setStateParams(Map<String, Object> stateParams) {
        this.stateParams = stateParams;
    }

    public boolean isParameterized() {
        return !MapUtils.isEmpty(stateParams);
    }

    public boolean isConcurrent() {
        return concurrent;
    }

    public void setConcurrent(boolean concurrent) {
        this.concurrent = concurrent;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    @Override
    public OrchestratorStateParams clone() throws CloneNotSupportedException {
        return (OrchestratorStateParams) super.clone();
    }

    @Override
    public String toString() {
        return "OrchestratorStateParams{" +
                "state='" + state + '\'' +
                ", primaryGatewayConfig=" + primaryGatewayConfig +
                ", targetHostNames=" + targetHostNames +
                ", exitCriteriaModel=" + exitCriteriaModel +
                ", stateRetryParams=" + stateRetryParams +
                ", stateParams=" + stateParams +
                ", concurrent=" + concurrent +
                ", errorMessage='" + errorMessage + '\'' +
                '}';
    }
}