text:
/**
 * types.js
 *
These are all derived from the interface specifications of the
 * Java topic map at https://github.com/SolrSherlock/JSONTopicMap

 *
They must be the same in order to insure database compatibility:

 * both the NodeJS and Java topic maps should be able to work from the
 * same database.

 */
///////////////////////////
// Types
///////////////////////////
module.exports.TYPE_TYPE								= 'TypeType';

module.exports.CLASS_TYPE 								= 'ClassType';
	//needed in export of a tuple
module.exports.NODE_TYPE								= 'NodeType';
//	TUPLE_TYPE								= 'TypleType';
module.exports.GRAPH_TYPE								= 'GraphType';
	//needed in merge and export of a tuple
module.exports.VIRTUAL_NODE_TYPE						= 'VirtualNodeType';
module.exports.ONTOLOGY_TYPE 							= 'OntologyType';

module.exports.RULE_TYPE 								= 'RuleType';
module.exports.MERGE_RULE_TYPE 							= 'MergeRuleType';
module.exports.RESOURCE_TYPE 							= 'ResourceType';
module.exports.WEB_RESOURCE_TYPE						= 'WebResourceType';
module.exports.RELATION_TYPE 							= 'RelationType';
module.exports.ROLE_TYPE 								= 'RoleType';
module.exports.USER_TYPE 								= 'UserType';
module.exports.UNKNOWN_USER_TYPE						= 'UnknownUserType';
    /**
     * A USER_TYPE generated on import from a different map
     */
module.exports.FOREIGN_USER_TYPE 						= 'ForeignUserType';
module.exports.AGENT_TYPE								= 'AgentType';
module.exports.MERGE_AGENT_TYPE							= 'MergeAgentType';
module.exports.HARVEST_AGENT_TYPE						= 'HarvestAgentType';

/**
 * The following LEGEND types are defined for exporting.
 * Is a CLASS_TYPE
 */
module.exports.LEGEND_TYPE 								= 'LegendType';
module.exports.SCOPE_TYPE 								= 'ScopeType';
module.exports.MERGE_RULE_SCOPE_TYPE					= 'MergeRuleScopeType';
module.exports.THEME_TYPE								= 'ThemeType';

///////////////////////
// Assertions
///////////////////////
module.exports.ASSERTION_TYPE 							= 'AssertionType';
module.exports.MERGE_ASSERTION_TYPE 					= 'MergeAssertionType';
module.exports.POSSIBLE_MERGE_ASSERTIONTYPE				= 'PossibleMergeAssertionType';
module.exports.UNMERGE_ASSERTION_TYPE					= 'UnMergeAssertionType';

module.exports.ROLE_BASED_RELATION_TYPE 				= 'RoleBasedRelationType';
module.exports.LINGUISTIC_RELATION_TYPE 				= 'linguisticRelationType';
module.exports.SIMPLE_ASSERTION_TYPE 					= 'SimpleAssertionType';
    /**
     * Predefines as subclass of LEGEND_TYPE: user must subclass which assertion type
     */
module.exports.LEGEND_ASSERTION_TYPE 					= 'LegendAssertionType';
////////////////////////////
// Specific node types
////////////////////////////
module.exports.GUILD_TYPE								= 'GuildNodeType';
module.exports.QUEST_TYPE								= 'QuestNodeType';
module.exports.AVATAR_TYPE								= 'AvatarNodeType';
module.exports.TAG_TYPE									= 'TagNodeType';
module.exports.THEME_TYPE								= 'ThemeNodeType';
module.exports.GRAPH_NODE_TYPE							= 'GraphNodeType';
module.exports.ONTOLOGY_NODE_TYPE						= 'OntologyNodeType';
module.exports.SOLUTION_TYPE							= 'SolutionNodeType';
//entities
module.exports.CITATION_NODE_TYPE						= 'CitationNodeType';
module.exports.ESSAY_TYPE								= 'EssayNodeType';
module.exports.ORGANIZATION_TYPE 						= 'OrganizationNodeType';
module.exports.PROJECT_TYPE								= 'ProjectNodeType';
module.exports.BIOGRAPHY_TYPE							= 'BiographyNodeType';
module.exports.BLOG_TYPE								= 'BlogNodeType';
module.exports.WIKI_TYPE								= 'WikiNodeType';
module.exports.MICROBLOG_TYPE							= 'MicroblogNodeType';
module.exports.SUMMARY_TYPE								= 'SummaryNodeType';
module.exports.PERSPECTIVE_TYPE							= 'PerspectiveNodeType';
module.exports.BOOKMARK_TYPE							= 'BookmarkNodeType';
module.exports.ANNOTATION_TYPE							= 'AnnotationNodeType';
////////////////////////
//IBIS types
////////////////////////
/////////////////////////////
//Conversations
//The root node type for any conversation is types.CONVERSATION_MAP_TYPE
//All nodes in a conversation use properties.CONVERSATION_NODE_TYPE to tell
//specifically which type they are
/////////////////////////////
module.exports.CONVERSATION_MAP_TYPE					= 'ConversationMapNodeType';
module.exports.PRO_TYPE									= 'ProNodeType';
module.exports.CON_TYPE									= 'ConNodeType';
module.exports.POSITION_TYPE							= 'PositionNodeType';
module.exports.CHALLENGE_TYPE 							= 'ChallengeNodeType';
module.exports.ISSUE_TYPE								= 'IssueNodeType';
module.exports.EVIDENCE_TYPE							= 'EvidenceNodeType';
module.exports.CLAIM_TYPE								= 'ClaimNodeType';
module.exports.RESOURCE_TYPE							= 'ResourceNodeType';
module.exports.DECISION_TYPE							= "DecisionNodeType";
module.exports.NOTE_TYPE								= "NoteNodeType";
////////////////////////////////
// Relation Types
////////////////////////////////
module.exports.CAUSES_RELATION_TYPE						= 'CausesRelationType'; //
module.exports.EXPLAINS_WHAT_RELATION_TYPE				= 'ExplainsWhatRelationType'; //
module.exports.EXPLAINS_WHY_RELATION_TYPE				= 'ExplainsWhyRelationType'; //
module.exports.EXPLAINS_HOW_RELATION_TYPE				= 'ExplainsHowRelationType'; //
//IDENTICAL_TO_RELATION_TYPE 			= 'IdenticalToRelationType'; now IS_SAME_AS
module.exports.IS_SIMILAR_TO_RELATION_TYPE 				= 'IsSimilarToRelationType'; //
module.exports.SHARES_ISSUES_WITH_RELATION_TYPE 		= 'SharesIssuesWithRelationType';//
module.exports.IS_ANALOGOUS_RELATION_TYPE 				= 'IsAnalogousRelationType'; //
module.exports.IS_METAPHOR_RELATION_TYPE 				= 'IsMetaphorRelationType'; //
//	IS_ABOUT_RELATION_TYPE 				= 'IsAboutRelationType';
module.exports.AGREES_WITH_RELATION_TYPE 				= 'AgreesWithRelationType'; //
module.exports.IS_DIFFERENT_TO_RELATION_TYPE 			= 'IsDifferentToRelationType'; //
module.exports.IS_OPPOSITE_OF_RELATION_TYPE 			= 'IsOppositeOfRelationType';//
	/**Note merge implications on this one -- might need a daemon watching it */
module.exports.IS_SAME_AS_RELATION_TYPE					= 'IsSameAsRelationType';//
module.exports.IS_NOT_ANALOGOUS_RELATION_TYPE 			= 'IsNotAnalogousRelationType'; //
module.exports.HAS_NOTHING_TO_DO_WITH_RELATION_TYPE 	= 'HasNothingToDoWithRelationType';//
module.exports.DISAGREES_WITH_RELATION_TYPE 			= 'DisagreesWithRelationType'; //
module.exports.USES_RELATION_TYPE 						= 'UsesRelationType'; //
module.exports.IMPLIES_RELATION_TYPE 					= 'ImpliesRelationType'; //
	//issue: most are right handed: a implies b
	// this is left handed: a is enabled by b
	// maybe should standardize on right handed? e.g. ENABLES
	//ENABLED_BY_RELATION_TYPE 			= 'EnabledByRelationType';
module.exports.ENABLES_RELATION_TYPE					= 'EnablesRelationType'; //
module.exports.IMPROVES_ON_RELATION_TYPE 				= 'ImprovesOnRelationType'; //
module.exports.ADDRESSES_RELATION_TYPE 					= 'AddressesRelationType'; //
module.exports.SOLVES_RELATION_TYPE 				 	= 'SolvesRelationType'; //
module.exports.IS_PREREQUISITE_FOR_RELATION_TYPE 		= 'IsPrerequisiteForRelationType';
module.exports.IMPAIRS_RELATION_TYPE 					= 'ImpairsRelationType'; //
module.exports.PREVENTS_RELATION_TYPE 					= 'PreventsRelationType'; //
module.exports.PROVES_RELATION_TYPE 					= 'ProvesRelationType'; //
module.exports.REFUTES_RELATION_TYPE 					= 'RefutesRelationType'; //
module.exports.IS_EVIDENCE_FOR_RELATION_TYPE 			= 'IsEvidenceForRelationType'; //
module.exports.IS_EVIDENCE_AGAINST_RELATION_TYPE 		= 'IsEvidenceAgainstRelationType'; //
module.exports.IS_CONSISTENT_WITH_RELATION_TYPE 		= 'IsConsistentWithRelationType'; //
module.exports.IS_EXAMPLE_OF_RELATION_TYPE 				= 'IsExampleRelationType'; //
module.exports.PREDICTS_RELATION_TYPE 					= 'PredictsRelationType';
module.exports.ENVISAGES_RELATION_TYPE 					= 'EnvisagesRelationRelationType'; //
module.exports.UNLIKELY_TO_AFFECT_RELATION_TYPE 		= 'UnlikelyToAffectRelationType';
module.exports.IS_INCONSISTENT_WITH_RELATION_TYPE 		= 'InconsistentWithRelationType'; //
module.exports.RESPONDS_TO_RELATION_TYPE 				= 'RespondsToRelationType'; //
module.exports.BOOMARK_RELATION_TYPE					= 'BookmarkRelationType';
module.exports.TAG_RELATION_TYPE						= 'TagRelationType';
//more relations from looking at OBO ontologies
module.exports.IS_RELATED_TO_RELATION_TYPE				= 'IsRelatedToRelationType';
module.exports.IS_PART_OF_RELATION_TYPE					= 'IsPartOfRelationType';
module.exports.IS_CONTAINED_IN_RELATION_TYPE			= 'IsContainedInRelationType';
module.exports.HAS_ROLE_RELATION_TYPE					= 'HasRoleRelationType';
//
module.exports.TAG_DOCUMENT_RELATION_TYPE				= 'TagDocumentRelationType';
module.exports.DOCUMENT_TAG_RELATION_TYPE				= 'DocumentTagRelationType';
module.exports.TAG_CREATOR_RELATION_TYPE				= 'TagCreatorRelationType';
module.exports.CREATOR_TAG_RELATION_TYPE				= 'CreatorTagRelationType';
module.exports.DOCUMENT_CREATOR_RELATION_TYPE			= "DocumentCreatorRelationType";
module.exports.CREATOR_DOCUMENT_RELATION_TYPE			= "CreatorDocumentRelationType";
module.exports.DOCUMENT_ANNOTATION_RELATION_TYPE		= "DocumentAnnotationRelationType";
module.exports.DOCUMENT_TRANSCLUDER_RELATION_TYPE		="DocumentTranscluderRelationType";
////////////////////////
// Role Types
////////////////////////
module.exports.IDEA_ROLE_TYPE 							= 'IdeaRoleType'; //
module.exports.IDEOLOGY_ROLE_TYPE 						= 'IdeologyRoleType';//
module.exports.METHOD_ROLE_TYPE 						= 'MethodRoleType';//
	/** not sure about this one */
module.exports.NATURAL_PHENOMENON_ROLE_TYPE 			= 'NaturalPhenomenonRoleType';//
module.exports.OPINION_ROLE_TYPE 						= 'OpinionRoleType';//
module.exports.PREDICTION_ROLE_TYPE 					= 'PredictionRoleType';//
module.exports.PROBLEM_ROLE_TYPE 						= 'ProblemRoleType';//
module.exports.SCENARIO_ROLE_TYPE 						= 'ScenarioRoleType';//
module.exports.SOFTWARE_ROLE_TYPE 						= 'SoftwareRoleType';//
module.exports.SOLUTION_ROLE_TYPE 						= 'SolutionRoleType';//
module.exports.THEORY_ROLE_TYPE 						= 'TheoryRoleType';//


text:
const GameAction = require('./GameAction');

class Shuffle extends GameAction {
    constructor() {
        super('shuffle');
    }

    canChangeGameState({ player }) {
        return player.drawDeck.length > 0;
    }

    createEvent({ player }) {
        return this.event('onDeckShuffled', { player }, event => {
            event.player.shuffleDrawDeck();
        });
    }
}

module.exports = new Shuffle();

redpajama_set_name: RedPajamaGithub


text:
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
                      super, zip)

# local imports
from .._params_mixins.PagingParamsMixin import PagingParamsMixin
from .._ParamsBase import ParamsBase
from .SortFieldType import SortFieldType
from .SortOrderType import SortOrderType

class ListResourcesParams(PagingParamsMixin, ParamsBase):
    """Holds parameter values for the "resources" content user item request."""
    @property
    def sort_field(self):
        """Gets or sets the output type of the published service."""

        return self._get_nullable_enum("sortField", SortFieldType)

    @sort_field.setter
    def sort_field(self, value):
        self._set_nullable_enum("sortField", value, SortFieldType)

    @property
    def sort_order(self):
        """Gets or sets the output type of the published service."""

        return self._get_nullable_enum("sortOrder", SortOrderType)

    @sort_order.setter
    def sort_order(self, value):
        self._set_nullable_enum("sortOrder", value, SortOrderType)


text:
/*
 * GET home page.
 */

 //Test commit

exports.dash = function(req, res){
  res.render('dash', { heading: "Dashboard" });
};

exports.newtracker = function(req, res){
  res.render('newtracker', { heading: "Add a new Tracker" });
};

exports.newresource = function(req, res){
  res.render('newresource', { heading: 'Add a new resource' });
};

exports.trails = function(req, res){
	res.render('trails', {heading: 'Path Analyzer', id: req.params.id});
};


text:
  <title>AnyPixel - Emulator</title>
  <link href="css/emulator.css" media="all" rel="stylesheet">

AnyPixel - Emulator

  <canvas id="display-canvas"></canvas>

  	<input checked="true" id="checkbox-show-grid-lines" type="checkbox">Show display unit grid lines
  	<input checked="true" id="checkbox-show-unit-numbers" type="checkbox">Show display unit numbers


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/swipeRefreshLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/rootLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbarLayout"
            app:elevation="0dp"
            style="@style/AppBarLayout">

            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"

                app:layout_scrollFlags="scroll"
                tools:context="net.coding.program.setting.order.OrderMainActivity">

                <RelativeLayout
                    android:id="@+id/topTip"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/layout_yellow_bg"
                    android:minHeight="44dp">

                    <ImageView
                        android:id="@+id/closeTipButton"
                        android:layout_width="44dp"
                        android:layout_height="44dp"
                        android:layout_alignParentRight="true"
                        android:scaleType="center"
                        android:src="@drawable/delete_edit_login_black" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:layout_marginLeft="15dp"
                        android:layout_marginRight="44dp"
                        android:text="APP 暂不支持订购服务,请前往企业版网站订购"
                        android:textColor="@color/font_yellow"
                        android:textSize="14sp" />
                </RelativeLayout>

                <TextView
                    android:id="@+id/topWarn"
                    style="@style/BaseListText"
                    android:layout_marginTop="15dp"
                    android:textColor="@color/font_1"
                    android:textSize="17sp"
                    tools:text="您的服务已过期,请订购后使用" />

                <TextView
                    android:id="@+id/balanceTitle"
                    style="@style/BaseListText"
                    android:layout_marginTop="15dp"
                    android:textColor="@color/font_1"
                    android:textSize="14sp"
                    tools:text="已透支金额(元)" />

                <TextView
                    android:id="@+id/balanceContent"
                    style="@style/BaseListText"
                    android:layout_marginTop="10dp"
                    android:textColor="@color/font_red"
                    android:textSize="30sp"
                    tools:text="500.00" />

                <TextView
                    android:id="@+id/balanceTip"
                    style="@style/BaseListText"
                    android:layout_marginBottom="15dp"
                    android:layout_marginTop="10dp"
                    android:textColor="@color/font_2"
                    android:textSize="14sp"
                    tools:text="过期时间 2017 年 2月 25 日,已超时使用 2 天。" />

                <include
                    android:id="@+id/divideSection"
                    layout="@layout/divide_middle_15" />

            </LinearLayout>
            <!--</android.support.v4.widget.SwipeRefreshLayout>-->
            <FrameLayout
                android:id="@+id/containerHeader"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

            </FrameLayout>
        </android.support.design.widget.AppBarLayout>

        <!--<FrameLayout-->
        <!--android:id="@+id/container"-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="200dp">-->

        <!--</FrameLayout>-->
        <include layout="@layout/common_viewpager" />
    </android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>


text:
#ifndef MONGOC_WRITE_CONCERN_H
#define MONGOC_WRITE_CONCERN_H

#if !defined(MONGOC_INSIDE) && !defined(MONGOC_COMPILATION)
#error "Only <mongoc.h> can be included directly."
#endif

#include <bson.h>

BSON_BEGIN_DECLS

#define MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED 0
#define MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED -1 /* deprecated */
#define MONGOC_WRITE_CONCERN_W_DEFAULT -2
#define MONGOC_WRITE_CONCERN_W_MAJORITY -3
#define MONGOC_WRITE_CONCERN_W_TAG -4

typedef struct _mongoc_write_concern_t mongoc_write_concern_t;

BSON_EXPORT (mongoc_write_concern_t *)
mongoc_write_concern_new (void);
BSON_EXPORT (mongoc_write_concern_t *)
mongoc_write_concern_copy (const mongoc_write_concern_t *write_concern);
BSON_EXPORT (void)
mongoc_write_concern_destroy (mongoc_write_concern_t *write_concern);
BSON_EXPORT (bool)
mongoc_write_concern_get_fsync (const mongoc_write_concern_t *write_concern)
   BSON_GNUC_DEPRECATED;
BSON_EXPORT (void)
mongoc_write_concern_set_fsync (mongoc_write_concern_t *write_concern,
                                bool fsync_) BSON_GNUC_DEPRECATED;
BSON_EXPORT (bool)
mongoc_write_concern_get_journal (const mongoc_write_concern_t *write_concern);
BSON_EXPORT (bool)
mongoc_write_concern_journal_is_set (
   const mongoc_write_concern_t *write_concern);
BSON_EXPORT (void)
mongoc_write_concern_set_journal (mongoc_write_concern_t *write_concern,
                                  bool journal);
BSON_EXPORT (int32_t)
mongoc_write_concern_get_w (const mongoc_write_concern_t *write_concern);
BSON_EXPORT (void)
mongoc_write_concern_set_w (mongoc_write_concern_t *write_concern, int32_t w);
BSON_EXPORT (const char *)
mongoc_write_concern_get_wtag (const mongoc_write_concern_t *write_concern);
BSON_EXPORT (void)
mongoc_write_concern_set_wtag (mongoc_write_concern_t *write_concern,
                               const char *tag);
BSON_EXPORT (int32_t)
mongoc_write_concern_get_wtimeout (const mongoc_write_concern_t *write_concern);
BSON_EXPORT (void)
mongoc_write_concern_set_wtimeout (mongoc_write_concern_t *write_concern,
                                   int32_t wtimeout_msec);
BSON_EXPORT (bool)
mongoc_write_concern_get_wmajority (
   const mongoc_write_concern_t *write_concern);
BSON_EXPORT (void)
mongoc_write_concern_set_wmajority (mongoc_write_concern_t *write_concern,
                                    int32_t wtimeout_msec);
BSON_EXPORT (bool)
mongoc_write_concern_is_acknowledged (
   const mongoc_write_concern_t *write_concern);
BSON_EXPORT (bool)
mongoc_write_concern_is_valid (const mongoc_write_concern_t *write_concern);
BSON_EXPORT (bool)
mongoc_write_concern_append (mongoc_write_concern_t *write_concern,
                             bson_t *doc);

BSON_END_DECLS

#endif /* MONGOC_WRITE_CONCERN_H */


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

import {ConferenceApp} from "./app.component";
import {CompaniesPipe} from "./pipe/companies.pipe";

@NgModule({
  declarations: [
    CompaniesPipe
  ],
  imports: [],
  // entryComponents: [],
  providers: [],
  exports:[CompaniesPipe]
})
export class SharedModule {
}


text:
package helpers;

/**
 * Created with IntelliJ IDEA.
 * User: Luis Fernando C.C
 * Date: 14/09/13
 * Time: 14:23
 * To change this template use File | Settings | File Templates.
 */
public class UserStoryHelper {
}


text:
(function($) {

/**
 * Attach this editor to a target element.
 *
 * @param context
 *   A DOM element, supplied by Drupal.attachBehaviors().
 * @param params
 *   An object containing input format parameters. Default parameters are:
 *   - editor: The internal editor name.
 *   - theme: The name/key of the editor theme/profile to use.
 *   - field: The CSS id of the target element.
 * @param settings
 *   An object containing editor settings for all enabled editor themes.
 */
Drupal.wysiwyg.editor.attach.none = function(context, params, settings) {
  if (params.resizable) {
    $('#' + params.field).addClass('resizable');
    $('#' + params.field).css({display: ''});
    if (Drupal.behaviors.textarea) {
      Drupal.behaviors.textarea();
    }
  }
};

/**
 * Detach a single or all editors.
 *
 * @param context
 *   A DOM element, supplied by Drupal.attachBehaviors().
 * @param params
 *   (optional) An object containing input format parameters. If defined,
 *   only the editor instance in params.field should be detached. Otherwise,
 *   all editors should be detached and saved, so they can be submitted in
 *   AJAX/AHAH applications.
 */
Drupal.wysiwyg.editor.detach.none = function(context, params) {
  if (typeof params != 'undefined') {
    var $textarea = $('#' + params.field, context).removeClass('textarea-processed');
    var $div = $textarea.parents('div.resizable-textarea');
    $div.before($textarea);
    $div.remove();
  }
};

/**
 * Instance methods for plain text areas.
 */
Drupal.wysiwyg.editor.instance.none = {
  insert: function(content) {
    var editor = document.getElementById(this.field);

    // IE support.
    if (document.selection) {
      editor.focus();
      var sel = document.selection.createRange();
      sel.text = content;
    }
    // Mozilla/Firefox/Netscape 7+ support.
    else if (editor.selectionStart || editor.selectionStart == '0') {
      var startPos = editor.selectionStart;
      var endPos = editor.selectionEnd;
      editor.value = editor.value.substring(0, startPos) + content + editor.value.substring(endPos, editor.value.length);
    }
    // Fallback, just add to the end of the content.
    else {
      editor.value += content;
    }
  }
};

})(jQuery);


text:
package stroom.searchable.impl;

import stroom.datasource.api.v2.DataSource;
import stroom.datasource.api.v2.DataSourceProvider;
import stroom.docref.DocRef;
import stroom.query.api.v2.QueryKey;
import stroom.query.api.v2.SearchRequest;
import stroom.query.api.v2.SearchResponse;
import stroom.query.common.v2.SearchResponseCreatorManager;
import stroom.searchable.api.Searchable;
import stroom.searchable.api.SearchableProvider;
import stroom.security.api.SecurityContext;
import stroom.util.logging.LambdaLogger;
import stroom.util.logging.LambdaLoggerFactory;

import javax.inject.Inject;

@SuppressWarnings("unused")
// Used by DI
class SearchableService implements DataSourceProvider {

    public static final long PROCESS_PAYLOAD_INTERVAL_SECS = 1L;
    private static final LambdaLogger LOGGER = LambdaLoggerFactory.getLogger(SearchableService.class);
    private final SearchableProvider searchableProvider;
    private final SearchResponseCreatorManager searchResponseCreatorManager;
    private final SearchableStoreFactory storeFactory;
    private final SecurityContext securityContext;

    @Inject
    SearchableService(final SearchableProvider searchableProvider,
                      final SearchResponseCreatorManager searchResponseCreatorManager,
                      final SearchableStoreFactory storeFactory,
                      final SecurityContext securityContext) {
        this.searchableProvider = searchableProvider;
        this.searchResponseCreatorManager = searchResponseCreatorManager;
        this.storeFactory = storeFactory;
        this.securityContext = securityContext;
    }

    @Override
    public DataSource getDataSource(final DocRef docRef) {
        return securityContext.useAsReadResult(() -> {
            LOGGER.debug(() -> "getDataSource called for docRef " + docRef);
            final Searchable searchable = searchableProvider.get(docRef);
            if (searchable == null) {
                return null;
            }
            return searchable.getDataSource();
        });
    }

    @Override
    public SearchResponse search(final SearchRequest searchRequest) {
        return searchResponseCreatorManager.search(storeFactory, searchRequest);
    }

    @Override
    public Boolean keepAlive(final QueryKey queryKey) {
        return searchResponseCreatorManager.keepAlive(queryKey);
    }

    @Override
    public Boolean destroy(final QueryKey queryKey) {
        return searchResponseCreatorManager.remove(queryKey);
    }

    @Override
    public String getType() {
        return "Searchable";
    }
}


text:
package org.optaplanner.examples.taskassigning.swingui;

import static org.optaplanner.examples.taskassigning.persistence.TaskAssigningGenerator.BASE_DURATION_AVERAGE;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.util.List;
import java.util.Random;

import javax.swing.AbstractAction;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSpinner;
import javax.swing.JToggleButton;
import javax.swing.SpinnerNumberModel;
import javax.swing.Timer;

import org.optaplanner.examples.common.swingui.SolutionPanel;
import org.optaplanner.examples.taskassigning.domain.Customer;
import org.optaplanner.examples.taskassigning.domain.Priority;
import org.optaplanner.examples.taskassigning.domain.Task;
import org.optaplanner.examples.taskassigning.domain.TaskAssigningSolution;
import org.optaplanner.examples.taskassigning.domain.TaskType;

public class TaskAssigningPanel extends SolutionPanel<TaskAssigningSolution> {

    public static final String LOGO_PATH = "/org/optaplanner/examples/taskassigning/swingui/taskAssigningLogo.png";

    private final TaskOverviewPanel taskOverviewPanel;

    private JSpinner consumeRateField;
    private AbstractAction consumeAction;
    private Timer consumeTimer;
    private JSpinner produceRateField;
    private AbstractAction produceAction;
    private Timer produceTimer;

    private int consumedTimeInSeconds = 0;
    private int previousConsumedTime = 0; // In minutes
    private int producedTimeInSeconds = 0;
    private int previousProducedTime = 0; // In minutes
    private volatile Random producingRandom;

    public TaskAssigningPanel() {
        setLayout(new BorderLayout());
        JPanel headerPanel = createHeaderPanel();
        add(headerPanel, BorderLayout.NORTH);
        taskOverviewPanel = new TaskOverviewPanel(this);
        add(new JScrollPane(taskOverviewPanel), BorderLayout.CENTER);
    }

    private JPanel createHeaderPanel() {
        JPanel headerPanel = new JPanel(new GridLayout(1, 0));
        JPanel consumePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        consumePanel.add(new JLabel("Consume rate:"));
        consumeRateField = new JSpinner(new SpinnerNumberModel(600, 10, 3600, 10));
        consumePanel.add(consumeRateField);
        consumeTimer = new Timer(1000, e -> {
            consumedTimeInSeconds += (Integer) consumeRateField.getValue();
            consumeUpTo(consumedTimeInSeconds / 60);
            repaint();
        });
        consumeAction = new AbstractAction("Consume") {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (!consumeTimer.isRunning()) {
                    consumeRateField.setEnabled(false);
                    consumeTimer.start();
                } else {
                    consumeRateField.setEnabled(true);
                    consumeTimer.stop();
                }
            }
        };
        consumePanel.add(new JToggleButton(consumeAction));
        headerPanel.add(consumePanel);
        JPanel producePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        producePanel.add(new JLabel("Produce rate:"));
        produceRateField = new JSpinner(new SpinnerNumberModel(600, 10, 3600, 10));
        producePanel.add(produceRateField);
        produceTimer = new Timer(1000, e -> {
            producedTimeInSeconds += (Integer) produceRateField.getValue();
            produceUpTo(producedTimeInSeconds / 60);
            repaint();
        });
        produceAction = new AbstractAction("Produce") {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (!produceTimer.isRunning()) {
                    produceRateField.setEnabled(false);
                    produceTimer.start();
                } else {
                    produceRateField.setEnabled(true);
                    produceTimer.stop();
                }
            }
        };
        producePanel.add(new JToggleButton(produceAction));
        headerPanel.add(producePanel);
        return headerPanel;
    }

    /**
     * @param consumedTime in minutes, just like {@link Task#getStartTime()}
     */
    public void consumeUpTo(final int consumedTime) {
        taskOverviewPanel.setConsumedDuration(consumedTime);
        if (consumedTime <= previousConsumedTime) {
            // Occurs due to rounding down of consumedTimeInSeconds
            return;
        }
        logger.debug("Scheduling consumption of all tasks up to {} minutes.", consumedTime);
        previousConsumedTime = consumedTime;
        doProblemFactChange(scoreDirector -> {
            TaskAssigningSolution solution = scoreDirector.getWorkingSolution();
            solution.setFrozenCutoff(consumedTime);
            for (Task task : solution.getTaskList()) {
                if (!task.isPinned()) {
                    if (task.getStartTime() != null && task.getStartTime() < consumedTime) {
                        scoreDirector.beforeProblemPropertyChanged(task);
                        task.setPinned(true);
                        scoreDirector.afterProblemPropertyChanged(task);
                        logger.trace("Consumed task ({}).", task);
                    } else if (task.getReadyTime() < consumedTime) {
                        // Prevent a non-pinned task from being assigned retroactively
                        scoreDirector.beforeProblemPropertyChanged(task);
                        task.setReadyTime(consumedTime);
                        scoreDirector.afterProblemPropertyChanged(task);
                    }
                }
            }
            scoreDirector.triggerVariableListeners();
        });
    }

    /**
     * @param producedTime in minutes, just like {@link Task#getStartTime()}
     */
    public void produceUpTo(final int producedTime) {
        if (producedTime <= previousProducedTime) {
            // Occurs due to rounding down of producedDurationInSeconds
            return;
        }
        final int baseDurationBudgetPerEmployee = (producedTime - previousProducedTime);
        final int newTaskCount = getSolution().getEmployeeList().size() * baseDurationBudgetPerEmployee / BASE_DURATION_AVERAGE;
        if (newTaskCount <= 0) {
            // Do not change previousProducedDuration
            return;
        }
        logger.debug("Scheduling production of {} new tasks.", newTaskCount);
        previousProducedTime = producedTime;
        final int readyTime = previousConsumedTime;
        doProblemFactChange(scoreDirector -> {
            TaskAssigningSolution solution = scoreDirector.getWorkingSolution();
            List<TaskType> taskTypeList = solution.getTaskTypeList();
            List<Customer> customerList = solution.getCustomerList();
            Priority[] priorities = Priority.values();
            List<Task> taskList = solution.getTaskList();
            for (int i = 0; i < newTaskCount; i++) {
                Task task = new Task();
                TaskType taskType = taskTypeList.get(producingRandom.nextInt(taskTypeList.size()));
                long nextTaskId = 0L;
                int nextIndexInTaskType = 0;
                for (Task other : taskList) {
                    if (nextTaskId <= other.getId()) {
                        nextTaskId = other.getId() + 1L;
                    }
                    if (taskType == other.getTaskType()) {
                        if (nextIndexInTaskType <= other.getIndexInTaskType()) {
                            nextIndexInTaskType = other.getIndexInTaskType() + 1;
                        }
                    }
                }
                task.setId(nextTaskId);
                task.setTaskType(taskType);
                task.setIndexInTaskType(nextIndexInTaskType);
                task.setCustomer(customerList.get(producingRandom.nextInt(customerList.size())));
                // Prevent the new task from being assigned retroactively
                task.setReadyTime(readyTime);
                task.setPriority(priorities[producingRandom.nextInt(priorities.length)]);

                scoreDirector.beforeEntityAdded(task);
                taskList.add(task);
                scoreDirector.afterEntityAdded(task);
            }
            scoreDirector.triggerVariableListeners();
        });
    }

    @Override
    public boolean isWrapInScrollPane() {
        return false;
    }

    @Override
    public void resetPanel(TaskAssigningSolution solution) {
        consumedTimeInSeconds = solution.getFrozenCutoff() * 60;
        previousConsumedTime = solution.getFrozenCutoff();
        producedTimeInSeconds = 0;
        previousProducedTime = 0;
        producingRandom = new Random(0); // Random is thread safe
        taskOverviewPanel.resetPanel(solution);
        taskOverviewPanel.setConsumedDuration(consumedTimeInSeconds / 60);
    }

    @Override
    public void updatePanel(TaskAssigningSolution taskAssigningSolution) {
        taskOverviewPanel.resetPanel(taskAssigningSolution);
    }

}


text:
package org.teamstbf.yats.logic.parser;

import static org.teamstbf.yats.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_DEADLINE;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_DESCRIPTION;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_END_TIME;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_LOCATION;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_RECURRENCE;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_START_TIME;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_TAG;
import static org.teamstbf.yats.logic.parser.CliSyntax.PREFIX_TIME_MULTIPLE;
import static org.teamstbf.yats.logic.parser.ParserUtil.INDEX_FIRST_DATE;
import static org.teamstbf.yats.logic.parser.ParserUtil.INDEX_SECOND_DATE;
import static org.teamstbf.yats.logic.parser.ParserUtil.SIZE_DEADLINE_TASK;
import static org.teamstbf.yats.logic.parser.ParserUtil.SIZE_EVENT_TASK;
import static org.teamstbf.yats.model.item.Event.MESSAGE_TOO_MANY_TIME;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.NoSuchElementException;

import org.teamstbf.yats.commons.exceptions.IllegalValueException;
import org.teamstbf.yats.logic.commands.AddCommand;
import org.teamstbf.yats.logic.commands.Command;
import org.teamstbf.yats.logic.commands.IncorrectCommand;

//@@author A0116219L
/**
 * Parses input arguments and creates a new AddCommand object
 */
public class AddCommandParser {

    public static final String MESSAGE_ADD_CONFLICTING_TIME = "Either -s/-e/-by OR "
            + "-time should be used in add command.";
    public static final String MESSAGE_INCORRECT_TIME_SLOTS = "There can only be 1 or 2 time points after -time flag.";

    /**
     * Parses the given {@code String} of arguments in the context of the
     * AddCommand and returns an AddCommand object for execution.
     */
    public Command parse(String args) {
        ArgumentTokenizer argsTokenizer = new ArgumentTokenizer(PREFIX_START_TIME, PREFIX_END_TIME, PREFIX_DEADLINE,
                PREFIX_LOCATION, PREFIX_DESCRIPTION, PREFIX_RECURRENCE, PREFIX_TAG, PREFIX_TIME_MULTIPLE);
        argsTokenizer.tokenize(args);
        try {
            HashMap<String, Object> addParam = new HashMap<>();
            addParam.put("name", argsTokenizer.getPreamble().get());
            addParam.put("location", argsTokenizer.getValue(PREFIX_LOCATION).orElse(null));
            addParam.put("start", ParserUtil.parseDateSingle(argsTokenizer.getValue(PREFIX_START_TIME)).orElse(null));
            addParam.put("end", ParserUtil.parseDateSingle(argsTokenizer.getValue(PREFIX_END_TIME)).orElse(null));
            addParam.put("deadline", ParserUtil.parseDateSingle(argsTokenizer.getValue(PREFIX_DEADLINE)).orElse(null));
            if ((ParserUtil.parseDateList(argsTokenizer.getValue(PREFIX_TIME_MULTIPLE)).isPresent())) {
                if (hasConflictingTimes(addParam)) {
                    throw new IllegalValueException(MESSAGE_ADD_CONFLICTING_TIME);
                } else {
                    fillTimeParameters(ParserUtil.parseDateList(argsTokenizer.getValue(PREFIX_TIME_MULTIPLE)).get(),
                            addParam);
                }
            }
            addParam.put("description", argsTokenizer.getValue(PREFIX_DESCRIPTION).orElse(null));
            addParam.put("tag", ParserUtil.toSet(argsTokenizer.getAllValues(PREFIX_TAG)));
            addParam.put("recurrence", argsTokenizer.getValue(PREFIX_RECURRENCE).orElse(null));
            return new AddCommand(addParam);
        } catch (NoSuchElementException nsee) {
            return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE));
        } catch (IllegalValueException ive) {
            return new IncorrectCommand(ive.getMessage());
        }
    }

    /*
     * Puts date contents inside list into addParam "start", "end", or
     * "deadline"
     */
    private void fillTimeParameters(List<Date> list, HashMap<String, Object> addParam) throws IllegalValueException {
        if (list.size() > SIZE_EVENT_TASK) {
            throw new IllegalValueException(MESSAGE_TOO_MANY_TIME);
        }
        if (list.size() == SIZE_DEADLINE_TASK) {
            addParam.put("deadline", list.get(INDEX_FIRST_DATE));
        } else if (list.size() == SIZE_EVENT_TASK) {
            addParam.put("start", list.get(INDEX_FIRST_DATE));
            addParam.put("end", list.get(INDEX_SECOND_DATE));
        } else {
            throw new IllegalValueException(MESSAGE_INCORRECT_TIME_SLOTS);
        }
    }

    private boolean hasConflictingTimes(HashMap<String, Object> addParam) {
        if (addParam.get("start") != null || addParam.get("end") != null || addParam.get("deadline") != null) {
            return true;
        }
        return false;
    }

}


text:
/**
 * index.js
 *
 * (C) 2017 mobile.de GmbH
 *
 * @author Patrick Hund
 * @since 05 Mai 2017
 */

const packager = require('electron-packager');
const path = require('path');

const options = {
    dir: path.resolve(__dirname, '../..'),
    out: path.resolve(__dirname, '../../dist'),
    icon: path.resolve(__dirname, '../../assets/fit17-logo.icns'),
    overwrite: true,
    appCopyright: 'Copyright © 2017 Patrick Hund'
};

packager(options, (err, appPaths) => {
    if (err) {
        console.error('Build failed!', err);
        process.exit(1);
    }
    console.log('Build successful!');
});


text:
package cmd

import (
	"fmt"
	"path/filepath"

	"github.com/snwfdhmp/duck/pkg/data"
	"github.com/snwfdhmp/duck/pkg/projects"
	"github.com/spf13/cobra"
)

var projectsCmd = &cobra.Command{
	Use:   "projects",
	Short: "List projects, has sub-commands",
	Run: func(cmd *cobra.Command, args []string) {
		for _, p := range data.Projects.Keys() {
			fmt.Println("-", Blue(p.Name()), "=>", Yellow(p.Value()))
		}

		fmt.Println(len(data.Projects.Keys()), "projects.")
	},
}

func RepairProject(path string) {
	absolutePath, err := filepath.Abs(path)
	if err != nil {
		return
	}
	projects.InitProject([]string{}, absolutePath, false, true)
}

func init() {
	RootCmd.AddCommand(projectsCmd)

	// Here you will define your flags and configuration settings.

	// Cobra supports Persistent Flags which will work for this command
	// and all subcommands, e.g.:
	// projectsCmd.PersistentFlags().String("foo", "", "A help for foo")

	// Cobra supports local flags which will only run when this command
	// is called directly, e.g.:
	// projectsCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}


text:
.class Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;
.super Lcom/android/internal/util/State;
.source "Tethering.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "UnavailableState"
.end annotation

# instance fields
.field final synthetic this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

# direct methods
.method constructor <init>(Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;)V
    .locals 0

    .prologue
    .line 1718
    iput-object p1, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    invoke-direct {p0}, Lcom/android/internal/util/State;-><init>()V

    return-void
.end method

# virtual methods
.method public enter()V
    .locals 4

    .prologue
    const/4 v3, 0x0

    .line 1722
    const-string v0, "Tethering"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "TetherInterfaceSM: "

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

    move-result-object v1

    iget-object v2, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    iget-object v2, v2, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->mIfaceName:Ljava/lang/String;

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

    move-result-object v1

    const-string v2, ": enter "

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

    move-result-object v1

    invoke-virtual {p0}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->getName()Ljava/lang/String;

    move-result-object v2

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1724
    iget-object v0, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    # invokes: Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->setAvailable(Z)V
    invoke-static {v0, v3}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->access$2100(Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;Z)V

    .line 1725
    iget-object v0, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    # invokes: Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->setLastError(I)V
    invoke-static {v0, v3}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->access$2500(Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;I)V

    .line 1726
    iget-object v0, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    # invokes: Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->setTethered(Z)V
    invoke-static {v0, v3}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->access$2200(Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;Z)V

    .line 1727
    iget-object v0, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    iget-object v0, v0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->this$0:Lcom/android/server/connectivity/Tethering;

    # invokes: Lcom/android/server/connectivity/Tethering;->sendTetherStateChangedBroadcast()V
    invoke-static {v0}, Lcom/android/server/connectivity/Tethering;->access$2300(Lcom/android/server/connectivity/Tethering;)V

    .line 1728
    return-void
.end method

.method public exit()V
    .locals 3

    .prologue
    .line 1732
    const-string v0, "Tethering"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "TetherInterfaceSM: "

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

    move-result-object v1

    iget-object v2, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    iget-object v2, v2, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->mIfaceName:Ljava/lang/String;

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

    move-result-object v1

    const-string v2, ": exit "

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

    move-result-object v1

    invoke-virtual {p0}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->getName()Ljava/lang/String;

    move-result-object v2

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1733
    return-void
.end method

.method public processMessage(Landroid/os/Message;)Z
    .locals 5
    .param p1, "message"    # Landroid/os/Message;

    .prologue
    .line 1738
    const-string v1, "Tethering"

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "TetherInterfaceSM: "

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

    move-result-object v2

    iget-object v3, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    iget-object v3, v3, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->mIfaceName:Ljava/lang/String;

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

    move-result-object v2

    const-string v3, ": "

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

    move-result-object v2

    invoke-virtual {p0}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->getName()Ljava/lang/String;

    move-result-object v3

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

    move-result-object v2

    const-string v3, " processMessage what="

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

    move-result-object v2

    iget-object v3, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    iget v4, p1, Landroid/os/Message;->what:I

    # invokes: Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->CmdToString(I)Ljava/lang/String;
    invoke-static {v3, v4}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->access$2400(Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;I)Ljava/lang/String;

    move-result-object v3

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

    move-result-object v2

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

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 1740
    const/4 v0, 0x1

    .line 1741
    .local v0, "retValue":Z
    iget v1, p1, Landroid/os/Message;->what:I

    packed-switch v1, :pswitch_data_0

    .line 1746
    const/4 v0, 0x0

    .line 1749
    :goto_0
    return v0

    .line 1743
    :pswitch_0
    iget-object v1, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    iget-object v2, p0, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM$UnavailableState;->this$1:Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;

    # getter for: Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->mInitialState:Lcom/android/internal/util/State;
    invoke-static {v2}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->access$3000(Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;)Lcom/android/internal/util/State;

    move-result-object v2

    # invokes: Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->transitionTo(Lcom/android/internal/util/IState;)V
    invoke-static {v1, v2}, Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;->access$4400(Lcom/android/server/connectivity/Tethering$TetherInterfaceSM;Lcom/android/internal/util/IState;)V

    goto :goto_0

    .line 1741
    :pswitch_data_0
    .packed-switch 0x5
        :pswitch_0
    .end packed-switch
.end method


text:
package org.consulo.compiler.server.fileSystem.archive;

import com.intellij.openapi.vfs.ArchiveEntry;
import com.intellij.openapi.vfs.ArchiveFile;
import com.intellij.openapi.vfs.ArchiveFileSystem;
import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

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

/**
 * @author VISTALL
 * @since 1:12/11.09.13
 */
public class ChildArchiveNewVirtualDirectory extends ChildArchiveNewVirtualFile {
  protected List<NewVirtualFile> myChilds = new ArrayList<NewVirtualFile>();

  public ChildArchiveNewVirtualDirectory(@NotNull ArchiveNewVirtualFile parentFile,
                                         @Nullable ChildArchiveNewVirtualDirectory parentDir,
                                         @NotNull String name,
                                         @NotNull ArchiveFileSystem archiveFileSystem,
                                         ArchiveFile archiveFile,
                                         ArchiveEntry archiveEntry) {
    super(parentFile, parentDir, name, archiveFileSystem, archiveFile, archiveEntry);
  }

  @Override
  public NewVirtualFile[] getChildren() {
    return myChilds.toArray(new NewVirtualFile[myChilds.size()]);
  }

  @Override
  public boolean isDirectory() {
    return true;
  }

  @Nullable
  @Override
  public NewVirtualFile findChild(@NotNull @NonNls String name) {
    NewVirtualFile[] children = getChildren();
    if (children == null) return null;
    for (NewVirtualFile child : children) {
      if (child.getName().equals(name)) {
        return child;
      }
    }
    return null;
  }
}


text:
<?php

namespace PhexcoreTest;

use PHPUnit_Framework_TestCase;
use Phexcore\Request;

class RequestTest extends PHPUnit_Framework_TestCase
{
    private $obj = null;

    protected function setUp()
    {
        $this->obj = new Request();
    }

    public function testParse_File_request()
    {
        $_SERVER['SCRIPT_NAME'] = '/foo/index.php';
        $_SERVER['REQUEST_URI'] = '/foo/bar/baz.html?qux=quux';

        $this->assertEquals(true, $this->obj->parse());
        $this->assertEquals('/foo', $this->obj->getBaseUri());
        $this->assertEquals('/bar/baz.html', $this->obj->getRequestUri());
        $this->assertEquals('/bar/', $this->obj->getDir());
        $this->assertEquals('baz', $this->obj->getFile());
        $this->assertEquals('html', $this->obj->getExtension());
        $this->assertEquals(true, $this->obj->isParsed());
        $this->assertEquals(false, $this->obj->isDirectoryIndex());
    }

    public function testParse_Dir_request()
    {
        $_SERVER['SCRIPT_NAME'] = '/foo/index.php';
        $_SERVER['REQUEST_URI'] = '/foo/bar/?qux=quux';

        $this->assertEquals(true, $this->obj->parse());
        $this->assertEquals('/foo', $this->obj->getBaseUri());
        $this->assertEquals('/bar/', $this->obj->getRequestUri());
        $this->assertEquals('/bar/', $this->obj->getDir());
        $this->assertEquals('index', $this->obj->getFile());
        $this->assertEquals('html', $this->obj->getExtension());
        $this->assertEquals(true, $this->obj->isParsed());
        $this->assertEquals(true, $this->obj->isDirectoryIndex());
    }

    public function testParse_Failure_parse()
    {
        $_SERVER['SCRIPT_NAME'] = '/foo/index.php';
        $_SERVER['REQUEST_URI'] = '/foo/bar/baz?qux=quux';

        $this->assertEquals(false, $this->obj->parse());
        $this->assertEquals('/foo', $this->obj->getBaseUri());
        $this->assertEquals('/bar/baz', $this->obj->getRequestUri());
        $this->assertEquals(null, $this->obj->getDir());
        $this->assertEquals(null, $this->obj->getFile());
        $this->assertEquals(null, $this->obj->getExtension());
        $this->assertEquals(false, $this->obj->isParsed());
        $this->assertEquals(false, $this->obj->isDirectoryIndex());
    }
}


text:
import React from "react";

// Import Spectacle Core tags
import {
	Appear,
	BlockQuote,
	Cite,
	CodePane,
	Deck,
	Fill,
	Fit,
	Heading,
	Image,
	Layout,
	Link,
	ListItem,
	List,
	Markdown,
	Quote,
	Slide,
	Spectacle,
	Text
} from "spectacle";

// Import image preloader util
import preloader from "spectacle/lib/utils/preloader";

// Import theme
import createTheme from "spectacle/lib/themes/default";

// Import custom component
import Interactive from "../assets/interactive";

// Require CSS
require("normalize.css");
require("spectacle/lib/themes/default/index.css");

const images = {
	city_01: require("../assets/nyc_01.jpg"),
	city_02: require("../assets/nyc_02.jpg"),
	city_03: require("../assets/nyc_03.jpg"),
	city_04: require("../assets/nyc_04.jpg"),
	edit_post: require("../assets/edit_post.jpg"),
	edit_post_zoomed: require("../assets/edit_post_zoomed.jpg"),
	edit_flow: require("../assets/edit_flow.jpg"),
	edit_flow_extras: require("../assets/edit_flow_extras.jpg"),
	confirm_publish_post: require("../assets/confirm_publish_post.jpg"),
	ntp_diagram: require("../assets/ntp_diagram.jpg"),
	scheduled_for: require("../assets/scheduledfor.jpg"),
	scheduling_post: require("../assets/scheduling.jpg"),
	wp_cron_trac: require("../assets/wp_cron_trac.jpg"),
	crontab_guru: require("../assets/crontab_guru.jpg"),
	dif_time_servers: require("../assets/dif_time_servers.jpg"),
	nist_time_servers: require("../assets/nist_time_servers.jpg"),
	publish_notifications: require("../assets/publish_notifications.jpg"),
	editorial_metabox: require("../assets/editorial_metabox.jpg"),
};

const gifs = {
	is_it_ready: require("../assets/is_it_ready_yet.gif"),
	classic: require("../assets/classic.gif"),
	loop_factory: require("../assets/loop_factory.gif"),
	loop_mouse: require("../assets/loop_mouse.gif"),
	loop_bb8: require("../assets/loop_bb8.gif"),
	loop_simpsons_honking: require("../assets/loop_simpsons_honking.gif"),
	loop_wargames: require("../assets/loop_wargames.gif"),
	loop_zoidberg: require("../assets/loop_zoidberg_blinking_futurama.gif"),
	loop_houses: require("../assets/loop_houses.gif"),
	loop_nerds: require("../assets/loop_nerds.gif"),
	loop_coffee_house: require("../assets/loop_coffee_house.gif"),
	ready_for_this: require("../assets/ready_for_this.gif"),
	pass_out: require("../assets/pass_out.gif"),
	time_is_abstract: require("../assets/time_is_abstract.gif"),
	frantic: require("../assets/frantic.gif"),
	timelord: require("../assets/timelord.gif"),
	ping_request: require("../assets/ping_request.gif"),
	traffic_jam: require("../assets/traffic_jam.gif"),
	whats_happening: require("../assets/whats_happening.gif"),
	waiting: require("../assets/waiting.gif"),
	waiting_spongebob: require("../assets/waiting_spongebob.gif"),
}

preloader(images);

preloader(gifs);

const theme = createTheme({
	// primary: "#ff4081"
	// primary: "#CC3300"
	// primary: "#0099CC"
	// primary: "#996699"
	primary: "#3D72A4",
	purple: "#673AB7",
	light_blue: "#3D72A4",
	light_grey: "#e6e6e6",
	dark_grey: "#464646",
	black: "#111111",
	white: "#fff",
});

export default class Presentation extends React.Component {
	render() {
		return (
			<Spectacle theme={theme}>
				<Deck transition={["zoom", "slide"]} transitionDuration={500}>

					<Slide transition={["zoom"]} bgColor="primary" id="welcome" bgImage={images.city_01.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} bold textColor="purple">
								A thorough explanation of
							</Heading>
							<Heading size={1} caps lineHeight={1} textColor="white">
								How WordPress
							</Heading>
							<Heading size={1} fit caps lineHeight={1} textColor="light_grey">
									 schedules Automatic Posts
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgColor="light_blue" bgImage={images.city_04.replace("/", "")}>
							<Heading size={1} caps textColor="white" textFont="primary">
								Context
							</Heading>
							<Layout>
									<Fill>
											<Image src={images.scheduling_post.replace("/", "")} margin="36px 8px 0" />
									</Fill>
									<Fill>
											<Image src={images.scheduled_for.replace("/", "")} margin="36px 8px 0" />
									</Fill>
							</Layout>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_03.replace("/", "")}
						notes="The goal of this presentation is to teach everyone enough about how WordPress schedules posts in order to set clear concise expectations for clients when using sheduling posts to be published."
					>
							<Heading size={1} padding="16px" bgColor="rgba(0,0,0,0.5)" caps textColor="white" textFont="primary">
								Setting Expectations
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
						<Heading size={1} caps lineHeight={1} textColor="black">The Edit Post Screen</Heading>
						<Image transition={["fade"]} src={images.edit_post.replace("/", "")} width="100%" />
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
						<Heading size={1} caps lineHeight={1} textColor="black">Stepping back for a moment...</Heading>
						<Image transition={["fade", "zoom"]} src={gifs.loop_zoidberg.replace("/", "")} margin="36px 8px 0" />
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_04.replace("/", "")}>
						<Image transition={["fade"]} src={gifs.time_is_abstract.replace("/", "")} width="100%" />
						<Heading size={1} fit caps lineHeight={1} textColor="white">
							How Robots Keep Track of Time
						</Heading>
					</Slide>

					<Slide transition={["fade"]} bgColor="white" bgImage={images.city_04.replace("/", "")}>
						<Layout bgColor="white">
							<Fill>
								<Heading size={1} fit caps lineHeight={1} textColor="white">
									Network Time Protocol (NTP)
								</Heading>
								<Text textColor="" lineHeight={1.25} textSize={32}  padding="18px" bgColor="white">
									is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. (<Link textColor="primary" href="https://en.wikipedia.org/wiki/Network_Time_Protocol">ref</Link>)
								</Text>
							</Fill>
							<Fill>
								<Image transition={["fade"]} src={images.ntp_diagram.replace("/", "")} height="280" />
							</Fill>
						</Layout>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_04.replace("/", "")}>
						<Heading size={1} fit caps lineHeight={1} textColor="white">
							NIST Time Servers
						</Heading>
						<Image transition={["fade"]} src={images.nist_time_servers.replace("/", "")} width="100%" />
						<Text textAlign="right" lineHeight={0.25} textSize={0.5}>
							<Link textColor="white" href="http://tf.nist.gov/tf-cgi/servers.cgi">url</Link>
						</Text>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_04.replace("/", "")}>
						<Heading size={1} fit caps lineHeight={1} textColor="white">
							Desktop at Home
						</Heading>
						<Image transition={["fade"]} src={images.dif_time_servers.replace("/", "")} width="100%" />
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
						<Heading size={1} caps lineHeight={1} textColor="black">The Edit Post Screen</Heading>
						<Image transition={["fade"]} src={images.edit_post.replace("/", "")} width="100%" />
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
							<Heading size={1} caps lineHeight={1} textColor="white">❄</Heading>
							<Heading size={1} fit caps lineHeight={1} textColor="black">Custom Workflows</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_04.replace("/", "")}>
						<Image transition={["fade", "zoom"]} src={images.confirm_publish_post.replace("/", "")} width="100%" />
						<Text lineHeight={1.25} textColor="white" bold>
							Occasionally clients will use plugins or custom functionality in the theme to achieve their desired workflow
						</Text>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_04.replace("/", "")}>
						<Heading size={1} fit caps lineHeight={1} textColor="white">
							Enter Edit Flow
						</Heading>
						<Image transition={["fade"]} src={images.edit_flow.replace("/", "")} width="100%" />
						<Text textAlign="right" lineHeight={0.25} textSize={0.5}>
							<Link textColor="white" href="http://editflow.org/">plugin homepage</Link>
						</Text>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_04.replace("/", "")}>
						<Heading size={1} fit caps lineHeight={1} textColor="white">
							A whole bunch of options...
						</Heading>
						<Image transition={["fade", "zoom"]} src={images.edit_flow_extras.replace("/", "")} width="100%" />
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
						<Heading size={1} fit caps lineHeight={1} textColor="black">
							Ready to Post
						</Heading>
						<Image transition={["fade", "zoom"]} src={images.edit_post_zoomed.replace("/", "")} width="100%" />
					</Slide>

					<Slide transition={["fade"]} bgImage={gifs.waiting.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black">
									What we expect
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={gifs.loop_factory.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black">
									Reality
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black">
									WordPress Default Behavior
							</Heading>
							<Image transition={["fade", "zoom"]} src={images.wp_cron_trac.replace("/", "")} width="100%" />
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
							<Image src={gifs.ping_request.replace("/", "")} />
							<Heading size={1} fit caps lineHeight={1} textColor="black">
								WordPress's Pseudo Cron
							</Heading>
							<Heading size={1} fit caps lineHeight={1} textColor="white">
								WP-Cron.php
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black" margin="0 0 24px">
								WP-Cron Example
							</Heading>
							<Layout>
								<Fill>
									<CodePane
										padding="24px"
								    source={require("raw!../assets/code/wp-cron_basic-scheduled-function.example")}
									/>
								</Fill>
							</Layout>
					</Slide>

					<Slide transition={["fade"]} bgColor="primary"  bgImage={images.city_02.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black">
									Low Traffic v.s. High Traffic
							</Heading>
							<Layout>
								<Fill>
									<Image padding="24px" transition={["fade", "zoom"]} src={gifs.waiting_spongebob.replace("/", "")} height="275px" />
								</Fill>
								<Fill>
									<Image padding="24px" transition={["fade", "zoom"]} src={gifs.traffic_jam.replace("/", "")} height="275px" />
								</Fill>
							</Layout>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_02.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black">
									Alternative Solutions
							</Heading>
							<Image margin="32px auto 0" src={gifs.timelord.replace("/", "")} />
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_03.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black" margin="0 0 32px">
									What is a Cron job?
							</Heading>
							<Text textColor="white" lineHeight={1.25} padding="16px" bgColor="rgba(0,0,0,0.5)" >
								is a Linux utility which schedules a command or script on your server to run automatically at a specified time and date.
							</Text>
							<Appear fid="1">
							  <Image padding="24px" transition={["fade", "zoom"]} src={gifs.loop_nerds.replace("/", "")} height="360px" />
							</Appear>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_03.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black" margin="0 0 24px">
									Simple Example
							</Heading>
							<Layout>
								<Fill>
									<CodePane
										padding="24px"
								    source={require("raw!../assets/code/crontab.example")}
									/>
									<Image padding="24px" src={images.crontab_guru.replace("/", "")} height="275px" />
								</Fill>
							</Layout>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_01.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="white">
									Our Hosting Solutions
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={gifs.loop_simpsons_honking.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="white">
									Pantheon
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={gifs.loop_simpsons_honking.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="white">
									VIP Classic
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={gifs.loop_bb8.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black">
									VIP Go
							</Heading>
					</Slide>

					<Slide transition={["fade"]} bgImage={gifs.loop_wargames.replace("/", "")}>
							<Heading size={1} fit caps lineHeight={1} textColor="black" margin="0 0 32px">
									Server Farm of "Runners"
							</Heading>
							<Text textColor="white" lineHeight={1.25} padding="16px" bgColor="rgba(0,0,0,0.5)" >"Scheduled jobs on VIP Go use the WP Cron API provided by WordPress core. The cron jobs are initiated and regulated via the WP Cron Control plugin. We trigger this on a one minute interval via HTTP request from our WordPress.com Jobs System."</Text>
							<Text textColor="black" lineHeight={1.25} padding="16px" bgColor="rgba(255,255,255,255.5)">
								For Devs: VIP will flag Cron tasks that are scheduled to occur less than every 15 mintes, gets expensive.
							</Text>
					</Slide>

					<Slide transition={["fade"]} bgImage={images.city_04.replace("/", "")}>
						<Image padding="24px" transition={["fade", "zoom"]} src={gifs.loop_coffee_house.replace("/", "")} height="360px" />
						<Heading size={1} fit caps lineHeight={1} textColor="white">
								Additional Services
						</Heading>
						<Layout textColor="white">
							<Fill>
								<Heading textSize={42} caps>WordPress Plugins</Heading>
								<List textColor="white">
								  <ListItem>WP Cron-Control</ListItem>
								  <ListItem>Cron-Control</ListItem>
								</List>
							</Fill>
							<Fill>
								<Heading textSize={42} caps>3rd Party Services</Heading>
								<List textColor="white">
								  <ListItem>EasyCron</ListItem>
								  <ListItem>WebCron</ListItem>
								  <ListItem>Dime a Dozen...</ListItem>
								</List>
							</Fill>
						</Layout>
					</Slide>

					<Slide transition={["fade"]}  bgImage={gifs.loop_houses.replace("/", "")}>
						<Heading size={1} fit caps lineHeight={1} textColor="white">
								Thank you
						</Heading>
						<Text textColor="white">
							Special thanks to Jared, Ben & Jake.
						</Text>
					</Slide>

					<Slide transition={["fade"]} bgImage={gifs.loop_houses.replace("/", "")}>
						<Heading size={1} fit caps lineHeight={1} textColor="white">
								Any Questions?
						</Heading>
					</Slide>

				</Deck>
			</Spectacle>
		);
	}
}


text:
<?php

namespace Noodlehaus\FileParser;

use Noodlehaus\Exception\ParseException;

/**
 * XML file parser
 *
 * @package    Config
 * @author     Jesus A. Domingo <jesus.domingo@gmail.com>
 * @author     Hassan Khan <contact@hassankhan.me>
 * @link       https://github.com/noodlehaus/config
 * @license    MIT
 */
class Xml implements FileParserInterface
{
    /**
     * {@inheritDoc}
     * Parses an XML file as an array
     *
     * @throws ParseException If there is an error parsing the XML file
     */
    public function parse($path)
    {
        libxml_use_internal_errors(true);

        $data = simplexml_load_file($path, null, LIBXML_NOERROR);

        if ($data === false) {
            $errors      = libxml_get_errors();
            $latestError = array_pop($errors);
            $error       = array(
                'message' => $latestError->message,
                'type'    => $latestError->level,
                'code'    => $latestError->code,
                'file'    => $latestError->file,
                'line'    => $latestError->line,
            );
            throw new ParseException($error);
        }

        $data = json_decode(json_encode($data), true);

        return $data;
    }

    /**
     * {@inheritDoc}
     */
    public function getSupportedExtensions()
    {
        return array('xml');
    }
}


text:
/* eslint-env node, jasmine */
import createElementAndApi from './utils/create-element-and-api';
import removeDiv from './utils/remove-div';

describe('PNG Export', () => {
  let api;
  let div;

  describe('tests', () => {
    beforeEach(() => {
      [div, api] = createElementAndApi(
        'http://higlass.io/api/v1/viewconfs/?d=Y7FtjugjR6OIV_P2DRqCSg'
      );
    });

    it('Exports to PNG', done => {
      const blobPromise = api.getComponent().createPNGBlobPromise();
      blobPromise.then(blob => {
        const reader = new FileReader();
        reader.addEventListener('loadend', () => {
          const array = new Uint8Array(reader.result.slice(1, 4));
          const pngString = new TextDecoder('iso-8859-2').decode(array);
          expect(pngString).toEqual('PNG');
          done();
        });
        reader.readAsArrayBuffer(blob);
      });
    });

    afterEach(() => {
      api.destroy();
      removeDiv(div);
      api = undefined;
      div = undefined;
    });
  });
});


text:
from omnilib.omnispec.omnispec import OmniSpec, OmniResource
import xml.etree.ElementTree as ET
from copy import deepcopy
import sys

def can_translate(rspec):
    if rspec.startswith('<rspec>') and 'openflow' in rspec and '<switches>' in rspec:
        return True
    return False

def rspec_to_omnispec(urn, rspec):
    ospec = OmniSpec("rspec_of", urn)
    ospec = make_skeleton_of_ospec(ospec)
    doc = ET.fromstring(rspec)
    #sys.stderr.write(rspec)
    for network in doc.findall('network'):
        net_name = network.get('name')
        switches = network.findall('switches')[0]
        swmap = {}
        for switch in switches.findall('switch'):
            # convert:
            #       "<switch urn="urn:publicid:IDN+openflow:stanford+switch:0" />"
            urn = switch.get('urn')
            # switchname = "stanford_network:switch:00:00:00:23:01:35:a5:5d"
            switchname = net_name + ':' + urn.split('+')[1]
            s = OmniResource(switchname, "OpenFlow Switch" ,'switch')

            options=['dl_src', 'dl_dst', 'dl_type', 'vlan_id', 'nw_src',\
                    'nw_dst', 'nw_proto', 'tp_src', 'tp_dst']

            for opt in options:
                s['options'][opt] = 'from=*, to=*'

            swmap[urn] = s
            ospec.add_resource(urn, s)

            for port in switch.findall('port'):
                port_urn = port.get('urn')
                port = 'port:' + port_urn.split('port:')[-1]
                swmap[urn]['options'][port] = "switch:* port:*"

        links = network.findall('links')[0]
        for link in links.findall('link'):
            # convert:
            #       <link
            #       src_urn="urn:publicid:IDN+openflow:stanford+switch:0+port:0
            #       dst_urn="urn:publicid:IDN+openflow:stanford+switch:1+port:0
            #       />
            _,domain,src_switch,src_port = link.get('src_urn').split('+')
            _,_,dst_switch,dst_port = link.get('dst_urn').split('+')

            switch_urn = "urn:publicid:IDN+" + domain + "+" + src_switch
            swmap[switch_urn]['options'][src_port] = dst_switch + " " + dst_port
            #sw_ports = swmap[switch_urn]['misc'].setdefault('ports', {})
            #sw_ports[src_port] = dst_switch + " " + dst_port

            #swmap[switch_urn]['options'][src_port] = "from=%s, to=%s" % (src_port.split(":")[-1], src_port.split(":")[-1])

    return ospec

def omnispec_to_rspec(omnispec, filter_allocated):
    # Load up information about all the resources
    user = {}
    project = {}
    slice = {}
    flowspaces = []

    ports={}

    # parse though each item; collecting ports as we go
    for urn, r in omnispec.get_resources().items():
        # not sure about matching on urn here:
        # why not type?  - Rob
        if '+user+sliceinfo' in urn:
            user['firstname'] = r['options']['firstname']
            user['lastname'] = r['options']['lastname']
            user['email'] = r['options']['email']
            user['fv_password'] = r['options']['fv_password']

            project['project_name'] = r['options']['project_name']
            project['project_description'] = r['options']['project_description']

            slice['slice_name'] = r['options']['slice_name']
            slice['slice_description'] = r['options']['slice_description']
            slice['controller_url'] = r['options']['controller_url']

        if r['type'] == 'switch':
            if not r.get_allocate():
                continue

            ports = []
            for (key,val) in r['options'].items():
                if key.startswith("port:"):
                    ports.append(key)
            for port in ports:
                r['options'].pop(port)

            # Okay, consider this switch part of a flowspace
            flowspace = {}
            flowspace['switch'] = urn

            flowspace['options'] = []

            for (key,val) in r['options'].items():
                #sys.stderr.write("val = %s \n" % val)
                vfrom,vto = val.split(",")
                vfrom = vfrom.strip().replace("from=",'')
                vto = vto.strip().replace("to=",'')
                flowspace['options'].append((key,vfrom,vto))

            for port in ports:
                curspace = deepcopy(flowspace)
                curspace['options'].append(('port_num', port.split(':')[-1], port.split(':')[-1]))
                flowspaces.append(curspace)

    # Now build the rspec

    root = ET.Element('resv_rspec')
    ET.SubElement(root, 'user', firstname=user['firstname'],lastname=user['lastname'], \
                           email=user['email'], password=user['fv_password'])
    ET.SubElement(root, 'project', name=project['project_name'], \
                              description=project['project_description'])
    ET.SubElement(root, 'slice', name=slice['slice_name'],\
                            description=slice['slice_description'],\
                            controller_url=slice['controller_url'])

    for flowspace in flowspaces:
        urn = flowspace['switch']
        flow = ET.SubElement(root, 'flowspace')
        switches = ET.SubElement(flow, 'switches')
        ET.SubElement(switches, 'switch', urn=urn)
        for (name,vfrom,vto) in flowspace['options']:
            opt = ET.SubElement(flow, name)
            opt.attrib['from'] = vfrom
            opt.attrib['to'] = vto

    xml = ET.tostring(root)
    return xml

def make_skeleton_of_ospec(ospec):
    ''' Add resources for the client to reserve.

        Hacking it in here because Expedient assumes the caller will add them
        themselves.
    '''
    # setup a resource for fv_account
    user = OmniResource("sliceinfo","Slice information for FlowVisor Access",'user')
    # goes in <user>
    user['options']['firstname'] = 'John'
    user['options']['lastname'] = 'Doe'
    user['options']['email'] = 'jdoe@geni.net'
    user['options']['fv_password'] = 'slice_pass'
    # goes in <project>
    user['options']['project_name'] = 'Stanford Networking Group'
    user['options']['project_description'] = 'Internet performance research to ...'
    # goes in <slice>
    user['options']['slice_name'] = 'Crazy Load Balancing Experiment'
    user['options']['slice_description'] = 'Does crazy load balancing and plate spinning'
    user['options']['controller_url'] = 'tcp:unknown:6633'
    user_urn = 'urn:publicid:IDN+openflow:stanford+user+' + user.get_name()

    ospec.add_resource(user_urn, user)
    return ospec

def set_dpid_port(ports,dpid, port):
        if not dpid in ports:
                sys.stderr.write("Adding switch %s\n" % ( dpid))
                ports['dpid'] = {}
        if not port in ports['dpid']:
                sys.stderr.write("Adding port %s to switch %s\n" % ( port, dpid))
                ports['dpid'][port]=True

##### Example OpenFlow rspec from expedient
'''
<rspec>
    <network name="Stanford" location="Stanford, CA, USA">
        <switches>
            <switch urn="urn:publicid:IDN+openflow:stanford+switch:0" />
            <switch urn="urn:publicid:IDN+openflow:stanford+switch:1" />
            <switch urn="urn:publicid:IDN+openflow:stanford+switch:2" />
        </switches>
        <links>
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:0+port:0
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:1+port:0
            />
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:1+port:0
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:0+port:0
            />
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:0+port:1
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:2+port:0
            />
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:2+port:0
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:0+port:1
            />
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:1+port:1
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:2+port:1
            />
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:2+port:1
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:1+port:1
            />
            </links>
            </network>
            <network name="Princeton" location="USA">
            <switches>
            <switch urn="urn:publicid:IDN+openflow:stanford+switch:3" />
            <switch urn="urn:publicid:IDN+openflow:stanford+switch:4" />
            </switches>
            <links>
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:3+port:0
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:4+port:0
            />
            <link
            src_urn="urn:publicid:IDN+openflow:stanford+switch:4+port:0
            dst_urn="urn:publicid:IDN+openflow:stanford+switch:3+port:0
            />
        </links>
    </network>
</rspec>

specifies a triangular graph at the Stanford network and a single link
at the Princeton network
'''

##### Example reservation back to OpenFlow/Expedient
'''
    Parses the reservation RSpec and returns a tuple:
    (project_name, project_desc, slice_name, slice_desc,
    controller_url, email, password, agg_slivers) where slivers
    is a list of (aggregate, slivers) tuples, and slivers is a dict suitable
    for use in the create_slice xml-rpc call of the opt-in manager.

    The reservation rspec looks like the following:

    <resv_rspec>
        <user
            firstname="John"
            lastname="Doe"
            email="john.doe@geni.net"
            password="slice_pass"
        />
        <project
            name="Stanford Networking Group"
            description="Internet performance research to ..."
        />
        <slice
            name="Crazy Load Balancer"
            description="Does this and that..."
            controller_url="tcp:controller.stanford.edu:6633"
        />
        <flowspace>
            <switches>
                <switch urn="urn:publicid:IDN+openflow:stanford+switch:0">
                <switch urn="urn:publicid:IDN+openflow:stanford+switch:2">
            </switches>
            <port from="1" to="4" />
            <dl_src from="22:33:44:55:66:77" to="22:33:44:55:66:77" />
            <dl_dst from="*" to="*" />
            <dl_type from="0x800" to="0x800" />
            <vlan_id from="15" to="20" />
            <nw_src from="192.168.3.0" to="192.168.3.255" />
            <nw_dst from="192.168.3.0" to="192.168.3.255" />
            <nw_proto from="17" to="17" />
            <tp_src from="100" to="100" />
            <tp_dst from="100" to="*" />
        </flowspace>
        <flowspace>
            <switches>
                <switch urn="urn:publicid:IDN+openflow:stanford+switch:1">
            </switches>
            <tp_src from="100" to="100" />
            <tp_dst from="100" to="*" />
        </flowspace>
    </resv_rspec>

    Any missing fields from the flowspace mean wildcard. All '*' means any
    value.

    All integers can be specified as hex or decimal.
    '''


text:
import os
import tempfile
import time
from datetime import datetime
from importlib import reload
from pathlib import Path
from types import TracebackType
from typing import Any, List, Optional, Tuple, Type, TypeVar

import pytest
from faker import Faker
from glom import glom
from python_on_whales import docker
from typer.testing import CliRunner

from controller import PROJECTRC, REGISTRY
from controller.app import Configuration
from controller.deploy.docker import Docker
from controller.utilities import configuration

runner = CliRunner()

# This does not work...
# from pytest.capture import CaptureFixture
# Capture = CaptureFixture[str]
Capture = Any

T = TypeVar("T", bound="TemporaryRemovePath")

class TemporaryRemovePath:
    def __init__(self, path: Path):
        self.path = path.absolute()
        self.tmp_path = self.path.with_suffix(f"{path.suffix}.bak")

    def __enter__(self: T) -> T:

        self.path.rename(self.tmp_path)
        return self

    def __exit__(
        self,
        _type: Optional[Type[Exception]],
        value: Optional[Exception],
        tb: Optional[TracebackType],
    ) -> bool:
        self.tmp_path.rename(self.path)
        # return False if the exception is not handled:
        # -> return True if the exception is None (nothing to be handled)
        # -> return False if the exception is not None (because it is not handled here)
        # always return False is not accepted by mypy...
        return _type is None

class Timeout(Exception):
    pass

def signal_handler(signum, frame):  # type: ignore
    raise Timeout("Time is up")

def mock_KeyboardInterrupt(signum, frame):  # type: ignore
    raise KeyboardInterrupt("Time is up")

def exec_command(capfd: Capture, command: str, *asserts: str) -> List[str]:

    # This is needed to reload the LOG dir
    import controller

    reload(controller)

    with capfd.disabled():
        print("\n")
        print("_____________________________________________")
        print(f"rapydo {command}")

    from controller.app import Application
    from controller.project import Project

    ctrl = Application()

    # re-read everytime before invoking a command to cleanup the Configuration class
    Application.load_projectrc()
    Application.project_scaffold = Project()
    Application.gits = {}

    start = datetime.now()
    result = runner.invoke(ctrl.app, command)
    end = datetime.now()

    elapsed_time = (end - start).seconds

    with capfd.disabled():
        print(f"Exit code: {result.exit_code}")
        print(f"Execution time: {elapsed_time} second(s)")
        print(result.stdout)
        print("_____________________________________________")

    captured = capfd.readouterr()

    # Here outputs from inside the containers
    cout = [x for x in captured.out.replace("\r", "").split("\n") if x.strip()]
    # Here output from rapydo
    err = [x for x in captured.err.replace("\r", "").split("\n") if x.strip()]
    # Here output from other sources, e.g. typer errors o docker-compose output
    out = [x for x in result.stdout.replace("\r", "").split("\n") if x.strip()]
    # Here exceptions, e.g. Time is up
    if result.exception:
        exc = [
            x for x in str(result.exception).replace("\r", "").split("\n") if x.strip()
        ]
    else:
        exc = []

    with capfd.disabled():
        for e in err:
            print(f"{e}")
        for o in cout:
            print(f">> {o}")
        for o in out:
            print(f"_ {o}")
        if result.exception and str(result.exception) != result.exit_code:
            print("\n!! Exception:")
            print(result.exception)

    for a in asserts:
        # Check if the assert is in any line (also as substring) from out or err
        assert a in out + err or any(a in x for x in out + err + cout + exc)

    return out + err + cout + exc

def service_verify(capfd: Capture, service: str) -> None:
    exec_command(
        capfd,
        f"shell backend 'restapi verify --service {service}'",
        f"Service {service} is reachable",
        f"{service} successfully authenticated on ",
    )

def random_project_name(faker: Faker) -> str:

    return f"{faker.word()}{faker.word()}".lower()

def create_project(
    capfd: Capture,
    name: Optional[str] = None,
    auth: str = "postgres",
    frontend: str = "angular",
    services: Optional[List[str]] = None,
    extra: str = "",
) -> None:

    opt = "--current --origin-url https://your_remote_git/your_project.git"
    s = ""
    if services:
        for service in services:
            s += f" --service {service}"

    exec_command(
        capfd,
        f"create {name} --auth {auth} --frontend {frontend} {opt} {extra} {s}",
        f"Project {name} successfully created",
    )

def init_project(capfd: Capture, pre_options: str = "", post_options: str = "") -> None:

    if "HEALTHCHECK_INTERVAL" not in pre_options:
        pre_options += " -e HEALTHCHECK_INTERVAL=1s "

    exec_command(
        capfd,
        f"{pre_options} init {post_options}",
        "Project initialized",
    )

def start_registry(capfd: Capture) -> None:
    if Configuration.swarm_mode:
        exec_command(capfd, "run registry --pull")
        time.sleep(2)

        print(docker.logs(REGISTRY))

def pull_images(capfd: Capture) -> None:

    exec_command(
        capfd,
        "pull --quiet",
        "Base images pulled from docker hub",
    )

def start_project(capfd: Capture) -> None:
    exec_command(
        capfd,
        "start",
        "Stack started",
    )
    if Configuration.swarm_mode:
        time.sleep(10)
    else:
        time.sleep(5)

def execute_outside(capfd: Capture, command: str) -> None:
    folder = os.getcwd()
    os.chdir(tempfile.gettempdir())
    exec_command(
        capfd,
        command,
        "You are not in a git repository",
    )

    os.chdir(folder)

def get_container_start_date(
    capfd: Capture, service: str, wait: bool = False
) -> datetime:

    if Configuration.swarm_mode and wait:
        time.sleep(5)
        # This is needed to debug and wait the service rollup to complete
        # Status is both for debug and to delay the get_container
        exec_command(capfd, "status")

    # Optional is needed because docker.get_container returns Optional[str]
    container: Optional[Tuple[str, str]] = None

    docker = Docker()
    if service == REGISTRY:
        # a tuple to have the same type of get_container
        container = (REGISTRY, "")
    else:
        container = docker.get_container(service, slot=1)

    assert container is not None
    return docker.client.container.inspect(container[0]).state.started_at

def get_variable_from_projectrc(variable: str) -> str:
    projectrc = configuration.load_yaml_file(file=PROJECTRC, is_optional=False)

    return glom(
        projectrc, f"project_configuration.variables.env.{variable}", default=""
    )

def wait_until(
    capfd: Capture, command: str, expected: str, max_retries: int = 30, sleep: int = 2
) -> bool:

    counter = 1

    while counter <= max_retries:
        result = exec_command(capfd, command)
        for r in result:
            if expected in r:
                return True

        counter += 1
        time.sleep(sleep)

    pytest.fail(
        f"Never found '{expected}' in '{command}' after {max_retries} retries"
    )  # pragma: no cover


text:
<input type="text" id="iframeSrc">
<button id="load-button" onclick="loadFile()">Load</button>

  <input type="number" id="interval" value="1"> Interval

  Objects and properties
  <button id="generate-button" onclick="startGeneratingExpectations()">Generate</button>

  <textarea id="obProp" class="textBox"></textarea>

 Outputted Checks


text:
Select Financial Ratios

                                Saved ratio selections :

                                <select class="all_elements" style="width: 100%;" name="ratio_selection" required="" id="ratio_selection" >
                                    <option value=""> ----- None ----</option>
                                    <?php foreach ($ratio_data as $ratio) { ?>
                                        <option value="<?php echo $ratio['id']; ?>"><?php echo $ratio['name']; ?></option>
                                    <?php } ?>
                                </select>

<button class="btn btn-primary btn_delete" data-ratioselectionid="">Delete Selected Ratio</button>

                        <form class="form-vertical" method="post" id="save_ratio">

                                        Selection Name :

                                        <input name="name" class="form-control" required=""/>

                                        <button type="submit" class="btn btn-primary save legitRipple">Save</button>

                        </form>

                                <?php foreach ($ratio_array as $key => $ratios) { ?>

                                                <?php echo $ratios['name']; ?>
                                                <?php echo $ratios['definition']; ?>

                                            <tr class="tableWrap sub_header" data-tbody="<?php echo $key; ?>">
                                                Add To Dashboard
 <input id="all_<?= $key ?>" type="checkbox" name="check"  class="select_all"><label for="all_<?= $key ?>">

                                                Ratio Name
                                                Recommended Calculation
                                                Definition
                                                Equation

                                        <tbody class="tableWrap" data-tbody="<?php echo $key; ?>">
                                            <?php foreach ($ratios['sub_ratios'] as $subratio) { ?>

 <input type="checkbox" id="<?= $subratio['name'] ?>" class="child_checkbox" value="<?= $subratio['id'] ?>"><label for="<?= $subratio['name'] ?>">

                                                    <?php echo $subratio['name']; ?>

                                                    <?php echo $subratio['definition']; ?>
                                                    <?php echo $subratio['equation']; ?>

                                            <?php } ?>

                                <?php } ?>


text:
hello world.
I create aplication now.
good bye