text:
package nl.mdlware.confluence.plugins.citation;

import org.hamcrest.CoreMatchers;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.matchers.JUnitMatchers;
import org.junit.rules.ExpectedException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class CitationTest {
    private TestI18NResolver testI18NResolver = new TestI18NResolver();

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Test
    public void testCreateCitationWithEmptyURL() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation("", "author", "somedate", "somedate", "page", "site", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithNullURL() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation(null, "author", "somedate", "somedate", "page", "site", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithNullReferenceDate() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation("url", "author", null, "", "page", "site", "Bibliography", testI18NResolver);
    }
    @Test
    public void testCreateCitationWithEmptyReferenceDate() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation("url", "author", "", "", "page", "site", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithInvalidReferenceDate() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Invalid"));
        new Citation("url", "author", "1234", "", "page", "site", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithInvalidPublicationDate() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Invalid"));
        new Citation("url", "author", "1-1-2000", "1234", "page", "site", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithEmptyPagename() {
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        thrown.expect(IllegalArgumentException.class);
        new Citation("url", "author", "somedate", "somedate", "", "site", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithNullPagename() {
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        thrown.expect(IllegalArgumentException.class);
        new Citation("url", "author", "somedate", "somedate", null, "site", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithEmptySitename() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation("url", "author", "somedate", "somedate", "page", "", "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithNullSitename() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation("url", "author", "somedate", "somedate", "page", null, "Bibliography", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithEmptyBibPageId() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation("url", "author", "somedate", "somedate", "page", "site", "", testI18NResolver);
    }

    @Test
    public void testCreateCitationWithNullBibPageId() {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(CoreMatchers.containsString("Empty"));
        new Citation("url", "author", "somedate", "somedate", "page", "site", null, testI18NResolver);
    }

    @Test
    public void testCompareTo()
    {
        Citation citation = new Citation("http://www.han.nl","Rody Middelkoop", "12-12-2000", "1-1-1999", "ICA", "HAN", "Bibliography", testI18NResolver);
        Citation copyCitation = new Citation("http://www.han.nl","Rody Middelkoop", "12-12-2000", "1-1-1999", "ICA", "HAN", "Bibliography", testI18NResolver);
        Citation citationWithoutAuthor = new Citation("http://www.han.nl","", "12-12-2000", "1-1-1999", "ICA", "HAN", "Bibliography", testI18NResolver);
        assertEquals(0, citation.compareTo(copyCitation));
        assertTrue(citationWithoutAuthor.compareTo(citation) <= -1);

    }

}


text:
package org.kuali.kpme.tklm.api.leave.block;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.kuali.kpme.core.api.accrualcategory.AccrualCategoryContract;
import org.kuali.kpme.core.api.accrualcategory.rule.AccrualCategoryRuleContract;
import org.kuali.kpme.core.api.block.CalendarBlockContract;
import org.kuali.kpme.core.api.mo.UserModified;
import org.kuali.rice.core.api.mo.common.GloballyUnique;

/**
 *
LeaveBlockContract interface

 *
 */
public interface LeaveBlockContract extends CalendarBlockContract, UserModified {

	/**
	 * The AccrualCategoryRuleId associated with the LeaveBlock
	 *
	 *

	 * It gets AccrualCategoryRule based on the AccrualCategory and PrincipalHRAttributes.
	 *

	 *
	 * @return lmAccrualCategoryRuleId if AccrualCategoryRule is not null
	 */
	public String getAccrualCategoryRuleId();

	/**
	 * The AccrualCategory name associated with the LeaveBlock
	 *
	 *

	 * It gets AccrualCategory based on the principal id and leave local date.
	 *

	 *
	 * @return accrualCategory for LeaveBlock
	 */
	public String getAccrualCategory();

	/**
	 * The accrualGenerated flag to indicate if the accrual is generated or not
	 *
	 *

	 * accrualGenerated of a LeaveBlock
	 *

	 *
	 * @return Y if accrual is generated, N if not
	 */
	public Boolean isAccrualGenerated();

	/**
	 * TODO: Put a better comment
	 * The submit flag of the LeaveBlock
	 *
	 *

	 * submit of a LeaveBlock
	 *

	 *
	 * @return Y if submitted, N if not
	 */
	public boolean isSubmit();

	/**
	 * TODO: What is this used for?  Different from lmLeaveBlockId??
	 * The blockId associated with the LeaveBlock
	 *
	 *

	 * blockId of a LeaveBlock
	 *

	 *
	 * @return blockId for LeaveBlock
	 */
	public Long getBlockId();

	/**
	 * The description associated with the LeaveBlock
	 *
	 *

	 * description of a LeaveBlock
	 *

	 *
	 * @return description for LeaveBlock
	 */
	public String getDescription();

	/**
	 * The leave date (Date) associated with the LeaveBlock
	 *
	 *

	 * leaveDate of a LeaveBlock
	 *

	 *
	 * @return leaveDate for LeaveBlock
	 */
	public DateTime getLeaveDateTime();

	/**
	 * The leave date (LocalDate) associated with the LeaveBlock
	 *
	 *

	 * leaveDate of a LeaveBlock
	 *

	 *
	 * @return leaveDate in LocalDate for LeaveBlock
	 */
	public LocalDate getLeaveLocalDate();

	/**
	 * The scheduleTimeOffId associated with the LeaveBlock
	 *
	 *

	 * scheduleTimeOffId of a LeaveBlock
	 *

	 *
	 * @return scheduleTimeOffId for LeaveBlock
	 */
	public String getScheduleTimeOffId();

	/**
	 * The requestStatus associated with the LeaveBlock
	 *
	 *

	 * requestStatus of a LeaveBlock
	 *

	 *
	 * @return requestStatus for LeaveBlock
	 */
	public String getRequestStatus();

	/**
	 * The value of requestStatus associated with the LeaveBlock
	 *
	 *

	 * value of requestStatus of a LeaveBlock
	 *

	 *
	 * @return value for requestStatus in REQUEST_STATUS_STRINGS map if found, "usage" if not found
	 */
    public String getRequestStatusString();

	/**
	 * The reason associated with the LeaveBlock
	 *
	 *

	 * reason of a LeaveBlock
	 *

	 *
	 * @return reason for LeaveBlock
	 */
	public String getReason();

	/**
	 * The assignment title associated with the LeaveBlock
	 *
	 *

	 * If the work area associated with the LeaveBlock is not null, it gets its description and its task.
	 * If the task is not null and not the default task, it gets the task description.
	 *

	 *
	 * @return "work area description - task description" for LeaveBlock
	 */
	public String getAssignmentTitle();

	/**
	 * The calendar id associated with the LeaveBlock
	 *
	 *

	 * calendarId of a LeaveBlock
	 *

	 *
	 * @return calendarId for LeaveBlock
	 */
	public String getCalendarId();

	/**
	 * The description of the earn code associated with the LeaveBlock
	 *
	 *

	 * earnCodeObj.getDescription() of a LeaveBlock
	 *

	 *
	 * @return earnCodeObj.getDescription() for LeaveBlock
	 */
	public String getEarnCodeDescription();

	/**
	 * The type of leave block associated with the LeaveBlock
	 *
	 *

	 * leaveBlockType of a LeaveBlock
	 *

	 *
	 * @return leaveBlockType for LeaveBlock
	 */
	public String getLeaveBlockType();

	/**
	 * Indicates if the principal has a permission to edit a leave block
	 *
	 *

	 *

	 *
	 * @return Y if the principal has a permission to edit a leave block, N if not
	 */
    //public boolean isEditable();

    /**
	 * Indicates if the principal has a permission to delete the leave block
	 *
	 *

	 *

	 *
	 * @return Y if the principal has a permission to delete the leave block, N if not
	 */
    //public boolean isDeletable();

    /**
	 * The assignment key associated with the LeaveBlock
	 *
	 *

	 * The key is consisted of job number, work area number, and task number
	 *

	 *
	 * @return assignmentKey for LeaveBlock
	 */
    public String getAssignmentKey();

    /**
	 * The document status associated with the LeaveBlock
	 *
	 *

	 * documentStatus of a LeaveBlock
	 *

	 *
	 * @return documentStatus for LeaveBlock
	 */
	public String getDocumentStatus();

	/**
	 * The document id of the leave request associated with the LeaveBlock
	 *
	 *

	 * leaveRequestDocumentId of a LeaveBlock
	 *

	 *
	 * @return leaveRequestDocumentId for LeaveBlock
	 */
    public String getLeaveRequestDocumentId();

    /**
     * TODO: Put a better comment
	 * The planning description associated with the LeaveBlock
	 *
	 *

	 * planningDescription of a LeaveBlock
	 *

	 *
	 * @return planningDescription for LeaveBlock
	 */
    public String getPlanningDescription();

    /**
     * TODO: Put a better comment
	 * The transactional document id associated with the LeaveBlock
	 *
	 *

	 * transactionalDocId of a LeaveBlock
	 *

	 *
	 * @return transactionalDocId for LeaveBlock
	 */
	public String getTransactionalDocId();

	/**
	 * The begin timestamp (DateTime) associated with the LeaveBlock
	 *
	 *

	 * beginTimestamp of a LeaveBlock
	 *

	 *
	 * @return beginTimestamp for LeaveBlock
	 */
	public DateTime getBeginDateTime();

	/**
	 * The end timestamp (DateTime) associated with the LeaveBlock
	 *
	 *

	 * endTimestamp of a LeaveBlock
	 *

	 *
	 * @return endTimestamp for LeaveBlock
	 */
	public DateTime getEndDateTime();

	/**
	 * The primary key of a LeaveBlock entry saved in a database
	 *
	 *

	 * lmLeaveBlockId of a LeaveBlock
	 *

	 *
	 * @return lmLeaveBlockId for LeaveBlock
	 */
	public String getLmLeaveBlockId();

	/**
	 * The leave amount associated with the LeaveBlock
	 *
	 *

	 * leaveAmount of a LeaveBlock
	 *

	 *
	 * @return leaveAmount for LeaveBlock
	 */
	public BigDecimal getLeaveAmount();

	/**
	 * The workArea number associated with the LeaveBlock
	 *
	 *

	 * workArea of a LeaveBlock
	 *

	 *
	 * @return workArea for LeaveBlock
	 */
	public Long getWorkArea();

	/**
	 * The job number associated with the LeaveBlock
	 *
	 *

	 * jobNumber of a LeaveBlock
	 *

	 *
	 * @return jobNumber for LeaveBlock
	 */
	public Long getJobNumber();

	/**
	 * The task number associated with the LeaveBlock
	 *
	 *

	 * task of a LeaveBlock
	 *

	 *
	 * @return task for LeaveBlock
	 */
	public Long getTask();

	/**
	 * The EarnCode name associated with the LeaveBlock
	 *
	 *

	 * earnCode of a LeaveBlock
	 *

	 *
	 * @return earnCode for LeaveBlock
	 */
	public String getEarnCode();

    /**
     * The AccrualCategoryRule associated with the LeaveBlock
     *
     *

     * accrualCategroyRule of a LeaveBlock
     *

     *
     * @return accrualCategroyRule for LeaveBlock
     */
    public AccrualCategoryRuleContract getAccrualCategoryRule();

    public AccrualCategoryContract getAccrualCategoryObj();

    public DateTime getCreateTime();

    public String getAffectPay();
}

redpajama_set_name: RedPajamaGithub


text:
package org.kaaproject.kaa.server.datamigration;

import com.datastax.driver.core.BatchStatement;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.utils.Bytes;
import com.mongodb.MongoClient;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.Filters;
import org.bson.Document;
import org.kaaproject.kaa.server.datamigration.model.Schema;
import org.kaaproject.kaa.server.datamigration.utils.Options;

import java.nio.ByteBuffer;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
import static com.datastax.driver.core.querybuilder.QueryBuilder.set;
import static com.datastax.driver.core.querybuilder.QueryBuilder.update;

public class CTLNotificationMigration extends AbstractCTLMigration {
    private MongoClient client;
    private Cluster cluster;
    private String dbName;
    private String nosql;

    public CTLNotificationMigration(Connection connection, String host, String db, String nosql) {
        super(connection);
        client = new MongoClient(host);
        cluster = Cluster.builder()
                .addContactPoint(host)
                .build();
        dbName = db;
        this.nosql = nosql;
    }

    @Override
    protected List<Schema> transform() throws SQLException {
        List<Schema> res = super.transform();

        if(nosql.equals(Options.DEFAULT_NO_SQL)) {
            MongoDatabase database = client.getDatabase(dbName);
            MongoCollection<Document> notification = database.getCollection("notification");
            MongoCollection<Document> enpNotification = database.getCollection("endpoint_notification");

            FindIterable<Document> cursor = notification.find();
            for (Document document : cursor) {
                Object id = document.get("_id");
                Long schemaId = Long.parseLong((String) document.get("notification_schema_id"));
                notification.updateMany(Filters.eq("_id", id), Filters.eq("$set", Filters.eq("notification_schema_id", schemaId + idShift)));
            }

            cursor = enpNotification.find();
            for (Document document : cursor) {
                Object id = document.get("_id");
                Long schemaId = Long.parseLong((String) document.get("notification.notification_schema_id"));
                notification.updateMany(Filters.eq("_id", id), Filters.eq("$set", Filters.eq("notification.notification_schema_id", schemaId + idShift)));
            }
        } else {
            Session session = cluster.connect(dbName);
            BatchStatement batchStatement = new BatchStatement();

            //notification
            ResultSet results = session.execute(select().from("notification"));
            for (Row row : results) {
                String id = row.getString("nf_id");
                Long schemaId = Long.parseLong(row.getString("schema_id"));
                String[] ids = id.split("::");

                batchStatement.add(
                        update("notification")
                                .with(set("schema_id", String.valueOf(schemaId + idShift)))
                                .where(eq("topic_id", ids[0]))
                                .and(eq("nf_type", ids[1]))
                                .and(eq("nf_version", Integer.valueOf(ids[2])))
                                .and(eq("seq_num", Integer.valueOf(ids[3])))
                );
            }

            //endpoint notification
            results = session.execute(select().from("ep_nfs"));
            for (Row row : results) {
                String id = row.getString("nf_id");
                Long schemaId = Long.parseLong(row.getString("schema_id"));
                String[] ids = id.split("::");
                ByteBuffer epKeyHash = Bytes.fromHexString(ids[0]);
                Date lastModTime = new Date(Long.valueOf(ids[1]));

                batchStatement.add(
                        update("ep_nfs")
                                .with(set("schema_id", String.valueOf(schemaId + idShift)))
                                .where(eq("ep_key_hash", epKeyHash))
                                .and(eq("last_mod_time", lastModTime))
                );
            }

            session.execute(batchStatement);
            session.close();
            cluster.close();
        }
        return res;
    }

    @Override
    protected String getPrefixTableName() {
        return "notification";
    }
}


text:
Web page archiver is a gem for building web archives. It supports mht (this gem is actually based on takuya's mht gem) and html with data urls (the rename from the original mht name is just to emphasize the support for this alternative format).
mht is known as mhtml that internet explorer's web page archive.
this package can make web archives from local files and URI's

## Contributing to web page archiver

* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

## Copyright

Copyright (c) 2012 murb. See LICENSE.txt for further details.
Portions copyright (c) 2011 takuya. See LICENSE.txt for further details.


text:
@interface NBPhoneMetadataCN : NBPhoneMetaData
{
}

- (id)init;

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

<meta name="generator" content="JDiff v1.0.9">

<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
org.apache.hadoop.fs.FileSystem
</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style">

       <tt>hadoop 0.20.2-cdh3u3</tt>
       Overview
       Package
        Class
       Statistics
       Help

  Generated by
JDiff

 PREV CLASS
 NEXT CLASS

  FRAMES
   NO FRAMES
   DETAIL:
CONSTRUCTORS |
METHODS |
FIELDS

Class org.apache.hadoop.fs.<tt>FileSystem</tt>

  Added Methods

  <nobr>void <tt>closeAllForUGI</tt>(UserGroupInformation)</nobr>

  Close all cached filesystems for a given UGI.

  <nobr>FSDataOutputStream <tt>createNonRecursive</tt>(Path,</nobr> boolean<nobr>,</nobr> int<nobr>,</nobr> short<nobr>,</nobr> long<nobr>,</nobr> Progressable<nobr><nobr>)</nobr>

  Opens an FSDataOutputStream at the indicated Path with write-progress reporting.

  <nobr>FSDataOutputStream <tt>createNonRecursive</tt>(Path,</nobr> FsPermission<nobr>,</nobr> boolean<nobr>,</nobr> int<nobr>,</nobr> short<nobr>,</nobr> long<nobr>,</nobr> Progressable<nobr><nobr>)</nobr>

  Opens an FSDataOutputStream at the indicated Path with write-progress reporting.

  <nobr>FileSystem <tt>get</tt>(URI,</nobr> Configuration<nobr>,</nobr> String<nobr><nobr>)</nobr>

  <nobr>String <tt>getCanonicalServiceName</tt>()</nobr>

  Get a canonical name for this file system.

  <nobr>int <tt>getDefaultPort</tt>()</nobr>

  Get the default port for this file system.

  <nobr>Token <tt>getDelegationToken</tt>(String)</nobr>

  Get a new delegation token for this file system.

  <nobr>FsStatus <tt>getStatus</tt>()</nobr>

  Returns a status object describing the use and capacity of the file system.

  <nobr>FsStatus <tt>getStatus</tt>(Path)</nobr>

  Returns a status object describing the use and capacity of the file system.

  <nobr>FileSystem <tt>newInstance</tt>(URI,</nobr> Configuration<nobr><nobr>)</nobr>

  Returns the FileSystem for this URI's scheme and authority.

  <nobr>FileSystem <tt>newInstance</tt>(Configuration)</nobr>

  Returns a unique configured filesystem implementation.

  <nobr>FileSystem <tt>newInstance</tt>(URI,</nobr> Configuration<nobr>,</nobr> String<nobr><nobr>)</nobr>

  Returns the FileSystem for this URI's scheme and authority and the passed user.

  <nobr>LocalFileSystem <tt>newInstanceLocal</tt>(Configuration)</nobr>

  Get a unique local file system object

  Added Fields

  <nobr>String <tt>FS_DEFAULT_NAME_KEY</tt></nobr>

       <tt>hadoop 0.20.2-cdh3u3</tt>
       Overview
       Package
        Class
       Statistics
       Help

 PREV CLASS
 NEXT CLASS

  FRAMES
   NO FRAMES


text:
%% Time-dependent integro-differential equation
% Nick Hale, October 2010

%%
% (Chebfun example pde/IntegroDiffT.m)
% [Tags: #integrodifferential]

%%
% Here we demonstrate how to solve the time-dependent integro-differential
% equation
%
%  u_t = 0.02 u"(x) + \int_{-1}^{1}u(\xi)d\xi \int_{-1}^{x}u(\xi)d\xi,
%  u(-1) = u(1) = 0.
%
% using Chebfun's PDE15S command.

%%
% We work on the domain [-1,1] with a pulse initial condition:
d = [-1,1];
x = chebfun('x',d);
u0 = (1-x.^2).*exp(-30*(x+.5).^2);

%%
% Here is the anonymous function defining the problem for PDE15S.
f = @(u,t,x,diff,sum,cumsum) 0.02*diff(u,2) + cumsum(u)*sum(u);

%%
% The 4th, 5th, and 6th arguments define the differential, integral
% (sum), and indefinite integral (cumsum) operators, respectively.
% See 'help pde15s' for more details.

%%
% Now we solve the problem and plot the result.
[tt uu] = pde15s(f,0:.1:4,u0,'dirichlet');
FS = 'fontsize';
waterfall(uu,tt,'simple')
xlabel('x',FS,14)
ylabel('t',FS,14)
zlabel('z',FS,14)

%%
% This example can also be found as the "Integro-differential equation"
% demo among the PDE-Scalar demos of CHEBGUI.


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolBar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

    <com.topnews.android.view.NoScrollViewPager
        android:id="@+id/vp_content"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"/>

    <RadioGroup
        android:id="@+id/rg_group"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <RadioButton
            android:id="@+id/btn_home"
            style="@style/Bottom_Tab_Style"
            android:text="首页"
            android:drawableTop="@drawable/tab_home"
            android:checked="true"/>

        <RadioButton
            android:id="@+id/btn_talking"
            style="@style/Bottom_Tab_Style"
            android:text="美女"
            android:drawableTop="@drawable/tab_talking"/>

        <RadioButton
            android:id="@+id/btn_topic"
            style="@style/Bottom_Tab_Style"
            android:text="话题"
            android:drawableTop="@drawable/tab_topic"/>

        <RadioButton
            android:id="@+id/btn_setting"
            style="@style/Bottom_Tab_Style"
            android:text="设置"
            android:drawableTop="@drawable/tab_setting"/>
    </RadioGroup>

</LinearLayout>


text:
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System.Collections.Generic;

namespace IdentityServer4.EntityFramework.Entities
{
    public class Client
    {
        public int Id { get; set; }
        public string ClientId { get; set; }
        public string ClientName { get; set; }
        public bool Enabled { get; set; }
        public List<ClientSecret> ClientSecrets { get; set; }
        public bool RequireClientSecret { get; set; }
        public string ClientUri { get; set; }
        public string LogoUri { get; set; }
        public bool RequireConsent { get; set; }
        public bool AllowRememberConsent { get; set; }
        public List<ClientGrantType> AllowedGrantTypes { get; set; }
        public bool RequirePkce { get; set; }
        public bool AllowAccessTokensViaBrowser { get; set; }
        public List<ClientRedirectUri> RedirectUris { get; set; }
        public List<ClientPostLogoutRedirectUri> PostLogoutRedirectUris { get; set; }
        public string LogoutUri { get; set; }
        public bool LogoutSessionRequired { get; set; }
        public bool AllowAccessToAllScopes { get; set; }
        public List<ClientScope> AllowedScopes { get; set; }
        public int IdentityTokenLifetime { get; set; }
        public int AccessTokenLifetime { get; set; }
        public int AuthorizationCodeLifetime { get; set; }
        public int AbsoluteRefreshTokenLifetime { get; set; }
        public int SlidingRefreshTokenLifetime { get; set; }
        public int RefreshTokenUsage { get; set; }
        public bool UpdateAccessTokenClaimsOnRefresh { get; set; }
        public int RefreshTokenExpiration { get; set; }
        public int AccessTokenType { get; set; }
        public bool EnableLocalLogin { get; set; }
        public List<ClientIdPRestriction> IdentityProviderRestrictions { get; set; }
        public bool IncludeJwtId { get; set; }
        public List<ClientClaim> Claims { get; set; }
        public bool AlwaysSendClientClaims { get; set; }
        public bool PrefixClientClaims { get; set; }
        public List<ClientCorsOrigin> AllowedCorsOrigins { get; set; }
        public bool PublicClient { get; set; }
        public bool AllowPromptNone { get; set; }
    }
}


text:
<?php

  class OAuth2Exception extends XPException {
  }
?>


text:
class CreateImages < ActiveRecord::Migration
  def change
    create_table :images do |t|
      t.string :location
      t.integer :user_id
      t.integer :community_id

      t.timestamps null: false
    end
  end
end


text:
using System.Web.Services;
using System.Xml;

namespace System.Web.Services.Description {
	public sealed class OperationInput : OperationMessage {
	}
}


text:
#ifndef T_ENUM_H
#define T_ENUM_H

#include "t_enum_value.h"
#include <vector>

/**
 * An enumerated type. A list of constant objects with a name for the type.
 *
 */
class t_enum : public t_type {
 public:
  t_enum(t_program* program) :
    t_type(program) {}

  void set_name(const std::string& name) {
    name_ = name;
  }

  void append(t_enum_value* constant) {
    constants_.push_back(constant);
  }

  const std::vector<t_enum_value*>& get_constants() {
    return constants_;
  }

  bool is_enum() const {
    return true;
  }

  virtual std::string get_fingerprint_material() const {
    return "enum";
  }

 private:
  std::vector<t_enum_value*> constants_;
};

#endif


text:
<?php
/**
 * Created by PhpStorm.
 * User: jdelahoz1
 * Date: 10/20/14
 * Time: 5:48 PM
 */

namespace Customer\Test;

use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
use tests\Bootstrap;
use Customer\Service\CustomerService;
use Zend\Http\Request;
use Zend\Stdlib\Parameters;
use User\Entity\User;

error_reporting(0);

class CustomerServiceTest extends AbstractHttpControllerTestCase{

    private $customerService;
    private $request;

    const ACCOUNT_ID = "Agua_Cristal";
    const TEXT_TO_LOOK_FOR = "a";
    const CUSTOMER_CODE = '8656056326304770';
    const CAMPAIGN_ID = '8028791047981467';
    const CUSTOMER_LIMIT = 5;
    const ENTITY = "profiles_agua_cristal";

    const FIRST_NAME = "Eusebio";
    const LAST_NAME = "EusebioMan";
    const NEW_LAST_NAME = "MozidoTestingMan";

    public function setUp()
    {
        parent::setUp();
        $this->customerService = new CustomerService(Bootstrap::getServiceManager());
        $this->customerService->setAccountId(self::ACCOUNT_ID);
        $this->customerService->setEntity(self::ENTITY);

        $this->request = new Request();
        $this->request->setMethod("POST");
    }

    public function testGetCustomerCount()
    {
        $customersCount = $this->customerService->getCustomerCount();
        $this->assertGreaterThanOrEqual(0, (int)$customersCount);
    }

    public function testGetMostActive()
    {
        $customers = $this->customerService->getMostActive(self::ACCOUNT_ID);
        foreach($customers as $customer)
        {
            $this->assertArrayHasKey('code', $customer);
        }
    }

    public function testGetCustomerByCode()
    {
        $customer = $this->customerService->getCustomerByCode(self::CUSTOMER_CODE, self::ACCOUNT_ID);
        $this->assertArrayHasKey('card_number', $customer);
    }

    public function testGetCustomersThisMonth()
    {
        $customerCount = $this->customerService->getCustomersThisMonth(self::ACCOUNT_ID);
        $this->assertGreaterThanOrEqual(0, (int)$customerCount);
    }

    public function testGetLastCustomers()
    {
        $customers = $this->customerService->getLastCustomers(self::CUSTOMER_LIMIT, self::ACCOUNT_ID);
        $this->assertArrayHasKey('card_number', $customers[0]);
    }

    public function testGetByText()
    {
        $customers = $this->customerService->getByText(self::TEXT_TO_LOOK_FOR, self::ACCOUNT_ID);
        $this->assertInstanceOf('Customer\Entity\Customer', $customers[0]);
    }

    public function testAddCustomer()
    {
        $user = new User();
        $user->setAccount(self::ACCOUNT_ID);

        $parameters = new Parameters(array("firstName" => self::FIRST_NAME, "lastName" => self::LAST_NAME));
        $this->request->setPost($parameters);

        $this->customerService->add($this->request->getPost(), $user);
        $customers = $this->customerService->getByText(self::LAST_NAME, self::ACCOUNT_ID);

        $this->assertEquals($customers[0]->getLastName(), self::LAST_NAME);
    }

    public function testEditCustomer()
    {
        $customers = $this->customerService->getByText(self::LAST_NAME, self::ACCOUNT_ID);
        $customer = $customers[0];
        $customer->setLastName(self::NEW_LAST_NAME);

        $this->customerService->editCustomer($customer, self::ACCOUNT_ID);
        $customers = $this->customerService->getByText(self::NEW_LAST_NAME, self::ACCOUNT_ID);

        $this->assertEquals($customers[0]->getLastName(), self::NEW_LAST_NAME);
    }

    public function testDeleteCustomer()
    {
        $customers = $this->customerService->getByText(self::NEW_LAST_NAME, self::ACCOUNT_ID);
        $this->customerService->deleteCustomer($customers[0], self::ACCOUNT_ID);

        $customers = $this->customerService->getByText(self::NEW_LAST_NAME, self::ACCOUNT_ID);

        $this->assertNull($customers);
    }

}


text:
All Notable changes to `pdo-crud-for-free-repositories` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## NEXT ?
- need to write some decent unit tests ...

### Added
- Nothing

### Deprecated
- Nothing

### Fixed
Removed empty test, and test dependencies from composer

### Removed

### Security
- Nothing

### Faulty Towers
- I know nothing (but I learn, I learn !!)


text:
<?php

namespace Acquia\Platform\Cloud\Hosting\Monitor;

interface MonitorInterface
{
    /**
     * Returns the monitor name.
     *
     * @return string
     *   The name of the monitor.
     */
    public function getName();

    /**
     * Returns the monitor status.
     *
     * @return string
     *   The status of the monitor.
     */
    public function getStatus();

    /**
     * Returns one or more reporting URLs for the monitor.
     *
     * @return array
     *   An array of strings, each representing a URL.
     */
    public function getMonitoringUrls();

    /**
     * Returns an array representation of the object.
     *
     * For example:
     *   Array(
     *      'name' => 'nagios',
     *      'status' => 'disabled',
     *      'urls' => [
     *          0 => 'http://my.nagios/interface',
     *          1 => 'http://your.nagios/interface',
     *      ],
     *   )
     *
     * @return array
     *   An array representing the object.
     */
    public function getArrayCopy();
}


text:
var mongoose = require("mongoose")
var logger = require('morgan');

var mhost = process.env.MONGODB_HOST || 'localhost'
var mport = process.env.MONGODB_PORT || '27017'
var mdb = process.env.MONGODB_DB || 'creamstream-local'
var mconn = 'mongodb://' + mhost + ':' + mport + '/' + mdb

var connected_db = null

function connect (callback) {
  if (connected_db != null) {
    // already connected, so callback the connected
    setTimeout(callback, 0, connected_db)

  } else {
    function ConnectMongoDB () {
      var db = mongoose.connection
      // Setting up and connecting to MongoDB
      console.log('mongodb connecting to ' + mconn)
      mongoose.connect(mconn, console.log.bind(console, "MONGODB CONNECTION"))
      db.on('all', console.log.bind(console, 'MONGODB_VERBOSE'))
      db.on('error', console.error.bind(console, 'MONGODB_ERROR'))
      db.once('open', function MongooseConnectionCallback () {
        connected_db = db
        console.log('MongoDB connected!')
        if (callback) callback(db)
      })
    }

    ConnectMongoDB()
  }
}

var passwordHash = require('./password-hasher').hash

// Setting up Database classes
var roomSchema = mongoose.Schema({
  slug: {
    index: 1,
    type: String
  },
  name: String,
  private: Boolean,
  hash: String,
  salt: String,
  capacity: Number,
  creationDate: Date,
})

// callback(error: Error, document: Room)
function setPassword (password, callback) {
  passwordHash(password, (error, salt, hash) => {
    if (error) return callback(error)
    this.set('salt', salt)
    this.set('hash', hash)
    callback(null, this)
  })
}

// callback(error: Error, matches: boolean)
function verifyPassword (password, callback) {
  var salt = this.get('salt')
  var hash = this.get('hash')
  passwordHash(password, salt, (error, genhash) => {
    if (error) return callback(error)
    var passValid = hash === genhash
    callback(null, passValid)
  })
}

roomSchema.methods.setPassword = setPassword
roomSchema.methods.verifyPassword = verifyPassword

exports.Room = mongoose.model('Room', roomSchema)
exports.connect = connect
exports.rooms = {}


text:
package org.jbpm.test.functional.gateway;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jbpm.test.JbpmTestCase;
import org.junit.Test;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.api.task.TaskService;
import org.kie.api.task.model.TaskSummary;

public class InclusiveGatewayWithHumanTasksProcessTest extends JbpmTestCase{

    public InclusiveGatewayWithHumanTasksProcessTest() {
        super(true, true);
    }

    @Test
    public void testInclusiveGatewayWithLoopAndUserTasks() {
        createRuntimeManager("org/jbpm/test/functional/gateway/InclusiveGatewayWithHumanTasksProcess.bpmn");
        RuntimeEngine runtimeEngine = getRuntimeEngine();
        KieSession ksession = runtimeEngine.getKieSession();
        TaskService taskService = runtimeEngine.getTaskService();

        String userId = "john";
        // start a new process instance
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("firstXor", true);
        params.put("secondXor", true);
        params.put("thirdXor", true);
		ProcessInstance pi = ksession.startProcess("InclusiveWithAdvancedLoop", params);

		List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner(userId, "en-UK");
		assertNotNull(tasks);
		assertEquals(1, tasks.size());
		//completing first task
		taskService.start(tasks.get(0).getId(), userId);
		taskService.complete(tasks.get(0).getId(), userId, new HashMap<String, Object>());

		//completing second task
		tasks = taskService.getTasksAssignedAsPotentialOwner(userId, "en-UK");
		assertNotNull(tasks);
		assertEquals(2, tasks.size());
		for(TaskSummary task : tasks) {

    		if(task.getName().equals("HT Form2")) {
    			taskService.start(task.getId(), userId);
        		taskService.complete(task.getId(), userId, new HashMap<String, Object>());

        		break;
    		}
		}
		List<TaskSummary> johntasks = taskService.getTasksAssignedAsPotentialOwner(userId, "en-UK");
		assertNotNull(johntasks);
		assertEquals(1, johntasks.size());
		taskService.start(johntasks.get(0).getId(), userId);
		taskService.complete(johntasks.get(0).getId(), userId, new HashMap<String, Object>());

		johntasks = taskService.getTasksAssignedAsPotentialOwner(userId, "en-UK");
		assertNotNull(johntasks);
		assertEquals(1, johntasks.size());
		taskService.start(johntasks.get(0).getId(), userId);
		taskService.complete(johntasks.get(0).getId(), userId, new HashMap<String, Object>());

		assertProcessInstanceCompleted(pi.getId());

    }
}


text:
#ifndef itkBMPImageIO_h
#define itkBMPImageIO_h
#include "ITKIOBMPExport.h"

#include <fstream>
#include "itkImageIOBase.h"
#include <cstdio>
#include "itkRGBPixel.h"

namespace itk
{
/** \class BMPImageIO
 *
 *  \brief Read BMPImage file format.
 *
 *  \ingroup IOFilters
 *
 * \ingroup ITKIOBMP
 */
class ITKIOBMP_EXPORT BMPImageIO:public ImageIOBase
{
public:
  ITK_DISALLOW_COPY_AND_ASSIGN(BMPImageIO);

  /** Standard class type aliases. */
  using Self = BMPImageIO;
  using Superclass = ImageIOBase;
  using Pointer = SmartPointer< Self >;

  using RGBPixelType = RGBPixel< unsigned char >; //Palette is only unsigned char in BMP files
  using PaletteType = std::vector< RGBPixelType >;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(BMPImageIO, Superclass);

  /** Getter for the FileLowerLeft attribute. */
  itkGetConstMacro(FileLowerLeft, bool);

  /** Getter for the BMPCompression attribute. */
  itkGetConstMacro(BMPCompression, long);

  /** Getter for the ColorPalette attribute. */
  itkGetConstReferenceMacro(ColorPalette, PaletteType);

  /*-------- This part of the interfaces deals with reading data. ----- */

  /** Determine the file type. Returns true if this ImageIO can read the
   * file specified. */
  bool CanReadFile(const char *) override;

  /** Set the spacing and dimension information for the set filename. */
  void ReadImageInformation() override;

  /** Reads the data from disk into the memory buffer provided. */
  void Read(void *buffer) override;

  /*-------- This part of the interfaces deals with writing data. ----- */

  /** Determine the file type. Returns true if this ImageIO can write the
   * file specified. */
  bool CanWriteFile(const char *) override;

  /** Set the spacing and dimension information for the set filename. */
  void WriteImageInformation() override;

  /** Writes the data to disk from the memory buffer provided. Make sure
   * that the IORegions has been set properly. */
  void Write(const void *buffer) override;

  BMPImageIO();
  ~BMPImageIO() override;
  void PrintSelf(std::ostream & os, Indent indent) const override;

private:
  void SwapBytesIfNecessary(void *buffer, SizeValueType numberOfPixels);

  /** This methods ensures that the endianness is respected */
  void Write32BitsInteger(unsigned int value);

  void Write16BitsInteger(unsigned short value);

  RGBPixelType GetColorPaletteEntry(const unsigned char entry) const;

  std::ifstream               m_Ifstream;
  std::ofstream               m_Ofstream;
  long                        m_BitMapOffset{ 0 };
  bool                        m_FileLowerLeft{ false };
  short                       m_Depth{ 8 };
  unsigned short              m_NumberOfColors{ 0 };
  unsigned int                m_ColorPaletteSize{ 0 };
  long                        m_BMPCompression{ 0 };
  unsigned long               m_BMPDataSize{ 0 };
  PaletteType                 m_ColorPalette;
};
} // end namespace itk

#endif // itkBMPImageIO_h


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Microsoft.CodeAnalysis.CodeStyle;
using Roslyn.Utilities;

#if CODE_STYLE
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
#endif

namespace Microsoft.CodeAnalysis.Options
{
    /// <summary>
    /// Specifies that an option should be read from an .editorconfig file.
    /// </summary>
    internal sealed class EditorConfigStorageLocation<T> : OptionStorageLocation2, IEditorConfigStorageLocation2
    {
        public string KeyName { get; }

        private readonly Func<string, Type, Optional<T>> _parseValue;
        private readonly Func<T, OptionSet, string?> _getEditorConfigStringForValue;

        public EditorConfigStorageLocation(string keyName, Func<string, Optional<T>> parseValue, Func<T, string> getEditorConfigStringForValue)
            : this(keyName, parseValue, (value, optionSet) => getEditorConfigStringForValue(value))
        {
            if (getEditorConfigStringForValue == null)
            {
                throw new ArgumentNullException(nameof(getEditorConfigStringForValue));
            }
        }

        public EditorConfigStorageLocation(string keyName, Func<string, Optional<T>> parseValue, Func<OptionSet, string> getEditorConfigStringForValue)
            : this(keyName, parseValue, (value, optionSet) => getEditorConfigStringForValue(optionSet))
        {
            if (getEditorConfigStringForValue == null)
            {
                throw new ArgumentNullException(nameof(getEditorConfigStringForValue));
            }
        }

        public EditorConfigStorageLocation(string keyName, Func<string, Optional<T>> parseValue, Func<T, OptionSet, string> getEditorConfigStringForValue)
        {
            if (parseValue == null)
            {
                throw new ArgumentNullException(nameof(parseValue));
            }

            KeyName = keyName ?? throw new ArgumentNullException(nameof(keyName));

            // If we're explicitly given a parsing function we can throw away the type when parsing
            _parseValue = (s, type) => parseValue(s);

            _getEditorConfigStringForValue = getEditorConfigStringForValue ?? throw new ArgumentNullException(nameof(getEditorConfigStringForValue));
        }

        public bool TryGetOption(IReadOnlyDictionary<string, string?> rawOptions, Type type, out object? result)
        {
            if (rawOptions.TryGetValue(KeyName, out var value)
                && value is object)
            {
                var ret = TryGetOption(value, type, out var typedResult);
                result = typedResult;
                return ret;
            }

            result = null;
            return false;
        }

        internal bool TryGetOption(string value, Type type, [MaybeNullWhen(false)] out T result)
        {
            var optionalValue = _parseValue(value, type);
            if (optionalValue.HasValue)
            {
                result = optionalValue.Value;
                return result != null;
            }
            else
            {
                result = default!;
                return false;
            }
        }

        /// <summary>
        /// Gets the editorconfig string representation for this storage location.
        /// </summary>
        public string GetEditorConfigStringValue(T value, OptionSet optionSet)
        {
            var editorConfigStringForValue = _getEditorConfigStringForValue(value, optionSet);
            RoslynDebug.Assert(!RoslynString.IsNullOrEmpty(editorConfigStringForValue));
            return editorConfigStringForValue;
        }

        string IEditorConfigStorageLocation2.GetEditorConfigString(object? value, OptionSet optionSet)
            => $"{KeyName} = {((IEditorConfigStorageLocation2)this).GetEditorConfigStringValue(value, optionSet)}";

        string IEditorConfigStorageLocation2.GetEditorConfigStringValue(object? value, OptionSet optionSet)
        {
            T typedValue;
            if (value is ICodeStyleOption codeStyleOption)
            {
                typedValue = (T)codeStyleOption.AsCodeStyleOption<T>();
            }
            else
            {
                typedValue = (T)value!;
            }

            return GetEditorConfigStringValue(typedValue, optionSet);
        }
    }
}


text:
package org.apache.spark.scheduler

/**
 * Represents free resources available on an executor.
 */
private[spark]
case class WorkerOffer(executorId: String, host: String, cores: Int)


text:
<!--
  Generated template for the ListPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>
  <ion-navbar>
    <ion-title>{{type.name}}</ion-title>
  </ion-navbar>
</ion-header>
<ion-content>
    <buy-item  *ngFor="let i of (cache$ |async).BuyItemList | filter:'Type':type.key" [item]="i"></buy-item>
</ion-content>


text:
"""
Copyright 2013 Gustav Arngarden

   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.
"""

from setuptools import setup, find_packages

LONG_DESCRIPTION = None
README_MARKDOWN = None

with open('README.md') as markdown_source:
    README_MARKDOWN = markdown_source.read()

try:
    import pandoc
    pandoc.core.PANDOC_PATH = 'pandoc'
    # Converts the README.md file to ReST, since PyPI uses ReST for formatting,
    # This allows to have one canonical README file, being the README.md
    doc = pandoc.Document()
    doc.markdown = README_MARKDOWN
    LONG_DESCRIPTION = doc.rst
except ImportError:
    # If pandoc isn't installed, e.g. when downloading from pip,
    # just use the regular README.
    LONG_DESCRIPTION = README_MARKDOWN

setup(
    name='MongoDBProxy',
    py_modules=['mongodb_proxy'],
    version='0.1.0',
    description='Proxy around MongoDB connection that automatically handles AutoReconnect exceptions.',
    author='Gustav Arngarden',
    long_description=LONG_DESCRIPTION,
    classifiers=[
        'License :: OSI Approved :: Apache Software License',
    ],
    setup_requires=['pyandoc'],
    install_requires=['pymongo'],
    url="https://github.com/arngarden/MongoDBProxy"
)


text:
package de.marcusjanke.katas.loadbalancer;

import org.junit.jupiter.api.Test;

import static java.util.Arrays.fill;
import static org.junit.jupiter.api.Assertions.*;

class LoadBalancerTest {

    private final LoadBalancer loadBalancer = new LoadBalancer();

    @Test
    void shouldFailOnTooShortList() {
        int[] data = {1, 3, 4, 2};
        assertFalse(loadBalancer.solution(data));
    }

    @Test
    void shouldFailOnTooLongList() {
        int[] data = new int[100_001];
        fill(data, 1);
        assertFalse(loadBalancer.solution(data));
    }

    @Test
    void shouldSucceed() {
        int[] data = {1, 3, 4, 2, 2, 2, 1, 1, 2};
        assertTrue(loadBalancer.solution(data));
    }

    @Test
    void shouldFail() {
        int[] data = {1, 1, 1, 1, 1, 1};
        assertFalse(loadBalancer.solution(data));
    }

    @Test
    void shouldSucceedOnLongSample() {
        int[] data = new int[20_000];
        for (int index = 0; index < data.length; index++) {
            data[index] = index % 2 + 1;
        }
        assertTrue(loadBalancer.solution(data));
    }
}


text:
<!--

    Copyright (C) 2014 Stratio (http://stratio.com)

    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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>parent</artifactId>
        <groupId>com.stratio.sparta</groupId>
        <version>1.6.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>plugins</artifactId>

    <properties>
        <morphline.version>0.17.0</morphline.version>
        <cassandra.spark.version>2.0.1</cassandra.spark.version>
        <breeze.version>0.11.1</breeze.version>
        <amqp-client.version>3.5.1</amqp-client.version>
        <geo.version>0.6.7</geo.version>
        <json-path.version>2.2.0</json-path.version>
        <xpath.version>0.1.3</xpath.version>
        <gson.version>2.8.0</gson.version>
        <mongodb.spark.version>0.12.0</mongodb.spark.version>
        <elastic.spark.version>5.3.0</elastic.spark.version>
        <kafka.spark.version>2.1.0</kafka.spark.version>
        <csv.spark.version>1.5.0</csv.spark.version>
        <avro.spark.version>3.2.0</avro.spark.version>
        <avro.version>1.7.6</avro.version>
        <rabbitmq.spark.version>0.5.1</rabbitmq.spark.version>
        <twitter.spark.version>2.1.0</twitter.spark.version>
        <redis.version>2.15</redis.version>
        <async.http.version>1.8.17</async.http.version>
    </properties>

    <build>
        <sourceDirectory>src/main/scala</sourceDirectory>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.stratio.sparta</groupId>
            <artifactId>sdk</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.binary.version}</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming_${scala.binary.version}</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.binary.version}</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.bahir</groupId>
            <artifactId>spark-streaming-twitter_${scala.binary.version}</artifactId>
            <version>${twitter.spark.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming-flume_${scala.binary.version}</artifactId>
            <version>${spark.version}</version>
        </dependency>
        <dependency>
            <groupId>net.debasishg</groupId>
            <artifactId>redisclient_${scala.binary.version}</artifactId>
            <version>${redis.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.typesafe.akka</groupId>
                    <artifactId>akka-actor_${scala.binary.version}</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch-spark-20_${scala.binary.version}</artifactId>
            <version>${elastic.spark.version}</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.spark</groupId>
            <artifactId>spark-cassandra-connector_${scala.binary.version}</artifactId>
            <version>${cassandra.spark.version}</version>
        </dependency>
        <dependency>
            <groupId>com.stratio.datasource</groupId>
            <artifactId>spark-mongodb_${scala.binary.version}</artifactId>
            <version>${mongodb.spark.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scalanlp</groupId>
            <artifactId>breeze_${scala.binary.version}</artifactId>
            <version>${breeze.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.github.rwl</groupId>
                    <artifactId>jtransforms</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.kitesdk</groupId>
            <artifactId>kite-morphlines-avro</artifactId>
            <version>${morphline.version}</version>
        </dependency>
        <dependency>
            <groupId>org.kitesdk</groupId>
            <artifactId>kite-morphlines-saxon</artifactId>
            <version>${morphline.version}</version>
        </dependency>
        <dependency>
            <groupId>org.kitesdk</groupId>
            <artifactId>kite-morphlines-protobuf</artifactId>
            <version>${morphline.version}</version>
        </dependency>
        <dependency>
            <groupId>org.kitesdk</groupId>
            <artifactId>kite-morphlines-json</artifactId>
            <version>${morphline.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.nscala-time</groupId>
            <artifactId>nscala-time_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning</groupId>
            <artifactId>async-http-client</artifactId>
            <version>${async.http.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.stratio.receiver</groupId>
            <artifactId>spark-rabbitmq</artifactId>
            <version>${rabbitmq.spark.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-streaming_${scala.binary.version}</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.github.davidmoten</groupId>
            <artifactId>geo</artifactId>
            <version>${geo.version}</version>
        </dependency>
        <dependency>
            <groupId>com.databricks</groupId>
            <artifactId>spark-avro_${scala.binary.version}</artifactId>
            <version>${avro.spark.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
            <version>${avro.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
          <groupId>org.scalaj</groupId>
            <artifactId>scalaj-http_${scala.binary.version}</artifactId>
        </dependency>
      <dependency>
        <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <version>${json-path.version}</version>
        </dependency>
        <dependency>
            <groupId>com.nrinaudo</groupId>
            <artifactId>kantan.xpath_${scala.binary.version}</artifactId>
            <version>${xpath.version}</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.3-1104-jdbc4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming-kafka-0-10_${scala.binary.version}</artifactId>
            <version>${kafka.spark.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>

        <!--Test dependencies-->
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.binary.version}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-testkit_${scala.binary.version}</artifactId>
            <version>2.3.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.sstone</groupId>
            <artifactId>amqp-client_${scala.binary.version}</artifactId>
            <version>1.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>PLASMA: /home/mathieu/ICL/Plasma/svn/trunk/tools/plasma_2.4.2/control/common.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css"/>

PLASMA 2.4.1

Main Page

Modules

Data Types List

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

/home/mathieu/ICL/Plasma/svn/trunk/tools/plasma_2.4.2/control/common.h

00001
00016 /***************************************************************************/
00020 #ifndef _PLASMA_COMMON_H_
00021 #define _PLASMA_COMMON_H_
00022
00023 #include "global.h"
00024 #include "context.h"
00025 #include "control.h"
00026 #include "core_blas.h"
00027 #include "core_blas_dag.h"
00028 #include "allocate.h"
00029 #include "auxiliary.h"
00030 #include "descriptor.h"
00031 #include "tile.h"
00032 #include "async.h"
00033
00034 #if defined( _WIN32 ) || defined( _WIN64 )
00035 # include <io.h>
00036 #else  /* NOT WIN32 */
00037 # include <unistd.h>
00038 #endif  /* IF WIN32 */
00039
00040
00044 #if defined(linux) || defined(__linux) || defined(__linux__)
00045 #if defined(__GNUC_EXCL__) || defined(__GNUC__)
00046 #define PLASMA_HAVE_WEAK 1
00047 #endif
00048 #endif
00049
00053 #if defined(ADD_)
00054 #define PLASMA_FNAME(lcname, UCNAME)        plasma_##lcname##_
00055 #define PLASMA_TILE_FNAME(lcname, UCNAME)   plasma_tile_##lcname##_
00056 #define PLASMA_ASYNC_FNAME(lcname, UCNAME)  plasma_tile_async_##lcname##_
00057 #define PLASMA_WS_FNAME(lcname, UCNAME)     plasma_alloc_workspace_##lcname##_
00058 #define PLASMA_WST_FNAME(lcname, UCNAME)    plasma_alloc_workspace_##lcname##_tile_
00059 #elif defined(NOCHANGE)
00060 #define PLASMA_FNAME(lcname, UCNAME)        plasma_##lcname
00061 #define PLASMA_TILE_FNAME(lcname, UCNAME)   plasma_tile_##lcname##
00062 #define PLASMA_ASYNC_FNAME(lcname, UCNAME)  plasma_tile_async_##lcname##
00063 #define PLASMA_WS_FNAME(lcname, UCNAME)     plasma_alloc_workspace_##lcname##
00064 #define PLASMA_WST_FNAME(lcname, UCNAME)    plasma_alloc_workspace_##lcname##_tile
00065 #elif defined(UPCASE)
00066 #define PLASMA_FNAME(lcname, UCNAME)        PLASMA_##UCNAME
00067 #define PLASMA_TILE_FNAME(lcname, UCNAME)   PLASMA_TILE_##UCNAME##
00068 #define PLASMA_ASYNC_FNAME(lcname, UCNAME)  PLASMA_TILE_ASYNC_##UCNAME##
00069 #define PLASMA_WS_FNAME(lcname, UCNAME)     PLASMA_ALLOC_WORKSPACE_##UCNAME##
00070 #define PLASMA_WST_FNAME(lcname, UCNAME)    PLASMA_ALLOC_WORKSPACE_##UCNAME##_TILE
00071 #endif
00072
00073 /***************************************************************************/
00076 #define PLASMA_RANK        plasma_rank(plasma)
00077 #define PLASMA_SIZE        plasma->world_size
00078 #define PLASMA_GRPSIZE     plasma->group_size
00079 #define PLASMA_NB          plasma->nb
00080 #define PLASMA_IB          plasma->ib
00081 #define PLASMA_NBNBSIZE    plasma->nbnbsize
00082 #define PLASMA_IBNBSIZE    plasma->ibnbsize
00083 #define PLASMA_SCHEDULING  plasma->scheduling
00084 #define PLASMA_RHBLK       plasma->rhblock
00085 #define PLASMA_TRANSLATION plasma->translation
00086
00087 /***************************************************************************/
00090 #define PlasmaIPT_NoDep   0
00091 #define PlasmaIPT_Panel   1
00092 #define PlasmaIPT_All     2
00093
00094 /***************************************************************************/
00097 #ifndef max
00098 #define max(a, b) ((a) > (b) ? (a) : (b))
00099 #endif
00100 #ifndef min
00101 #define min(a, b) ((a) < (b) ? (a) : (b))
00102 #endif
00103 #ifndef roundup
00104 #define roundup(a, b) (b <= 0) ? (a) : (((a) + (b)-1) & ~((b)-1))
00105 #endif
00106
00107 /***************************************************************************/
00110 #define ss_init(m, n, init_val) \
00111 { \
00112     if (PLASMA_RANK == 0) { \
00113         plasma->ss_progress = (volatile int *)plasma_shared_alloc(plasma, (m)*(n), PlasmaInteger); \
00114         plasma_memset_int((int*)plasma->ss_progress, (m)*(n), (init_val)); \
00115     } \
00116     plasma->ss_ld = (m); \
00117     plasma->ss_abort = 0; \
00118     plasma_barrier(plasma); \
00119 }
00120
00121 #define ss_abort()   plasma->ss_abort = 1;
00122 #define ss_aborted() plasma->ss_abort
00123
00124 #define ss_cond_set(m, n, val) \
00125 { \
00126     plasma->ss_progress[(m)+plasma->ss_ld*(n)] = (val); \
00127 }
00128
00129 #define ss_cond_wait(m, n, val) \
00130 { \
00131     while (!plasma->ss_abort && \
00132             plasma->ss_progress[(m)+plasma->ss_ld*(n)] != (val)) \
00133         plasma_yield(); \
00134     if (plasma->ss_abort) \
00135         break; \
00136 }
00137
00138 #define ss_finalize() \
00139 { \
00140     plasma_barrier(plasma); \
00141     if (PLASMA_RANK == 0) \
00142         plasma_shared_free(plasma, (void*)plasma->ss_progress); \
00143 }
00144
00145 /***************************************************************************/
00148 extern char *plasma_lapack_constants[];
00149
00150 #ifdef __cplusplus
00151 extern "C" {
00152 #endif
00153
00154 #include "compute_s.h"
00155 #include "compute_d.h"
00156 #define COMPLEX
00157 #include "compute_c.h"
00158 #include "compute_z.h"
00159 #undef COMPLEX
00160
00161 void plasma_pdlag2s(plasma_context_t *plasma);
00162 void plasma_pzlag2c(plasma_context_t *plasma);
00163 void plasma_pslag2d(plasma_context_t *plasma);
00164 void plasma_pclag2z(plasma_context_t *plasma);
00165
00166 #ifdef __cplusplus
00167 }
00168 #endif
00169
00170 #endif

 All Data Structures

<address class="footer">Generated by

 1.7.3 </address>


text:
YouTrack Client PHP Library
===========================

[![Build Status](https://travis-ci.org/nepda/youtrack.png?branch=master)](https://travis-ci.org/nepda/youtrack)
[![Dependency Status](https://www.versioneye.com/user/projects/53f72420e09da3fa11000327/badge.svg)](https://www.versioneye.com/user/projects/53f72420e09da3fa11000327)

The bugtracker [YouTrack](http://www.jetbrains.com/youtrack/) provides a
[REST-API](http://confluence.jetbrains.com/display/YTD5/YouTrack+REST+API+Reference).
Because a lot of web applications are written in [PHP](http://php.net) I decided to write a client library for it.
To make it easier for developers to write connectors to YouTrack.

The initial development was sponsored by [Telematika GmbH](http://www.telematika.de).
The current development is made by nepda.

The source of this library is released under the BSD license (see LICENSE for details).

## Requirements

* PHP >= 5.4 (Tested with >= 5.5, Travis runs tests with 5.4 and 5.5)
* curl
* simplexml
* YouTrack 3.0+ with REST-API enabled (currently, the production system runs with YouTrack 5.0.3)

## Changelog

### 2014-09-01 - v1.0.1

* Added executeCountQueries ([Get Number of Issues for Several Queries](http://confluence.jetbrains.com/display/YTD5/Get+Number+of+Issues+for+Several+Queries)). See `./examples/query-count.php`. (Thanks [Limelyte](https://github.com/Limelyte/youtrack/commit/4e4f30e2a118e20f8f364119c37f3e17f38addfa)).

## Usage

    <?php
    require_once("YouTrack/Connection.php");
    $youtrack = new \YouTrack\Connection("http://example.com", "login", "password");
    $issue = $youtrack->getIssue("TEST-1");
    ...

See `./examples` folder for more usage examples.

## Usage with ZF2 ZendSkeletonApplication

In your /init_autoloader.php

    <?php
    // ... snip
    if ($zf2Path) {
        if (isset($loader)) {
            $loader->add('Zend', $zf2Path);
        } else {
            include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
            Zend\Loader\AutoloaderFactory::factory(array(
                'Zend\Loader\StandardAutoloader' => array(
                    'autoregister_zf' => true,
                    'namespaces' => [                            // add this
                        'YouTrack' => 'vendor/YouTrack'          // ...
                    ],                                           // ...
                )
            ));
        }
    }
    // ... snip

From now on you can use YouTrack-Client-PHP-Library from any file in you ZF2-App.

    <?php
    // ...
    // example
    use YouTrack\Connection as YouTrackConnection;

    class ExampleController extends AbstractActionController
    {

        public function anyAction()
        {
            $youtrack = new YouTrackConnection("http://example.com", "login", "password");
            $issue = $youtrack->getIssue("TEST-1");
            // ...
        }
    }

## Tests

The testsuite depends on PHPUnit. You can install it with `composer.phar`:

    curl -sS https://getcomposer.org/installer | php --
    php composer.phar install

The unit tests are incomplete but you can run them using `phpunit` like this:

    ./vendor/bin/phpunit ./test

## Contributors

* [@jan0sch](https://github.com/jan0sch)
* [@jkswoods](https://github.com/jkswoods)
* [@Shyru](https://github.com/Shyru)
* [@nepda](https://github.com/nepda)
* [@richardhinkamp](https://github.com/richardhinkamp)
* [@Limelyte](https://github.com/Limelyte)


text:
// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*
  TODO More docs for this class
*/

/**
  @class

  This is a simple undo manager.  To use this UndoManager, all you need to
  do is to make sure that you register a function with this manager to undo
  every change you make.  You can then invoke the undo/redo methods to do it.

  ## Using SC.UndoManager

  Typically you create an undo manager inside on of your controllers.  Then,
  whenever you are about to perform an action on your model object, all you
  need to do is to register a function with the undo manager that can undo
  whatever  you just did.

  Besure the undo function you register also saves undo functions.  This makes
  redo possible.

  @extends SC.Object
*/
SC.UndoManager = SC.Object.extend(
/** @scope SC.UndoManager.prototype */ {

  /**
    Use this property to build your Undo menu name.

    @field
    @type String
    @default null
  */
  undoActionName: function() {
    return this.undoStack ? this.undoStack.name : null ;
  }.property('undoStack'),

  /**
    Use this property to build your Redo menu name.

    @field
    @type String
    @default null
  */
  redoActionName: function() {
    return this.redoStack ? this.redoStack.name : null ;
  }.property('redoStack'),

  /**
    True if there is an undo action on the stack.

    Use to validate your menu item.

    @field
    @type Boolean
    @default NO
  */
  canUndo: function() {
    // instead of this.undoStack !== null && this.undoStack !== undefined
    return this.undoStack != null;
  }.property('undoStack'),

  /**
    True if there is an redo action on the stack. Use to validate your menu item.

    @field
    @type Boolean
    @default NO
  */
  canRedo: function() {
    // instead of this.redoStack !== null && this.redoStack !== undefined
    return this.redoStack != null;
  }.property('redoStack'),

  /**
    Tries to undo the last action. Fails if an undo group is currently open.

    @returns {Boolean} YES if succeeded, NO otherwise.
  */
  undo: function() {
    this._undoOrRedo('undoStack','isUndoing');
  },

  /**
    Tries to redo the last action. Fails if a redo group is currently open.

    @returns {Boolean} YES if succeeded, NO otherwise.
  */
  redo: function() {
    this._undoOrRedo('redoStack','isRedoing');
  },

  /**
    @type Boolean
    @default NO
  */
  isUndoing: NO,

  /**
    @type Boolean
    @default NO
  */
  isRedoing: NO,

  /** @private */
  groupingLevel: 0,

  // --------------------------------
  // SIMPLE REGISTRATION
  //
  // These are the core method to register undo/redo events.

  /**
    This is how you save new undo events.

    @param {Function} func A prebound function to be invoked when the undo executes.
    @param {String} [name] An optional name for the undo.  If you are using
      groups, this is not necessary.
  */
  registerUndo: function(func, name) {
    this.beginUndoGroup(name) ;
    this._activeGroup.actions.push(func) ;
    this.endUndoGroup(name) ;
  },

  /**
    Begins a new undo groups

    Whenever you start an action that you expect to need to bundle under a single
    undo action in the menu, you should begin an undo group.  This way any
    undo actions registered by other parts of the application will be
    automatically bundled into this one action.

    When you are finished performing the action, balance this with a call to
    `endUndoGroup()`.

    @param {String} name
  */
  beginUndoGroup: function(name) {
    // is a group already active? Just increment the counter.
    if (this._activeGroup) {
      this.groupingLevel++ ;

    // otherwise, create a new active group.
    } else {
      var stack = this.isUndoing ? 'redoStack' : 'undoStack' ;
      this._activeGroup = { name: name, actions: [], prev: this.get(stack) } ;
      this.set(stack, this._activeGroup) ;
      this.groupingLevel = 1 ;
    }
  },

  /**
    @throws {Error} If there is no active group

    @param {String} name
    @see beginUndoGroup()
  */
  endUndoGroup: function(name) {
    // if more than one groups are active, just decrement the counter.
    if (!this._activeGroup) raise("endUndoGroup() called outside group.") ;
    if (this.groupingLevel > 1) {
      this.groupingLevel-- ;

    // otherwise, close out the current group.
    } else {
      this._activeGroup = null ; this.groupingLevel = 0 ;
    }
    this.propertyDidChange(this.isUndoing ? 'redoStack' : 'undoStack') ;
  },

  /**
    Change the name of the current undo group.

    Normally you don't want to do this as it will effect the whole group.

    @param {String} name

    @throws {Error} If there is no active group
  */
  setActionName: function(name) {
    if (!this._activeGroup) raise("setActionName() called outside group.") ;
    this._activeGroup.name = name ;
  },

  // --------------------------------
  // PRIVATE
  //

  /** @private */
  _activeGroup: null,

  /** @private */
  undoStack: null,

  /** @private */
  redoStack: null,

  /** @private */
  _undoOrRedo: function(stack, state) {
    if (this._activeGroup) return false ;
    if (this.get(stack) == null) return true; // noting to do.

    this.set(state, true) ;
    var group = this.get(stack) ;
    this.set(stack, group.prev) ;
    var action ;

    var useGroup = group.actions.length > 1;
    if (useGroup) this.beginUndoGroup(group.name) ;
    while(action = group.actions.pop()) { action(); }
    if (useGroup) this.endUndoGroup(group.name) ;

    this.set(state, false) ;
  }

}) ;


text:
template<typename T>
using I = p1788::infsup::interval<T, p1788::flavor::infsup::setbased::mpfr_bin_ieee754_flavor>;

// and the same for decorated intervals
template<typename T>
using DI = p1788::infsup::decorated_interval<T, p1788::flavor::infsup::setbased::mpfr_bin_ieee754_flavor>;

// constant for the value +oo
const double INF = std::numeric_limits<double>::infinity();

int main()
{
    // 1) Default constructors create empty intervals
    std::cout << I<double>() << std::endl;
    std::cout << DI<double>() << std::endl << std::endl;

    // 1.1) The same could be achieved by static functions
    std::cout << I<double>::empty() << std::endl;
    std::cout << DI<double>::empty() << std::endl << std::endl;

    // 2) There are also static functions to create entire intervals
    std::cout << I<double>::entire() << std::endl;
    std::cout << DI<double>::entire() << std::endl << std::endl;

    // 2.1) The same can be achieved by using the constructor with two parameters
    std::cout << I<double>(-INF, INF) << std::endl;
    std::cout << DI<double>(-INF, INF) << std::endl << std::endl;

    // 3) The parameter constructor can be used to create all kinds of nonempty intervals
    std::cout << I<double>(-3.0, INF) << std::endl;
    std::cout << DI<double>(5.0, 27.7) << std::endl << std::endl;

    // 3.1) For decorated intervals it is also possible to specify a decoration
    std::cout << DI<double>(5.0, 27.7, p1788::decoration::decoration::def) << std::endl << std::endl;

    // 3.2) But take care: the parameters are number literals which are computed and rounded by the compiler
    //      Hence the following interval is not an enclosure of 1/10
    //      Note: This is also a reasopn why a constructor with one floating point parameter is not supported
    std::cout << I<double>(0.1, 0.1) << std::endl << std::endl;

    // 4) To ensure enclosure you can use the string constructor
    //    Notice the difference in the output compared to the constructor above
    std::cout << I<double>("[0.1, 0.1]") << std::endl;
    std::cout << I<double>("[0.1, 1/10]") << std::endl;
    std::cout << DI<double>("[0.1]_trv") << std::endl;
    std::cout << I<double>("[1/10]_dac") << std::endl;
    std::cout << DI<double>("0.1000000?") << std::endl << std::endl;

    // 5) Additionally it is possible to convert interval types

    // Auxiliary intervals
    I<double> i("[0.1, 0.1]");
    DI<double> di("[0.1, 1.1]_dac");

    std::cout << p1788::io::precision(10);  // increase the precision of the output to see a difference

    // 5.1) Different bound types
    std::cout << i << std::endl;
    std::cout << I<float>( i ) << std::endl;
    std::cout << di << std::endl;
    std::cout << DI<float>( di ) << std::endl << std::endl;

    // 5.2) Bare interval <-> decorated interval
    std::cout << I<double>( di ) << std::endl;
    std::cout << I<float>( di ) << std::endl;
    std::cout << DI<double>( i ) << std::endl;
    std::cout << DI<float>( i ) << std::endl << std::endl;

    // 5.4) And the same for casts
    std::cout << static_cast< I<float> >( i ) << std::endl;
    std::cout << static_cast< I<double> >( di ) << std::endl;
    std::cout << static_cast< DI<double> >( i ) << std::endl << std::endl;

    // 6) Set a decoration
    std::cout << DI<double>( i, p1788::decoration::decoration::def ) << std::endl;
    std::cout << DI<float>( i, p1788::decoration::decoration::trv ) << std::endl << std::endl;

    // 6.1) And get a decoration
    std::cout << decoration( di ) << std::endl;     // function
    std::cout << DI<double>::decoration( di ) << std::endl << std::endl;    // static

    // 7) In case of invalid input an empty interval (bare interval constructor)
    //    or a NaI (decorated interval constructor) will be created
    std::cout << I<double>(5.0,0.0) << std::endl;
    std::cout << I<double>("foo") << std::endl;
    std::cout << DI<double>("[1.0,inf]_com") << std::endl << std::endl;

    // 7.1) and of course
    std::cout << DI<double>::nai() << std::endl;

    return 0;
}


text:
require File.expand_path('../application', __FILE__)

# Custom Mime types
# "Nolayout" for HTML without layout
Mime::Type.register_alias "text/html", :nolayout

# Initialize the rails application
Snoonet::Application.initialize!


text:
  <link href='/public/Bootstrap/bootstrap.css' rel='stylesheet' />
  <link href='/public/Bootstrap/bootstrap-theme.css' rel='stylesheet' />
  <script language="javascript" type="text/javascript" src="/public/Bootstrap/bootstrap.js"></script>
  <script language="javascript" type="text/javascript" src="/public/Bootstrap/bootstrap.min.js"></script>
  <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
  <!-- <script language="javascript" type="text/javascript" src="/public/Bootstrap/npm.js"></script> -->