text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.app.util.bin.format.pdb2.pdbreader.symbol;

import ghidra.app.util.bin.format.pdb2.pdbreader.*;

/**
 * This class represents various flavors of Register symbol.
 * <P>
 * Note: we do not necessarily understand each of these symbol type classes.  Refer to the
 *  base class for more information.
 */
public abstract class AbstractRegisterMsSymbol extends AbstractMsSymbol {

	protected RecordNumber recordNumber;
	protected RegisterName register;
	protected String name;

	/**
	 * Constructor for this symbol.
	 * @param pdb {@link AbstractPdb} to which this symbol belongs.
	 * @param reader {@link PdbByteReader} from which this symbol is deserialized.
	 * @param recordNumberSize size of record number to parse.
	 * @param strType {@link StringParseType} to use.
	 * @throws PdbException upon error parsing a field.
	 */
	public AbstractRegisterMsSymbol(AbstractPdb pdb, PdbByteReader reader, int recordNumberSize,
			StringParseType strType) throws PdbException {
		super(pdb, reader);
		recordNumber = RecordNumber.parse(pdb, reader, RecordCategory.TYPE, recordNumberSize);
		register = parseRegister(reader);
		name = reader.parseString(pdb, strType);
		reader.align4();
	}

	@Override
	public void emit(StringBuilder builder) {
		builder.append(getSymbolTypeName());
		builder.append(": ");
		emitRegisterInformation(builder);
		builder.append(", Type: ");
		builder.append(pdb.getTypeRecord(recordNumber));
		builder.append(", ");
		builder.append(name);
	}

	/**
	 * Parses the register field for this symbol.
	 * @param reader {@link PdbByteReader} from which the data is parsed.
	 * @return The register field.
	 * @throws PdbException Upon not enough data left to parse.
	 */
	protected abstract RegisterName parseRegister(PdbByteReader reader) throws PdbException;

	/**
	 * Emits the register information to the {@link StringBuilder}
	 * @param builder {@link StringBuilder} to which the data is emitted.
	 */
	protected abstract void emitRegisterInformation(StringBuilder builder);

}

redpajama_set_name: RedPajamaGithub


text:
package be.wegenenverkeer.atomium.japi.client;

import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.common.SingleRootFileSource;
import com.github.tomakehurst.wiremock.junit.WireMockClassRule;
import org.junit.*;
import rx.Observable;
import rx.observers.TestSubscriber;

import java.util.concurrent.TimeUnit;

import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import static org.junit.Assert.assertEquals;

/**
 * Created by Karel Maesen, Geovise BVBA on 28/10/15.
 */
public class RetryStrategyTest {

    private final static SingleRootFileSource WIREMOCK_MAPPINGS = new SingleRootFileSource
            ("modules/client-java/src/test/resources/retry-scenario");

    @ClassRule
    public static WireMockClassRule wireMockRule = new WireMockClassRule(
            wireMockConfig().fileSource(WIREMOCK_MAPPINGS)
    );

    @Rule
    public WireMockClassRule instanceRule = wireMockRule;

    AtomiumClient client;

    @Before
    public void before() {
        client = new AtomiumClient.Builder()
                .setBaseUrl("http://localhost:8080/")
                .setAcceptJson()
                .build();

        //reset WireMock so it will serve the events feed
        WireMock.resetToDefault();
    }

    @After
    public void after() {
        client.close();
    }

    @Test
    public void testNoRetryStrategy() {

        Observable<FeedEntry<Event>> observable = client.feed("/feeds/events", Event.class)
                .observeFromBeginning(1000);

        TestSubscriber<FeedEntry<Event>> subscriber = new TestSubscriber<>();

        observable.subscribe(subscriber);

        subscriber.awaitTerminalEvent(60, TimeUnit.SECONDS);

        assertEquals(1, subscriber.getOnErrorEvents().size());

    }

    @Test
    public void testRetryStrategyOneRetries() {

        Observable<FeedEntry<Event>> observable = client
                .feed("/feeds/events", Event.class)
                .withRetry((n, t) -> {
                    if (n < 2) {
                        return 2*n*1000L;
                    } else throw new RuntimeException(t);
                })
                .observeFromBeginning(1000);

        TestSubscriber<FeedEntry<Event>> subscriber = new TestSubscriber<>();

        observable.subscribe(subscriber);

        subscriber.awaitTerminalEvent(60, TimeUnit.SECONDS);

        assertEquals(1, subscriber.getOnErrorEvents().size());

    }

    @Test
    public void testRetryStrategyThreeRetries() {

        Observable<FeedEntry<Event>> observable = client
                .feed("/feeds/events", Event.class)
                .withRetry((n, t) -> {
                    if (n < 3) {
                        return 2*n*1000L;
                    } else throw new RuntimeException(t);
                })
                .observeFromBeginning(1000).take(25);

        TestSubscriber<FeedEntry<Event>> subscriber = new TestSubscriber<>();

        observable.subscribe(subscriber);

        subscriber.awaitTerminalEvent(60, TimeUnit.SECONDS);

        subscriber.assertNoErrors();
        assertEquals(25, subscriber.getOnNextEvents().size());

    }

}


text:
<?php
// autogenerated file 30.09.2013 15:20
// $Id: $
// $Log: $
//
require_once 'EbatNs_FacetType.php';

/**
 * This type is deprecated as the partent of this type is no longer available.
 *
 * @link http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/types/ExternalProductCodeType.html
 *
 * @property string ISBN
 * @property string UPC
 * @property string ProductID
 * @property string EAN
 * @property string Keywords
 * @property string MPN
 * @property string CustomCode
 */
class ExternalProductCodeType extends EbatNs_FacetType
{
	const CodeType_ISBN = 'ISBN';
	const CodeType_UPC = 'UPC';
	const CodeType_ProductID = 'ProductID';
	const CodeType_EAN = 'EAN';
	const CodeType_Keywords = 'Keywords';
	const CodeType_MPN = 'MPN';
	const CodeType_CustomCode = 'CustomCode';

	/**
	 * @return
	 */
	function __construct()
	{
		parent::__construct('ExternalProductCodeType', 'urn:ebay:apis:eBLBaseComponents');

	}
}

$Facet_ExternalProductCodeType = new ExternalProductCodeType();

?>


text:
package org.eclipse.winery.repository.resources._support.collections.withoutid;

import org.eclipse.winery.repository.Utils;
import org.eclipse.winery.repository.resources._support.collections.IIdDetermination;

public class IdDeterminationWithHashCode implements IIdDetermination<Object> {

	public static final IdDeterminationWithHashCode INSTANCE = new IdDeterminationWithHashCode();

	@Override
	public String getId(Object entity) {
		// We assume that different Object serializations *always* have different hashCodes
		int hash = Utils.getXMLAsString(entity).hashCode();
		return Integer.toString(hash);
	}

	/**
	 * Static wrapper method for functions.tld
	 */
	public static String getIdStatically(Object entity) {
		return IdDeterminationWithHashCode.INSTANCE.getId(entity);
	}

}


text:
 require 'spec_helper'
 require "base_properties_spec"

describe IiifS3::Manifest do
  include_context("fake data")

  context "base" do
      before(:each) do
        @object = m
      end
      it_behaves_like "base properties"
  end

  let (:config) {IiifS3::Config.new()}
  let (:m) {IiifS3::Manifest.new([@fake_data],config)}
  let (:output) {JSON.parse(m.to_json)}

  it "initializes without an error" do
    expect(m).to be_a(IiifS3::Manifest)
  end

  it "exports JSON-LD as a valid JSON string" do
    expect(m.to_json).to be_a(String)
    expect{JSON.parse(m.to_json)}.not_to raise_error
  end

  it "has a @context" do
    expect(output["@context"]).to eq(IiifS3::PRESENTATION_CONTEXT)
  end
  it "has a @type" do
    expect(output["@type"]).to eq(IiifS3::Manifest::TYPE)
  end
  it "has an @id" do
    expect(output["@id"]).to eq("#{IiifS3::Config::DEFAULT_URL}/1/manifest.json")
  end

  context "error checking" do
    it "throws an error if not provided ImageRecords" do
      expect{IiifS3::Manifest.new(["not an image record"],config)}.to raise_error(IiifS3::Error::InvalidImageData)
    end
    it "throws an error unless there's a primary image" do
      data = @fake_data.clone
      data.is_primary = false
      expect{IiifS3::Manifest.new([data],config)}.to raise_error(IiifS3::Error::InvalidImageData)
    end
    it "throws an error if there are two primary images" do
      data1 = IiifS3::ImageRecord.new({is_primary: true})
      data2 = IiifS3::ImageRecord.new({is_primary: true})

      expect{IiifS3::Manifest.new([data1, data2],config)}.to raise_error(IiifS3::Error::MultiplePrimaryImages)
    end
  end

  context "config variables" do
    let (:config) {IiifS3::Config.new({:use_extensions => false})}
    it "the @id has an extension if configured thusly" do
      expect(output["@id"]).to eq("#{IiifS3::Config::DEFAULT_URL}/1/manifest")
    end
  end

  context "base_url config variable" do
    let (:config) {IiifS3::Config.new({base_url: "http://www.example.com"})}
    it "uses non-test uris" do
      expect(output["@id"]).to eq("http://www.example.com/1/manifest.json")
    end
  end

  context "spec requirements" do
    it "has a label" do
      expect(output["label"].length).to be > 0
    end
    it "does not have a format" do
      expect(output["format"]).to be_nil
    end
    it "does not have a height" do
      expect(output["height"]).to be_nil
    end
    it "does not have a width" do
      expect(output["width"]).to be_nil
    end
    it "does not have a startCanvas" do
      expect(output["startCanvas"]).to be_nil
    end
    it "accepts valid viewing directions" do
      dir = "right-to-left"
      new_data = @fake_data
      new_data.viewing_direction = dir
      m = IiifS3::Manifest.new([new_data],config)
      o = JSON.parse(m.to_json)
      expect(o["viewingDirection"]).to eq(dir)

    end
  end

end


text:
type EffectUnit = () => void;
let _diagnosticsBegin: EffectUnit = () => { }
export const setDiagnosticsBegin = (f: EffectUnit) => {
  _diagnosticsBegin = f;
}
export const diagnosticsBegin = () => {
  _diagnosticsBegin();
}
let _cleanBegin: EffectUnit = () => { }
export const setCleanBegin = (f: EffectUnit) => {
  _cleanBegin = f;
}
export const cleanBegin = () => {
  _cleanBegin();
}
let _diagnosticsEnd: EffectUnit = () => { }
export const setDiagnosticsEnd = (f: EffectUnit) => {
  _diagnosticsEnd = f;
}
export const diagnosticsEnd = () => {
  _diagnosticsEnd();
}
let _cleanEnd: EffectUnit = () => { }
export const setCleanEnd = (f: EffectUnit) => {
  _cleanEnd = f;
}
export const cleanEnd = () => {
  _cleanEnd();
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/ycsbCore.iml" filepath="$PROJECT_DIR$/ycsbCore.iml" />
    </modules>
  </component>
</project>


text:
import './components.js';
import './config.js';


text:
LIB_EXTERNAL=-L/usr/local/lib/event2 -L$(HOME)/local/lib
INCLUDE_EXTERNAL=-I/usr/local/include/event2 -I/$(HOME)/local/include

LIBS=$(LIB_EXTERNAL) -levent -ltinydtls
CFLAGS=-Wall -g -Wincompatible-pointer-types-discards-qualifiers -Wno-error=incompatible-pointer-types
INCLUDE=$(INCLUDE_EXTERNAL) -I./include  -L./
CXX=clang++
default: dtls_server dtls_client

dtls_server: dtls_server.c ../../libcantcoap.a ../../nethelper.o
	$(CXX) $(CFLAGS) $(INCLUDE) $^ $(LIBS) -o $@

dtls_client: dtls_client.c ../../libcantcoap.a ../../nethelper.o
	$(CXX) $(CFLAGS) $(INCLUDE) $^ $(LIBS) -o $@

%.o : %.c
	$(CXX) $< $(CFLAGS) $(INCLUDE) -c -o $@

clean:
	rm *.o; rm dtls_server; rm dtls_client;


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>TABULA BOOTSTRAP THEME by creativeLabs</title>
	<meta name="description" content="Tabula Bootstrap Theme"/>
	<meta name="keywords" content="Template, Theme, web, html5, css3, Bootstrap, pin, wall, responsive, fluid, retina" />
	<meta name="author" content="Łukasz Holeczek from creativeLabs"/>

	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<meta property="og:title" content=""/>
	<meta property="og:description" content=""/>
	<meta property="og:type" content=""/>
	<meta property="og:url" content=""/>
	<meta property="og:image" content=""/>

	<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700">
	<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Serif">
	<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Boogaloo">
	<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Economica:700,400italic">
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
	<link href="css/style.css" rel="stylesheet" type="text/css">
	<link href="css/layerslider.css" rel="stylesheet" type="text/css">

					tabula

Home

About

	                			Features

Social Icons

Glyphicons Halflings

Glyphicons PRO

Font Awesome Icons

Typography

Shortcodes

List Styles

Charts

Sliders

Portfolio

Pricing

Blog

Contact

Login

Register

Icons GLYPHICONS Halflings

Image

glass

music

search

envelope

heart

star

star-empty

user

film

th-large

th

th-list

ok

remove

zoom-in

zoom-out

off

signal

cog

trash

home

file

time

road

download-alt

download

upload

inbox

play-circle

repeat

refresh

list-alt

lock

flag

headphones

volume-off

volume-down

volume-up

qrcode

barcode

tag

tags

book

bookmark

print

camera

font

bold

italic

text-height

text-width

align-left

align-center

align-right

align-justify

list

indent-left

indent-right

facetime-video

picture

pencil

map-marker

adjust

tint

edit

share

check

move

step-backward

fast-backward

backward

play

pause

stop

forward

fast-forward

step-forward

eject

chevron-left

chevron-right

plus-sign

minus-sign

remove-sign

ok-sign

question-sign

info-sign

screenshot

remove-circle

ok-circle

ban-circle

arrow-left

arrow-right

arrow-up

arrow-down

share-alt

resize-full

resize-small

plus

minus

asterisk

exclamation-sign

gift

leaf

fire

eye-open

eye-close

warning-sign

plane

calendar

random

comments

magnet

chevron-up

chevron-down

retweet

shopping-cart

folder-close

folder-open

resize-vertical

resize-horizontal

hdd

bullhorn

bell

certificate

thumbs-up

thumbs-down

hand-right

hand-left

hand-top

hand-down

circle-arrow-right

circle-arrow-left

circle-arrow-top

circle-arrow-down

globe

wrench

tasks

filter

briefcase

fullscreen

dashboard

paperclip

heart-empty

link

phone

pushpin

euro

usd

gbp

sort

sort-by-alphabet

sort-by-alphabet-alt

sort-by-order

sort-by-order-alt

sort-by-attributes

sort-by-attributes-alt

unchecked

expand

collapse

collapse-top

Image - white

glass

music

search

envelope

heart

star

star-empty

user

film

th-large

th

th-list

ok

remove

zoom-in

zoom-out

off

signal

cog

trash

home

file

time

road

download-alt

download

upload

inbox

play-circle

repeat

refresh

list-alt

lock

flag

headphones

volume-off

volume-down

volume-up

qrcode

barcode

tag

tags

book

bookmark

print

camera

font

bold

italic

text-height

text-width

align-left

align-center

align-right

align-justify

list

indent-left

indent-right

facetime-video

picture

pencil

map-marker

adjust

tint

edit

share

check

move

step-backward

fast-backward

backward

play

pause

stop

forward

fast-forward

step-forward

eject

chevron-left

chevron-right

plus-sign

minus-sign

remove-sign

ok-sign

question-sign

info-sign

screenshot

remove-circle

ok-circle

ban-circle

arrow-left

arrow-right

arrow-up

arrow-down

share-alt

resize-full

resize-small

plus

minus

asterisk

exclamation-sign

gift

leaf

fire

eye-open

eye-close

warning-sign

plane

calendar

random

comments

magnet

chevron-up

chevron-down

retweet

shopping-cart

folder-close

folder-open

resize-vertical

resize-horizontal

hdd

bullhorn

bell

certificate

thumbs-up

thumbs-down

hand-right

hand-left

hand-top

hand-down

circle-arrow-right

circle-arrow-left

circle-arrow-top

circle-arrow-down

globe

wrench

tasks

filter

briefcase

fullscreen

dashboard

paperclip

heart-empty

link

phone

pushpin

euro

usd

gbp

sort

sort-by-alphabet

sort-by-alphabet-alt

sort-by-order

sort-by-order-alt

sort-by-attributes

sort-by-attributes-alt

unchecked

expand

collapse

collapse-top

Fonts

				glass
				music
				search
				envelope
				heart
				star
				star-empty
				user
				film
				th-large
				th
				th-list
				ok
				remove
				zoom-in
				zoom-out
				off
				signal
				cog
				trash
				home
				file
				time
				road
				download-alt
				download
				upload
				inbox
				play-circle
				repeat
				refresh
				list-alt
				lock
				flag
				headphones
				volume-off
				volume-down
				volume-up
				qrcode
				barcode
				tag
				tags
				book
				bookmark
				print
				camera
				font
				bold
				italic
				text-height
				text-width
				align-left
				align-center
				align-right
				align-justify
				list
				indent-left
				indent-right
				facetime-video
				picture
				pencil
				map-marker
				adjust
				tint
				edit
				share
				check
				move
				step-backward
				fast-backward
				backward
				play
				pause
				stop
				forward
				fast-forward
				step-forward
				eject
				chevron-left
				chevron-right
				plus-sign
				minus-sign
				remove-sign
				ok-sign
				question-sign
				info-sign
				screenshot
				remove-circle
				ok-circle
				ban-circle
				arrow-left
				arrow-right
				arrow-up
				arrow-down
				share-alt
				resize-full
				resize-small
				plus
				minus
				asterisk
				exclamation-sign
				gift
				leaf
				fire
				eye-open
				eye-close
				warning-sign
				plane
				calendar
				random
				comments
				magnet
				chevron-up
				chevron-down
				retweet
				shopping-cart
				folder-close
				folder-open
				resize-vertical
				resize-horizontal
				hdd
				bullhorn
				bell
				certificate
				thumbs-up
				thumbs-down
				hand-right
				hand-left
				hand-top
				hand-down
				circle-arrow-right
				circle-arrow-left
				circle-arrow-top
				circle-arrow-down
				globe
				wrench
				tasks
				filter
				briefcase
				fullscreen
				dashboard
				paperclip
				heart-empty
				link
				phone
				pushpin
				euro
				usd
				gbp
				sort
				sort-by-alphabet
				sort-by-alphabet-alt
				sort-by-order
				sort-by-order-alt
				sort-by-attributes
				sort-by-attributes-alt
				unchecked
				expand
				collapse
				collapse-top

Fonts - white

				glass
				music
				search
				envelope
				heart
				star
				star-empty
				user
				film
				th-large
				th
				th-list
				ok
				remove
				zoom-in
				zoom-out
				off
				signal
				cog
				trash
				home
				file
				time
				road
				download-alt
				download
				upload
				inbox
				play-circle
				repeat
				refresh
				list-alt
				lock
				flag
				headphones
				volume-off
				volume-down
				volume-up
				qrcode
				barcode
				tag
				tags
				book
				bookmark
				print
				camera
				font
				bold
				italic
				text-height
				text-width
				align-left
				align-center
				align-right
				align-justify
				list
				indent-left
				indent-right
				facetime-video
				picture
				pencil
				map-marker
				adjust
				tint
				edit
				share
				check
				move
				step-backward
				fast-backward
				backward
				play
				pause
				stop
				forward
				fast-forward
				step-forward
				eject
				chevron-left
				chevron-right
				plus-sign
				minus-sign
				remove-sign
				ok-sign
				question-sign
				info-sign
				screenshot
				remove-circle
				ok-circle
				ban-circle
				arrow-left
				arrow-right
				arrow-up
				arrow-down
				share-alt
				resize-full
				resize-small
				plus
				minus
				asterisk
				exclamation-sign
				gift
				leaf
				fire
				eye-open
				eye-close
				warning-sign
				plane
				calendar
				random
				comments
				magnet
				chevron-up
				chevron-down
				retweet
				shopping-cart
				folder-close
				folder-open
				resize-vertical
				resize-horizontal
				hdd
				bullhorn
				bell
				certificate
				thumbs-up
				thumbs-down
				hand-right
				hand-left
				hand-top
				hand-down
				circle-arrow-right
				circle-arrow-left
				circle-arrow-top
				circle-arrow-down
				globe
				wrench
				tasks
				filter
				briefcase
				fullscreen
				dashboard
				paperclip
				heart-empty
				link
				phone
				pushpin
				euro
				usd
				gbp
				sort
				sort-by-alphabet
				sort-by-alphabet-alt
				sort-by-order
				sort-by-order-alt
				sort-by-attributes
				sort-by-attributes-alt
				unchecked
				expand
				collapse
				collapse-top

creativeLabs

						 30 South Park Avenue

						 San Francisco, CA 94108, USA

						 Phone: (123) 456-7890

						 Fax: +08 (123) 456-7890

						 Email: contact@companyname.com

						 Web: companyname.com

Latest Tweets

Flickr Photo Stream

Follow Us

						tabula

						© 2012, creativeLabs. Designed by creativeLabs in Poland


text:
@interface PBTextView : UITextView

@end


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title> Christie | Gregor von Laszewski</title>
    <link>/author/christie/</link>
      <atom:link href="/author/christie/index.xml" rel="self" type="application/rss+xml" />
    <description> Christie</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Mon, 01 Jan 2007 00:00:00 +0000</lastBuildDate>
    <image>
      <url>/images/icon_hufdd866d90d76849587aac6fbf27da1ac_464_512x512_fill_lanczos_center_2.png</url>
      <title> Christie</title>
      <link>/author/christie/</link>
    </image>

    <item>
      <title>The Open Grid Computing Environments collaboration: portlets and services for science gateways</title>
      <link>/publication/las-07-ogce/</link>
      <pubDate>Mon, 01 Jan 2007 00:00:00 +0000</pubDate>
      <guid>/publication/las-07-ogce/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
@interface NSDate (Components)
+ (NSCalendar*)calendar;

- (NSDate*)firstDayOfMonth;
- (NSDate*)lastDayOfMonth;

- (NSDate*)startOfDate;
- (NSDateComponents*)totalComponents;
- (NSDateComponents*)commonComponents;
- (NSDateComponents*)chineseCalendarComponents;
- (NSInteger)numberOfWeeks;
- (NSInteger)numberOfDays;

- (NSArray*)datesForCurrentMonth;
- (NSArray*)datesForPreviousMonth:(NSInteger)limit;
- (NSArray*)datesForNextMonth:(NSInteger)limit;

+ (NSDate*)dateWithYear:(NSInteger)year
                  month:(NSInteger)month
                    day:(NSInteger)day;
+ (NSDate*)dateWithYear:(NSInteger)year
                  month:(NSInteger)month
                    day:(NSInteger)day
                   hour:(NSInteger)hour
                 minute:(NSInteger)minute
                 second:(NSInteger)second;

- (NSDate*)dateByAddingYears:(NSInteger)years;
- (NSDate*)dateByAddingMonths:(NSInteger)months;
- (NSDate*)dateByAddingWeeks:(NSInteger)weeks;
- (NSDate*)dateByAddingDays:(NSInteger)days;
- (NSDate*)dateByAddingHours:(NSInteger)hours;
- (NSDate*)dateByAddingMinutes:(NSInteger)minutes;
- (NSDate*)dateByAddingSeconds:(NSInteger)seconds;

UIKIT_EXTERN NSString* const kDateDescriptionKey;
UIKIT_EXTERN NSString* const kDateStatusKey;
@end


text:
{% extends 'dashboard/base.html' %}
{% load i18n %}{% load hq_shared_tags %}

{% block js-inline %}{{ block.super }}

{% endblock js-inline %}

{% block uncompressed-js %} {{ block.super }}

{% endblock %}

{% block dashboard-content %}

        {% if project.commtrack_enabled %}
            {% trans 'Welcome to CommCare Supply' %}
        {% else %}
            {% trans 'Welcome to CommCare HQ' %}
        {% endif %}
         {% trans 'What would you like to do?' %}

                {% trans 'Exchange' %}

                    {% blocktrans %}
                        Start with an
existing application
                    {% endblocktrans %}

                {% if project.commtrack_enabled %}
                    {% trans 'CommCare Supply Setup' %}
                {% else %}
                    {% trans 'Applications' %}
                {% endif %}

                            Build a new application

{% trans 'Help Site' %}

                    {% blocktrans %}
                        Learn how to build
an application
                    {% endblocktrans %}

{% endblock dashboard-content %}


text:
import deepFreeze from 'deep-freeze'
import { RECEIVE_DEVICE_LIST } from 'redux-midi-fork'
import stompblock from '../../src/reducers/stompblock'
import {
  SEARCHED_FOR_STOMPBLOCK,
  STOMPBLOCK_FOUND,
  STOMPBLOCK_MISSING,
  MIDI_IN_ACTIVITY,
  MIDI_OUT_ACTIVITY,
  NOT_RESPONDING,
} from '../../src/action-creators/actions'

describe('stompblock reducer', () => {
  const initialState = {
    responding: true,
    searchedForStompblock: false,
    accessGranted: false,
    found: false,
    midiInActivity: false,
    midiOutActivity: false,
  }
  deepFreeze(initialState)

  it('searchedForStompblock success', () => {
    const action = {
      type: SEARCHED_FOR_STOMPBLOCK,
    }
    expect(stompblock(initialState, action)).toEqual({
      ...initialState,
      searchedForStompblock: true,
    })
  })

  it('stompblockFound success', () => {
    const action = {
      type: STOMPBLOCK_FOUND,
    }
    expect(stompblock(initialState, action)).toEqual({
      ...initialState,
      found: true,
    })
  })

  it('notResponding success', () => {
    const action = {
      type: NOT_RESPONDING,
    }
    expect(stompblock(initialState, action)).toEqual({
      ...initialState,
      responding: false,
    })
  })

  it('stompblockMissing success', () => {
    const action = {
      type: STOMPBLOCK_MISSING,
    }
    expect(stompblock(initialState, action)).toEqual({
      ...initialState,
      found: false,
    })
  })

  it('receivedDeviceList success', () => {
    const action = {
      type: RECEIVE_DEVICE_LIST,
    }
    expect(stompblock(initialState, action)).toEqual({
      ...initialState,
      accessGranted: true,
    })
  })

  it('midiInActivityChanged success', () => {
    const action = {
      type: MIDI_IN_ACTIVITY,
      midiInActivity: true,
    }
    expect(stompblock(initialState, action)).toEqual({
      ...initialState,
      midiInActivity: true,
    })
  })
  it('midiOutActivityChanged success', () => {
    const action = {
      type: MIDI_OUT_ACTIVITY,
      midiOutActivity: true,
    }
    expect(stompblock(initialState, action)).toEqual({
      ...initialState,
      midiOutActivity: true,
    })
  })
})


text:
/**
 * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jivesoftware.smackx.pubsub;

import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.pubsub.provider.ItemProvider;

/**
 * This class represents an item that has been, or will be published to a pubsub node. An
 * <tt>Item</tt> has several properties that are dependent on the configuration of the node to which
 * it has been or will be published.
An Item received from a node (via
 * {@link LeafNode#getItems()} or
 * {@link LeafNode#addItemEventListener(org.jivesoftware.smackx.pubsub.listener.ItemEventListener)}
 *
 *
Will always have an id (either user or server generated) unless node configuration has both
 * {@link ConfigureForm#isPersistItems()} and {@link ConfigureForm#isDeliverPayloads()}set to false.
 *
Will have a payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()}
 * set to true, otherwise it will be null.
 *
An Item created to send to a node (via {@link LeafNode#send()} or {@link LeafNode#publish()}
 *
 *
The id is optional, since the server will generate one if necessary, but should be used if it
 * is meaningful in the context of the node. This value must be unique within the node that it is
 * sent to, since resending an item with the same id will overwrite the one that already exists if
 * the items are persisted.
 *
Will require payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()}
 * set to true.
 *

 * To customise the payload object being returned from the {@link #getPayload()} method, you can add
 * a custom parser as explained in {@link ItemProvider}.
 * @author Robin Collier
 */
public class PayloadItem<E extends PacketExtension> extends Item {
	private E payload;

	/**
	 * Create an <tt>Item</tt> with no id and a payload The id will be set by the server.
	 * @param payloadExt A {@link PacketExtension} which represents the payload data.
	 */
	public PayloadItem(E payloadExt) {
		super();
		if (payloadExt == null)
			throw new IllegalArgumentException("payload cannot be 'null'");
		payload = payloadExt;
	}
	/**
	 * Create an <tt>Item</tt> with an id and payload.
	 * @param itemId The id of this item. It can be null if we want the server to set the id.
	 * @param payloadExt A {@link PacketExtension} which represents the payload data.
	 */
	public PayloadItem(String itemId, E payloadExt) {
		super(itemId);
		if (payloadExt == null)
			throw new IllegalArgumentException("payload cannot be 'null'");
		payload = payloadExt;
	}
	/**
	 * Create an <tt>Item</tt> with an id, node id and payload.
	 *

	 * Note: This is not valid for publishing an item to a node, only receiving from one as
	 * part of {@link Message}. If used to create an Item to publish (via
	 * {@link LeafNode#publish(Item)}, the server may return an error for an invalid packet.
	 * @param itemId The id of this item.
	 * @param nodeId The id of the node the item was published to.
	 * @param payloadExt A {@link PacketExtension} which represents the payload data.
	 */
	public PayloadItem(String itemId, String nodeId, E payloadExt) {
		super(itemId, nodeId);
		if (payloadExt == null)
			throw new IllegalArgumentException("payload cannot be 'null'");
		payload = payloadExt;
	}
	/**
	 * Get the payload associated with this <tt>Item</tt>. Customising the payload parsing from the
	 * server can be accomplished as described in {@link ItemProvider}.
	 * @return The payload as a {@link PacketExtension}.
	 */
	public E getPayload() {
		return payload;
	}
	@Override
	public String toXML() {
		StringBuilder builder = new StringBuilder("<item");
		if (getId() != null) {
			builder.append(" id='");
			builder.append(getId());
			builder.append("'");
		}
		if (getNode() != null) {
			builder.append(" node='");
			builder.append(getNode());
			builder.append("'");
		}
		builder.append(">");
		builder.append(payload.toXML());
		builder.append("</item>");
		return builder.toString();
	}
	@Override
	public String toString() {
		return getClass().getName() + " | Content [" + toXML() + "]";
	}
}


text:
var GPProperties = Class.create();
GPProperties.prototype =
{

	initialize:function(ctx, action){
		this.action = action;
		this._ctx = ctx
		//this.cste= $H({decorator:'none', ctx:ctx});
	},

	createParams:function(params){ return $H({decorator:'none', ctx:this._ctx}).merge(params); },

	uploadLicense:function(){
		if ($F('license_txt') == ''){return;}
		this.action.uploadLicense(this.createParams({refreshRegistration:false, newLicense:$F('license_txt')}));
	},

	getRunnersPane:function(id){
		GP.View.showPane('runnersPane_display','paneGroup','div');
		this.action.getRunnersPane(this.createParams({id:'none'}));
	},
	getRunner:function(id, selectedRunnerName){ this.action.getRunnersPane(this.createParams({id:id, selectedRunnerName:(selectedRunnerName ? selectedRunnerName : $F('selectedRunner'))})); },
	showRunnerInputs:function(id){this.action.getRunnersPane(this.createParams({id:id, addMode:true})); },
	addRunner:function(id){
		var runnerName = $F('runnerName');
		if (runnerName == ''){return;}
		this.action.addRunner(this.createParams({id:id, newRunnerName:runnerName, newCmdLineTemplate:$F('cmdLineTemplate'), newMainClass:$F('mainClass'), newServerName:$F('serverName'), newServerPort:$F('serverPort'), newEnvType:$F('envType'),  secured:$('secured').checked, addMode:true}));
	},
	removeRunner:function(id){this.action.removeRunner(this.createParams({id:id, selectedRunnerName:$F('selectedRunner')})); },
	editRunnerProperties:function(id){this.action.editRunnerProperties(this.createParams({id:id, selectedRunnerName:$F('selectedRunner'), editPropertiesMode:true}));},
	updateRunnerProperties:function(id){
		if ($F('runnerName') == ''){return;}
		this.action.updateRunnerProperties(this.createParams({id:id, selectedRunnerName:$F('selectedRunner'), newRunnerName:$F('runnerName'), newCmdLineTemplate:$F('cmdLineTemplate'), newServerName:$F('serverName'), newServerPort:$F('serverPort'), secured:$('secured').checked, newMainClass:$F('mainClass'), newEnvType:$F('envType'), editPropertiesMode:true}));
	},
	editRunnerClasspaths:function(id){this.action.editRunnerClasspaths(this.createParams({id:id, selectedRunnerName:$F('selectedRunner'), editClasspathsMode:true})); },
	editRunnerClasspath:function(id, classpath){
		classpath = classpath.replace(/\\/g, "/");
		this.action.editRunnerClasspath(this.createParams({id:id, selectedRunnerName:$F('selectedRunner'), classpath:classpath, editClasspathsMode:false}));
	},

	editSutClasspath:function(id, projectName, classpath){
		classpath = classpath.replace(/\\/g, "/");
		this.action.editSutClasspath(this.createParams({id:id, selectedSutName:$F('selectedSut'), projectName:projectName, sutClasspath:classpath, editClasspathsMode:false}));
	},

	getRegistration:function(id){
		GP.View.switchView('registrationPane_display', 'fileSystemPane_display');
		GP.View.hide('configurationPane_display');
		this.action.getRegistration(this.createParams({id:id}));
	},
	editRegistration:function(id){this.action.editRegistration(this.createParams({id:id, projectName:($('projectName')? $F('projectName') : ''), repositoryName:($('repositoryName')? $F('repositoryName') : ''), readonly:true, editMode:true})); },
	register:function(id){
		if($F('repositoryName') === ''){ return; }
		var newProjectName = $('newProjectName') ? $F('newProjectName') : 'NA';
		this.action.register(this.createParams({id:id, repositoryName:$F('repositoryName'), projectName:$F('projectName'), newProjectName:newProjectName, username:$F('username'), pwd:$F('pwd')}));
	},
	updateRegistration:function(id){
		if($F('repositoryName') === ''){ return; }
		var newProjectName = $('newProjectName') ? $F('newProjectName') : 'NA';
		this.action.updateRegistration(this.createParams({id:id, repositoryName:$F('repositoryName'), projectName:$F('projectName'), newProjectName:newProjectName, username:$F('username'), pwd:$F('pwd')}));
	},
	getSutsPane:function(id, projectName){
		var readonly = $('readonly') ? true : false;
		this.action.getSutsPane(this.createParams({id:id, projectName:projectName ? projectName : $F('projectName'), readonly:readonly}));
	},
	getSut:function(id, projectName, selectedSutName){
		var readonly = $('readonly') ? true : false;
		this.action.getSutsPane(this.createParams({id:id, projectName:projectName, selectedSutName:selectedSutName ? selectedSutName : $F('selectedSut'), readonly:readonly}));
	},
	showSutInputs:function(id, projectName){ this.action.getSutsPane(this.createParams({id:id, projectName:projectName, addMode:true})); },
	addSut:function(id, projectName){
		if ($F('newSutName') == ''){return;}
		this.action.addSut(this.createParams({id:id, projectName:projectName, newSutName:$F('newSutName'), newFixtureFactory:$F('fixtureFactory'), newFixtureFactoryArgs:$F('fixtureFactoryArgs'), newRunnerName:$F('sutRunnerName'), newProjectDependencyDescriptor:$F('projectDependencyDescriptor'), addMode:true}));
	},
	removeSut:function(id, projectName){ this.action.removeSut(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut')})); },
	editSutProperties:function(id, projectName){ this.action.editSutProperties(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut'), editPropertiesMode:true})); },
	updateSutProperties:function(id, projectName){
		if ($F('newSutName') == ''){return;}
		this.action.updateSutProperties(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut'), newSutName:$F('newSutName'), newFixtureFactory:$F('fixtureFactory'), newFixtureFactoryArgs:$F('fixtureFactoryArgs'), newRunnerName:$F('sutRunnerName'), newProjectDependencyDescriptor:$F('projectDependencyDescriptor'), editPropertiesMode:true}));
	},
	editSutClasspaths:function(id, projectName){ this.action.editSutClasspaths(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut'), editClasspathsMode:true})); },
	editSutFixtures:function(id, projectName){ this.action.editSutFixtures(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut'), editFixturesMode:true})); },
	editSutFixture:function(id, projectName, newFixtureClasspath) {
		var newFixtureClasspath = newFixtureClasspath.replace(/\\/g, "/");
		this.action.editSutFixture(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut'), fixtureClasspath:newFixtureClasspath, editFixturesMode:false}));
	},
	removeSystemUnderTest:function(id, projectName){ this.action.removeSystemUnderTest(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut')})); },
	setSutAsDefault:function(id, projectName){ this.action.setSutAsDefault(this.createParams({id:id, projectName:projectName, selectedSutName:$F('selectedSut')})); },
	getFileSystemRegistration:function(){
		GP.View.showPane('fileSystemPane_display','paneGroup','div');
		this.action.getFileSystemRegistration(this.createParams({editMode:false}));
	},
	editFileSystem:function(){this.action.editFileSystem(this.createParams({editMode:true})); },
	addFileSystem:function(){
		if ($F('newFileSystemName') == ''){return;}
		var path = $F('newFileSystemUrl');
		if (path == ''){return;}
		path = path.replace(/\\/g, "/");
		this.action.addFileSystem(this.createParams({projectName:$F('newProjectName'), newName:$F('newFileSystemName'), newBaseTestUrl:path, editMode:true}));
	},
	removeFileSystem:function(repositoryUid){this.action.removeFileSystem(this.createParams({repositoryUid:repositoryUid, editMode:true})); },

	getLicensePane:function(){
		GP.View.showPane('license_display','paneGroup','div');
		this.action.getLicensePane(this.createParams({id:'none'}));
	},

	editDbms:function(){
		GP.View.showPane('dbmsConfigPane_display','paneGroup','div');
		this.action.getInstallWizardPane(this.createParams({editMode:true}));
	},
	getDbmsConfigPane:function(){
		GP.View.showPane('dbmsConfigPane_display','paneGroup','div');
		this.action.getInstallWizardPane(this.createParams({id:'none'}));
	},
	updateQuickDbmsConfiguration:function(){ this.action.updateDbmsConfiguration(this.createParams({installType:$F('installType_Cmb'), hibernateDialect:'org.hibernate.dialect.HSQLDialect'})); },
	updateCustomDbmsConfiguration:function(){
		if($F('jndi_txtfield') === ''){ return; }
		this.action.updateDbmsConfiguration(this.createParams({installType:$F('installType_Cmb'),jndiUrl:$F('jndi_txtfield'), hibernateDialect:$F('dbms')})); },
	testDbmsConnection:function(){
		if($F('jndi_txtfield') === ''){ return; }
		GP.View.write('testConnection_display', ''); this.action.testDbmsConnection(this.createParams({jndiUrl:$F('jndi_txtfield'), hibernateDialect:$F('dbms')})); },
	changeInstallationType:function(){ GP.View.write('dbmsChoice_display', ''); this.action.changeInstallationType(this.createParams({installType:$F('installType_Cmb')}));},
	getGpProjectPane:function(){
		GP.View.showPane('GpProjectPane_display','paneGroup','div');
		this.action.getGpProjectPane(this.createParams({id:'none'}));
	},

	getDemoPane:function() {
		GP.View.showPane('demoPane_display','paneGroup','div');
		this.action.getDemoPane(this.createParams({id:'none'}));
	},
	createDemoSpace:function(checkUsername) {
		if (checkUsername == 'true') {
			if ($F('username') == ''){return;}
		}
		GP.View.showPane('demoPane_display','paneGroup','div');
		this.action.createDemoSpace(this.createParams({username:$F('username'), pwd:$F('pwd')}));
	},
	removeDemoSpace:function() {
		GP.View.showPane('demoPane_display','paneGroup','div');
		this.action.removeDemoSpace(this.createParams({}));
	},

	addAjaxListeners:function(){
		Ajax.Responders.register({
			  onCreate: function() {
			    	GP.View.hide('sutsPaneError_display');
			    	GP.View.hide('runnersPaneError_display');
			    	GP.View.hide('registrationPaneError_display');
			    	Element.setOpacity('waiting_display', 1.0);
			    	GP.View.switchView('waiting_display', 'systemError_display');
			  },
			  onComplete: function() {
			    if (Ajax.activeRequestCount == 0)
			      	GP.View.fade('waiting_display', 0.3);
			  },
			  onFailure: function() {
			    if (Ajax.activeRequestCount == 0)
			    	GP.View.switchView('systemError_display', 'waiting_display');
			  },
			  onException: function() {
			    if (Ajax.activeRequestCount == 0)
			    	GP.View.switchView('systemError_display', 'waiting_display');
			  }
			});
	}
};


text:
module ArtifactLogger::ActiveRecord
  extend ActiveSupport::Concern

  module ClassMethods
    def enable_artifact_logger options={}
      include ArtifactLogger::ModelExtensions

      #Store the levels which are valid
      @_valid_levels = options[:levels]
    end
  end
end


text:
import Graph

class GraphExecutionType(object):
	def __init__(self):
		# @AttributeType GraphExecutionType
		self.___pATH = None
		# @AttributeType GraphExecutionType
		self.___cLUSTER = None
		# @AttributeType GraphExecutionType
		self.___rANK = None


text: require 'carrierwave/audio'


text:
package org.alljoyn.bus.samples.simpleservice;

import org.alljoyn.bus.BusAttachment;
import org.alljoyn.bus.BusListener;
import org.alljoyn.bus.BusObject;
import org.alljoyn.bus.Mutable;
import org.alljoyn.bus.SessionOpts;
import org.alljoyn.bus.SessionPortListener;
import org.alljoyn.bus.Status;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class Service extends Activity {
    /* Load the native alljoyn_java library. */
    static {
        System.loadLibrary("alljoyn_java");
    }

    private static final String TAG = "SimpleService";

    private static final int MESSAGE_PING = 1;
    private static final int MESSAGE_PING_REPLY = 2;
    private static final int MESSAGE_POST_TOAST = 3;

    private ArrayAdapter<String> mListViewArrayAdapter;
    private ListView mListView;
    private Menu menu;

    private Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
            case MESSAGE_PING:
                String ping = (String) msg.obj;
                mListViewArrayAdapter.add("Ping:  " + ping);
                break;
            case MESSAGE_PING_REPLY:
                String reply = (String) msg.obj;
                mListViewArrayAdapter.add("Reply:  " + reply);
                break;
            case MESSAGE_POST_TOAST:
                Toast.makeText(getApplicationContext(), (String) msg.obj, Toast.LENGTH_LONG).show();
                break;
            default:
                break;
            }
        }
    };

    /* The AllJoyn object that is our service. */
    private SimpleService mSimpleService;

    /* Handler used to make calls to AllJoyn methods. See onCreate(). */
    private Handler mBusHandler;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mListViewArrayAdapter = new ArrayAdapter<String>(this, R.layout.message);
        mListView = (ListView) findViewById(R.id.ListView);
        mListView.setAdapter(mListViewArrayAdapter);

        /* Make all AllJoyn calls through a separate handler thread to prevent blocking the UI. */
        HandlerThread busThread = new HandlerThread("BusHandler");
        busThread.start();
        mBusHandler = new BusHandler(busThread.getLooper());

        /* Start our service. */
        mSimpleService = new SimpleService();
        mBusHandler.sendEmptyMessage(BusHandler.CONNECT);
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.mainmenu, menu);
        this.menu = menu;
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
        case R.id.quit:
            finish();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        /* Disconnect to prevent any resource leaks. */
        mBusHandler.sendEmptyMessage(BusHandler.DISCONNECT);
    }

    /* The class that is our AllJoyn service.  It implements the SimpleInterface. */
    class SimpleService implements SimpleInterface, BusObject {

        /*
         * This is the code run when the client makes a call to the Ping method of the
         * SimpleInterface.  This implementation just returns the received String to the caller.
         *
         * This code also prints the string it received from the user and the string it is
         * returning to the user to the screen.
         */
        public String Ping(String inStr) {
            sendUiMessage(MESSAGE_PING, inStr);

            /* Simply echo the ping message. */
            sendUiMessage(MESSAGE_PING_REPLY, inStr);
            return inStr;
        }

        /* Helper function to send a message to the UI thread. */
        private void sendUiMessage(int what, Object obj) {
            mHandler.sendMessage(mHandler.obtainMessage(what, obj));
        }
    }

    /* This class will handle all AllJoyn calls. See onCreate(). */
    class BusHandler extends Handler {
        /*
         * Name used as the well-known name and the advertised name.  This name must be a unique name
         * both to the bus and to the network as a whole.  The name uses reverse URL style of naming.
         */
        private static final String SERVICE_NAME = "org.alljoyn.bus.samples.simple";
        private static final short CONTACT_PORT=42;

        private BusAttachment mBus;

        /* These are the messages sent to the BusHandler from the UI. */
        public static final int CONNECT = 1;
        public static final int DISCONNECT = 2;

        public BusHandler(Looper looper) {
            super(looper);
        }

        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
            /* Connect to the bus and start our service. */
            case CONNECT: {
                org.alljoyn.bus.alljoyn.DaemonInit.PrepareDaemon(getApplicationContext());
                /*
                 * All communication through AllJoyn begins with a BusAttachment.
                 *
                 * A BusAttachment needs a name. The actual name is unimportant except for internal
                 * security. As a default we use the class name as the name.
                 *
                 * By default AllJoyn does not allow communication between devices (i.e. bus to bus
                 * communication).  The second argument must be set to Receive to allow
                 * communication between devices.
                 */
                mBus = new BusAttachment(getPackageName(), BusAttachment.RemoteMessage.Receive);

                /*
                 * Create a bus listener class
                 */
                mBus.registerBusListener(new BusListener());

                /*
                 * To make a service available to other AllJoyn peers, first register a BusObject with
                 * the BusAttachment at a specific path.
                 *
                 * Our service is the SimpleService BusObject at the "/SimpleService" path.
                 */
                Status status = mBus.registerBusObject(mSimpleService, "/SimpleService");
                logStatus("BusAttachment.registerBusObject()", status);
                if (status != Status.OK) {
                    finish();
                    return;
                }

                /*
                 * The next step in making a service available to other AllJoyn peers is to connect the
                 * BusAttachment to the bus with a well-known name.
                 */
                /*
                 * connect the BusAttachement to the bus
                 */
                status = mBus.connect();
                logStatus("BusAttachment.connect()", status);
                if (status != Status.OK) {
                    finish();
                    return;
                }

                /*
                 * Create a new session listening on the contact port of the chat service.
                 */
                Mutable.ShortValue contactPort = new Mutable.ShortValue(CONTACT_PORT);

                SessionOpts sessionOpts = new SessionOpts();
                sessionOpts.traffic = SessionOpts.TRAFFIC_MESSAGES;
                sessionOpts.isMultipoint = false;
                sessionOpts.proximity = SessionOpts.PROXIMITY_ANY;
                sessionOpts.transports = SessionOpts.TRANSPORT_ANY;

                status = mBus.bindSessionPort(contactPort, sessionOpts, new SessionPortListener() {
                    @Override
                    public boolean acceptSessionJoiner(short sessionPort, String joiner, SessionOpts sessionOpts) {
                        if (sessionPort == CONTACT_PORT) {
                            return true;
                        } else {
                            return false;
                        }
                    }
                });
                logStatus(String.format("BusAttachment.bindSessionPort(%d, %s)",
                                        contactPort.value, sessionOpts.toString()), status);
                if (status != Status.OK) {
                    finish();
                    return;
                }

                /*
                 * request a well-known name from the bus
                 */
                int flag = BusAttachment.ALLJOYN_REQUESTNAME_FLAG_REPLACE_EXISTING | BusAttachment.ALLJOYN_REQUESTNAME_FLAG_DO_NOT_QUEUE;

                status = mBus.requestName(SERVICE_NAME, flag);
                logStatus(String.format("BusAttachment.requestName(%s, 0x%08x)", SERVICE_NAME, flag), status);
                if (status == Status.OK) {
                    /*
                     * If we successfully obtain a well-known name from the bus
                     * advertise the same well-known name
                     */
                    status = mBus.advertiseName(SERVICE_NAME, sessionOpts.transports);
                    logStatus(String.format("BusAttachement.advertiseName(%s)", SERVICE_NAME), status);
                    if (status != Status.OK) {
                        /*
                         * If we are unable to advertise the name, release
                         * the well-known name from the local bus.
                         */
                        status = mBus.releaseName(SERVICE_NAME);
                        logStatus(String.format("BusAttachment.releaseName(%s)", SERVICE_NAME), status);
                        finish();
                        return;
                    }
                }

                break;
            }

            /* Release all resources acquired in connect. */
            case DISCONNECT: {
                /*
                 * It is important to unregister the BusObject before disconnecting from the bus.
                 * Failing to do so could result in a resource leak.
                 */
                mBus.unregisterBusObject(mSimpleService);
                mBus.disconnect();
                mBusHandler.getLooper().quit();
                break;
            }

            default:
                break;
            }
        }
    }

    private void logStatus(String msg, Status status) {
        String log = String.format("%s: %s", msg, status);
        if (status == Status.OK) {
            Log.i(TAG, log);
        } else {
            Message toastMsg = mHandler.obtainMessage(MESSAGE_POST_TOAST, log);
            mHandler.sendMessage(toastMsg);
            Log.e(TAG, log);
        }
    }
}


text:
mccn
====

Minecraft Cloud Network


text:
package github

import (
	// Internal
	"github.com/salsaflow/salsaflow/config/loader"
	"github.com/salsaflow/salsaflow/modules/common"
)

const (
	ModuleId   = "salsaflow.modules.codereview.github"
	ModuleKind = loader.ModuleKindCodeReview
)

type module struct{}

func NewModule() loader.Module {
	return &module{}
}

func (mod *module) Id() string {
	return ModuleId
}

func (mod *module) Kind() loader.ModuleKind {
	return ModuleKind
}

func (mod *module) ConfigSpec() loader.ModuleConfigSpec {
	return newConfigSpec()
}

func (mod *module) NewCodeReviewTool() (common.CodeReviewTool, error) {
	return newCodeReviewTool()
}


text:
![](slider_full.png)

Example:

```
import 'dart:math';
// EXCLUDE_FROM_GALLERY_DOCS_END
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';

/// This is just a simple line chart with a behavior that adds slider controls.
///
/// A [Slider] behavior is added manually to enable slider controls, with an
/// initial position at 1 along the domain axis.
///
/// An onChange event handler has been configured to demonstrate updating a div
/// with data from the slider's current position. An "initial" drag state event
/// will be fired when the chart is drawn because an initial domain value is
/// set.
///
/// [Slider.moveSliderToDomain] can be called to programmatically position the
/// slider. This is useful for synchronizing the slider with external elements.
class SliderLine extends StatefulWidget {
  final List<charts.Series> seriesList;
  final bool animate;

  SliderLine(this.seriesList, {this.animate});

  /// Creates a [LineChart] with sample data and no transition.
  factory SliderLine.withSampleData() {
    return new SliderLine(
      _createSampleData(),
      // Disable animations for image tests.
      animate: false,
    );
  }

  // We need a Stateful widget to build the selection details with the current
  // selection as the state.
  @override
  State<StatefulWidget> createState() => new _SliderCallbackState();

  /// Create one series with sample hard coded data.
  static List<charts.Series<LinearSales, int>> _createSampleData() {
    final data = [
      new LinearSales(0, 5),
      new LinearSales(1, 25),
      new LinearSales(2, 100),
      new LinearSales(3, 75),
    ];

    return [
      new charts.Series<LinearSales, int>(
        id: 'Sales',
        domainFn: (LinearSales sales, _) => sales.year,
        measureFn: (LinearSales sales, _) => sales.sales,
        data: data,
      )
    ];
  }
}

class _SliderCallbackState extends State<SliderLine> {
  num _sliderDomainValue;
  String _sliderDragState;
  Point<int> _sliderPosition;

  // Handles callbacks when the user drags the slider.
  _onSliderChange(Point<int> point, dynamic domain, String roleId,
      charts.SliderListenerDragState dragState) {
    // Request a build.
    void rebuild(_) {
      setState(() {
        _sliderDomainValue = (domain * 10).round() / 10;
        _sliderDragState = dragState.toString();
        _sliderPosition = point;
      });
    }

    SchedulerBinding.instance.addPostFrameCallback(rebuild);
  }

  @override
  Widget build(BuildContext context) {
    // The children consist of a Chart and Text widgets below to hold the info.
    final children = <Widget>[
      new SizedBox(
          height: 150.0,
          child: new charts.LineChart(
            widget.seriesList,
            animate: widget.animate,
            // Configures a [Slider] behavior.
            //
            // Available options include:
            //
            // [eventTrigger] configures the type of mouse gesture that controls
            // the slider.
            //
            // [handleRenderer] draws a handle for the slider. Defaults to a
            // rectangle.
            //
            // [initialDomainValue] sets the initial position of the slider in
            // domain units. The default is the center of the chart.
            //
            // [onChangeCallback] will be called when the position of the slider
            // changes during a drag event.
            //
            // [roleId] optional custom role ID for the slider. This can be used to
            // allow multiple [Slider] behaviors on the same chart. Normally, there can
            // only be one slider (per event trigger type) on a chart. This setting
            // allows for configuring multiple independent sliders.
            //
            // [snapToDatum] configures the slider to snap snap onto the nearest
            // datum (by domain distance) when dragged. By default, the slider
            // can be positioned anywhere along the domain axis.
            //
            // [style] takes in a [SliderStyle] configuration object, and
            // configures the color and sizing of the slider line and handle.
            behaviors: [
              new charts.Slider(
                  initialDomainValue: 1.0, onChangeCallback: _onSliderChange),
            ],
          )),
    ];

    // If there is a slider change event, then include the details.
    if (_sliderDomainValue != null) {
      children.add(new Padding(
          padding: new EdgeInsets.only(top: 5.0),
          child: new Text('Slider domain value: ${_sliderDomainValue}')));
    }
    if (_sliderPosition != null) {
      children.add(new Padding(
          padding: new EdgeInsets.only(top: 5.0),
          child: new Text(
              'Slider position: ${_sliderPosition.x}, ${_sliderPosition.y}')));
    }
    if (_sliderDragState != null) {
      children.add(new Padding(
          padding: new EdgeInsets.only(top: 5.0),
          child: new Text('Slider drag state: ${_sliderDragState}')));
    }

    return new Column(children: children);
  }
}

/// Sample linear data type.
class LinearSales {
  final int year;
  final int sales;

  LinearSales(this.year, this.sales);
}
```


text:
$(function(){
    var $fname = $("#fname"),
          $lname = $("#lname"),
          $course = $("#course"),
          $year = $("#year"),
          $email = $("#email"),
          $phone = $("#phone_no"),
          $stud_status = $("#statuss"),
          $letter = $("#coverLetter"),
          $resume = $("#resume"),
          $form = $("#resume_form"),
          $notify = $("#notify"),
          $submit  = $("#submit_resume");

          $submit.click(function( event ){
                event.stopImmediatePropagation();
                event.preventDefault();
                var data = {
                    fname: $fname.val(),
                    lname: $lname.val(),
                    course: $course.val(),
                    year: $year.val(),
                    email: $email.val(),
                    phone_no: $phone.val(),
                    statuss: $stud_status.val(),
                    coverLetter: $letter.val(),
                    resume: $resume.val(),
                    submit_resume: $submit.val()
                };

                $.ajax({
                    url:  $form.attr('action') ,
                    type: "POST",
                    data: data,
                    dataType: "json"
                })
                .done(function( responseData){
                    if (responseData.status){
                        $form.find("input").val("");
                        $form.find("textarea").val();
                        $notify.html(responseData.message);
                    }else{
                        $notify.html(responseData.message);
                    }
                })

                .fail(function( responseData ){
                    console.log(responseData);
                });
          });
});


text:
mvn compile
mvn exec:java -Dexec.mainClass="codecrafter.orders.Program"


text:
class ofApp : public ofBaseApp {

	public:
        priority_queue<Patient*, vector<Patient*>, Patient::PatientCompare> waitingRoom;
        vector<Patient*> waitingRoomVector;
        vector<Doctor*> doctorOffices;

        void setup();
		void update();
		void draw();

        Doctor doctor1 = Doctor(875,125);
        Doctor doctor2 = Doctor(875,325);
        Doctor doctor3 = Doctor(875,525);

		void keyPressed(int key);
		void mousePressed(int x, int y, int button);
};


text:
package yaml

import (
	"errors"
	"io/ioutil"
)

// LoadYAMLFile is to read yaml file
func LoadYAMLFile(filePath string) ([]byte, error) {
	// Loading jsonfile
	if filePath == "" {
		err := errors.New("nothing JSON file")
		return nil, err
	}

	file, err := ioutil.ReadFile(filePath)
	if err != nil {
		return nil, err
	}
	return file, nil
}


text:
<?php

namespace SIICBundle\Entity;

/**
 * Comentarioreportado
 */
class Comentarioreportado
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $justificacion;

    /**
     * @var boolean
     */
    private $status;

    /**
     * @var \DateTime
     */
    private $createdAt;

    /**
     * @var \SIICBundle\Entity\Comentariosactividad
     */
    private $comentariosactividad;

    /**
     * @var \SIICBundle\Entity\Usuario
     */
    private $usuario;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set justificacion
     *
     * @param string $justificacion
     *
     * @return Comentarioreportado
     */
    public function setJustificacion($justificacion)
    {
        $this->justificacion = $justificacion;

        return $this;
    }

    /**
     * Get justificacion
     *
     * @return string
     */
    public function getJustificacion()
    {
        return $this->justificacion;
    }

    /**
     * Set status
     *
     * @param boolean $status
     *
     * @return Comentarioreportado
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return boolean
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     *
     * @return Comentarioreportado
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set comentariosactividad
     *
     * @param \SIICBundle\Entity\Comentariosactividad $comentariosactividad
     *
     * @return Comentarioreportado
     */
    public function setComentariosactividad(\SIICBundle\Entity\Comentariosactividad $comentariosactividad = null)
    {
        $this->comentariosactividad = $comentariosactividad;

        return $this;
    }

    /**
     * Get comentariosactividad
     *
     * @return \SIICBundle\Entity\Comentariosactividad
     */
    public function getComentariosactividad()
    {
        return $this->comentariosactividad;
    }

    /**
     * Set usuario
     *
     * @param \SIICBundle\Entity\Usuario $usuario
     *
     * @return Comentarioreportado
     */
    public function setUsuario(\SIICBundle\Entity\Usuario $usuario = null)
    {
        $this->usuario = $usuario;

        return $this;
    }

    /**
     * Get usuario
     *
     * @return \SIICBundle\Entity\Usuario
     */
    public function getUsuario()
    {
        return $this->usuario;
    }
}


text:
var _        = require('lodash');
var seed     = require('./fixtures/seed');
var hyena    = require('../');
var Document = hyena.Document;
var sinon    = require('sinon');
var expect   = require('chai').expect;
var assert   = sinon.assert;
var sandbox  = sinon.sandbox.create();
var Faker    = require('Faker');
var User     = hyena.model('User');
var Collection = require('../lib/collection');
require('mocha');

describe('Document collection', function () {

  beforeEach(function (done) {
    seed.clear(function () {
      seed.create(function () {
        var conn = hyena.connection;
        var query = "INSERT INTO `friends` VALUES (1,2,'APPROVE'), (1,3,'APPROVE'), (1,4,'APPROVE'), (1,5,'PENDING')";
        conn.query(query, done);
      });
    });
  });

  afterEach(function (done) {
    var conn = hyena.connection;
    var query = "TRUNCATE TABLE `friends`";
    conn.query(query, done);
  });

  it('should popuate friends with 3 friends', function(done) {
    User.findById(1, function (err, doc) {
      doc.populate('friends', function (err, doc) {
        expect(doc).to.have.property('friends').to.have.length(3);
       done();
      });
    });
  });

  it('should have property friends instance of Collection', function(done) {
    User.findById(1, function (err, doc) {
      doc.populate('friends', function (err, doc) {
        expect(doc).to.have.property('friends').to.be.instanceof(Collection);
        done();
      });
    });
  });

  it('should have property friends instance of Collection', function(done) {
    var doc = new User({ id: 1 });
    var friend = new User({ id: 3 });
    var additionalFields = { status: 'APPROVE' };
    friend.friends.add(doc, additionalFields, function (err) {
      expect(friend.friends).to.have.length(1);
      expect(friend.friends[0].id).to.equal(1);
      done();
    });
  });

  it('should add additonal fields', function(done) {
    var doc = new User({ id: 1 });
    var friend = new User({ id: 3 });
    friend.friends.add(doc, function (err) {
      expect(friend.friends).to.have.length(0);
      done();
    });
  });

});


text:
namespace meshModify{

  class ScaleHandler : public Handler {

  public:

    virtual void handle(Mesh& mesh, const Json::Value& modification) {

      const Json::Value& options = modification["options"];

      const double factor = options["factor"].asDouble();

      for( arma::vec& vertex: mesh.get_vertices() ) {

        vertex(0) *= factor;
        vertex(1) *= factor;
        vertex(2) *= factor;

      }

    }

  };

}
#endif


text:
/* A Bison parser, made by GNU Bison 2.3.  */

/* Skeleton interface for Bison's Yacc-like parsers in C

   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
   Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     KW_TRANSFORM = 258,
     KW_FROM = 259,
     KW_TO = 260,
     KW_THROUGH = 261,
     KW_LE = 262,
     KW_GE = 263,
     KW_EQ = 264,
     KW_WHERE = 265,
     KW_AND = 266,
     KW_OR = 267,
     KW_PRIMARY = 268,
     KW_SECONDARY = 269,
     KW_PRIORITY = 270,
     KW_ROTATABLE = 271,
     KW_MAIN = 272,
     KW_RECURSIVE = 273,
     KW_DUPLICATE = 274,
     KW_MEMOIZED = 275,
     KW_GENERATOR = 276,
     KW_TEMPLATE = 277,
     KW_TUNABLE = 278,
     KW_CONFIG = 279,
     KW_PARAM = 280,
     KW_ACCURACYMETRIC = 281,
     KW_ACCURACYBINS = 282,
     KW_ACCURACYVARIABLE = 283,
     KW_RULE = 284,
     TOK_INTEGER = 285,
     TOK_FLOAT = 286,
     TOK_RULEBODY = 287,
     IDENT = 288
   };
#endif
/* Tokens.  */
#define KW_TRANSFORM 258
#define KW_FROM 259
#define KW_TO 260
#define KW_THROUGH 261
#define KW_LE 262
#define KW_GE 263
#define KW_EQ 264
#define KW_WHERE 265
#define KW_AND 266
#define KW_OR 267
#define KW_PRIMARY 268
#define KW_SECONDARY 269
#define KW_PRIORITY 270
#define KW_ROTATABLE 271
#define KW_MAIN 272
#define KW_RECURSIVE 273
#define KW_DUPLICATE 274
#define KW_MEMOIZED 275
#define KW_GENERATOR 276
#define KW_TEMPLATE 277
#define KW_TUNABLE 278
#define KW_CONFIG 279
#define KW_PARAM 280
#define KW_ACCURACYMETRIC 281
#define KW_ACCURACYBINS 282
#define KW_ACCURACYVARIABLE 283
#define KW_RULE 284
#define TOK_INTEGER 285
#define TOK_FLOAT 286
#define TOK_RULEBODY 287
#define IDENT 288

#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 68 "pbparser.ypp"
{
  int i;
  double d;
  const char* str;
  petabricks::Transform*       transform;
  petabricks::TransformList*   transforms;
  petabricks::MatrixDef*       matrixdef;
  petabricks::MatrixDefList*   matrixdefs;
  petabricks::UserRule*        rule;
  petabricks::RuleList*        rules;
  petabricks::Formula*         formula;
  petabricks::FormulaList*     formulas;
  petabricks::Region*          region;
  petabricks::RegionList*      regions;
  petabricks::OrderedFreeVars* freevars;
  petabricks::TemplateArg*     templatearg;
  petabricks::TemplateArgList* templateargs;
  petabricks::DoubleList*      doublelist;
  struct { const char* str; petabricks::FormulaList* formulas; } str_formulas;
}
/* Line 1489 of yacc.c.  */
#line 136 "libpbcompiler_a-pbparser.h"
	YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif

extern YYSTYPE pblval;

#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
} YYLTYPE;
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif

extern YYLTYPE pblloc;


text:
responsive-body-classes
=======================
Copyright (c) 2014 Scott Siemens (http://scottsiemens.com)
version 0.1
Licensed under the MIT License (LICENSE.txt).
=======================
RBC - Responsive Body Class Helpers

Basic script to add body classes: (i.e. desktop, tablet, mobile, no-touch, touch).
Dependencies: jQuery

INSTALLATION:
Simply include rbc.min.js in your project.

CLASS NAMES TRIGGERED:
desktop - 960px and up
tablet - 959px - 768px
mobile - 767px and down
no-touch
touch


text:
var wfx = wfx || {};

wfx.wrapper = function(txt, lnk){

    var open = '<opml><body><outline text="';
    var text = escapeOPML(txt);
    var splitter = '" _note="';
    var note = lnk;
    var end = '" /></body></opml>';

	// Escape special characters for OPML
	// thanks go to rawbytes -- more credit to come don't worry
	function escapeOPML(i){
		var o=i
			.replace(/&/g,'&amp;')
			.replace(/</g,'&lt;')
			.replace(/>/g,'&gt;')
			.replace(/"/g,'"');
	//		.replace(/(\n)/g,'
');  for future selected text
	return (o);	}

    return open + text + splitter + note + end;
}

wfx.nodeUrl = (function(){

    var wrapOPML = wfx.wrapper;

    var get = function(){

        var $thisNode = {};

        // native backdoor api
        if (typeof window.getCurrentlyFocusedContent !== 'undefined') {
            $thisNode = window.getCurrentlyFocusedContent();
        } else {
            $thisNode = $('[contenteditable]:focus');
        }

        var text = $thisNode.text();
        var $thisAnchor = $thisNode.prev('a.bullet');

        // console.log(typeof $thisAnchor, $thisAnchor);

        if ($thisAnchor === undefined || $thisAnchor.length === 0) {
            console.warn('No selected anchor link.');
        } else {
//            window.prompt("Focused item url: ", "https://workflowy.com" + $thisAnchor.attr('href')); // + ' ' + textnode);
              window.prompt("Focused item url: ", wrapOPML(text, "https://workflowy.com" + $thisAnchor.attr('href')));
        }
    }

    return get();
}())


text:
package org.locationtech.geomesa.index.index.z2

import org.locationtech.geomesa.index.api.ShardStrategy.ZShardStrategy
import org.locationtech.geomesa.index.api.{GeoMesaFeatureIndex, IndexKeySpace}
import org.locationtech.geomesa.index.geotools.GeoMesaDataStore
import org.locationtech.geomesa.index.index.ConfiguredIndex
import org.locationtech.geomesa.index.strategies.SpatialFilterStrategy
import org.locationtech.geomesa.utils.index.IndexMode.IndexMode
import org.opengis.feature.simple.SimpleFeatureType

class XZ2Index protected (ds: GeoMesaDataStore[_], sft: SimpleFeatureType, version: Int, val geom: String, mode: IndexMode)
    extends GeoMesaFeatureIndex[XZ2IndexValues, Long](ds, sft, XZ2Index.name, version, Seq(geom), mode)
        with SpatialFilterStrategy[XZ2IndexValues, Long] {

  def this(ds: GeoMesaDataStore[_], sft: SimpleFeatureType, geom: String, mode: IndexMode) =
    this(ds, sft, XZ2Index.version, geom, mode)

  override val keySpace: XZ2IndexKeySpace = new XZ2IndexKeySpace(sft, ZShardStrategy(sft), geom)

  override val tieredKeySpace: Option[IndexKeySpace[_, _]] = None
}

object XZ2Index extends ConfiguredIndex {

  import org.locationtech.geomesa.utils.geotools.RichSimpleFeatureType.RichSimpleFeatureType

  override val name = "xz2"
  override val version = 2

  override def supports(sft: SimpleFeatureType, attributes: Seq[String]): Boolean =
    XZ2IndexKeySpace.supports(sft, attributes)

  override def defaults(sft: SimpleFeatureType): Seq[Seq[String]] =
    if (sft.nonPoints) { Seq(Seq(sft.getGeomField)) } else { Seq.empty }
}


text:
var _ = require('lodash');

var httpDefaults = {
    type: 'http',
    method: 'get'
};

var wsDefaults = {
    interval: 5000
};

var validate = function(obj, key, path) {
    'use strict';
    if (!_.has(obj, key)) {
        throw new Error('miss [' + key + '] in ' + path);
    }
};

var RouterParser = function(module) {
    'use strict';
    var _this = this;
    var routerJson = module.mod;
    validate(routerJson, 'when', module.path);

    if (!_.has(routerJson, 'type') || routerJson.type === 'http') {
        _.defaults(routerJson, httpDefaults);
        validate(routerJson, 'method', module.path);
    } else if (routerJson.type === 'ws') {
        _.defaults(routerJson, wsDefaults);
    } else {
        throw new Error('type [' + routerJson.type + '] is not available');
    }

    if (routerJson.type === 'http') {
        this.app[routerJson.method](routerJson.when, function(req, res) {
            if (routerJson.responseMap) {
                var matched = _.find(routerJson.responseMap, function(item) {
                    return JSON.stringify(item.query) === JSON.stringify(req.query);
                });
                if (matched) {
                    res.send(matched.responseData);
                    return;
                }
                matched = _.find(routerJson.responseMap, function(item) {
                    return item.query && _.where([req.query], item.query).length > 0;
                });

                if (matched) {
                    res.send(matched.responseData);
                    return;
                }
                matched = _.find(routerJson.responseMap, function(item) {
                    return item.default;
                });
                if (matched) {
                    res.send(matched.default);
                    return;
                }
                res.statusCode = 404;
                res.send('Cannot ' + req.method + ' ' + req.originalUrl);
            } else {
                res.send(routerJson.responseData);
            }
        });
    } else {
        var WebSocketServer = require('ws').Server;
        var wss = new WebSocketServer({
            path: routerJson.when,
            server: _this.server
        });

        wss.on('connection', function(ws) {
            var id = setInterval(function() {
                ws.send(JSON.stringify(routerJson.responseData));
            }, routerJson.interval);

            ws.on('close', function() {
                clearInterval(id);
            });
        });

    }
};

module.exports = RouterParser;


text:
module.exports = {
	dist: {
		src: [
			'dist/scripts/swagger-ui.js',
			'dist/scripts/swagger-client.js',
			'dist/scripts/swagger-model.js',
			'dist/scripts/swagger-modules.js',
			'dist/scripts/modules/swagger-json-parser.js',
			'dist/scripts/templates.js'
		],
		dest: 'dist/scripts/swagger-ui.js'
	},
	copyright: {
		src: [
			'copyright.txt',
			'dist/scripts/swagger-ui.min.js'
		],
		dest: 'dist/scripts/swagger-ui.min.js'
	},
	copyrightExternals: {
		src: [
			'copyright.txt',
			'dist/scripts/modules/swagger-external-references.min.js'
		],
		dest: 'dist/scripts/modules/swagger-external-references.min.js'
	},
	copyrightXml: {
		src: [
			'copyright.txt',
			'dist/scripts/modules/swagger-xml-formatter.min.js'
		],
		dest: 'dist/scripts/modules/swagger-xml-formatter.min.js'
	}
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Glycosmis sapindoides var. australiensis B.C.Stone

### Remarks
null


text:
<?xml version="1.0"?>
<MenuItems>
    <MenuItem id="accessTwitter">
        <Name>Visit dev.twitter.com</Name>
        <CallbackMethod>accessDevTwitter</CallbackMethod>
    </MenuItem>
</MenuItems>


text:
<?php

namespace FacebookAds\Object;

use FacebookAds\ApiRequest;
use FacebookAds\Cursor;
use FacebookAds\Http\RequestInterface;
use FacebookAds\TypeChecker;
use FacebookAds\Object\Fields\AdAccountGroupResultFields;

/**
 * This class is auto-genereated.
 *
 * For any issues or feature requests related to this class, please let us know
 * on github and we'll fix in our codegen framework. We'll not be able to accept
 * pull request for this class.
 *
 */

class AdAccountGroupResult extends AbstractObject {

  /**
   * @return AdAccountGroupResultFields
   */
  public static function getFieldsEnum() {
    return AdAccountGroupResultFields::getInstance();
  }

  protected static function getReferencedEnums() {
    $ref_enums = array();
    return $ref_enums;
  }

}


text:
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.IO;
using NUnit.Framework;
using SilverNeedle;
using SilverNeedle.Dice;
using SilverNeedle.Characters;
using YamlDotNet.RepresentationModel;
using System.Text;

namespace Characters {

	[TestFixture]
	public class ClassTests {

	}
}


text:
import os
import re
import time
import yaml
import socket
import subprocess
from contextlib import contextmanager
from subprocess import check_call, check_output, CalledProcessError
from xml.etree import ElementTree as ET
from xml.dom import minidom
from distutils.util import strtobool as _strtobool
from path import Path
from tempfile import NamedTemporaryFile

from charmhelpers.core import unitdata
from charmhelpers.core import hookenv
from charmhelpers.core import host
from charmhelpers import fetch

class DistConfig(object):
    """
    This class processes distribution-specific configuration options.

    Some configuration options are specific to the Hadoop distribution,
    (e.g. Apache, Hortonworks, MapR, etc). These options are immutable and
    must not change throughout the charm deployment lifecycle.

    Helper methods are provided for keys that require action. Presently, this
    includes adding/removing directories, dependent packages, and groups/users.
    Other required keys may be listed when instantiating this class, but this
    will only validate these keys exist in the yaml; it will not provide any
    helper functionality for unkown keys.

    :param str filename: File to process (default dist.yaml)
    :param list required_keys: A list of keys required to be present in the yaml

    Example dist.yaml with supported keys::

        vendor: '<name>'
        hadoop_version: '<version>'
        packages:
            - '<package 1>'
            - '<package 2>'
        groups:
            - '<name>'
        users:
            <user 1>:
                groups: ['<primary>', '<group>', '<group>']
            <user 2>:
                groups: ['<primary>']
        dirs:
            <dir 1>:
                path: '</path/to/dir>'
                perms: 0777
            <dir 2>:
                path: '{config[<option>]}'  # value comes from config option
                owner: '<user>'
                group: '<group>'
                perms: 0755
        ports:
            <name1>:
                port: <port>
                exposed_on: <service>  # optional
            <name2>:
                port: <port>
                exposed_on: <service>  # optional
    """
    def __init__(self, filename='dist.yaml', required_keys=None):
        self.yaml_file = filename
        self.dist_config = yaml.load(Path(self.yaml_file).text())

        # validate dist.yaml
        missing_keys = set(required_keys or []) - set(self.dist_config.keys())
        if missing_keys:
            raise ValueError('{} is missing required option{}: {}'.format(
                filename,
                's' if len(missing_keys) > 1 else '',
                ', '.join(missing_keys)))

        for opt in required_keys:
            setattr(self, opt, self.dist_config[opt])

    def path(self, key):
        config = hookenv.config()
        dirs = {name: self.dirs[name]['path'] for name in self.dirs.keys()}
        levels = 0
        old_path = None
        path = self.dirs[key]['path']
        while '{' in path and path != old_path:
            levels += 1
            if levels > 100:
                raise ValueError('Maximum level of nested dirs references exceeded for: {}'.format(key))
            old_path = path
            path = path.format(config=config, dirs=dirs)
        return Path(path)

    def port(self, key):
        return self.ports.get(key, {}).get('port')

    def exposed_ports(self, service):
        exposed = []
        for port in self.ports.values():
            if port.get('exposed_on') == service:
                exposed.append(port['port'])
        return exposed

    def add_dirs(self):
        for name, details in self.dirs.items():
            host.mkdir(
                self.path(name),
                owner=details.get('owner', 'root'),
                group=details.get('group', 'root'),
                perms=details.get('perms', 0o755))

    def add_packages(self):
        with disable_firewall():
            fetch.apt_update()
            fetch.apt_install(self.packages)

    def add_users(self):
        for group in self.groups:
            host.add_group(group)
        for username, details in self.users.items():
            primary_grp = None
            secondary_grps = None
            groups = details.get('groups', [])
            if groups:
                primary_grp = groups[0]
                secondary_grps = groups[1:]
            hookenv.log('Creating user {0} in primary group {1} and secondary groups {2}'
                        .format(username, primary_grp, secondary_grps))
            host.adduser(username, primary_group=primary_grp, secondary_groups=secondary_grps)

    def remove_dirs(self):
        # TODO: no removal function exists in CH, just log what we would do.
        for name in self.dirs.items():
            hookenv.log('noop: remove directory {0}'.format(name))

    def remove_packages(self):
        # TODO: no removal function exists in CH, just log what we would do.
        for name in self.packages.items():
            hookenv.log('noop: remove package {0}'.format(name))

    def remove_users(self):
        # TODO: no removal function exists in CH, just log what we would do.
        for user in self.users.items():
            hookenv.log('noop: remove user {0}'.format(user))
        for group in self.groups:
            hookenv.log('noop: remove group {0}'.format(group))

@contextmanager
def disable_firewall():
    """
    Temporarily disable the firewall, via ufw.
    """
    status = check_output(['ufw', 'status']).decode('utf8')
    already_disabled = 'inactive' in status
    if not already_disabled:
        check_call(['ufw', 'disable'])
    try:
        yield
    finally:
        if not already_disabled:
            check_call(['ufw', 'enable'])

def re_edit_in_place(filename, subs, encoding='utf8'):
    """
    Perform a set of in-place edits to a file.

    :param str filename: Name of file to edit
    :param dict subs: Mapping of patterns to replacement strings
    """
    with Path(filename).in_place(encoding=encoding) as (reader, writer):
        for line in reader:
            for pat, repl in subs.iteritems():
                line = re.sub(pat, repl, line)
            writer.write(line)

@contextmanager
def xmlpropmap_edit_in_place(filename):
    """
    Edit an XML property map (configuration) file in-place.

    This helper acts as a context manager which edits an XML file of the form::

        <configuration>
            <property>
                <name>property-name</name>
                <value>property-value</value>
                <description>Optional property description</description>
            </property>
            ...
        </configuration>

    This context manager yields a dict containing the existing name/value
    mappings.  Properties can then be modified, added, or removed, and the
    changes will be reflected in the file.

    Example usage::

        with xmlpropmap_edit_in_place('my.xml') as props:
            props['foo'] = 'bar'
            del props['removed']

    Note that the file is not locked during the edits.
    """
    tree = ET.parse(filename)
    root = tree.getroot()
    props = {}
    for prop in root.findall('property'):
        props[prop.find('name').text] = prop.find('value').text
    old_props = set(props.keys())
    yield props
    new_props = set(props.keys())
    added = new_props - old_props
    modified = new_props & old_props
    removed = old_props - new_props
    for prop in root.findall('property'):
        name = prop.find('name').text
        if name in modified and props[name] is not None:
            prop.find('value').text = str(props[name])
        elif name in removed:
            root.remove(prop)
    for name in added:
        prop = ET.SubElement(root, 'property')
        ET.SubElement(prop, 'name').text = name
        ET.SubElement(prop, 'value').text = str(props[name])
    for node in tree.iter():
        node.tail = None
        node.text = (node.text or '').strip() or None
    prettied = minidom.parseString(ET.tostring(root)).toprettyxml(indent='    ')
    Path(filename).write_text(prettied)

@contextmanager
def environment_edit_in_place(filename='/etc/environment'):
    """
    Edit the `/etc/environment` file in-place.

    There is no standard definition for the format of `/etc/environment`,
    but the convention, which this helper supports, is simple key-value
    pairs, separated by `=`, with optionally quoted values.

    Note that this helper will implicitly quote all values.

    Also note that the file is not locked during the edits.
    """
    etc_env = Path(filename)
    lines = [l.strip().split('=', 1) for l in etc_env.lines()]
    data = {k.strip(): v.strip(' \'"') for k, v in lines}
    yield data
    etc_env.write_lines('{}="{}"'.format(k, v) for k, v in data.items())

def strtobool(value):
    return bool(_strtobool(str(value)))

def normalize_strbool(value):
    intbool = strtobool(value)
    return str(bool(intbool)).lower()

def jps(name):
    """
    Get PIDs for named Java processes, for any user.
    """
    pat = re.sub(r'^(.)', r'^[^ ]*java .*[\1]', name)
    try:
        output = check_output(['sudo', 'pgrep', '-f', pat]).decode('utf8')
    except CalledProcessError:
        return []
    return filter(None, map(str.strip, output.split('\n')))

class TimeoutError(Exception):
    pass

def read_etc_env():
    """
    Read /etc/environment and return it, along with proxy configuration, as
    a dict.
    """
    env = {}

    # Proxy config (e.g. https_proxy, no_proxy, etc) is not stored in
    # /etc/environment on a Juju unit, but we should pass it along so anyone
    # using this env will have correct proxy settings.
    env.update({k: v for k, v in os.environ.items()
                if k.lower().endswith('_proxy')})

    etc_env = Path('/etc/environment')
    if etc_env.exists():
        for line in etc_env.lines(retain=False):
            var, value = line.split('=', 1)
            env[var.strip()] = value.strip(' \'"')
    return env

def run_as(user, command, *args, **kwargs):
    """
    Run a command as a particular user, using ``/etc/environment`` and optionally
    capturing and returning the output.

    Raises subprocess.CalledProcessError if command fails.

    :param str user: Username to run command as
    :param str command: Command to run
    :param list args: Additional args to pass to command
    :param dict env: Additional env variables (will be merged with ``/etc/environment``)
    :param bool capture_output: Capture and return output (default: False)
    :param str input: Stdin for command
    """
    parts = [command] + list(args)
    quoted = ' '.join("'%s'" % p for p in parts)
    env = read_etc_env()
    if 'env' in kwargs:
        env.update(kwargs['env'])
    if kwargs.get('capture_output'):
        run = lambda *a, **kw: check_output(*a, **kw).decode('utf8')
    else:
        run = check_call
    try:
        stdin = None
        if 'input' in kwargs:
            stdin = NamedTemporaryFile()
            stdin.write(kwargs['input'])
            stdin.seek(0)
        return run(['su', user, '-c', quoted], env=env, stdin=stdin)
    finally:
        if stdin:
            stdin.close()  # this also removes tempfile

def update_etc_hosts(ips_to_names):
    '''
    Update /etc/hosts given a mapping of managed IP / hostname pairs.

    :param dict ips_to_names: mapping of IPs to hostnames (must be one-to-one)
    '''
    etc_hosts = Path('/etc/hosts')
    hosts_contents = etc_hosts.lines()
    comment_pat = re.compile(r'^\s*#?\s*([^#]*)\s*#.*$')
    IP_pat = re.compile(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')

    new_lines = []
    managed = {}
    for line in hosts_contents:
        if '# JUJU MANAGED' not in line:
            # pass-thru unmanaged lines unchanged
            new_lines.append(line)
        else:
            # record existing managed entries
            # managed is inverted (name-to-ip) because, while it's ok to have
            # multiple hosts resolve to the same IP, having multiple IPs for
            # the same host can be problematic
            ip, name = comment_pat.sub(r'\1', line).split(None, 2)
            managed[name] = ip
    # add or update new hosts
    managed.update({name: ip for ip, name in ips_to_names.items()})

    # render all of our managed entries as lines
    for name, ip in managed.items():
        line = '%s %s  # JUJU MANAGED' % (ip, name)
        if not IP_pat.match(ip):
            line = '# %s (INVALID IP)' % line
        # add new host
        new_lines.append(line)

    # write new /etc/hosts
    etc_hosts.write_lines(new_lines, append=False)

def manage_etc_hosts():
    """
    Manage the /etc/hosts file from the host entries stored in unitdata.kv()
    by the various relations.
    """
    kv_hosts = get_kv_hosts()
    hookenv.log('Updating /etc/hosts from kv with %s' %
                kv_hosts, hookenv.DEBUG)
    update_etc_hosts(kv_hosts)

def resolve_private_address(addr):
    IP_pat = re.compile(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')
    contains_IP_pat = re.compile(r'\d{1,3}[-.]\d{1,3}[-.]\d{1,3}[-.]\d{1,3}')
    if IP_pat.match(addr):
        return addr  # already IP
    try:
        ip = socket.gethostbyname(addr)
        return ip
    except socket.error as e:
        hookenv.log('Unable to resolve private IP: %s (will attempt to guess)' % addr, hookenv.ERROR)
        hookenv.log('%s' % e, hookenv.ERROR)
        contained = contains_IP_pat.search(addr)
        if not contained:
            raise ValueError('Unable to resolve or guess IP from private-address: %s' % addr)
        return contained.groups(0).replace('-', '.')

def initialize_kv_host():
    # get the hostname attrs from our local unit and update the kv store
    local_ip = resolve_private_address(hookenv.unit_private_ip())
    local_host = hookenv.local_unit().replace('/', '-')
    update_kv_host(local_ip, local_host)

def get_kv_hosts():
    return unitdata.kv().getrange('etc_host.', strip=True)

def update_kv_host(ip, host):
    unit_kv = unitdata.kv()

    # store attrs in the kv as 'etc_host.<ip>'; kv.update will insert
    # a new record or update any existing key with current data.
    unit_kv.update({ip: host},
                   prefix="etc_host.")
    unit_kv.flush(True)

def get_ssh_key(user):
    sshdir = Path('/home/%s/.ssh' % user)
    if not sshdir.exists():
        host.mkdir(sshdir, owner=user, group='hadoop', perms=0o755)
    keyfile = sshdir / 'id_rsa'
    pubfile = sshdir / 'id_rsa.pub'
    authfile = sshdir / 'authorized_keys'
    if not pubfile.exists():
        (sshdir / 'config').write_lines([
            'Host *',
            '    StrictHostKeyChecking no'
        ], append=True)
        check_call(['ssh-keygen', '-t', 'rsa', '-P', '', '-f', keyfile])
        host.chownr(sshdir, user, 'hadoop')
    # allow ssh'ing to localhost; useful for things like start_dfs.sh
    if not authfile.exists():
        Path.copy(pubfile, authfile)
    return pubfile.text()

def install_ssh_key(user, ssh_key):
    sshdir = Path('/home/%s/.ssh' % user)
    if not sshdir.exists():
        host.mkdir(sshdir, owner=user, group='hadoop', perms=0o755)
    Path(sshdir / 'authorized_keys').write_text(ssh_key, append=True)
    host.chownr(sshdir, user, 'hadoop')

def wait_for_hdfs(timeout):
    start = time.time()
    while time.time() - start < timeout:
        try:
            output = run_as('hdfs', 'hdfs', 'dfsadmin', '-report', capture_output=True)
            if 'Datanodes available' in output or 'Live datanodes' in output:
                return True
        except CalledProcessError as e:
            output = e.output  # probably a "connection refused"; wait and try again
        time.sleep(2)
    raise TimeoutError('Timed-out waiting for HDFS:\n%s' % output)

def wait_for_jps(process_name, timeout):
    hookenv.log('Waiting for jps to see %s' % process_name, hookenv.DEBUG)
    start = time.time()
    while time.time() - start < timeout:
        if jps(process_name):
            hookenv.log('Jps shows %s is running' % process_name, hookenv.DEBUG)
            return True
        time.sleep(2)
    raise TimeoutError('Timed-out waiting for jps process:\n%s' % process_name)

def cpu_arch():
    return subprocess.check_output(['uname', '-p']).decode('utf8').strip()

class verify_resources(object):
    """
    Predicate for specific named resources, with useful rendering in the logs.

    :param str \*which: One or more resource names to fetch & verify.  Defaults to
        all non-optional resources.
    """
    def __init__(self, *which):
        self.which = list(which)

    def __str__(self):
        return '<resources %s>' % ', '.join(map(repr, self.which))

    def __call__(self):
        import jujuresources
        result = True
        if not jujuresources.verify(self.which):
            mirror_url = hookenv.config('resources_mirror')
            hookenv.status_set('maintenance', 'Fetching resources')
            result = jujuresources.fetch(self.which, mirror_url=mirror_url)
            if not result:
                missing = jujuresources.invalid(self.which)
                hookenv.status_set('blocked', 'Unable to fetch required resource%s: %s' % (
                    's' if len(missing) > 1 else '',
                    ', '.join(missing),
                ))
        return result