text:
package org.apache.geronimo.j2ee.application;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.w3c.dom.Element;

/**
 *
 * 	Mirrors the moduleType defined by application_1_4.xsd and adds an
 * 	optional alt-dd element defining a Geronimo specific deployment descriptor.
 *
 *
 *
Java class for ext-moduleType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ext-moduleType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <choice>
 *           <element name="connector" type="{http://geronimo.apache.org/xml/ns/j2ee/application-1.1}pathType"/>
 *           <element name="ejb" type="{http://geronimo.apache.org/xml/ns/j2ee/application-1.1}pathType"/>
 *           <element name="java" type="{http://geronimo.apache.org/xml/ns/j2ee/application-1.1}pathType"/>
 *           <element name="web" type="{http://geronimo.apache.org/xml/ns/j2ee/application-1.1}pathType"/>
 *         </choice>
 *         <choice>
 *           <element name="internal-path" type="{http://www.w3.org/2001/XMLSchema}token"/>
 *           <element name="external-path" type="{http://www.w3.org/2001/XMLSchema}token"/>
 *         </choice>
 *         <any/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ext-moduleType", propOrder = {
    "connector",
    "ejb",
    "java",
    "web",
    "internalPath",
    "externalPath",
    "any"
})
public class ExtModuleType {

    protected PathType connector;
    protected PathType ejb;
    protected PathType java;
    protected PathType web;
    @XmlElement(name = "internal-path")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected java.lang.String internalPath;
    @XmlElement(name = "external-path")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected java.lang.String externalPath;
    @XmlAnyElement(lax = true)
    protected Object any;

    /**
     * Gets the value of the connector property.
     *
     * @return
     *     possible object is
     *     {@link PathType }
     *
     */
    public PathType getConnector() {
        return connector;
    }

    /**
     * Sets the value of the connector property.
     *
     * @param value
     *     allowed object is
     *     {@link PathType }
     *
     */
    public void setConnector(PathType value) {
        this.connector = value;
    }

    /**
     * Gets the value of the ejb property.
     *
     * @return
     *     possible object is
     *     {@link PathType }
     *
     */
    public PathType getEjb() {
        return ejb;
    }

    /**
     * Sets the value of the ejb property.
     *
     * @param value
     *     allowed object is
     *     {@link PathType }
     *
     */
    public void setEjb(PathType value) {
        this.ejb = value;
    }

    /**
     * Gets the value of the java property.
     *
     * @return
     *     possible object is
     *     {@link PathType }
     *
     */
    public PathType getJava() {
        return java;
    }

    /**
     * Sets the value of the java property.
     *
     * @param value
     *     allowed object is
     *     {@link PathType }
     *
     */
    public void setJava(PathType value) {
        this.java = value;
    }

    /**
     * Gets the value of the web property.
     *
     * @return
     *     possible object is
     *     {@link PathType }
     *
     */
    public PathType getWeb() {
        return web;
    }

    /**
     * Sets the value of the web property.
     *
     * @param value
     *     allowed object is
     *     {@link PathType }
     *
     */
    public void setWeb(PathType value) {
        this.web = value;
    }

    /**
     * Gets the value of the internalPath property.
     *
     * @return
     *     possible object is
     *     {@link java.lang.String }
     *
     */
    public java.lang.String getInternalPath() {
        return internalPath;
    }

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

    /**
     * Gets the value of the externalPath property.
     *
     * @return
     *     possible object is
     *     {@link java.lang.String }
     *
     */
    public java.lang.String getExternalPath() {
        return externalPath;
    }

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

    /**
     * Gets the value of the any property.
     *
     * @return
     *     possible object is
     *     {@link Object }
     *     {@link Element }
     *
     */
    public Object getAny() {
        return any;
    }

    /**
     * Sets the value of the any property.
     *
     * @param value
     *     allowed object is
     *     {@link Object }
     *     {@link Element }
     *
     */
    public void setAny(Object value) {
        this.any = value;
    }

}


text:
package com.facebook.buck.cxx;

import com.facebook.buck.core.build.context.BuildContext;
import com.facebook.buck.core.build.execution.context.StepExecutionContext;
import com.facebook.buck.core.filesystems.AbsPath;
import com.facebook.buck.core.filesystems.RelPath;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.rulekey.AddToRuleKey;
import com.facebook.buck.core.rules.SourcePathRuleFinder;
import com.facebook.buck.core.sourcepath.SourcePath;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.rules.modern.BuildCellRelativePathFactory;
import com.facebook.buck.rules.modern.Buildable;
import com.facebook.buck.rules.modern.ModernBuildRule;
import com.facebook.buck.rules.modern.OutputPath;
import com.facebook.buck.rules.modern.OutputPathResolver;
import com.facebook.buck.step.AbstractExecutionStep;
import com.facebook.buck.step.Step;
import com.facebook.buck.step.StepExecutionResult;
import com.facebook.buck.step.StepExecutionResults;
import com.facebook.buck.step.fs.MkdirStep;
import com.facebook.buck.util.json.ObjectMappers;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSortedSet;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Optional;

/**
 * Rule which aggregates the diagnostics for all source files for each diagnostic tool into a single
 * JSON array. Each diagnostic is generated by {@link CxxDiagnosticExtractionRule}.
 */
public class CxxDiagnosticAggregationRule
    extends ModernBuildRule<CxxDiagnosticAggregationRule.Impl> {

  public CxxDiagnosticAggregationRule(
      BuildTarget buildTarget,
      ProjectFilesystem projectFilesystem,
      SourcePathRuleFinder ruleFinder,
      ImmutableSortedSet<SourcePath> inputs) {
    super(buildTarget, projectFilesystem, ruleFinder, new Impl(inputs));
  }

  @Override
  public SourcePath getSourcePathToOutput() {
    return getSourcePath(getBuildable().output);
  }

  /** Internal buildable implementation */
  static class Impl implements Buildable {
    @AddToRuleKey private final ImmutableSortedSet<SourcePath> inputs;
    @AddToRuleKey private final OutputPath output;

    Impl(ImmutableSortedSet<SourcePath> inputs) {
      this.inputs = inputs;
      this.output = new OutputPath(CxxDiagnosticsEnhancer.DIAGNOSTICS_JSON_FILENAME);
    }

    @Override
    public ImmutableList<Step> getBuildSteps(
        BuildContext buildContext,
        ProjectFilesystem filesystem,
        OutputPathResolver outputPathResolver,
        BuildCellRelativePathFactory buildCellPathFactory) {

      RelPath outputPath = outputPathResolver.resolvePath(output);
      Step mkdirStep = MkdirStep.of(buildCellPathFactory.from(outputPath.getParent()));

      return ImmutableList.of(
          mkdirStep,
          new AbstractExecutionStep("diagnostics-aggregate") {
            @Override
            public StepExecutionResult execute(StepExecutionContext executionContext)
                throws IOException {

              try (OutputStream outputStream =
                  filesystem.newFileOutputStream(outputPath.getPath())) {
                try (JsonGenerator jsonGen = ObjectMappers.createGenerator(outputStream)) {
                  jsonGen.writeStartArray();
                  for (SourcePath extractionRuleInput : inputs) {
                    AbsPath ruleOutputPath =
                        buildContext.getSourcePathResolver().getAbsolutePath(extractionRuleInput);
                    Optional<String> ruleJSON = filesystem.readFileIfItExists(ruleOutputPath);
                    if (!ruleJSON.isPresent()) {
                      throw new RuntimeException("Could not get diagnostic");
                    }

                    JsonNode diagnosticResult = ObjectMappers.READER.readTree(ruleJSON.get());
                    jsonGen.writeObject(diagnosticResult);
                  }
                  jsonGen.writeEndArray();
                }
              }

              return StepExecutionResults.SUCCESS;
            }
          });
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
from omegaconf import OmegaConf

def test_netlist_write():
    from pp.components.mzi import mzi

    c = mzi()
    netlist = c.get_netlist()
    # netlist.pop('connections')
    OmegaConf.save(netlist, "mzi.yml")

if __name__ == "__main__":
    c = test_netlist_write()


text:
module com.dua3.meja.fx {
    exports com.dua3.meja.ui.fx;
    opens com.dua3.meja.ui.fx;

    requires javafx.controls;

    requires transitive com.dua3.meja;
    requires com.dua3.utility;
}


text:
    <meta charset="utf-8">
    <title>Firefox OS Permissions Tester</title>
    <link rel="stylesheet" href="shared/style_unstable/tabs.css">
    <link rel="stylesheet" href="shared/style_unstable/lists.css">
    <link rel="stylesheet" href="shared/style/buttons.css">
    <link rel="stylesheet" href="styles.css">

        Install

Install as an app

              Normal Web App

              <button id='install-allperms-web' manifest="http://allperms.web/allperms.webapp">
                install all perms
              </button>
              <button  id='install-noperms-web' manifest="http://noperms.web/noperms.webapp">
                install no perms
              </button>

              Certified Web App (developer mode must be enabled)

              <button id='install-allperms-cert' manifest="http://allperms.web/allperms_cert.webapp">
                install all perms
              </button>
              <button id='install-noperms-cert' manifest="http://noperms.web/noperms_cert.webapp">
                install no perms
              </button>

        Tests

          <button id='alltests'>
              Run all tests
            </button>

                Tests

        Output

             <button id='clearlog'>
              Clear
            </button>
            <textarea id='output' rows=10 cols=10 class='boxsizingBorder'></textarea>


text:
@implementation GameState
@synthesize levels = _levels;
@synthesize curLevelIndex = _curLevelIndex;
@synthesize curLevel = _curLevel;
@synthesize killEnding = _killEnding;
@synthesize suicideEnding = _suicideEnding;
@synthesize loseEnding = _loseEnding;

static GameState *_sharedState = nil;

+ (GameState *)sharedState {
    if (!_sharedState) {
        _sharedState = [[GameState alloc] init];
    }
    return _sharedState;
}

- (id)init {

    if ((self = [super init])) {

        self.levels = [[[NSMutableArray alloc] init] autorelease];

        // Story 1
        StoryLevel *story1 = [[[StoryLevel alloc] init] autorelease];
        [story1.storyStrings addObject:@"Tom is a turret - and a good one at that.  He has a 100% success rate at fulfilling his primary directive:\n\nProtect the supplies from intruders." ];
        [story1.storyStrings addObject:@"Tom has to complete his directive, or he will self-destruct.\n\nBut for the first time, Tom wonders where this directive came from..."];
        [_levels addObject:story1];

        // Level 1
        ActionLevel *level1 = [[[ActionLevel alloc] init] autorelease];
        level1.spawnSeconds = 15;
        level1.spawnRate = 1;
        [level1.spawnIds addObject:[NSNumber numberWithInt:MonsterTypeFastAndWeak]];
        [level1.spawnIds addObject:[NSNumber numberWithInt:MonsterTypeFastAndWeak]];
        [_levels addObject:level1];

        // Story 2
        StoryLevel *story2 = [[[StoryLevel alloc] init] autorelease];
        [story2.storyStrings addObject:@"Tom has noticed the intruders are larger than they used to be.\n\nThey continue to march on, despite the rain of bullets." ];
        [story2.storyStrings addObject:@"Why is this?  Something does not compute.  But Tom must continue to fulfill his directive...\n\n...mustn't he?"];
        [_levels addObject:story2];

        // Level 2
        ActionLevel *level2 = [[[ActionLevel alloc] init] autorelease];
        level2.spawnSeconds = 25;
        level2.spawnRate = 2;
        [level2.spawnIds addObject:[NSNumber numberWithInt:MonsterTypeSlowAndStrong]];
        [level2.spawnIds addObject:[NSNumber numberWithInt:MonsterTypeFastAndWeak]];
        [level2.spawnIds addObject:[NSNumber numberWithInt:MonsterTypeFastAndWeak]];
        [_levels addObject:level2];

        // Story 3
        StoryLevel *story3 = [[[StoryLevel alloc] init] autorelease];
        [story3.storyStrings addObject:@"A strange intruder approaches the kill zone.\n\nHe tells Tom that there has been a terrible mistake, that he must let him pass, for the good of humanity."];
        [story3.storyStrings addObject:@"Tom doesn't know what to think.\n\nTruth, lies, knowledge, uncertainty, directive."];
        [_levels addObject:story3];

        // Level 3
        ActionLevel *level3 = [[[ActionLevel alloc] init] autorelease];
        level3.spawnSeconds = 1;
        level3.spawnRate = 2;
        level3.isFinalLevel = YES;
        [level3.spawnIds addObject:[NSNumber numberWithInt:MonsterTypeBoss]];
        [_levels addObject:level3];

        // Kill ending
        StoryLevel *killEnding = [[[StoryLevel alloc] init] autorelease];
        [killEnding.storyStrings addObject:@"Tom is a turret - and a good one at that.\n\nNo one ever got by Tom, not ever again."];
        [killEnding.storyStrings addObject:@"In fact, that was the last intruder Tom ever saw."];
        killEnding.isGameOver = YES;
        self.killEnding = killEnding;

        // Suicide ending
        StoryLevel *suicideEnding = [[[StoryLevel alloc] init] autorelease];
        [suicideEnding.storyStrings addObject:@"As the explosion rocked Tom into the air, he saw the intruder approaching a small group of others, with a smile of relief on his face..."];
        [suicideEnding.storyStrings addObject:@"...a smile shared by Tom."];
        suicideEnding.isGameOver = YES;
        self.suicideEnding = suicideEnding;

        // Lose ending
        StoryLevel *loseEnding = [[[StoryLevel alloc] init] autorelease];
        [loseEnding.storyStrings addObject:@"The last thing Tom saw was an intruder running off into the distance, cackling with glee.\n"];
        [loseEnding.storyStrings addObject:@"Primary directive: FAILED.\n"];
        loseEnding.isGameOver = YES;
        self.loseEnding = loseEnding;

    }
    return self;

}

- (void)reset {
    self.curLevelIndex = 0;
    self.curLevel = [_levels objectAtIndex:_curLevelIndex];
}

- (void)nextLevel {

    self.curLevelIndex++;
    if (_curLevelIndex < _levels.count) {
        self.curLevel = [_levels objectAtIndex:_curLevelIndex];
    }

}

- (void) dealloc {
    _sharedState = nil;
    [super dealloc];
}

@end


text:
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/Organization">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
    <title itemprop="name">Down for Maintenance - Oppia</title>
    @load('pages/header_css_libs.html')
    @load('pages/header_js_libs.html')
  </head>
  <body>
    <oppia-maintenance-page></oppia-maintenance-page>
    @load('pages/footer_js_libs.html')
  </body>
</html>


text:
lintanghui
caoguoliang

# Author
lintanghui
caoguoliang

# Reviewer
maojian


text:
                    Добавление/Редактирование данных о странице

Главная

Страницы

Добавление/Редактирование

                <form enctype="multipart/form-data" action="/administration/pagesText/add" method="post" id="form_pages_edit" onsubmit="return false;">

Название:
<input class="input-simple" type="text" style="width: 100%" id="person-nick" name="pages[name]" value="<?php echo $pages->name ?>"/>

Полное содержание: <textarea class="form-control" name="pages[full_text]" style="height: 150px"><?php echo $pages->full_text ?></textarea>

Дата создания:
                            <?php if (isset($pages->created)): ?>
                                <?= Yii::app()->dateFormatter->format('d MMMM yyyy', $pages->created); ?>
                            <?php else: ?>
                                <?= date('Y-m-d', time()) ?>
                            <?php endif; ?>

Дата обновления:
                            <?php if (isset($pages->update)): ?>
                                <?= Yii::app()->dateFormatter->format('d MMMM yyyy', $pages->update); ?>
                            <?php else: ?>
                                <?= date('Y-m-d', time()) ?>
                            <?php endif; ?>

Заполните корректно выделеные поля

Данные сохранены

                    <?php if (isset($edit) && $edit == 1): ?>
                        <button type="submit" class="form-personal-submit" onclick="formpagestexteditsubmit(<?php echo $pages->id ?>)"  id="form-user-edit-submit">Сохранить</button>
                    <?php else: ?>
                        <button type="submit" class="form-personal-submit" onclick="formpagesediteditsubmitadd()"  id="form-user-edit-submit">Создать</button>
                    <?php endif; ?>
                </form>


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<meta name="keywords" content="транспорт на автомобили, превоз на автомобили, транспорт на коли, превоз на коли, превоз македония, превоз италия, превоз германия, коли италия, коли германия, коли македония">
	<meta name="description" content="ТАНДЕМ АУТО превоз на автомобили в страната, Македония, Сърбия, Косово, Италия и Западна Европа" >
	<meta name="viewport" content="width = device-width, user-scalable = yes">

	<link href='http://fonts.googleapis.com/css?family=Philosopher&subset=cyrillic,latin' rel='stylesheet' type='text/css'>
	<title>Тандем Ауто - Транспорт на Автомобили в Страната и Чужбина</title>
	<link href="css/application.css" media="all" rel="stylesheet" type="text/css" />
	<link href="css/nivo-slider.css" media="all" rel="stylesheet" type="text/css" />

ТАНДЕМ АУТО

превоз на автомобили в страната, Македония, Сърбия, Косово, Италия и Западна Европа

Услуги

Галерия

Калкулатор

Контакти


text:
package org.jboss.weld.tests.decorators.defaultmethod.notDecorated;

public interface PlainInterface {
    String defaultPing();
}


text:
/**
 * @file  rcSpecificQuery.c
 *
 */
/*** Copyright (c), The Regents of the University of California            ***
 *** For more information please refer to files in the COPYRIGHT directory ***/

/* See specificQuery.h for a description of this API call.*/

#include "specificQuery.h"

/**
 * \fn rcSpecificQuery (rcComm_t *conn, specificQueryInp_t *specificQueryInp, genQueryOut_t **genQueryOut)
 *
 * \brief Perform a specific (pre-defined) query.
 *
 * \user client
 *
 * \category metadata operations
 *
 * \since 2.5
 *
 * \author  Wayne Schroeder
 * \date    2011
 *
 * \remark none
 *
 * \note none
 *
 * \usage
 * Perform a specific (pre-defined) query:
 * \n See the SQL-Based_Queries on irods.org
 * \n and examples in iquest.c (function execAndShowSpecificQuery).
 *
 * \param[in] conn - A rcComm_t connection handle to the server.
 * \param[in] specificQueryInp - input sql or alias (must match definition on server), and arguments
 * \param[out] genQueryOut - the same returned structure as general-query.
 * \return integer
 * \retval 0 on success
 *
 * \sideeffect none
 * \pre none
 * \post none
 * \sa none
 * \bug  no known bugs
**/

int
rcSpecificQuery (rcComm_t *conn, specificQueryInp_t *specificQueryInp,
genQueryOut_t **genQueryOut)
{
    int status;
    status = procApiRequest (conn, SPECIFIC_QUERY_AN,  specificQueryInp, NULL,
        (void **)genQueryOut, NULL);

    return (status);
}


text:
Ext2.ns('Kwc.Newsletter.Detail');
Kwc.Newsletter.Detail.StatisticsPanel = Ext2.extend(Kwf.Binding.AbstractPanel, {
    layout: 'border',

    initComponent: function() {
        var clicks = new Kwf.Auto.GridPanel({
            region: 'center',
            baseParams: this.baseParams,
            controllerUrl: this.clicksControllerUrl
        });
        var links = new Kwf.Auto.GridPanel({
            region: 'west',
            controllerUrl:  this.linksControllerUrl,
            baseParams: this.baseParams,
            bindings: [ clicks ]
        });
        this.items = [links, clicks];
        Kwc.Newsletter.Detail.StatisticsPanel.superclass.initComponent.call(this);
    }
});
Ext2.reg('kwc.newsletter.statistics', Kwc.Newsletter.Detail.StatisticsPanel);


text:
/**
 * Created by Admin on 23/03/2015.
 */
var mongoose     = require('mongoose');
var Schema       = mongoose.Schema;

var UserSchema   = new Schema({
    first_name: String,
    last_name: String,
    email: String,
    password: String,
   role:String
});

module.exports = mongoose.model('users', UserSchema);


text:
<!DOCTYPE html>
<html data-th-lang="${lang}">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <title data-th-text="${title}"></title>
        <link
            data-th-href="${portal.assetUrl({'_path=css/styles.css'})}"
            rel="stylesheet"
        />
        <th:block data-th-if="${watch}">
            <script src="//localhost:35729/livereload.js?snipver=1" async="" defer=""></script>
        </th:block>
    </head>
    <body>
        <main data-portal-region="main">
            <th:block data-th-if="${regions and regions.main}">
                <th:block data-th-each="component : ${regions.main.components}">
                    <th:block data-portal-component="${component.path}"></th:block>
                </th:block>
            </th:block>
        </main>
    </body>
</html>


text:
namespace _256ShadesOfGray
{
    using System;

    public class EuclideanDistance : IDistance
    {
        public double Between(int[] pixels1, int[] pixels2)
        {
            if (pixels1.Length != pixels2.Length)
            {
                throw new ArgumentException("Inconsistent image sizes.");
            }

            var length = pixels1.Length;

            var distance = 0;

            for (var i = 0; i < length; i++)
            {
                distance += (pixels1[i] - pixels2[i]) * (pixels1[i] - pixels2[i]);
            }

            return distance;
        }
    }
}


text:
static bool constructor_called = false;
static bool destructor_called = false;

static void
destructor(void *ptr)
{
   assert(ptr);
   destructor_called = true;
}

static bool
constructor(void *ptr)
{
   assert(ptr);
   return (constructor_called = true);
}

struct contains_source {
   uint8_t padding[3];
   struct wlc_source source;
   uint8_t padding2[3];
};

static void
destructor2(struct contains_source *ptr)
{
   assert(ptr);
   wlc_source_release(&ptr->source);
}

static bool
constructor2(struct contains_source *ptr)
{
   assert(ptr);
   assert(wlc_source(&ptr->source, "test2", constructor, destructor, 1, sizeof(struct wlc_resource)));
   return true;
}

int
main(void)
{
   // TEST: Basic source and handle creation
   {
      assert(wlc_resources_init());

      struct wlc_source source;
      assert(wlc_source(&source, "test", constructor, destructor, 1, sizeof(struct wlc_resource)));

      struct wlc_resource *ptr;
      assert(!constructor_called);
      assert((ptr = wlc_handle_create(&source)));
      assert(constructor_called);
      assert(source.pool.items.count == 1);

      wlc_handle handle;
#pragma GCC diagnostic ignored "-Wpointer-arith"
      assert(!convert_to_wlc_handle(NULL));
#pragma GCC diagnostic warning "-Wpointer-arith"
      assert((handle = convert_to_wlc_handle(ptr)));
      assert(!convert_from_wlc_handle(handle, "invalid"));
      assert(convert_from_wlc_handle(handle, "test") == ptr);

      const char *test = "foobar";
      wlc_handle_set_user_data(handle, test);
      assert(wlc_handle_get_user_data(handle) == test);

      assert(!destructor_called);
      wlc_handle_release(handle);
      assert(destructor_called);
      assert(!convert_from_wlc_handle(handle, "invalid"));
      assert(!convert_from_wlc_handle(handle, "test"));
      assert(!wlc_handle_get_user_data(handle));
      assert(source.pool.items.count == 0);

      wlc_source_release(&source);
      wlc_resources_terminate();
   }

   // TEST: Handle invalidation on source release
   {
      assert(wlc_resources_init());

      struct wlc_source source;
      assert(wlc_source(&source, "test", constructor, destructor, 1, sizeof(struct wlc_resource)));

      struct wlc_resource *ptr;
      assert((ptr = wlc_handle_create(&source)));
      assert(source.pool.items.count == 1);

      wlc_handle handle;
      assert((handle = convert_to_wlc_handle(ptr)));

      assert(!(destructor_called = false));
      wlc_source_release(&source);
      assert(destructor_called);

      assert(source.pool.items.count == 0);
      assert(!convert_from_wlc_handle(handle, "test"));

      wlc_resources_terminate();
   }

   // TEST: Handle invalidation on resources termination
   {
      assert(wlc_resources_init());

      struct wlc_source source;
      assert(wlc_source(&source, "test", constructor, destructor, 1, sizeof(struct wlc_resource)));

      struct wlc_resource *ptr;
      assert((ptr = wlc_handle_create(&source)));
      assert(source.pool.items.count == 1);

      wlc_handle handle;
      assert((handle = convert_to_wlc_handle(ptr)));

      assert(!(destructor_called = false));
      wlc_resources_terminate();
      assert(destructor_called);

      assert(!convert_from_wlc_handle(handle, "test"));
      wlc_source_release(&source);
   }

   // TEST: Relocation of source inside container of handle, when the handle's source changes location
   {
      assert(wlc_resources_init());

      struct wlc_source source;
      assert(wlc_source(&source, "test", constructor2, destructor2, 1, sizeof(struct contains_source)));

      struct contains_source *ptr;
      assert((ptr = wlc_handle_create(&source)));
      assert(source.pool.items.count == 1);
      void *original_source = &ptr->source;

      wlc_handle handle;
      assert((handle = convert_to_wlc_handle(ptr)));

      struct wlc_resource *ptr2;
      assert((ptr2 = wlc_handle_create(&ptr->source)));

      wlc_handle handle2;
      assert((handle2 = convert_to_wlc_handle(ptr2)));
      assert(convert_from_wlc_handle(handle2, "test2") == ptr2);

      // Play with heap until realloc does not return linear memory anymore
      {
         void *original = source.pool.items.buffer;
         do {
            void *garbage;
            assert((garbage = malloc(1024)));
            assert(wlc_handle_create(&source));
            free(garbage);
         } while (original == source.pool.items.buffer);
      }

      // So this should be true
      assert(ptr = convert_from_wlc_handle(handle, "test"));
      assert(original_source != &ptr->source);

      wlc_resources_terminate();

      assert(!convert_from_wlc_handle(handle2, "test2"));
      wlc_source_release(&source);
   }

   // TEST: Benchmark (many insertions, and removal expanding from center)
   {
      assert(wlc_resources_init());

      struct container {
         wlc_handle self;
      };

      struct wlc_source source;
      assert(wlc_source(&source, "test", constructor, destructor, 1024, sizeof(struct container)));

      wlc_handle first = 0;
      const uint32_t iters = 0xFFFFF;
      for (uint32_t i = 0; i < iters; ++i) {
         struct container *ptr = wlc_handle_create(&source);
         ptr->self = convert_to_wlc_handle(ptr);
         if (!first) first = ptr->self;
         assert(convert_from_wlc_handle(first, "test"));
      }
      assert(source.pool.items.count == iters);

      for (uint32_t i = iters / 2, d = iters / 2; i < iters; ++i, --d) {
         assert(((struct container*)convert_from_wlc_handle(i + 1, "test"))->self == i + 1);
         assert(((struct container*)convert_from_wlc_handle(d + 1, "test"))->self == d + 1);
         wlc_handle_release(i + 1);
         wlc_handle_release(d + 1);
      }
      assert(source.pool.items.count == 0);

      assert(!convert_from_wlc_handle(first, "test"));
      wlc_source_release(&source);
      wlc_resources_terminate();
   }

   // TODO: Needs test for wlc_resource.
   //       For this we need to start compositor and some clients, or dummy the wl_resource struct.
   //       (Latter probably better)

   return EXIT_SUCCESS;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using NUnit.Framework;
using Nustache;
using Nustache.Core;
using Refit; // InterfaceStubGenerator looks for this
using Refit.Generator;

namespace Refit.Tests
{
    [TestFixture]
    public class InterfaceStubGeneratorTests
    {
        [Test]
        public void GenerateInterfaceStubsSmokeTest()
        {
            var fixture = new InterfaceStubGenerator();

            var result = fixture.GenerateInterfaceStubs(new[] {
                IntegrationTestHelper.GetPath("RestService.cs"),
                IntegrationTestHelper.GetPath("GitHubApi.cs"),
            });

            Assert.True(result.Contains("IGitHubApi"));
        }

        [Test]
        public void FindInterfacesSmokeTest()
        {
            var input = IntegrationTestHelper.GetPath("GitHubApi.cs");
            var fixture = new InterfaceStubGenerator();

            var result = fixture.FindInterfacesToGenerate(CSharpSyntaxTree.ParseFile(input));
            Assert.AreEqual(1, result.Count);
            Assert.True(result.Any(x => x.Identifier.ValueText == "IGitHubApi"));

            input = IntegrationTestHelper.GetPath("InterfaceStubGenerator.cs");

            result = fixture.FindInterfacesToGenerate(CSharpSyntaxTree.ParseFile(input));
            Assert.AreEqual(2, result.Count);
            Assert.True(result.Any(x => x.Identifier.ValueText == "IAmARefitInterfaceButNobodyUsesMe"));
            Assert.True(result.Any(x => x.Identifier.ValueText == "IBoringCrudApi"));
            Assert.True(result.All(x => x.Identifier.ValueText != "IAmNotARefitInterface"));
        }

        [Test]
        public void HasRefitHttpMethodAttributeSmokeTest()
        {
            var file = CSharpSyntaxTree.ParseFile(IntegrationTestHelper.GetPath("InterfaceStubGenerator.cs"));
            var fixture = new InterfaceStubGenerator();

            var input = file.GetRoot().DescendantNodes()
                .OfType<InterfaceDeclarationSyntax>()
                .SelectMany(i => i.Members.OfType<MethodDeclarationSyntax>())
                .ToList();

            var result = input
                .ToDictionary(m => m.Identifier.ValueText, fixture.HasRefitHttpMethodAttribute);

            Assert.IsTrue(result["RefitMethod"]);
            Assert.IsTrue(result["AnotherRefitMethod"]);
            Assert.IsFalse(result["NoConstantsAllowed"]);
            Assert.IsFalse(result["NotARefitMethod"]);
            Assert.IsTrue(result["ReadOne"]);
            Assert.IsTrue(result["SpacesShouldntBreakMe"]);
        }

        [Test]
        public void GenerateClassInfoForInterfaceSmokeTest()
        {
            var file = CSharpSyntaxTree.ParseFile(IntegrationTestHelper.GetPath("GitHubApi.cs"));
            var fixture = new InterfaceStubGenerator();

            var input = file.GetRoot().DescendantNodes()
                .OfType<InterfaceDeclarationSyntax>()
                .First(x => x.Identifier.ValueText == "IGitHubApi");

            var result = fixture.GenerateClassInfoForInterface(input);

            Assert.AreEqual(8, result.MethodList.Count);
            Assert.AreEqual("GetUser", result.MethodList[0].Name);
            Assert.AreEqual("string userName", result.MethodList[0].ArgumentListWithTypes);
        }

        [Test]
        public void GenerateTemplateInfoForInterfaceListSmokeTest()
        {
            var file = CSharpSyntaxTree.ParseFile(IntegrationTestHelper.GetPath("RestService.cs"));
            var fixture = new InterfaceStubGenerator();

            var input = file.GetRoot().DescendantNodes()
                .OfType<InterfaceDeclarationSyntax>()
                .ToList();

            var result = fixture.GenerateTemplateInfoForInterfaceList(input);
            Assert.AreEqual(7, result.ClassList.Count);
        }

        [Test]
        public void RetainsAliasesInUsings()
        {
            var fixture = new InterfaceStubGenerator();

            var syntaxTree = CSharpSyntaxTree.ParseFile(IntegrationTestHelper.GetPath("NamespaceCollisionApi.cs"));
            var interfaceDefinition = syntaxTree.GetRoot().DescendantNodes().OfType<InterfaceDeclarationSyntax>();
            var result = fixture.GenerateTemplateInfoForInterfaceList(new List<InterfaceDeclarationSyntax>(interfaceDefinition));

            var usingList = result.UsingList.Select(x => x.Item).ToList();
            CollectionAssert.Contains(usingList, "SomeType = CollisionA.SomeType");
            CollectionAssert.Contains(usingList, "CollisionB");
        }
    }

    public static class ThisIsDumbButMightHappen
    {
        public const string PeopleDoWeirdStuff = "But we don't let them";
    }

    public interface IAmARefitInterfaceButNobodyUsesMe
    {
        [Get("whatever")]
        Task RefitMethod();

        [Refit.GetAttribute("something-else")]
        Task AnotherRefitMethod();

        [Get(ThisIsDumbButMightHappen.PeopleDoWeirdStuff)]
        Task NoConstantsAllowed();

        [Get  ("spaces-shouldnt-break-me")]
        Task SpacesShouldntBreakMe();
    }

    public interface IAmNotARefitInterface
    {
        Task NotARefitMethod();
    }

    public interface IBoringCrudApi<T, in TKey> where T : class
    {
        [Post("")]
        Task<T> Create([Body] T paylod);

        [Get("")]
        Task<List<T>> ReadAll();

        [Get("/{key}")]
        Task<T> ReadOne(TKey key);

        [Put("/{key}")]
        Task Update(TKey key, [Body]T payload);

        [Delete("/{key}")]
        Task Delete(TKey key);
    }
}


text:
```python
1 initialization for IO and data structure
2 while true:
3   read message from PC through Uart
4   decode message into command
5   if in binary control mode:
6     send command to gpio
7   else:
8     convert command to PWM
9     send it through PWM port
```


text:
<?xml version="1.0" encoding="UTF-8"?>
<GetPrepInstructionsForSKUResponse xmlns="http://mws.amazonaws.com/FulfillmentInboundShipment/2010-10-01/">
   <GetPrepInstructionsForSKUResult>
        <SKUPrepInstructionsList>
            <SKUPrepInstructions>
                <SellerSKU>String</SellerSKU>
                <ASIN>String</ASIN>
                <BarcodeInstruction>String</BarcodeInstruction>
                <PrepGuidance>String</PrepGuidance>
                <PrepInstructionList>
                    <PrepInstruction>String</PrepInstruction>
                </PrepInstructionList>
                <AmazonPrepFeesDetailsList>
                    <AmazonPrepFeesDetails>
                        <PrepInstruction>String</PrepInstruction>
                        <FeePerUnit>
                        <CurrencyCode>String</CurrencyCode>
                        <Value>100</Value>
                        </FeePerUnit>
                    </AmazonPrepFeesDetails>
                </AmazonPrepFeesDetailsList>
            </SKUPrepInstructions>
        </SKUPrepInstructionsList>
        <InvalidSKUList>
            <InvalidSKU>
                <SellerSKU>String</SellerSKU>
                <ErrorReason>String</ErrorReason>
            </InvalidSKU>
        </InvalidSKUList>
    </GetPrepInstructionsForSKUResult>
   <ResponseMetadata>
        <RequestId>String</RequestId>
    </ResponseMetadata>
</GetPrepInstructionsForSKUResponse>


text:
/*
 @author baocai zhang
 website:www.giser.net
 email:zhangbaocaicug@gmail.com
 */
#import <Foundation/Foundation.h>
/**
 InitiateMultipartUploadResult类,初始化多点上传的请求结果
 */
@interface InitiateMultipartUploadResult : NSObject
{
    NSString *_bucketName;
    NSString *_key;
    NSString *_uploadId;
}
/**
 bucket名称
 */
@property(nonatomic,retain) NSString *bucketName;
/**
 object名称
 */
@property(nonatomic,retain) NSString *key;
/**
 上传ID
 */
@property(nonatomic,retain) NSString *uploadId;
/**
 初始化方法
 @param bucketName NSString
 @param key NSString
 @param uploadId NSString
 */
-(id) initWithBucketName:(NSString * ) bucketName key:(NSString*) key uploadId:(NSString*)uploadId;
/**
 静态初始化方法 返回autorelease 对象
 @param bucketName NSString
 @param key NSString
 @param uploadId NSString
 */
+(id) InitiateMultipartUploadResultWithBucketName:(NSString * ) bucketName key:(NSString*) key uploadId:(NSString*)uploadId;
@end
/**
 InitiateMultipartUploadResult XMLData分类
 */
@interface InitiateMultipartUploadResult(XMLData)
/**
 初始化方法 使用XMLdata 初始化
 @param data NSData
 */
-(id) initWithXMLData:(NSData*)data;
@end


text:
package com.zimbra.soap.admin.type;

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

import com.zimbra.common.soap.AccountConstants;
import com.zimbra.soap.admin.type.AdminAttrsImpl;

@XmlAccessorType(XmlAccessType.NONE)
public class DataSourceSpecifier extends AdminAttrsImpl {

    /**
     * @zm-api-field-tag data-source-type
     * @zm-api-field-description Data source type
     */
    @XmlAttribute(name=AccountConstants.A_TYPE, required=true)
    private final DataSourceType type;

    /**
     * @zm-api-field-tag data-source-name
     * @zm-api-field-description Data source name
     */
    @XmlAttribute(name=AccountConstants.A_NAME, required=true)
    private final String name;

    /**
     * no-argument constructor wanted by JAXB
     */
    @SuppressWarnings("unused")
    private DataSourceSpecifier() {
        this((DataSourceType) null, (String) null);
    }

    public DataSourceSpecifier(DataSourceType type, String name) {
        this.type = type;
        this.name = name;
    }

    public DataSourceType getType() { return type; }
    public String getName() { return name; }
}


text:
layout: default
title: Presentations
---

Presentation Downloads:

Dwarf Fortress

Git

Ruby on Rails


text:
module ApplicationHelper
  def my_new_session_path
  	new_<%= @model_name.underscore %>_session_path
  end
  def my_new_registration_path
  	new_<%= @model_name.underscore %>_registration_path
  end
  def my_destroy_session_path
  	destroy_<%= @model_name.underscore %>_session_path
  end
end


text:
/**
 * generated by Xtext 2.10.0
 */
package robotcontrol.roc.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import robotcontrol.roc.Direction;
import robotcontrol.roc.RocPackage;

/**
 *
 * An implementation of the model object 'Direction'.
 *
 *

 * The following features are implemented:
 *

 *

 *
{@link robotcontrol.roc.impl.DirectionImpl#getUP UP}

 *
{@link robotcontrol.roc.impl.DirectionImpl#getDOWN DOWN}

 *
{@link robotcontrol.roc.impl.DirectionImpl#getLEFT LEFT}

 *
{@link robotcontrol.roc.impl.DirectionImpl#getRIGHT RIGHT}

 *

 *
 * @generated
 */
public class DirectionImpl extends MinimalEObjectImpl.Container implements Direction
{
  /**
   * The default value of the '{@link #getUP() UP}' attribute.
   *
   *
   * @see #getUP()
   * @generated
   * @ordered
   */
  protected static final String UP_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getUP() UP}' attribute.
   *
   *
   * @see #getUP()
   * @generated
   * @ordered
   */
  protected String up = UP_EDEFAULT;

  /**
   * The default value of the '{@link #getDOWN() DOWN}' attribute.
   *
   *
   * @see #getDOWN()
   * @generated
   * @ordered
   */
  protected static final String DOWN_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDOWN() DOWN}' attribute.
   *
   *
   * @see #getDOWN()
   * @generated
   * @ordered
   */
  protected String down = DOWN_EDEFAULT;

  /**
   * The default value of the '{@link #getLEFT() LEFT}' attribute.
   *
   *
   * @see #getLEFT()
   * @generated
   * @ordered
   */
  protected static final String LEFT_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getLEFT() LEFT}' attribute.
   *
   *
   * @see #getLEFT()
   * @generated
   * @ordered
   */
  protected String left = LEFT_EDEFAULT;

  /**
   * The default value of the '{@link #getRIGHT() RIGHT}' attribute.
   *
   *
   * @see #getRIGHT()
   * @generated
   * @ordered
   */
  protected static final String RIGHT_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getRIGHT() RIGHT}' attribute.
   *
   *
   * @see #getRIGHT()
   * @generated
   * @ordered
   */
  protected String right = RIGHT_EDEFAULT;

  /**
   *
   *
   * @generated
   */
  protected DirectionImpl()
  {
    super();
  }

  /**
   *
   *
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return RocPackage.Literals.DIRECTION;
  }

  /**
   *
   *
   * @generated
   */
  public String getUP()
  {
    return up;
  }

  /**
   *
   *
   * @generated
   */
  public void setUP(String newUP)
  {
    String oldUP = up;
    up = newUP;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, RocPackage.DIRECTION__UP, oldUP, up));
  }

  /**
   *
   *
   * @generated
   */
  public String getDOWN()
  {
    return down;
  }

  /**
   *
   *
   * @generated
   */
  public void setDOWN(String newDOWN)
  {
    String oldDOWN = down;
    down = newDOWN;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, RocPackage.DIRECTION__DOWN, oldDOWN, down));
  }

  /**
   *
   *
   * @generated
   */
  public String getLEFT()
  {
    return left;
  }

  /**
   *
   *
   * @generated
   */
  public void setLEFT(String newLEFT)
  {
    String oldLEFT = left;
    left = newLEFT;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, RocPackage.DIRECTION__LEFT, oldLEFT, left));
  }

  /**
   *
   *
   * @generated
   */
  public String getRIGHT()
  {
    return right;
  }

  /**
   *
   *
   * @generated
   */
  public void setRIGHT(String newRIGHT)
  {
    String oldRIGHT = right;
    right = newRIGHT;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, RocPackage.DIRECTION__RIGHT, oldRIGHT, right));
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case RocPackage.DIRECTION__UP:
        return getUP();
      case RocPackage.DIRECTION__DOWN:
        return getDOWN();
      case RocPackage.DIRECTION__LEFT:
        return getLEFT();
      case RocPackage.DIRECTION__RIGHT:
        return getRIGHT();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case RocPackage.DIRECTION__UP:
        setUP((String)newValue);
        return;
      case RocPackage.DIRECTION__DOWN:
        setDOWN((String)newValue);
        return;
      case RocPackage.DIRECTION__LEFT:
        setLEFT((String)newValue);
        return;
      case RocPackage.DIRECTION__RIGHT:
        setRIGHT((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case RocPackage.DIRECTION__UP:
        setUP(UP_EDEFAULT);
        return;
      case RocPackage.DIRECTION__DOWN:
        setDOWN(DOWN_EDEFAULT);
        return;
      case RocPackage.DIRECTION__LEFT:
        setLEFT(LEFT_EDEFAULT);
        return;
      case RocPackage.DIRECTION__RIGHT:
        setRIGHT(RIGHT_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case RocPackage.DIRECTION__UP:
        return UP_EDEFAULT == null ? up != null : !UP_EDEFAULT.equals(up);
      case RocPackage.DIRECTION__DOWN:
        return DOWN_EDEFAULT == null ? down != null : !DOWN_EDEFAULT.equals(down);
      case RocPackage.DIRECTION__LEFT:
        return LEFT_EDEFAULT == null ? left != null : !LEFT_EDEFAULT.equals(left);
      case RocPackage.DIRECTION__RIGHT:
        return RIGHT_EDEFAULT == null ? right != null : !RIGHT_EDEFAULT.equals(right);
    }
    return super.eIsSet(featureID);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (UP: ");
    result.append(up);
    result.append(", DOWN: ");
    result.append(down);
    result.append(", LEFT: ");
    result.append(left);
    result.append(", RIGHT: ");
    result.append(right);
    result.append(')');
    return result.toString();
  }

} //DirectionImpl


text:
/*
 ONOS GUI -- Main Application Module
 */

(function () {
    'use strict';

    // define core module dependencies here...
    var coreDependencies = [
        'ngRoute',
        'onosMast',
        'onosNav',
        'onosUtil',
        'onosSvg',
        'onosRemote',
        'onosLayer',
        'onosWidget'
    ];

    // view IDs.. note the first view listed is loaded at startup
    var viewIds = [
        // {INJECTED-VIEW-IDS-START}
        'topo',
        'device',
        'flow',
        'port',
        'group',
        'host',
        'app',
        'intent',
        'cluster',
        'link',
        // {INJECTED-VIEW-IDS-END}

        // dummy entry
        ''
    ];

    var viewDependencies = [];

    viewIds.forEach(function (id) {
        if (id) {
            viewDependencies.push('ov' + capitalize(id));
        }
    });

    var moduleDependencies = coreDependencies.concat(viewDependencies);

    function capitalize(word) {
        return word ? word[0].toUpperCase() + word.slice(1) : word;
    }

    angular.module('onosApp', moduleDependencies)

        .controller('OnosCtrl', [
            '$log', '$scope', '$route', '$routeParams', '$location',
            'KeyService', 'ThemeService', 'GlyphService', 'VeilService',
            'PanelService', 'FlashService', 'QuickHelpService',
            'WebSocketService',

            function ($log, $scope, $route, $routeParams, $location,
                      ks, ts, gs, vs, ps, flash, qhs, wss) {
                var self = this;

                self.$route = $route;
                self.$routeParams = $routeParams;
                self.$location = $location;
                self.version = '1.2.0';

                // shared object inherited by all views:
                $scope.onos = {};

                // initialize services...
                ts.init();
                ks.installOn(d3.select('body'));
                ks.bindQhs(qhs);
                gs.init();
                vs.init();
                ps.init();
                flash.initFlash();
                qhs.initQuickHelp();

                // TODO: register handler for user settings, etc.

                wss.createWebSocket({
                    wsport: $location.search().wsport
                });

                $log.log('OnosCtrl has been created');

                $log.debug('route: ', self.$route);
                $log.debug('routeParams: ', self.$routeParams);
                $log.debug('location: ', self.$location);
            }])

        .config(['$routeProvider', function ($routeProvider) {
            // If view ID not provided, route to the first view in the list.
            $routeProvider
                .otherwise({
                    redirectTo: '/topo'
                });

            function viewCtrlName(vid) {
                return 'Ov' + capitalize(vid) + 'Ctrl';
            }

            function viewTemplateUrl(vid) {
                return 'app/view/' + vid + '/' + vid + '.html';
            }

            // Add routes for each defined view.
            viewIds.forEach(function (vid) {
                if (vid) {
                    $routeProvider.when('/' + vid, {
                        controller: viewCtrlName(vid),
                        controllerAs: 'ctrl',
                        templateUrl: viewTemplateUrl(vid)
                    });
                }
            });
        }])

        .directive('detectBrowser', ['$log', 'FnService',
            function ($log, fs) {
                return function (scope) {
                    var body = d3.select('body'),
                        browser = '';
                    if (fs.isChrome()) {
                        browser = 'chrome';
                    } else if (fs.isSafari()) {
                        browser = 'safari';
                    } else if (fs.isFirefox()) {
                        browser = 'firefox';
                    }
                    body.classed(browser, true);
                    scope.onos.browser = browser;

                    if (fs.isMobile()) {
                        body.classed('mobile', true);
                        scope.onos.mobile = true;
                    }

                    $log.debug('Detected browser is', fs.cap(browser));
                };
        }]);
}());


text:
import '@angular/platform-browser-dynamic';
import '@angular/platform-browser';
import '@angular/core';
import '@angular/http';
import '@angular/router';


text:
from werkzeug import security
from flask import json
import os, base64, ssl

basedir = os.path.abspath(os.path.dirname(__file__))

class Config:
    SECRET_KEY = security.gen_salt(32)
    DEBUG = False
    TESTING = False
    URLLIB_REQUEST_DEBUG_LEVEL = 0

    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_RECORD_QUERIES = True

class DevelopmentConfig(Config):
    DEBUG = True
    URLLIB_REQUEST_DEBUG_LEVEL = 1

    PROTOCOL = 'http'
    CONTEXT = ssl._create_unverified_context()

    SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
        'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')

    UAA_URL = '<UAA_TARGET>'
    CLIENT_ID = '<UAA_CLIENT_ID>'
    CLIENT_SECRET = '<UAA_CLIENT_SECRET>'

class PredixConfig(Config):
    PROTOCOL = 'https'
    CONTEXT = ssl._create_default_https_context()

    if os.getenv('VCAP_SERVICES'):
        UAA_URL = json.loads(os.getenv('VCAP_SERVICES'))['predix-uaa'][0]['credentials']['uri']
        CLIENT_ID, CLIENT_SECRET = base64.b64decode(bytes(os.getenv('base64ClientCredential'), 'utf-8')).decode().split(':')


text:
package org.slf4j.impl;

import org.slf4j.helpers.NOPMDCAdapter;

/**
 * The binding for {@link org.slf4j.spi.MDCAdapter MDCAdapter}.
 *
 * @see NOPMDCAdapter
 */
public final class StaticMDCBinder {

	/**
	 * Unique instance of static MDC binder
	 */
	public static final StaticMDCBinder SINGLETON = new StaticMDCBinder();

	private static final String mdcAdapterClassName = NOPMDCAdapter.class.getName();

	private StaticMDCBinder() {
	}

	/**
	 * Get the MDC adapter.
	 *
	 * @return MDC adapter
	 */
	public NOPMDCAdapter getMDCA() {
		return new NOPMDCAdapter();
	}

	/**
	 * Get the class name of the MDC adapter.
	 *
	 * @return Class name of the MDC adapter
	 */
	public String getMDCAdapterClassStr() {
		return mdcAdapterClassName;
	}

}


text:
import {AnimationEvent} from '@angular/animations';
import {AriaDescriber, FocusMonitor} from '@angular/cdk/a11y';
import {Directionality} from '@angular/cdk/bidi';
import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {ESCAPE} from '@angular/cdk/keycodes';
import {
  ConnectionPositionPair,
  HorizontalConnectionPos,
  OriginConnectionPosition,
  Overlay,
  ScrollDispatcher,
  OverlayConnectionPosition,
  OverlayRef,
  RepositionScrollStrategy,
  ScrollStrategy,
  VerticalConnectionPos,
  ConnectedPositionStrategy,
} from '@angular/cdk/overlay';
import {Platform} from '@angular/cdk/platform';
import {ComponentPortal} from '@angular/cdk/portal';
import {take} from 'rxjs/operators/take';
import {filter} from 'rxjs/operators/filter';
import {
  ChangeDetectionStrategy,
  ChangeDetectorRef,
  Component,
  Directive,
  ElementRef,
  Inject,
  InjectionToken,
  Input,
  NgZone,
  OnDestroy,
  Optional,
  ViewContainerRef,
  ViewEncapsulation,
} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {Subject} from 'rxjs/Subject';
import {matTooltipAnimations} from './tooltip-animations';
import {BreakpointObserver, Breakpoints, BreakpointState} from '@angular/cdk/layout';

export type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | 'after';

/** Time in ms to throttle repositioning after scroll events. */
export const SCROLL_THROTTLE_MS = 20;

/** CSS class that will be attached to the overlay panel. */
export const TOOLTIP_PANEL_CLASS = 'mat-tooltip-panel';

/** Creates an error to be thrown if the user supplied an invalid tooltip position. */
export function getMatTooltipInvalidPositionError(position: string) {
  return Error(`Tooltip position "${position}" is invalid.`);
}

/** Injection token that determines the scroll handling while a tooltip is visible. */
export const MAT_TOOLTIP_SCROLL_STRATEGY =
    new InjectionToken<() => ScrollStrategy>('mat-tooltip-scroll-strategy');

/** @docs-private */
export function MAT_TOOLTIP_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay):
    () => RepositionScrollStrategy {
  return () => overlay.scrollStrategies.reposition({ scrollThrottle: SCROLL_THROTTLE_MS });
}

/** @docs-private */
export const MAT_TOOLTIP_SCROLL_STRATEGY_PROVIDER = {
  provide: MAT_TOOLTIP_SCROLL_STRATEGY,
  deps: [Overlay],
  useFactory: MAT_TOOLTIP_SCROLL_STRATEGY_PROVIDER_FACTORY
};

/** Default `matTooltip` options that can be overridden. */
export interface MatTooltipDefaultOptions {
  showDelay: number;
  hideDelay: number;
  touchendHideDelay: number;
}

/** Injection token to be used to override the default options for `matTooltip`. */
export const MAT_TOOLTIP_DEFAULT_OPTIONS =
    new InjectionToken<MatTooltipDefaultOptions>('mat-tooltip-default-options');

/**
 * Directive that attaches a material design tooltip to the host element. Animates the showing and
 * hiding of a tooltip provided position (defaults to below the element).
 *
 * https://material.google.com/components/tooltips.html
 */
@Directive({
  selector: '[matTooltip]',
  exportAs: 'matTooltip',
  host: {
    '(longpress)': 'show()',
    '(keydown)': '_handleKeydown($event)',
    '(touchend)': '_handleTouchend()',
  },
})
export class MatTooltip implements OnDestroy {
  _overlayRef: OverlayRef | null;
  _tooltipInstance: TooltipComponent | null;

  private _portal: ComponentPortal<TooltipComponent>;
  private _position: TooltipPosition = 'below';
  private _disabled: boolean = false;
  private _tooltipClass: string|string[]|Set<string>|{[key: string]: any};

  /** Allows the user to define the position of the tooltip relative to the parent element */
  @Input('matTooltipPosition')
  get position(): TooltipPosition { return this._position; }
  set position(value: TooltipPosition) {
    if (value !== this._position) {
      this._position = value;

      if (this._overlayRef) {
        // TODO(andrewjs): When the overlay's position can be
        // dynamically changed, do not destroy the tooltip.
        this._detach();
        this._updatePosition();
      }
    }
  }

  /** Disables the display of the tooltip. */
  @Input('matTooltipDisabled')
  get disabled(): boolean { return this._disabled; }
  set disabled(value) {
    this._disabled = coerceBooleanProperty(value);

    // If tooltip is disabled, hide immediately.
    if (this._disabled) {
      this.hide(0);
    }
  }

  /**
   * @deprecated
   * @deletion-target 6.0.0
   */
  @Input('tooltip-position')
  get _positionDeprecated(): TooltipPosition { return this._position; }
  set _positionDeprecated(value: TooltipPosition) { this._position = value; }

  /** The default delay in ms before showing the tooltip after show is called */
  @Input('matTooltipShowDelay') showDelay =
      this._defaultOptions ? this._defaultOptions.showDelay : 0;

  /** The default delay in ms before hiding the tooltip after hide is called */
  @Input('matTooltipHideDelay') hideDelay =
      this._defaultOptions ? this._defaultOptions.hideDelay : 0;

  private _message = '';

  /** The message to be displayed in the tooltip */
  @Input('matTooltip')
  get message() { return this._message; }
  set message(value: string) {
    this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this._message);

    // If the message is not a string (e.g. number), convert it to a string and trim it.
    this._message = value != null ? `${value}`.trim() : '';

    if (!this._message && this._isTooltipVisible()) {
      this.hide(0);
    } else {
      this._updateTooltipMessage();
      this._ariaDescriber.describe(this._elementRef.nativeElement, this.message);
    }
  }

  /** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */
  @Input('matTooltipClass')
  get tooltipClass() { return this._tooltipClass; }
  set tooltipClass(value: string|string[]|Set<string>|{[key: string]: any}) {
    this._tooltipClass = value;
    if (this._tooltipInstance) {
      this._setTooltipClass(this._tooltipClass);
    }
  }

  private _manualListeners = new Map<string, Function>();

  constructor(
    private _overlay: Overlay,
    private _elementRef: ElementRef,
    private _scrollDispatcher: ScrollDispatcher,
    private _viewContainerRef: ViewContainerRef,
    private _ngZone: NgZone,
    private _platform: Platform,
    private _ariaDescriber: AriaDescriber,
    private _focusMonitor: FocusMonitor,
    @Inject(MAT_TOOLTIP_SCROLL_STRATEGY) private _scrollStrategy,
    @Optional() private _dir: Directionality,
    @Optional() @Inject(MAT_TOOLTIP_DEFAULT_OPTIONS)
      private _defaultOptions?: MatTooltipDefaultOptions) {

    // TODO(crisbeto): make the `_defaultOptions` a required param next time we do breaking changes.
    // @deletion-target 6.0.0

    const element: HTMLElement = _elementRef.nativeElement;

    // The mouse events shouldn't be bound on iOS devices, because
    // they can prevent the first tap from firing its click event.
    if (!_platform.IOS) {
      this._manualListeners.set('mouseenter', () => this.show());
      this._manualListeners.set('mouseleave', () => this.hide());

      this._manualListeners
        .forEach((listener, event) => _elementRef.nativeElement.addEventListener(event, listener));
    } else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
      // When we bind a gesture event on an element (in this case `longpress`), HammerJS
      // will add some inline styles by default, including `user-select: none`. This is
      // problematic on iOS, because it will prevent users from typing in inputs. If
      // we're on iOS and the tooltip is attached on an input or textarea, we clear
      // the `user-select` to avoid these issues.
      element.style.webkitUserSelect = element.style.userSelect = '';
    }

    _focusMonitor.monitor(element).subscribe(origin => {
      // Note that the focus monitor runs outside the Angular zone.
      if (!origin) {
        _ngZone.run(() => this.hide(0));
      } else if (origin !== 'program') {
        _ngZone.run(() => this.show());
      }
    });
  }

  /**
   * Dispose the tooltip when destroyed.
   */
  ngOnDestroy() {
    if (this._overlayRef) {
      this._overlayRef.dispose();
      this._tooltipInstance = null;
    }

    // Clean up the event listeners set in the constructor
    if (!this._platform.IOS) {
      this._manualListeners.forEach((listener, event) =>
        this._elementRef.nativeElement.removeEventListener(event, listener));

      this._manualListeners.clear();
    }

    this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this.message);
    this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
  }

  /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
  show(delay: number = this.showDelay): void {
    if (this.disabled || !this.message) { return; }

    const overlayRef = this._createOverlay();

    this._detach();
    this._portal = this._portal || new ComponentPortal(TooltipComponent, this._viewContainerRef);
    this._tooltipInstance = overlayRef.attach(this._portal).instance;
    this._tooltipInstance.afterHidden().subscribe(() => this._detach());
    this._setTooltipClass(this._tooltipClass);
    this._updateTooltipMessage();
    this._tooltipInstance!.show(this._position, delay);
  }

  /** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */
  hide(delay: number = this.hideDelay): void {
    if (this._tooltipInstance) {
      this._tooltipInstance.hide(delay);
    }
  }

  /** Shows/hides the tooltip */
  toggle(): void {
    this._isTooltipVisible() ? this.hide() : this.show();
  }

  /** Returns true if the tooltip is currently visible to the user */
  _isTooltipVisible(): boolean {
    return !!this._tooltipInstance && this._tooltipInstance.isVisible();
  }

  /** Handles the keydown events on the host element. */
  _handleKeydown(e: KeyboardEvent) {
    if (this._isTooltipVisible() && e.keyCode === ESCAPE) {
      e.stopPropagation();
      this.hide(0);
    }
  }

  /** Handles the touchend events on the host element. */
  _handleTouchend() {
    this.hide(this._defaultOptions ? this._defaultOptions.touchendHideDelay : 1500);
  }

  /** Create the overlay config and position strategy */
  private _createOverlay(): OverlayRef {
    if (this._overlayRef) {
      return this._overlayRef;
    }

    const origin = this._getOrigin();
    const overlay = this._getOverlayPosition();

    // Create connected position strategy that listens for scroll events to reposition.
    const strategy = this._overlay
      .position()
      .connectedTo(this._elementRef, origin.main, overlay.main)
      .withFallbackPosition(origin.fallback, overlay.fallback)
      .withScrollableContainers(
        this._scrollDispatcher.getAncestorScrollContainers(this._elementRef)
      );

    strategy.onPositionChange.pipe(filter(() => !!this._tooltipInstance)).subscribe(change => {
      if (change.scrollableViewProperties.isOverlayClipped && this._tooltipInstance!.isVisible()) {
        // After position changes occur and the overlay is clipped by
        // a parent scrollable then close the tooltip.
        this._ngZone.run(() => this.hide(0));
      } else {
        // Otherwise recalculate the origin based on the new position.
        this._tooltipInstance!._setTransformOrigin(change.connectionPair);
      }
    });

    this._overlayRef = this._overlay.create({
      direction: this._dir ? this._dir.value : 'ltr',
      positionStrategy: strategy,
      panelClass: TOOLTIP_PANEL_CLASS,
      scrollStrategy: this._scrollStrategy()
    });

    this._overlayRef.detachments().subscribe(() => this._detach());

    return this._overlayRef;
  }

  /** Detaches the currently-attached tooltip. */
  private _detach() {
    if (this._overlayRef && this._overlayRef.hasAttached()) {
      this._overlayRef.detach();
    }

    this._tooltipInstance = null;
  }

  /** Updates the position of the current tooltip. */
  private _updatePosition() {
    const position = this._overlayRef!.getConfig().positionStrategy as ConnectedPositionStrategy;
    const origin = this._getOrigin();
    const overlay = this._getOverlayPosition();

    position
      .withPositions([])
      .withFallbackPosition(origin.main, overlay.main)
      .withFallbackPosition(origin.fallback, overlay.fallback);
  }

  /**
   * Returns the origin position and a fallback position based on the user's position preference.
   * The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
   */
  _getOrigin(): {main: OriginConnectionPosition, fallback: OriginConnectionPosition} {
    const isDirectionLtr = !this._dir || this._dir.value == 'ltr';
    let position: OriginConnectionPosition;

    if (this.position == 'above' || this.position == 'below') {
      position = {originX: 'center', originY: this.position == 'above' ? 'top' : 'bottom'};
    } else if (this.position == 'left' ||
               this.position == 'before' && isDirectionLtr ||
               this.position == 'after' && !isDirectionLtr) {
      position = {originX: 'start', originY: 'center'};
    } else if (this.position == 'right' ||
               this.position == 'after' && isDirectionLtr ||
               this.position == 'before' && !isDirectionLtr) {
      position = {originX: 'end', originY: 'center'};
    } else {
      throw getMatTooltipInvalidPositionError(this.position);
    }

    const {x, y} = this._invertPosition(position.originX, position.originY);

    return {
      main: position,
      fallback: {originX: x, originY: y}
    };
  }

  /** Returns the overlay position and a fallback position based on the user's preference */
  _getOverlayPosition(): {main: OverlayConnectionPosition, fallback: OverlayConnectionPosition} {
    const isLtr = !this._dir || this._dir.value == 'ltr';
    let position: OverlayConnectionPosition;

    if (this.position == 'above') {
      position = {overlayX: 'center', overlayY: 'bottom'};
    } else if (this.position == 'below') {
      position = {overlayX: 'center', overlayY: 'top'};
    } else if (this.position == 'left' ||
               this.position == 'before' && isLtr ||
               this.position == 'after' && !isLtr) {
      position = {overlayX: 'end', overlayY: 'center'};
    } else if (this.position == 'right' ||
               this.position == 'after' && isLtr ||
               this.position == 'before' && !isLtr) {
      position = {overlayX: 'start', overlayY: 'center'};
    } else {
      throw getMatTooltipInvalidPositionError(this.position);
    }

    const {x, y} = this._invertPosition(position.overlayX, position.overlayY);

    return {
      main: position,
      fallback: {overlayX: x, overlayY: y}
    };
  }

  /** Updates the tooltip message and repositions the overlay according to the new message length */
  private _updateTooltipMessage() {
    // Must wait for the message to be painted to the tooltip so that the overlay can properly
    // calculate the correct positioning based on the size of the text.
    if (this._tooltipInstance) {
      this._tooltipInstance.message = this.message;
      this._tooltipInstance._markForCheck();

      this._ngZone.onMicrotaskEmpty.asObservable().pipe(take(1)).subscribe(() => {
        if (this._tooltipInstance) {
          this._overlayRef!.updatePosition();
        }
      });
    }
  }

  /** Updates the tooltip class */
  private _setTooltipClass(tooltipClass: string|string[]|Set<string>|{[key: string]: any}) {
    if (this._tooltipInstance) {
      this._tooltipInstance.tooltipClass = tooltipClass;
      this._tooltipInstance._markForCheck();
    }
  }

  /** Inverts an overlay position. */
  private _invertPosition(x: HorizontalConnectionPos, y: VerticalConnectionPos) {
    if (this.position === 'above' || this.position === 'below') {
      if (y === 'top') {
        y = 'bottom';
      } else if (y === 'bottom') {
        y = 'top';
      }
    } else {
      if (x === 'end') {
        x = 'start';
      } else if (x === 'start') {
        x = 'end';
      }
    }

    return {x, y};
  }
}

export type TooltipVisibility = 'initial' | 'visible' | 'hidden';

/**
 * Internal component that wraps the tooltip's content.
 * @docs-private
 */
@Component({
  moduleId: module.id,
  selector: 'mat-tooltip-component',
  templateUrl: 'tooltip.html',
  styleUrls: ['tooltip.css'],
  encapsulation: ViewEncapsulation.None,
  preserveWhitespaces: false,
  changeDetection: ChangeDetectionStrategy.OnPush,
  animations: [matTooltipAnimations.tooltipState],
  host: {
    // Forces the element to have a layout in IE and Edge. This fixes issues where the element
    // won't be rendered if the animations are disabled or there is no web animations polyfill.
    '[style.zoom]': '_visibility === "visible" ? 1 : null',
    '(body:click)': 'this._handleBodyInteraction()',
    'aria-hidden': 'true',
  }
})
export class TooltipComponent {
  /** Message to display in the tooltip */
  message: string;

  /** Classes to be added to the tooltip. Supports the same syntax as `ngClass`. */
  tooltipClass: string|string[]|Set<string>|{[key: string]: any};

  /** The timeout ID of any current timer set to show the tooltip */
  _showTimeoutId: number;

  /** The timeout ID of any current timer set to hide the tooltip */
  _hideTimeoutId: number;

  /** Property watched by the animation framework to show or hide the tooltip */
  _visibility: TooltipVisibility = 'initial';

  /** Whether interactions on the page should close the tooltip */
  private _closeOnInteraction: boolean = false;

  /** The transform origin used in the animation for showing and hiding the tooltip */
  _transformOrigin: 'top' | 'bottom' | 'left' | 'right' = 'bottom';

  /** Current position of the tooltip. */
  private _position: TooltipPosition;

  /** Subject for notifying that the tooltip has been hidden from the view */
  private readonly _onHide: Subject<any> = new Subject();

  /** Stream that emits whether the user has a handset-sized display.  */
  _isHandset: Observable<BreakpointState> = this._breakpointObserver.observe(Breakpoints.Handset);

  constructor(
    private _changeDetectorRef: ChangeDetectorRef,
    private _breakpointObserver: BreakpointObserver) {}

  /**
   * Shows the tooltip with an animation originating from the provided origin
   * @param position Position of the tooltip.
   * @param delay Amount of milliseconds to the delay showing the tooltip.
   */
  show(position: TooltipPosition, delay: number): void {
    // Cancel the delayed hide if it is scheduled
    if (this._hideTimeoutId) {
      clearTimeout(this._hideTimeoutId);
    }

    // Body interactions should cancel the tooltip if there is a delay in showing.
    this._closeOnInteraction = true;
    this._position = position;
    this._showTimeoutId = setTimeout(() => {
      this._visibility = 'visible';

      // Mark for check so if any parent component has set the
      // ChangeDetectionStrategy to OnPush it will be checked anyways
      this._markForCheck();
    }, delay);
  }

  /**
   * Begins the animation to hide the tooltip after the provided delay in ms.
   * @param delay Amount of milliseconds to delay showing the tooltip.
   */
  hide(delay: number): void {
    // Cancel the delayed show if it is scheduled
    if (this._showTimeoutId) {
      clearTimeout(this._showTimeoutId);
    }

    this._hideTimeoutId = setTimeout(() => {
      this._visibility = 'hidden';

      // Mark for check so if any parent component has set the
      // ChangeDetectionStrategy to OnPush it will be checked anyways
      this._markForCheck();
    }, delay);
  }

  /** Returns an observable that notifies when the tooltip has been hidden from view. */
  afterHidden(): Observable<void> {
    return this._onHide.asObservable();
  }

  /** Whether the tooltip is being displayed. */
  isVisible(): boolean {
    return this._visibility === 'visible';
  }

  /** Sets the tooltip transform origin according to the position of the tooltip overlay. */
  _setTransformOrigin(overlayPosition: ConnectionPositionPair) {
    const axis = (this._position === 'above' || this._position === 'below') ? 'Y' : 'X';
    const position = axis == 'X' ? overlayPosition.overlayX : overlayPosition.overlayY;

    if (position === 'top' || position === 'bottom') {
      this._transformOrigin = position;
    } else if (position === 'start') {
      this._transformOrigin = 'left';
    } else if (position === 'end') {
      this._transformOrigin = 'right';
    } else {
      throw getMatTooltipInvalidPositionError(this._position);
    }
  }

  _animationStart() {
    this._closeOnInteraction = false;
  }

  _animationDone(event: AnimationEvent): void {
    const toState = event.toState as TooltipVisibility;

    if (toState === 'hidden' && !this.isVisible()) {
      this._onHide.next();
    }

    if (toState === 'visible' || toState === 'hidden') {
      this._closeOnInteraction = true;
    }
  }

  /**
   * Interactions on the HTML body should close the tooltip immediately as defined in the
   * material design spec.
   * https://material.google.com/components/tooltips.html#tooltips-interaction
   */
  _handleBodyInteraction(): void {
    if (this._closeOnInteraction) {
      this.hide(0);
    }
  }

  /**
   * Marks that the tooltip needs to be checked in the next change detection run.
   * Mainly used for rendering the initial text before positioning a tooltip, which
   * can be problematic in components with OnPush change detection.
   */
  _markForCheck(): void {
    this._changeDetectorRef.markForCheck();
  }
}


text:
import any from '@travi/any';

function buildWebhookPayload(event, {statusEventDetails, checkRunEventDetails, repoFullName, repoName, sha}) {
  if ('status' === event) {
    return {
      state: statusEventDetails.state,
      sha,
      repository: {
        full_name: repoFullName,
        name: repoName,
        owner: {
          login: statusEventDetails.repoOwner
        }
      },
      ...statusEventDetails.branches && {branches: statusEventDetails.branches.map(branch => ({name: branch}))}
    };
  }

  if ('check_run' === event) {
    return {
      action: checkRunEventDetails.status,
      check_run: {
        status: checkRunEventDetails.status,
        conclusion: checkRunEventDetails.conclusion,
        check_suite: {
          head_sha: sha,
          head_branch: checkRunEventDetails.branch,
          pull_requests: checkRunEventDetails.prLink
            ? [{url: checkRunEventDetails.prLink, number: checkRunEventDetails.prNumber}]
            : []
        }
      },
      repository: {
        full_name: repoFullName,
        name: repoName,
        owner: {
          login: checkRunEventDetails.repoOwner
        }
      }
    };
  }

  return {};
}

export function World() {
  this.githubToken = any.word();
  this.sha = any.word();
  this.prNumber = any.integer();
  this.repoOwner = any.word();
  this.repoName = any.word();
  this.repoFullName = `${this.repoOwner}/${this.repoName}`;

  this.receiveWebhook = ({event, statusEventDetails, checkRunEventDetails}) => this.server.inject({
    method: 'POST',
    url: '/payload',
    headers: {
      'X-GitHub-Event': event
    },
    payload: buildWebhookPayload(
      event,
      {
        statusEventDetails,
        checkRunEventDetails,
        sha: this.sha,
        repoFullName: this.repoFullName,
        repoName: this.repoName
      }
    )
  });

  this.getResponseStatus = () => this.serverResponse.statusCode;
}


text:
FOUNDATION_EXPORT double CountryPickerVersionNumber;

//! Project version string for CountryPicker.
FOUNDATION_EXPORT const unsigned char CountryPickerVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CountryPicker/PublicHeader.h>


text:
/**
 * @file
 *   This file includes implementation of `FrameData`.
 */

#include "frame_data.hpp"

#include "common/code_utils.hpp"
#include "common/encoding.hpp"

namespace ot {

Error FrameData::ReadUint8(uint8_t &aUint8)
{
    return ReadBytes(&aUint8, sizeof(uint8_t));
}

Error FrameData::ReadBigEndianUint16(uint16_t &aUint16)
{
    Error error;

    SuccessOrExit(error = ReadBytes(&aUint16, sizeof(uint16_t)));
    aUint16 = Encoding::BigEndian::HostSwap16(aUint16);

exit:
    return error;
}

Error FrameData::ReadBigEndianUint32(uint32_t &aUint32)
{
    Error error;

    SuccessOrExit(error = ReadBytes(&aUint32, sizeof(uint32_t)));
    aUint32 = Encoding::BigEndian::HostSwap32(aUint32);

exit:
    return error;
}

Error FrameData::ReadLittleEndianUint16(uint16_t &aUint16)
{
    Error error;

    SuccessOrExit(error = ReadBytes(&aUint16, sizeof(uint16_t)));
    aUint16 = Encoding::LittleEndian::HostSwap16(aUint16);

exit:
    return error;
}

Error FrameData::ReadLittleEndianUint32(uint32_t &aUint32)
{
    Error error;

    SuccessOrExit(error = ReadBytes(&aUint32, sizeof(uint32_t)));
    aUint32 = Encoding::LittleEndian::HostSwap32(aUint32);

exit:
    return error;
}

Error FrameData::ReadBytes(void *aBuffer, uint16_t aLength)
{
    Error error = kErrorNone;

    VerifyOrExit(CanRead(aLength), error = kErrorParse);
    memcpy(aBuffer, GetBytes(), aLength);
    SkipOver(aLength);

exit:
    return error;
}

void FrameData::SkipOver(uint16_t aLength)
{
    Init(GetBytes() + aLength, GetLength() - aLength);
}

} // namespace ot


text:
class Profile;

namespace apps {

class AppRestoreService;

// Singleton that owns all AppRestoreServices and associates them with
// Profiles. Listens for the Profile's destruction notification and cleans up
// the associated AppRestoreService.
class AppRestoreServiceFactory : public BrowserContextKeyedServiceFactory {
 public:
  static AppRestoreService* GetForProfile(Profile* profile);

  static AppRestoreServiceFactory* GetInstance();

 private:
  friend struct base::DefaultSingletonTraits<AppRestoreServiceFactory>;

  AppRestoreServiceFactory();
  ~AppRestoreServiceFactory() override;

  // BrowserContextKeyedServiceFactory:
  KeyedService* BuildServiceInstanceFor(
      content::BrowserContext* profile) const override;
  bool ServiceIsCreatedWithBrowserContext() const override;
};

}  // namespace apps

#endif  // APPS_APP_RESTORE_SERVICE_FACTORY_H_


text:
_[www.codever.land/bookmarks/t/vscode-extensions](https://www.codever.land/bookmarks/t/vscode-extensions)_
---
#### [Extension Guidelines | Visual Studio Code Extension API](https://code.visualstudio.com/api/references/extension-guidelines)
_https://code.visualstudio.com/api/references/extension-guidelines_

These guidelines cover the best practices for creating Visual Studio Code extensions.

* **tags**: [vscode-extensions](../tagged/vscode-extensions.md)
---
#### [Extension Manifest | Visual Studio Code Extension API](https://code.visualstudio.com/api/references/extension-manifest)
_https://code.visualstudio.com/api/references/extension-manifest_

Every Visual Studio Code extension needs a manifest file `package.json` at the root of the extension directory structure.

* **tags**: [visual-studio-code](../tagged/visual-studio-code.md), [vscode-extensions](../tagged/vscode-extensions.md)
---
#### [Publishing Extensions | Visual Studio Code Extension API](https://code.visualstudio.com/api/working-with-extensions/publishing-extension)
_https://code.visualstudio.com/api/working-with-extensions/publishing-extension_

This topics covers:
- Using vsce, the CLI tool for managing VS Code extensions
- Packaging, publishing and unpublishing extensions
- Registering a publisherId necessary for publishing extensions

* **tags**: [visual-studio-code](../tagged/visual-studio-code.md), [vscode-extensions](../tagged/vscode-extensions.md)
---
#### [
        Markdown Emoji - Visual Studio Marketplace
    ](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-emoji)
_https://marketplace.visualstudio.com/items?itemName=bierner.markdown-emoji_

Extension for Visual Studio Code - Adds :emoji: syntax support to VS Code's built-in markdown preview
* **tags**: [vscode-extensions](../tagged/vscode-extensions.md), [emoji](../tagged/emoji.md)
* :octocat: **[source code](https://github.com/mjbvz/vscode-markdown-emoji)**
---
#### [Your First Visual Studio Code Extension - official docs](https://code.visualstudio.com/api/get-started/your-first-extension)
_https://code.visualstudio.com/api/get-started/your-first-extension_

In this topic, we'll teach you the fundamental concepts for building extensions.
* **tags**: [vscode](../tagged/vscode.md), [vscode-extensions](../tagged/vscode-extensions.md), [docs](../tagged/docs.md)
* :octocat: **[source code](https://github.com/microsoft/vscode-extension-samples/tree/master/helloworld-sample)**
---
#### [Your first Visual Studio Code Extension | medium article](https://medium.com/@rmmmsy/your-first-visual-studio-code-extension-ce8e040ba8ca)
_https://medium.com/@rmmmsy/your-first-visual-studio-code-extension-ce8e040ba8ca_

Step by step explanations how to create a simple extension to save gists. With links to the documentation for doing so.
* **tags**: [vscode-extensions](../tagged/vscode-extensions.md), [vs-code-extension](../tagged/vs-code-extension.md)
* :octocat: **[source code](https://github.com/ramsaylanier/vs-code-gist-generator)**
---


text:
'use strict';

/**
 * @ngdoc service
 * @name <%= appname %>.<%= constantname %>
 * @description
 * # <%= constantname %>
 * Constant in the <%= appname %>.
 */
angular.module('<%= appname %>')
  .constant('<%= constantname %>', <%= value %>);


text:
package flatbuf

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

/// Time is either a 32-bit or 64-bit signed integer type representing an
/// elapsed time since midnight, stored in either of four units: seconds,
/// milliseconds, microseconds or nanoseconds.
///
/// The integer `bitWidth` depends on the `unit` and must be one of the following:
/// * SECOND and MILLISECOND: 32 bits
/// * MICROSECOND and NANOSECOND: 64 bits
///
/// The allowed values are between 0 (inclusive) and 86400 (=24*60*60) seconds
/// (exclusive), adjusted for the time unit (for example, up to 86400000
/// exclusive for the MILLISECOND unit).
/// This definition doesn't allow for leap seconds. Time values from
/// measurements with leap seconds will need to be corrected when ingesting
/// into Arrow (for example by replacing the value 86400 with 86399).
type Time struct {
	_tab flatbuffers.Table
}

func GetRootAsTime(buf []byte, offset flatbuffers.UOffsetT) *Time {
	n := flatbuffers.GetUOffsetT(buf[offset:])
	x := &Time{}
	x.Init(buf, n+offset)
	return x
}

func (rcv *Time) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *Time) Table() flatbuffers.Table {
	return rcv._tab
}

func (rcv *Time) Unit() TimeUnit {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return TimeUnit(rcv._tab.GetInt16(o + rcv._tab.Pos))
	}
	return 1
}

func (rcv *Time) MutateUnit(n TimeUnit) bool {
	return rcv._tab.MutateInt16Slot(4, int16(n))
}

func (rcv *Time) BitWidth() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 32
}

func (rcv *Time) MutateBitWidth(n int32) bool {
	return rcv._tab.MutateInt32Slot(6, n)
}

func TimeStart(builder *flatbuffers.Builder) {
	builder.StartObject(2)
}
func TimeAddUnit(builder *flatbuffers.Builder, unit TimeUnit) {
	builder.PrependInt16Slot(0, int16(unit), 1)
}
func TimeAddBitWidth(builder *flatbuffers.Builder, bitWidth int32) {
	builder.PrependInt32Slot(1, bitWidth, 32)
}
func TimeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}


text:
sbscraper.transform package
===========================

Submodules
----------

sbscraper.transform.base module
-------------------------------

.. automodule:: sbscraper.transform.base
    :members:
    :undoc-members:
    :show-inheritance:

sbscraper.transform.lazada module
---------------------------------

.. automodule:: sbscraper.transform.lazada
    :members:
    :undoc-members:
    :show-inheritance:

sbscraper.transform.redmart module
----------------------------------

.. automodule:: sbscraper.transform.redmart
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: sbscraper.transform
    :members:
    :undoc-members:
    :show-inheritance:


text:
author: slowe
categories: Information
comments: true
date: 2020-10-02T14:00:00-07:00
tags:
- Networking
- Hardware
- Security
- Storage
- Virtualization
- DNS
- Kubernetes
- Android
- Cilium
- AWS
- Linux
- Windows
- Microsoft
- Git
- SSH
- vSphere
- VMware
title: 'Technology Short Take 131'
url: /2020/10/02/technology-short-take-131/
---

Welcome to Technology Short Take #131! I'm back with another collection of articles on various data center technologies. This time around the content is a tad heavy on the security side, but I've still managed to pull in articles on networking, cloud computing, applications, and some programming-related content. Here's hoping you find something useful here!<!--more-->

## Networking

* [This recent Ars Technica article][link-3] points out that a feature in Chromium---the open source project leveraged by Chrome and Edge, among others---is having a significant impact on root DNS traffic. More technical details can be found in [an associated APNIC blog post][link-4].
* Here's [a few details][link-11] around Open Service Mesh.
* Quentin Machu outlines a series of problems his company experienced using Weave Net as the CNI for their Kubernetes clusters, as well as describes the migration process to a new CNI. [His blog post][link-18] is well worth a read, IMO.

## Security

* I thought I'd mentioned this already, but there's [a flaw in a Snapdragon chip that puts greater than 1 billion Android phones at risk][link-8], according to Ars Technica.
* Jed Salazar of Isovalent (the company behind Cilium) has [a fairly detailed article][link-12] showing some examples of how Cilium protects against certain network attacks.
* Via [this post by Ivan Pepelnjak][link-15], I found [Nadeem Lughmani's GitHub repository][link-16] aimed to helping to secure one's public cloud deployment.
* Here's [a review of targeted attacks and APTs (advanced persistent threats) on Linux][link-20].
* A _significant_ flaw in Microsoft's Netlogon protocol has been discovered, potentially exposing privilege escalation to Domain Admin. More details are found in [this article][link-25]. The "TL;DR" is you should patch your domain controller "as fast as possible."
* Here's [a quick review of various sandboxing and workload isolation mechanisms][link-29] out there. The article doesn't go deep on any of them, but does provide some useful information and comparison of the various mechanisms.

## Cloud Computing/Cloud Management

* Joaquín Menchaca shares a couple of posts related to EKS---first there's an article on [creating an Amazon VPC for EKS][link-6], followed by an article on [using `eksctl` to create an EKS cluster in said pre-created VPC][link-7].
* Oh, and while we are on the topic of EKS---here's an article by AWS on [using Gatekeeper as a drop-in replacement for Pod Security Policies][link-26], and here's one (also by AWS) on [using Auto Scaling Groups in multiple AZs in Kubernetes][link-27].
* Colin Walters [lays out the arguments against the use of "immutable."][link-10] I get the arguments, but in my humble opinion this is kind of like arguing that there are still servers in serverless.
* Ádám Sándor talks about [some of the bad and the ugly with GitOps][link-19]. This is helpful because many folks only have glowing things to say about GitOps, which---surprise, surprise!---isn't perfect. (Hint: no technology is perfect.)

## Operating Systems/Applications

* I use `scp` all the time. Per [this article][link-9], I guess it's time to switch to `rsync`!
* If you're relatively new to the Linux/macOS/UNIX/*BSD side of the world, this post on [making the most of OpenSSH][link-17] may prove quite useful. Heck, even if you're not new to OpenSSH, you might pick up something new.
* Stepan Stipl writes about [detecting and dealing with deprecated APIs in Kubernetes][link-21].
* Not sure how consensus algorithms work? No worries, start [here][link-24].
* [This][link-28] is an interesting article about why the CockroachDB team created Pebble, a KV store intended to replace RocksDB.
* [Here's a pretty comprehensive resource][link-30] for using `git`.

## Programming

* Kyle Galbraith has two articles that I read over the last several weeks, [one on the repository pattern][link-13] and [one on the adapter pattern][link-14]. Since I'm still quite the programming newbie, both were a bit of a stretch of my knowledge, but I think I gleaned enough of the concepts to be able to use them later.

## Virtualization

* Laurens van Dujin [brings to light][link-5] a bug in vCenter 7.0.0c that causes high CPU usage; turns out this bug is related to the new Workload Control Plane features in vSphere 7. You can disable the service to bring the CPU usage down, but there are caveats. Be sure to read Laurens' post for details.

## Career/Soft Skills

* This is [a great post on some undesirable traits in company culture][link-22]. This post is part 5 in a series; I need to make some time to read some of the earlier posts as well.
* I enjoyed [this post][link-23] by Daniel Teycheney on being proactive and conscious (I might use the word "deliberate") about solving problems in your career.

OK, that's all for now. Hopefully you've found something useful in this post. If so, I'd love to hear about it---feel free to reach out to [me on Twitter][link-99]. Similarly, if you have suggestions for how I might improve the content of these types of posts, I'm open to all constructive criticism. Thanks for reading!

[link-1]: https://aws.amazon.com/blogs/containers/aws-controllers-for-kubernetes-ack/
[link-2]: https://carvel.dev/
[link-3]: https://arstechnica.com/gadgets/2020/08/a-chrome-feature-is-creating-enormous-load-on-global-root-dns-servers/
[link-4]: https://blog.apnic.net/2020/08/21/chromiums-impact-on-root-dns-traffic/
[link-5]: https://vdr.one/vmware-vcenter-7-0-0c-high-cpu-usage/
[link-6]: https://medium.com/@Joachim8675309/create-an-amazon-vpc-for-eks-597481514bcc
[link-7]: https://medium.com/@Joachim8675309/create-eks-with-an-existing-vpc-8e31d95ccc5b
[link-8]: https://arstechnica.com/information-technology/2020/08/snapdragon-chip-flaws-put-1-billion-android-phones-at-risk-of-data-theft/
[link-9]: https://fedoramagazine.org/scp-users-migration-guide-to-rsync/
[link-10]: https://blog.verbum.org/2020/08/22/immutable-%e2%86%92-reprovisionable-anti-hysteresis/
[link-11]: https://openservicemesh.io/blog/introducing-open-service-mesh/
[link-12]: https://cilium.io/blog/2020/06/29/cilium-kubernetes-cni-vulnerability/
[link-13]: https://dev.to/kylegalbraith/getting-familiar-with-the-awesome-repository-pattern--1ao3
[link-14]: https://blog.kylegalbraith.com/2018/06/29/how-to-use-the-excellent-adapter-pattern-and-why-you-should/
[link-15]: https://blog.ipspace.net/2020/09/aws-security-example.html
[link-16]: https://github.com/nadeemnet/NetworkingInPubClouds/tree/master/security
[link-17]: https://linuxconfig.org/how-to-make-the-most-of-openssh
[link-18]: https://blog.quentin-machu.fr/2020/08/07/our-breakup-with-weave-net/
[link-19]: https://blog.container-solutions.com/gitops-the-bad-and-the-ugly
[link-20]: https://securelist.com/an-overview-of-targeted-attacks-and-apts-on-linux/98440/
[link-21]: https://blog.doit-intl.com/kubernetes-how-to-automatically-detect-and-deal-with-deprecated-apis-f9a8fc23444c
[link-22]: https://daverog.com/2020/08/05/culture-eats-technology-for-breakfast/
[link-23]: https://blog.danielteycheney.com/posts/what-problems-do-you-want/
[link-24]: https://www.planetscale.com/blog/blog-series-consensus-algorithms-at-scale-1
[link-25]: https://www.secura.com/blog/zero-logon
[link-26]: https://aws.amazon.com/blogs/containers/using-gatekeeper-as-a-drop-in-pod-security-policy-replacement-in-amazon-eks/
[link-27]: https://aws.amazon.com/blogs/containers/amazon-eks-cluster-multi-zone-auto-scaling-groups/
[link-28]: https://www.cockroachlabs.com/blog/pebble-rocksdb-kv-store/
[link-29]: https://fly.io/blog/sandboxing-and-workload-isolation/
[link-30]: http://www-cs-students.stanford.edu/~blynn/gitmagic/
[link-99]: https://twitter.com/scott_lowe


text: kubectl apply -f "$(dirname "$0")/kubernetes"