text:
package com.ddiehl.android.htn.listings.comments;

import androidx.fragment.app.FragmentActivity;

import com.ddiehl.android.htn.R;
import com.ddiehl.android.htn.gallery.MediaGalleryRouter;
import com.ddiehl.android.htn.listings.BaseListingsPresenter;
import com.ddiehl.android.htn.listings.report.ReportViewRouter;
import com.ddiehl.android.htn.routing.AppRouter;
import com.ddiehl.android.htn.utils.RedditUtilKt;
import com.ddiehl.android.htn.view.MainView;
import com.ddiehl.android.htn.view.video.VideoPlayerRouter;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;

import javax.inject.Inject;

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.schedulers.Schedulers;
import rxreddit.model.AbsComment;
import rxreddit.model.Comment;
import rxreddit.model.CommentStub;
import rxreddit.model.GalleryItem;
import rxreddit.model.Link;
import rxreddit.model.Listing;
import rxreddit.model.ListingResponse;
import rxreddit.model.Media;
import rxreddit.model.MoreChildrenResponse;
import timber.log.Timber;

public class LinkCommentsPresenter extends BaseListingsPresenter {

    private static final int MAX_CHILDREN_PER_REQUEST = 20;

    private final FragmentActivity activity;
    private final MainView mainView;
    private final AppRouter appRouter;
    private final MediaGalleryRouter mediaGalleryRouter;
    private final VideoPlayerRouter videoPlayerRouter;
    private final AddCommentDialogRouter addCommentDialogRouter;
    private final LinkCommentsView linkCommentsView;
    private final CommentBank commentBank;
    private Link linkContext;
    private Listing replyTarget = null;
    private boolean dataRequested = false;

    @Inject
    public LinkCommentsPresenter(
            FragmentActivity activity,
            MainView main,
            AppRouter appRouter,
            LinkCommentsRouter linkCommentsRouter,
            MediaGalleryRouter mediaGalleryRouter,
            VideoPlayerRouter videoPlayerRouter,
            AddCommentDialogRouter addCommentDialogRouter,
            ReportViewRouter reportViewRouter,
            LinkCommentsView view) {
        super(
                activity,
                main,
                appRouter,
                linkCommentsRouter,
                mediaGalleryRouter,
                videoPlayerRouter,
                addCommentDialogRouter,
                reportViewRouter,
                view
        );
        this.activity = activity;
        this.mainView = main;
        this.appRouter = appRouter;
        this.mediaGalleryRouter = mediaGalleryRouter;
        this.videoPlayerRouter = videoPlayerRouter;
        this.addCommentDialogRouter = addCommentDialogRouter;
        linkCommentsView = view;
        commentBank = new CommentBankList();
    }

    @Override
    public boolean hasData() {
        return commentBank.size() != 0;
    }

    @Override
    public void clearData() {
        linkContext = null;
        commentBank.clear();
    }

    @Override
    public void refreshData() {
        int numItems = getListings().size();
        commentBank.clear();
        linkCommentsView.notifyItemRangeRemoved(0, numItems);
        getNextData();
    }

    @Override
    protected void requestPreviousData() {
        // Comments aren't paginated the same as a listings endpoint
    }

    @Override
    protected void requestNextData() {
        if (!dataRequested) {
            dataRequested = true;
            redditService.loadLinkComments(
                            linkCommentsView.getSubreddit(), linkCommentsView.getArticleId(),
                            linkCommentsView.getSort(), linkCommentsView.getCommentId()
                    )
                    .subscribeOn(Schedulers.io())
                    .observeOn(AndroidSchedulers.mainThread())
                    .doOnSubscribe(disposable -> mainView.showSpinner())
                    .doFinally(() -> {
                        dataRequested = false;
                        mainView.dismissSpinner();
                    })
                    .subscribe(
                            this::onLoadLinkComments,
                            error -> {
                                if (error instanceof IOException) {
                                    String message = context.getString(R.string.error_network_unavailable);
                                    mainView.showError(message);
                                } else {
                                    Timber.w(error, "Error retrieving comment listings");
                                    String message = context.getString(R.string.error_get_link_comments);
                                    mainView.showError(message);
                                }
                            }
                    );
        }
    }

    private void onLoadLinkComments(List<ListingResponse> listingResponseList) {
        if (listingResponseList == null) return;

        linkCommentsView.refreshOptionsMenu();

        // Get link
        ListingResponse linkResponse = listingResponseList.get(0);
        linkContext = (Link) linkResponse.getData().getChildren().get(0);
        Timber.i("Link: %s", linkContext.getFullName());

        // Get comments and flatten the comment tree
        ListingResponse commentsResponse = listingResponseList.get(1);
        List<Listing> comments = commentsResponse.getData().getChildren();
        RedditUtilKt.flattenCommentList(comments);
        Timber.i("Comments: %d", comments.size());

        // Add comments to CommentBank
        commentBank.clear();
        commentBank.addAll(comments);

        // Collapse all threads under the user's minimum score
        Integer minScore = settingsManager.getMinCommentScore();
        commentBank.collapseAllThreadsUnder(minScore);

        // Notify adapter
        // TODO Specify commentsAdded
        linkCommentsView.notifyDataSetChanged();
    }

    @Override
    public void getMoreComments(@NotNull CommentStub parentStub) {
        List<String> children = parentStub.getChildren();
        // Truncate list of children to 20
        children = children.subList(0, Math.min(MAX_CHILDREN_PER_REQUEST, children.size()));
        redditService.loadMoreChildren(linkContext.getId(), children, linkCommentsView.getSort())
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .doOnSubscribe(disposable -> mainView.showSpinner())
                .doFinally(mainView::dismissSpinner)
                .subscribe(
                        response -> onLoadMoreChildren(response, parentStub),
                        error -> {
                            if (error instanceof IOException) {
                                String message = context.getString(R.string.error_network_unavailable);
                                mainView.showError(message);
                            } else {
                                Timber.w(error, "Error retrieving more comments");
                                String message = context.getString(R.string.error_get_more_comments);
                                mainView.showError(message);
                            }
                        }
                );
    }

    private void onLoadMoreChildren(MoreChildrenResponse response, @NotNull CommentStub parentStub) {
        final int stubIndex = commentBank.indexOf(parentStub);
        if (stubIndex == -1) {
            // Parent comment stub is no longer in the list, we've probably already processed this response
            return;
        }

        List<Listing> comments = response.getChildComments();

        if (comments == null || comments.size() == 0) {
            commentBank.remove(parentStub);
        } else {
            Timber.i("More comments: %d", comments.size());

            setDepthForCommentsList(comments, parentStub);

            parentStub.removeChildren(comments);
            parentStub.setCount(parentStub.getChildren().size());

            if (parentStub.getCount() == 0) {
                commentBank.remove(stubIndex);
            }

            commentBank.addAll(stubIndex, comments);
        }

        Integer minScore = settingsManager.getMinCommentScore();
        commentBank.collapseAllThreadsUnder(minScore);

        // TODO Specify commentRemoved and commentsAdded
        linkCommentsView.notifyDataSetChanged();
    }

    /**
     * Sets depth for comments in a flat comments list
     * <p>
     * BUG: When we load additional comments, the relative depth is lost somewhere before calling this method
     * We should account for the depth currently set to the comment when we call this
     */
    public static void setDepthForCommentsList(List<Listing> comments, CommentStub parentStub) {
        HashMap<String, Integer> depthMap = new HashMap<>();
        depthMap.put(parentStub.getId(), parentStub.getDepth());

        for (Listing listing : comments) {
            AbsComment comment = (AbsComment) listing;
            if (depthMap.containsKey(comment.getParentId())) {
                int parentDepth = depthMap.get(comment.getParentId());
                comment.setDepth(parentDepth + 1);
            } else {
                comment.setDepth(parentStub.getDepth());
            }
            depthMap.put(comment.getId(), comment.getDepth());
        }
    }

    public Link getLinkContext() {
        return linkContext;
    }

    @Override
    public AbsComment getListingAt(int position) {
        return commentBank.getVisibleComment(position);
    }

    public void toggleThreadVisible(Comment comment) {
        int before = commentBank.getNumVisible();
        int position = commentBank.visibleIndexOf(comment);
        commentBank.toggleThreadVisible(comment);
        int diff = commentBank.getNumVisible() - before;
        linkCommentsView.notifyItemChanged(position);
        if (diff > 0) {
            linkCommentsView.notifyItemRangeInserted(position + 1, diff);
        } else { // diff < 0
            linkCommentsView.notifyItemRangeRemoved(position + 1, diff * -1);
        }
    }

    @Override
    public int getNumListings() {
        return commentBank.getNumVisible();
    }

    @Override
    protected int getIndexOf(Listing listing) {
        if (listing instanceof AbsComment)
            return commentBank.visibleIndexOf((AbsComment) listing);
        else return -1;
    }

    // Keep in sync with impl in BaseListingsPresenter
    // TODO: Eventually consolidate routing so we don't have duplicate routing for Links
    @Override
    public void openLink(@NotNull Link link) {
        if (link.isSelf()) {
            // Overriding this so we don't keep opening link comments over and over
            return;
        }

        // Determine correct routing for link
        if (link.isGallery()) {
            final List<GalleryItem> galleryItems = link.getGalleryItems();
            mediaGalleryRouter.openLinkGallery(activity, galleryItems);
            return;
        }

        final Media media = link.getMedia();
        if (media != null) {
            final Media.RedditVideo redditVideo = media.getRedditVideo();
            if (redditVideo != null) {
                videoPlayerRouter.openRedditVideo(activity, redditVideo);
                return;
            }
        }

        final String linkUrl = link.getUrl();
        if (linkUrl != null) {
            appRouter.openUrl(linkUrl);
        }
    }

    @Override
    public void replyToLink(Link link) {
        if (link.getArchived()) {
            mainView.showToast(context.getString(R.string.listing_archived));
        } else if (!redditService.isUserAuthorized()) {
            mainView.showToast(context.getString(R.string.user_required));
        } else {
            replyTarget = link;
            addCommentDialogRouter.openReplyDialog(link.getFullName());
        }
    }

    @Override
    public void replyToComment(@NotNull Comment comment) {
        if (comment.getArchived()) {
            mainView.showToast(context.getString(R.string.listing_archived));
        } else if (!redditService.isUserAuthorized()) {
            mainView.showToast(context.getString(R.string.user_required));
        } else {
            replyTarget = comment;
            addCommentDialogRouter.openReplyDialog(comment.getFullName());
        }
    }

    public void onCommentSubmitted(@NotNull String commentText) {
        String parentId = replyTarget.getFullName();
        redditService.addComment(parentId, commentText)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(
                        comment -> {
                            String message = context.getString(R.string.comment_added);
                            mainView.showToast(message);

                            // TODO Optimize this logic, it probably takes a long time in large threads
                            int position;
                            if (parentId.startsWith("t1_")) { // Comment
                                comment.setDepth(((Comment) replyTarget).getDepth() + 1);
                                position = commentBank.indexOf((Comment) replyTarget) + 1;
                            } else {
                                comment.setDepth(1);
                                position = 0;
                            }
                            commentBank.add(position, comment);
                            linkCommentsView.notifyItemInserted(
                                    commentBank.visibleIndexOf(comment)
                            );
                        },
                        error -> {
                            if (error instanceof IOException) {
                                String message = context.getString(R.string.error_network_unavailable);
                                mainView.showError(message);
                            } else {
                                Timber.w(error, "Error adding comment");
                                String message = context.getString(R.string.error_add_comment);
                                mainView.showError(message);
                            }
                        }
                );
    }

    @Override
    public void openCommentLink(@NotNull Comment comment) {
        // Link is already being displayed with this presenter
    }

    public boolean shouldShowParentLink() {
        return linkCommentsView.getCommentId() != null;
    }
}


text:
<idea-plugin>
  <id>net.jackofalltrades.workflow</id>
  <name>OS Workflow Support</name>
  <version></version>
  <vendor email="brad.handy@gmail.com"
      url="https://github.com/bradhandy/osworkflow-intellij-plugin">
    Brad Handy
  </vendor>

  <idea-version since-build="" until-build="" />

  <description><![CDATA[ Support for working with OS Workflow configuration files. ]]></description>

  <change-notes>
    <![CDATA[

 Version 3.8

 Support for Intellij 2021.1

 Version 3.7

 Support for Intellij 2020.1

 Version 3.6

 Support for IntelliJ 2019.1

 Version 3.5

 Support for IntelliJ 2018.3

 Version 3.4

 Support for IntelliJ 2018.2

 Version 3.3

 Support for IntelliJ 2018.1 EAP

        ]]>
  </change-notes>

  <depends>com.intellij.modules.platform</depends>
  <depends>com.intellij.modules.xml</depends>
  <depends>com.intellij.modules.java</depends>

  <depends optional="true" config-file="spring-integration.xml">com.intellij.spring</depends>

  <extensionPoints>

    <extensionPoint
        interface="com.intellij.util.xml.converters.values.GenericDomValueConvertersRegistry$Provider"
        name="valueConverter" />

  </extensionPoints>

  <extensions defaultExtensionNs="com.intellij">

    <applicationService
        serviceImplementation="net.jackofalltrades.workflow.model.converter.WorkflowValueConverterRegistry" />

    <xmlStructureViewBuilderProvider
        implementation="net.jackofalltrades.workflow.model.structure.WorkflowStructureViewBuilderProvider"
        order="first" />

    <inspectionToolProvider
        implementation="net.jackofalltrades.workflow.model.inspection.WorkflowInspectionToolProvider" />
    <localInspection shortName="UnnecessaryConditions" groupName="OS Workflow"
        displayName="Unnecessary conditions elements"
        implementationClass="net.jackofalltrades.workflow.model.inspection.UnnecessaryConditionHolderInspection" />
    <localInspection shortName="UnusedStep" groupName="OS Workflow"
        displayName="Unused Step"
        implementationClass="net.jackofalltrades.workflow.model.inspection.UnusedStepInspection" />
    <localInspection shortName="UseOfPostFunctions" groupName="OS Workflow"
        displayName="Inconsistent workflow state"
        implementationClass="net.jackofalltrades.workflow.model.inspection.UseOfPostFunctionsInspection" />

    <elementDescriptionProvider
        implementation="net.jackofalltrades.workflow.model.presentation.WorkflowElementDescriptionProvider" />
    <dom.fileMetaData
        implementation="net.jackofalltrades.workflow.model.xml.WorkflowDomFileDescription"
        rootTagName="workflow" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.FunctionProvider"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.FunctionProviderImpl" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.SingleCondition"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.SingleConditionImpl" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.Action"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.ActionImpl" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.ConditionalResult"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.ConditionalResultImpl" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.ConditionHolder"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.ConditionHolderImpl" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.Result"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.ResultImpl" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.Step"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.StepImpl" />
    <dom.implementation interfaceClass="net.jackofalltrades.workflow.model.xml.WorkflowValue"
        implementationClass="net.jackofalltrades.workflow.model.impl.xml.WorkflowValueImpl" />

  </extensions>
</idea-plugin>

redpajama_set_name: RedPajamaGithub


text:
@class EvernoteFUSE, EvernoteConnection;

@interface EvernoteFSController : NSObject {
	EvernoteFUSE* _efs;
	EvernoteConnection* _econn;

	// preference panel outlets
	IBOutlet NSPanel* _prefPanel;
	IBOutlet NSTextField* _username;
	IBOutlet NSTextField* _password;
	IBOutlet NSButton* _verifyAccount;
	IBOutlet NSTextField* _info;
	IBOutlet NSButton* _useFullName;

	BOOL _changingMountPoint;
}

- (void) mountFuseFS;
- (void) checkKeychainAndMount;

- (IBAction) verifyAccount:(id)sender;
- (IBAction) fullNameToggle:(id)sender;

- (IBAction) quit:(id)sender;
@end


text:
const assert = require('assert');
const should = require('should');
const rules = require('../src/rules.js');

describe('Rules', () => {

  it('Should properly parse rules', () => {

    const rulesJson = {
    	"rules": [{
    		"term": "crazy",
    		"reaction": "Please dont say crazy"
    	}, {
    		"term": "mad",
    		"reaction": "Please dont say mad"
    	}]
    };

    const parsedRules = rules.rulesFromJson(rulesJson);

    assert(parsedRules.length().should.be.exactly(2));
    assert(parsedRules.rules[0].expression.test('crazy').should.be.true());
    assert(parsedRules.rules[0].reaction.message.should.be.exactly('Please dont say crazy'));
    assert(parsedRules.rules[1].expression.test('mad').should.be.true());
    assert(parsedRules.rules[1].reaction.message.should.be.exactly('Please dont say mad'));
  });

  it('Should ignore rules without a term', () => {
    const rulesJson = {
    	"rules": [{
    		"reaction": "Please dont say crazy"
    	}, {
    		"term": "mad",
    		"reaction": "Please dont say mad"
    	}]
    };

    const parsedRules = rules.rulesFromJson(rulesJson);
    assert(parsedRules.length().should.be.exactly(1));
  });

  it('Should ignore rules without a reaction', () => {
    const rulesJson = {
    	"rules": [{
    		"term": "crazy",
    	}, {
    		"term": "mad",
    		"reaction": "Please dont say mad"
    	}]
    };

    const parsedRules = rules.rulesFromJson(rulesJson);
    assert(parsedRules.length().should.be.exactly(1));
  });

  it('Should throw if no rules provided', () => {

    // No JSON
    assert.throws(() => {
      rules.rulesFromJson();
    },
    checkError);

    // Empty JSON
    assert.throws(() => {
      rules.rulesFromJson({});
    },
    checkError);

    // JSON with empty rules
    assert.throws(() => {
      rules.rulesFromJson({rules: []});
    },
    checkError);

    // JSON with only invalid rules
    assert.throws(() => {
      rules.rulesFromJson({rules: [{term: 'LOL'}, {reaction: 'LOL'}]});
    },
    checkError);
  });
});

function checkError(error) {
  if (error instanceof Error && /No rules found/.test(error)) {
    return true;
  }
}


text:
package synth.ui.providers;

import net.beadsproject.beads.core.AudioContext;
import net.beadsproject.beads.ugens.Add;
import synth.auxilliary.ContextProvider;
import synth.ui.AdditiveUI;
import synth.ui.components.swing.BlankButton;
import synth.ui.components.swing.BlankLabel;
import synth.ui.components.swing.BlankPanel;
import synth.ui.components.swing.BlankTextfield;

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

public class AdditiveUIProvider implements Provider {
    private AudioContext ac;
    //Layouts
    private GridLayout presetGrid;

    //panels
    private BlankPanel mainPane;
    private BlankPanel presetPane;
    private BlankPanel synthPane;

    //buttons
    private BlankButton presetDefault;
    private BlankButton presetSaw;
    private BlankButton presetSquare;
    private BlankButton presetTriangle;

    //textfields and labels
    private BlankTextfield basicFreq;
    private BlankTextfield voices;
    private BlankLabel basicFreqLabel;
    private BlankLabel voicesLabel;

    private AdditiveUI currUI;
    private JFrame ui;

    public AdditiveUIProvider() {
        this.ac = ContextProvider.ac();
        this.ac.start();
        this.mainPane = new BlankPanel();
        this.presetPane = new BlankPanel();
        this.currUI = new AdditiveUI(10, ac, AdditiveUI.DEFAULT);
        this.synthPane = currUI.contentPane;
        this.presetGrid = new GridLayout(1, 4);
        // setup layouts
        this.mainPane.setLayout(new BoxLayout(mainPane, BoxLayout.Y_AXIS));
        // presetPane.setLayout(new BoxLayout(presetPane, BoxLayout.X_AXIS));
        this.presetPane.setLayout(presetGrid);

        // setup preset Buttons
        this.presetDefault = new BlankButton("Default");
        this.presetDefault.addActionListener(e -> {
            this.spawnUI(AdditiveUI.DEFAULT);
        });

        this.presetSaw = new BlankButton("Saw");
        this.presetSaw.addActionListener(e -> {
            this.spawnUI(AdditiveUI.SAW);
        });

        this.presetSquare = new BlankButton("Square");
        this.presetSquare.addActionListener(e -> {
            this.spawnUI(AdditiveUI.SQUARE);
        });

        this.presetTriangle = new BlankButton("Triangle");
        this.presetTriangle.addActionListener(e -> {
            this.spawnUI(AdditiveUI.TRIANGLE);
        });

        //setup textfield and Label
        this.basicFreq = new BlankTextfield("220.0");
        this.basicFreqLabel =  new BlankLabel("Basic Freq.:");
        this.voices = new BlankTextfield("10");
        this.voicesLabel = new BlankLabel("Voices:");

        //add buttons
        this.presetPane.add(presetDefault);
        this.presetPane.add(presetSaw);
        this.presetPane.add(presetSquare);
        this.presetPane.add(presetTriangle);
        this.presetPane.add(basicFreqLabel);
        this.presetPane.add(basicFreq);
        this.presetPane.add(voicesLabel);
        this.presetPane.add(voices);

        //add panels
        this.mainPane.add(presetPane);
        this.mainPane.add(synthPane);

        this.ui = new JFrame("Additiv");
        this.ui.setContentPane(this.mainPane);
        this.ui.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.ui.addWindowListener(new WindowListener() {
            @Override
            public void windowOpened(WindowEvent e) {}

            @Override
            public void windowClosing(WindowEvent e) {
                ac.stop();
                ui.setVisible(false);
                ui.dispose();
            }

            @Override
            public void windowClosed(WindowEvent e) {}

            @Override
            public void windowIconified(WindowEvent e) {}

            @Override
            public void windowDeiconified(WindowEvent e) {}

            @Override
            public void windowActivated(WindowEvent e) {}

            @Override
            public void windowDeactivated(WindowEvent e) {}
        });
        this.ui.pack();
        this.ui.setResizable(true);
        this.ui.setVisible(true);
    }

    private void removeSynthPane() {
        this.currUI.killAllOscillators();
        this.mainPane.remove(synthPane);
        this.mainPane.updateUI();
    }

    private void spawnUI(AdditiveUI.Preset preset){
        this.removeSynthPane();
        this.currUI = new AdditiveUI(Integer.parseInt(voices.getText()), ac, preset, Float.parseFloat(basicFreq.getText()));
        this.synthPane = currUI.contentPane;
        this.mainPane.add(synthPane);
        this.mainPane.updateUI();
        this.ui.pack();
    }

    public void close(){
        this.ui.dispatchEvent(new WindowEvent(this.ui, WindowEvent.WINDOW_CLOSING));
    }
}


text:
<!DOCTYPE html>

	<title>Next Step</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<link rel="stylesheet" href="/style/style.css" />

Next Step!

Utilize o poder da nossa plataforma cognitiva para obter indicações de skills com um grau de acerto de 99.9%.

Compartilhe as suas conquistas e emerja como um novo profissional

Saiba quais as HOT Skills da sua área.

Saiba onde investir o seu tempo e energia com base em seus objetivos de carreira.

Seja reconhecido por seus objetivos alcançados e compartilhe-os.

<button type="button" id="button" style="display: block;"onclick="MostrarForm('form', 'button')">Quero ser beta!</button>

<form action="Script_do_Formulario.php" method="post">

<fieldset>
 <legend>Dados Pessoais</legend>

    Nome:

    <input type="text" name="email">

    Sobrenome:

    <input type="text" name="sobrenome">

    Nascimento:

    <input type="text" name="dia" size="2" maxlength="2" value="dd">
   <input type="text" name="mes" size="2" maxlength="2" value="mm">
   <input type="text" name="ano" size="4" maxlength="4" value="aaaa">

</fieldset>

<fieldset>
 <legend>Dados de login</legend>

    E-mail:

    <input type="text" name="email">

    Login de usuário:

    <input type="text" name="login">

    Senha:

    <input type="password" name="pass">

    Confirme a senha:

    <input type="password" name="passconfirm">

</fieldset>

<input type="submit">
<input type="reset" value="Limpar">
</form>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class org.apache.cassandra.cql3.ColumnSpecification (apache-cassandra API)</title>
<meta name="date" content="2015-08-28">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.cassandra.cql3.ColumnSpecification

Packages that use ColumnSpecification

Package
Description

org.apache.cassandra.config

org.apache.cassandra.cql3

org.apache.cassandra.cql3.functions

org.apache.cassandra.cql3.selection

org.apache.cassandra.cql3.statements

org.apache.cassandra.db.marshal

org.apache.cassandra.transport.messages

Uses of ColumnSpecification in org.apache.cassandra.config

Subclasses of ColumnSpecification in org.apache.cassandra.config

Modifier and Type
Class and Description

class
ColumnDefinition

Uses of ColumnSpecification in org.apache.cassandra.cql3

Fields in org.apache.cassandra.cql3 declared as ColumnSpecification

Modifier and Type
Field and Description

protected ColumnSpecification
AbstractMarker.receiver

Fields in org.apache.cassandra.cql3 with type parameters of type ColumnSpecification

Modifier and Type
Field and Description

java.util.List<ColumnSpecification>
ResultSet.ResultMetadata.names

java.util.List<ColumnSpecification>
ResultSet.PreparedMetadata.names

Methods in org.apache.cassandra.cql3 that return ColumnSpecification

Modifier and Type
Method and Description

static ColumnSpecification
Tuples.componentSpecOf(ColumnSpecification column,
               int component)

static ColumnSpecification
UserTypes.fieldSpecOf(ColumnSpecification column,
           int field)

static ColumnSpecification
Lists.indexSpecOf(ColumnSpecification column)

static ColumnSpecification
Maps.keySpecOf(ColumnSpecification column)

static ColumnSpecification
Lists.valueSpecOf(ColumnSpecification column)

static ColumnSpecification
Maps.valueSpecOf(ColumnSpecification column)

static ColumnSpecification
Sets.valueSpecOf(ColumnSpecification column)

ColumnSpecification
ColumnSpecification.withAlias(ColumnIdentifier alias)

Returns a new ColumnSpecification for the same column but with the specified alias.

Methods in org.apache.cassandra.cql3 that return types with arguments of type ColumnSpecification

Modifier and Type
Method and Description

java.util.List<ColumnSpecification>
UntypedResultSet.Row.getColumns()

java.util.List<ColumnSpecification>
VariableSpecifications.getSpecifications()

abstract java.util.List<ColumnSpecification>
UntypedResultSet.metadata()

java.util.List<ColumnSpecification>
ResultSet.ResultMetadata.requestNames()

Return only the column names requested by the user, excluding those added for post-query re-orderings,
 see definition of names and columnCount.

Methods in org.apache.cassandra.cql3 with parameters of type ColumnSpecification

Modifier and Type
Method and Description

void
VariableSpecifications.add(int bindIndex,
   ColumnSpecification spec)

void
ResultSet.ResultMetadata.addNonSerializedColumn(ColumnSpecification name)

static ColumnSpecification
Tuples.componentSpecOf(ColumnSpecification column,
               int component)

static ColumnSpecification
UserTypes.fieldSpecOf(ColumnSpecification column,
           int field)

static ColumnSpecification
Lists.indexSpecOf(ColumnSpecification column)

static ColumnSpecification
Maps.keySpecOf(ColumnSpecification column)

Term.NonTerminal
AbstractMarker.Raw.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

AbstractMarker
AbstractMarker.INRaw.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

Constants.Value
Constants.Literal.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

Term
Lists.Literal.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

Term
Maps.Literal.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

Term
Sets.Literal.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

Term
Term.Raw.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

This method validates this RawTerm is valid for provided column
 specification and "prepare" this RawTerm, returning the resulting
 prepared Term.

Term
Tuples.Literal.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

AbstractMarker
Tuples.Raw.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

AbstractMarker
Tuples.INRaw.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

Term
TypeCast.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

Term
UserTypes.Literal.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

static AssignmentTestable.TestResult
AssignmentTestable.TestResult.testAll(java.lang.String keyspace,
       ColumnSpecification receiver,
       java.util.Collection<? extends AssignmentTestable> toTest)

AssignmentTestable.TestResult
AbstractMarker.Raw.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
AssignmentTestable.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
Constants.Literal.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
Lists.Literal.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
Maps.Literal.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
Sets.Literal.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
Tuples.Literal.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
TypeCast.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
UserTypes.Literal.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

protected java.lang.String
Operation.SetValue.toString(ColumnSpecification column)

protected java.lang.String
Operation.SetElement.toString(ColumnSpecification column)

protected java.lang.String
Operation.Addition.toString(ColumnSpecification column)

protected java.lang.String
Operation.Substraction.toString(ColumnSpecification column)

protected java.lang.String
Operation.Prepend.toString(ColumnSpecification column)

static ColumnSpecification
Lists.valueSpecOf(ColumnSpecification column)

static ColumnSpecification
Maps.valueSpecOf(ColumnSpecification column)

static ColumnSpecification
Sets.valueSpecOf(ColumnSpecification column)

Method parameters in org.apache.cassandra.cql3 with type arguments of type ColumnSpecification

Modifier and Type
Method and Description

static boolean
ColumnSpecification.allInSameTable(java.util.Collection<ColumnSpecification> names)

Returns true if all ColumnSpecifications are in the same table, false otherwise.

QueryOptions
QueryOptions.prepare(java.util.List<ColumnSpecification> specs)

Term
Term.MultiColumnRaw.prepare(java.lang.String keyspace,
       java.util.List<? extends ColumnSpecification> receiver)

Term
Tuples.Literal.prepare(java.lang.String keyspace,
       java.util.List<? extends ColumnSpecification> receivers)

AbstractMarker
Tuples.Raw.prepare(java.lang.String keyspace,
       java.util.List<? extends ColumnSpecification> receivers)

AbstractMarker
Tuples.INRaw.prepare(java.lang.String keyspace,
       java.util.List<? extends ColumnSpecification> receivers)

protected Term
MultiColumnRelation.toTerm(java.util.List<? extends ColumnSpecification> receivers,
      Term.Raw raw,
      java.lang.String keyspace,
      VariableSpecifications boundNames)

protected abstract Term
Relation.toTerm(java.util.List<? extends ColumnSpecification> receivers,
      Term.Raw raw,
      java.lang.String keyspace,
      VariableSpecifications boundNames)

Converts the specified Raw into a Term.

protected Term
SingleColumnRelation.toTerm(java.util.List<? extends ColumnSpecification> receivers,
      Term.Raw raw,
      java.lang.String keyspace,
      VariableSpecifications boundNames)

protected Term
TokenRelation.toTerm(java.util.List<? extends ColumnSpecification> receivers,
      Term.Raw raw,
      java.lang.String keyspace,
      VariableSpecifications boundNames)

protected java.util.List<Term>
Relation.toTerms(java.util.List<? extends ColumnSpecification> receivers,
       java.util.List<? extends Term.Raw> raws,
       java.lang.String keyspace,
       VariableSpecifications boundNames)

Converts the specified Raw terms into a Terms.

Constructors in org.apache.cassandra.cql3 with parameters of type ColumnSpecification

Constructor and Description

AbstractMarker(int bindIndex,
              ColumnSpecification receiver)

InMarker(int bindIndex,
        ColumnSpecification receiver)

Marker(int bindIndex,
      ColumnSpecification receiver)

Marker(int bindIndex,
      ColumnSpecification receiver)

Marker(int bindIndex,
      ColumnSpecification receiver)

Marker(int bindIndex,
      ColumnSpecification receiver)

Marker(int bindIndex,
      ColumnSpecification receiver)

Constructor parameters in org.apache.cassandra.cql3 with type arguments of type ColumnSpecification

Constructor and Description

PreparedMetadata(java.util.List<ColumnSpecification> names,
                java.lang.Short[] partitionKeyBindIndexes)

ResultMetadata(java.util.List<ColumnSpecification> names)

ResultSet(java.util.List<ColumnSpecification> metadata)

Row(java.util.List<ColumnSpecification> names,
   java.util.List<java.nio.ByteBuffer> columns)

Uses of ColumnSpecification in org.apache.cassandra.cql3.functions

Methods in org.apache.cassandra.cql3.functions that return ColumnSpecification

Modifier and Type
Method and Description

static ColumnSpecification
Functions.makeArgSpec(java.lang.String receiverKs,
           java.lang.String receiverCf,
           Function fun,
           int i)

Methods in org.apache.cassandra.cql3.functions with parameters of type ColumnSpecification

Modifier and Type
Method and Description

Term
FunctionCall.Raw.prepare(java.lang.String keyspace,
       ColumnSpecification receiver)

AssignmentTestable.TestResult
AbstractFunction.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

AssignmentTestable.TestResult
FunctionCall.Raw.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

Uses of ColumnSpecification in org.apache.cassandra.cql3.selection

Methods in org.apache.cassandra.cql3.selection that return ColumnSpecification

Modifier and Type
Method and Description

ColumnSpecification
Selector.Factory.getColumnSpecification(CFMetaData cfm)

Returns the column specification corresponding to the output value of the selector instances created by
 this factory.

Methods in org.apache.cassandra.cql3.selection that return types with arguments of type ColumnSpecification

Modifier and Type
Method and Description

java.util.List<ColumnSpecification>
SelectionColumnMapping.getColumnSpecifications()

java.util.List<ColumnSpecification>
SelectionColumns.getColumnSpecifications()

com.google.common.collect.Multimap<ColumnSpecification,ColumnDefinition>
SelectionColumnMapping.getMappings()

com.google.common.collect.Multimap<ColumnSpecification,ColumnDefinition>
SelectionColumns.getMappings()

Methods in org.apache.cassandra.cql3.selection with parameters of type ColumnSpecification

Modifier and Type
Method and Description

protected abstract void
Selector.Factory.addColumnMapping(SelectionColumnMapping mapping,
                ColumnSpecification resultsColumn)

Record a mapping between the ColumnDefinitions that are used by the selector
 instances created by this factory and a column in the ResultSet.Metadata
 returned with a query.

protected SelectionColumnMapping
SelectionColumnMapping.addMapping(ColumnSpecification colSpec,
          ColumnDefinition column)

protected SelectionColumnMapping
SelectionColumnMapping.addMapping(ColumnSpecification colSpec,
          java.lang.Iterable<ColumnDefinition> columns)

AssignmentTestable.TestResult
Selector.testAssignment(java.lang.String keyspace,
              ColumnSpecification receiver)

Uses of ColumnSpecification in org.apache.cassandra.cql3.statements

Fields in org.apache.cassandra.cql3.statements with type parameters of type ColumnSpecification

Modifier and Type
Field and Description

java.util.List<ColumnSpecification>
ParsedStatement.Prepared.boundNames

Constructor parameters in org.apache.cassandra.cql3.statements with type arguments of type ColumnSpecification

Constructor and Description

Prepared(CQLStatement statement,
        java.util.List<ColumnSpecification> boundNames,
        java.lang.Short[] partitionKeyBindIndexes)

Uses of ColumnSpecification in org.apache.cassandra.db.marshal

Methods in org.apache.cassandra.db.marshal that return ColumnSpecification

Modifier and Type
Method and Description

ColumnSpecification
CollectionType.makeCollectionReceiver(ColumnSpecification collection,
                      boolean isKey)

abstract ColumnSpecification
CollectionType.Kind.makeCollectionReceiver(ColumnSpecification collection,
                      boolean isKey)

Methods in org.apache.cassandra.db.marshal with parameters of type ColumnSpecification

Modifier and Type
Method and Description

ColumnSpecification
CollectionType.makeCollectionReceiver(ColumnSpecification collection,
                      boolean isKey)

abstract ColumnSpecification
CollectionType.Kind.makeCollectionReceiver(ColumnSpecification collection,
                      boolean isKey)

Uses of ColumnSpecification in org.apache.cassandra.transport.messages

Method parameters in org.apache.cassandra.transport.messages with type arguments of type ColumnSpecification

Modifier and Type
Method and Description

static ResultMessage.Prepared
ResultMessage.Prepared.forThrift(int statementId,
         java.util.List<ColumnSpecification> names)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2015 The Apache Software Foundation


text:
class GroupList
{
public:
	GroupList(void);
	~GroupList(void);

	GroupData *AddGroup(const char *name);
	void RemoveGroup(GroupData *data);
	bool HasGroup(const char *item);

	GroupData *FindGroup(const char *name);

	GroupItem *ItemForGroup(const char *name);
	GroupItem *ItemForGroup(GroupData *data);
};

#endif


text:
from __future__ import unicode_literals
from .. import unittest
from fig.service import Service
from fig.project import Project, ConfigurationError

class MockClientMaker(object):
    def get_client(self, *arg, **kwags):
        return None

class ProjectTest(unittest.TestCase):
    def test_from_dict(self):
        project = Project.from_dicts('figtest', [
            {
                'name': 'web',
                'image': 'busybox:latest'
            },
            {
                'name': 'db',
                'image': 'busybox:latest'
            },
        ], MockClientMaker())
        self.assertEqual(len(project.services), 2)
        self.assertEqual(project.get_service('web').name, 'web')
        self.assertEqual(project.get_service('web').options['image'], 'busybox:latest')
        self.assertEqual(project.get_service('db').name, 'db')
        self.assertEqual(project.get_service('db').options['image'], 'busybox:latest')

    def test_from_dict_sorts_in_dependency_order(self):
        project = Project.from_dicts('figtest', [
            {
                'name': 'web',
                'image': 'busybox:latest',
                'links': ['db'],
            },
            {
                'name': 'db',
                'image': 'busybox:latest',
                'volumes_from': ['volume']
            },
            {
                'name': 'volume',
                'image': 'busybox:latest',
                'volumes': ['/tmp'],
            }
        ], MockClientMaker())

        self.assertEqual(project.services[0].name, 'volume')
        self.assertEqual(project.services[1].name, 'db')
        self.assertEqual(project.services[2].name, 'web')

    def test_from_config(self):
        project = Project.from_config('figtest', {
            'web': {
                'image': 'busybox:latest',
            },
            'db': {
                'image': 'busybox:latest',
            },
        }, MockClientMaker())
        self.assertEqual(len(project.services), 2)
        self.assertEqual(project.get_service('web').name, 'web')
        self.assertEqual(project.get_service('web').options['image'], 'busybox:latest')
        self.assertEqual(project.get_service('db').name, 'db')
        self.assertEqual(project.get_service('db').options['image'], 'busybox:latest')

    def test_from_config_throws_error_when_not_dict(self):
        with self.assertRaises(ConfigurationError):
            project = Project.from_config('figtest', {
                'web': 'busybox:latest',
            }, MockClientMaker())

    def test_get_service(self):
        web = Service(
            project='figtest',
            name='web',
            client=None,
            image="busybox:latest",
        )
        project = Project('test', [web], None)
        self.assertEqual(project.get_service('web'), web)

    def test_get_services_returns_all_services_without_args(self):
        web = Service(
            project='figtest',
            name='web',
        )
        console = Service(
            project='figtest',
            name='console',
        )
        project = Project('test', [web, console], None)
        self.assertEqual(project.get_services(), [web, console])

    def test_get_services_returns_listed_services_with_args(self):
        web = Service(
            project='figtest',
            name='web',
        )
        console = Service(
            project='figtest',
            name='console',
        )
        project = Project('test', [web, console], None)
        self.assertEqual(project.get_services(['console']), [console])

    def test_get_services_with_include_links(self):
        db = Service(
            project='figtest',
            name='db',
        )
        web = Service(
            project='figtest',
            name='web',
            links=[(db, 'database')]
        )
        cache = Service(
            project='figtest',
            name='cache'
        )
        console = Service(
            project='figtest',
            name='console',
            links=[(web, 'web')]
        )
        project = Project('test', [web, db, cache, console], None)
        self.assertEqual(
            project.get_services(['console'], include_links=True),
            [db, web, console]
        )

    def test_get_services_removes_duplicates_following_links(self):
        db = Service(
            project='figtest',
            name='db',
        )
        web = Service(
            project='figtest',
            name='web',
            links=[(db, 'database')]
        )
        project = Project('test', [web, db], None)
        self.assertEqual(
            project.get_services(['web', 'db'], include_links=True),
            [db, web]
        )


text:
module UploadcareHelpers
  module SimpleFormInputs
    class UploadcareInput < ::SimpleForm::Inputs::Base
      @@uploadcare_widget_options_keys = %w(
        public_key
        multiple
        multiple_max
        multiple_min
        images_only
        preview_step
        crop
        clearable
        tabs
        autostore
        path_value
      )

      def input
        options.symbolize_keys!
        input_options = (options[:input_html] || {}).dup
        input_options.merge! Hash[@@uploadcare_widget_options_keys.map do |key|
          if value = options.delete(key.to_sym)
            ["data-#{key.dasherize}", value]
          end
        end.compact]

        input_options[:role] = [input_options[:role].presence, 'uploadcare-uploader'].compact.join(' ')

        template.content_tag :div, class: 'form-control-static' do
          @builder.hidden_field attribute_name, input_options
        end
      end
    end
  end
end


text:
hector-visualization
====================

Visualization for Data


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


text:
package main

import (
	"fmt"
	"log"
	"os"
	"strings"
	"time"

	"github.com/codegangsta/cli"
	"github.com/fsouza/go-dockerclient"
)

type images []docker.APIImages

type filter func(image docker.APIImages) bool

func (i images) Filter(f filter) images {
	ret := images{}
	for _, image := range i {
		if f(image) {
			ret = append(ret, image)
		}
	}
	return ret
}

func listImages(client *docker.Client) (images, error) {
	images := images{}
	apiImages, err := client.ListImages(docker.ListImagesOptions{All: false})
	if err != nil {
		return nil, err
	}
	for i := range apiImages {
		images = append(images, apiImages[i])
	}
	return apiImages, nil
}

func filterByName(name string) filter {
	return func(image docker.APIImages) bool {
		for i := range image.RepoTags {
			if strings.HasPrefix(image.RepoTags[i], name) {
				return true
			}
		}
		return false
	}
}

func filterByCreatedAt(duration int) filter {
	return func(image docker.APIImages) bool {
		d := time.Second * time.Duration(duration)
		return time.Since(time.Unix(image.Created, 0)) > d
	}
}

func doImage(c *cli.Context) {
	client, err := docker.NewClient(c.GlobalString("endpoint"))
	if err != nil {
		log.Fatal(err)
	}

	images, err := listImages(client)
	if err != nil {
		log.Fatal(err)
	}

	ret := images.
		Filter(filterByName(c.String("name"))).
		Filter(filterByCreatedAt(c.Int("duration")))
	for i := range ret {
		var err error
		run(!c.Bool("force"),
			func() {
				fmt.Println("dryrun: removed:", ret[i].ID, ret[i].RepoTags)
			},
			func() {
				err = client.RemoveImage(ret[i].ID)
				fmt.Println("removed:", ret[i].ID, ret[i].RepoTags)
			},
		)
		if err != nil {
			fmt.Fprintf(os.Stderr, "%s: failed to delete a image %v %s", err, ret[i].ID, ret[i].RepoTags)
		}
	}
}


text:
from pySDC import CollocationClasses as collclass

import numpy as np

from examples.advection_1d_implicit.ProblemClass import advection
from examples.advection_1d_implicit.TransferClass import mesh_to_mesh_1d_periodic
from pySDC.datatype_classes.mesh import mesh, rhs_imex_mesh
from pySDC.sweeper_classes.imex_1st_order import imex_1st_order
import pySDC.PFASST_stepwise as mp
from pySDC import Log
from pySDC.Stats import grep_stats, sort_stats

if __name__ == "__main__":

    # set global logger (remove this if you do not want the output at all)
    logger = Log.setup_custom_logger('root')

    num_procs = 8

    # This comes as read-in for the level class (this is optional!)
    lparams = {}
    lparams['restol'] = 1E-10

    # This comes as read-in for the step class (this is optional!)
    sparams = {}
    sparams['maxiter'] = 15
    sparams['fine_comm'] = True

    # This comes as read-in for the problem class
    pparams = {}
    pparams['c'] = 1.0
    pparams['nvars'] = [32,16]
    pparams['order'] = [4]

    # This comes as read-in for the transfer operations (this is optional!)
    tparams = {}
    tparams['finter'] = True

    # Fill description dictionary for easy hierarchy creation
    description = {}
    description['problem_class'] = advection
    description['problem_params'] = pparams
    description['dtype_u'] = mesh
    description['dtype_f'] = rhs_imex_mesh
    description['collocation_class'] = collclass.CollGaussLegendre
    description['num_nodes'] = 5
    description['sweeper_class'] = imex_1st_order
    description['level_params'] = lparams
    description['transfer_class'] = mesh_to_mesh_1d_periodic
    description['transfer_params'] = tparams

    # quickly generate block of steps
    MS = mp.generate_steps(num_procs,sparams,description)

    # setup parameters "in time"
    t0 = 0.0
    dt = 0.05
    Tend = 8*dt

    # get initial values on finest level
    P = MS[0].levels[0].prob
    uinit = P.u_exact(t0)

    # call main function to get things done...
    uend,stats = mp.run_pfasst(MS,u0=uinit,t0=t0,dt=dt,Tend=Tend)

    # compute exact solution and compare
    uex = P.u_exact(Tend)

    print('error at time %s: %s' %(Tend,np.linalg.norm(uex.values-uend.values,np.inf)/np.linalg.norm(
        uex.values,np.inf)))

    # extract_stats = grep_stats(stats,iter=-1,type='residual')
    # sortedlist_stats = sort_stats(extract_stats,sortby='step')
    # print(extract_stats,sortedlist_stats)


text:
{% extends "base_email_template.html" %}
{% block content %}

Hey {{user.first_name}}!

            Congrats! We've matched you this week for Yelp Beans ({{meeting_title}})! Feel free to talk to your match about when
            you'd like to meet, but we suggest meeting on {{meeting_start_day}} from {{meeting_start_time}} to
            {{meeting_end_time}}. Here's who you are meeting:

                    {% for participant in participants %}

{{participant.first_name}} {{participant.last_name}}

{{participant.meta_data['department']}}

{{participant.meta_data['business_title']}}

                    {% endfor %}

When: {{meeting_start_date}} from {{meeting_start_time}} to {{meeting_end_time}} (Add to calendar)

Meeting Advice: We suggest keeping the meeting short (30 mins). Introduce yourselves,
            talk about your background, what you're working on at Yelp.

{% endblock %}


text:
package org.apache.directory.server.core.shared;

import org.apache.directory.api.ldap.model.constants.SchemaConstants;
import org.apache.directory.api.ldap.model.entry.Attribute;
import org.apache.directory.api.ldap.model.entry.DefaultAttribute;
import org.apache.directory.api.ldap.model.entry.DefaultEntry;
import org.apache.directory.api.ldap.model.entry.Entry;
import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.schema.AttributeType;
import org.apache.directory.api.ldap.model.schema.DitContentRule;
import org.apache.directory.api.ldap.model.schema.DitStructureRule;
import org.apache.directory.api.ldap.model.schema.LdapComparator;
import org.apache.directory.api.ldap.model.schema.LdapSyntax;
import org.apache.directory.api.ldap.model.schema.MatchingRule;
import org.apache.directory.api.ldap.model.schema.MatchingRuleUse;
import org.apache.directory.api.ldap.model.schema.NameForm;
import org.apache.directory.api.ldap.model.schema.Normalizer;
import org.apache.directory.api.ldap.model.schema.ObjectClass;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.model.schema.SchemaObjectRenderer;
import org.apache.directory.api.ldap.model.schema.SchemaUtils;
import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
import org.apache.directory.api.ldap.model.schema.registries.NormalizerRegistry;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.api.DirectoryService;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.interceptor.context.FilteringOperationContext;
import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;

/**
 * This class manage the Schema's operations.
 *
 * @author Apache Directory Project
 */
public final class SchemaService
{
    /** cached version of the schema subentry with all attributes in it */
    private static Entry schemaSubentry;

    /** A lock to avid concurrent generation of the SubschemaSubentry */
    private static Object schemaSubentrLock = new Object();

    private SchemaService()
    {
    }

    /**
     * Generate the comparators attribute from the registry
     */
    private static Attribute generateComparators( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.lookupAttributeTypeRegistry( SchemaConstants.COMPARATORS_AT ) );

        for ( LdapComparator<?> comparator : schemaManager.getComparatorRegistry() )
        {
            attr.add( SchemaUtils.render( comparator ) );
        }

        return attr;
    }

    private static Attribute generateNormalizers( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.NORMALIZERS_AT ) );

        NormalizerRegistry nr = schemaManager.getNormalizerRegistry();

        for ( Normalizer normalizer : nr )
        {
            attr.add( SchemaUtils.render( normalizer ) );
        }

        return attr;
    }

    private static Attribute generateSyntaxCheckers( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.SYNTAX_CHECKERS_AT ) );

        for ( SyntaxChecker syntaxChecker : schemaManager.getSyntaxCheckerRegistry() )
        {
            attr.add( SchemaUtils.render( syntaxChecker ) );
        }

        return attr;
    }

    private static Attribute generateObjectClasses( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASSES_AT ) );

        for ( ObjectClass objectClass : schemaManager.getObjectClassRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( objectClass ) );
        }

        return attr;
    }

    private static Attribute generateAttributeTypes( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT ) );

        for ( AttributeType attributeType : schemaManager.getAttributeTypeRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( attributeType ) );
        }

        return attr;
    }

    private static Attribute generateMatchingRules( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.MATCHING_RULES_AT ) );

        for ( MatchingRule matchingRule : schemaManager.getMatchingRuleRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( matchingRule ) );
        }

        return attr;
    }

    private static Attribute generateMatchingRuleUses( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.MATCHING_RULE_USE_AT ) );

        for ( MatchingRuleUse matchingRuleUse : schemaManager.getMatchingRuleUseRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( matchingRuleUse ) );
        }

        return attr;
    }

    private static Attribute generateSyntaxes( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.LDAP_SYNTAXES_AT ) );

        for ( LdapSyntax syntax : schemaManager.getLdapSyntaxRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( syntax ) );
        }

        return attr;
    }

    private static Attribute generateDitContextRules( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.DIT_CONTENT_RULES_AT ) );

        for ( DitContentRule ditContentRule : schemaManager.getDITContentRuleRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( ditContentRule ) );
        }

        return attr;
    }

    private static Attribute generateDitStructureRules( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.DIT_STRUCTURE_RULES_AT ) );

        for ( DitStructureRule ditStructureRule : schemaManager.getDITStructureRuleRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( ditStructureRule ) );
        }

        return attr;
    }

    private static Attribute generateNameForms( SchemaManager schemaManager ) throws LdapException
    {
        Attribute attr = new DefaultAttribute(
            schemaManager.getAttributeType( SchemaConstants.NAME_FORMS_AT ) );

        for ( NameForm nameForm : schemaManager.getNameFormRegistry() )
        {
            attr.add( SchemaObjectRenderer.SUBSCHEMA_SUBENTRY_RENDERER.render( nameForm ) );
        }

        return attr;
    }

    /**
     * Creates the SSSE by extracting all the SchemaObjects from the registries.
     */
    private static void generateSchemaSubentry( SchemaManager schemaManager, Entry mods ) throws LdapException
    {
        Entry attrs = new DefaultEntry( schemaManager, mods.getDn() );

        // add the objectClass attribute : 'top', 'subschema', 'subentry' and 'apacheSubschema'
        attrs.put( SchemaConstants.OBJECT_CLASS_AT,
            SchemaConstants.TOP_OC,
            SchemaConstants.SUBSCHEMA_OC,
            SchemaConstants.SUBENTRY_OC,
            ApacheSchemaConstants.APACHE_SUBSCHEMA_OC
            );

        // add the cn attribute as required for the Rdn
        attrs.put( SchemaConstants.CN_AT, "schema" );

        // generate all the other operational attributes
        attrs.put( generateComparators( schemaManager ) );
        attrs.put( generateNormalizers( schemaManager ) );
        attrs.put( generateSyntaxCheckers( schemaManager ) );
        attrs.put( generateObjectClasses( schemaManager ) );
        attrs.put( generateAttributeTypes( schemaManager ) );
        attrs.put( generateMatchingRules( schemaManager ) );
        attrs.put( generateMatchingRuleUses( schemaManager ) );
        attrs.put( generateSyntaxes( schemaManager ) );
        attrs.put( generateDitContextRules( schemaManager ) );
        attrs.put( generateDitStructureRules( schemaManager ) );
        attrs.put( generateNameForms( schemaManager ) );
        attrs.put( SchemaConstants.SUBTREE_SPECIFICATION_AT, "{}" );

        // -------------------------------------------------------------------
        // set standard operational attributes for the subentry
        // -------------------------------------------------------------------

        // Add the createTimestamp
        Attribute createTimestamp = mods.get( SchemaConstants.CREATE_TIMESTAMP_AT );
        attrs.put( SchemaConstants.CREATE_TIMESTAMP_AT, createTimestamp.get() );

        // Add the creatorsName
        attrs.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN );

        // Add the modifyTimestamp
        Attribute schemaModifyTimestamp = mods.get( ApacheSchemaConstants.SCHEMA_MODIFY_TIMESTAMP_AT );
        attrs.put( SchemaConstants.MODIFY_TIMESTAMP_AT, schemaModifyTimestamp.get() );

        // Add the modifiersName
        Attribute schemaModifiersName = mods.get( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT );
        attrs.put( SchemaConstants.MODIFIERS_NAME_AT, schemaModifiersName.get() );

        // don't swap out if a request for the subentry is in progress or we
        // can give back an inconsistent schema back to the client so we block
        synchronized ( schemaSubentrLock )
        {
            schemaSubentry = attrs;
        }
    }

    private static void addAttribute( Entry attrs, String id ) throws LdapException
    {
        Attribute attr = schemaSubentry.get( id );

        if ( ( attr != null ) && ( attr.size() > 0 ) )
        {
            attrs.put( attr );
        }
    }

    /**
     * {@inheritDoc}
     */
    public static Entry getSubschemaEntryImmutable( DirectoryService directoryService ) throws LdapException
    {
        synchronized ( schemaSubentrLock )
        {
            if ( schemaSubentry == null )
            {
                Dn schemaModificationAttributesDn = new Dn( directoryService.getSchemaManager(),
                    SchemaConstants.SCHEMA_MODIFICATIONS_DN );

                generateSchemaSubentry(
                    directoryService.getSchemaManager(),
                    directoryService.getSchemaPartition().lookup(
                        new LookupOperationContext( null, schemaModificationAttributesDn ) ) );
            }

            return schemaSubentry.clone();
        }
    }

    /* (non-Javadoc)
     * @see org.apache.directory.server.core.schema.SchemaService#getSubschemaEntryCloned()
     */
    public static Entry getSubschemaEntryCloned( DirectoryService directoryService ) throws LdapException
    {
        if ( schemaSubentry == null )
        {
            Dn schemaModificationAttributesDn = new Dn( directoryService.getSchemaManager(),
                SchemaConstants.SCHEMA_MODIFICATIONS_DN );

            generateSchemaSubentry(
                directoryService.getSchemaManager(),
                directoryService.getSchemaPartition().lookup(
                    new LookupOperationContext( null, schemaModificationAttributesDn ) ) );
        }

        return schemaSubentry.clone();
    }

    /**
     * {@inheritDoc}
     */
    public static Entry getSubschemaEntry( DirectoryService directoryService, FilteringOperationContext operationContext )
        throws LdapException
    {
        SchemaManager schemaManager = directoryService.getSchemaManager();

        Entry attrs = new DefaultEntry( schemaManager, Dn.ROOT_DSE );

        synchronized ( schemaSubentrLock )
        {
            // ---------------------------------------------------------------
            // Check if we need an update by looking at timestamps on disk
            // ---------------------------------------------------------------
            Dn schemaModificationAttributesDn = new Dn( directoryService.getSchemaManager(),
                SchemaConstants.SCHEMA_MODIFICATIONS_DN );

            Entry mods =
                directoryService.getSchemaPartition().lookup(
                    new LookupOperationContext( null, schemaModificationAttributesDn,
                        SchemaConstants.ALL_ATTRIBUTES_ARRAY ) );

            // @todo enable this optimization at some point but for now it
            // is causing some problems so I will just turn it off
            //          Attribute modifyTimeDisk = mods.get( SchemaConstants.MODIFY_TIMESTAMP_AT );
            //
            //          Attribute modifyTimeMemory = null;
            //
            //            if ( schemaSubentry != null )
            //            {
            //                modifyTimeMemory = schemaSubentry.get( SchemaConstants.MODIFY_TIMESTAMP_AT );
            //                if ( modifyTimeDisk == null && modifyTimeMemory == null )
            //                {
            //                    // do nothing!
            //                }
            //                else if ( modifyTimeDisk != null && modifyTimeMemory != null )
            //                {
            //                    Date disk = DateUtils.getDate( ( String ) modifyTimeDisk.get() );
            //                    Date mem = DateUtils.getDate( ( String ) modifyTimeMemory.get() );
            //                    if ( disk.after( mem ) )
            //                    {
            //                        generateSchemaSubentry( mods );
            //                    }
            //                }
            //                else
            //                {
            //                    generateSchemaSubentry( mods );
            //                }
            //            }
            //            else
            //            {
            generateSchemaSubentry( schemaManager, mods );
            //            }

            // ---------------------------------------------------------------
            // Prep Work: Transform the attributes to their OID counterpart
            // ---------------------------------------------------------------
            addAttribute( attrs, SchemaConstants.COMPARATORS_AT );
            addAttribute( attrs, SchemaConstants.NORMALIZERS_AT );
            addAttribute( attrs, SchemaConstants.SYNTAX_CHECKERS_AT );
            addAttribute( attrs, SchemaConstants.OBJECT_CLASSES_AT );
            addAttribute( attrs, SchemaConstants.ATTRIBUTE_TYPES_AT );
            addAttribute( attrs, SchemaConstants.MATCHING_RULES_AT );
            addAttribute( attrs, SchemaConstants.MATCHING_RULE_USE_AT );
            addAttribute( attrs, SchemaConstants.LDAP_SYNTAXES_AT );
            addAttribute( attrs, SchemaConstants.DIT_CONTENT_RULES_AT );
            addAttribute( attrs, SchemaConstants.DIT_STRUCTURE_RULES_AT );
            addAttribute( attrs, SchemaConstants.NAME_FORMS_AT );
            addAttribute( attrs, SchemaConstants.SUBTREE_SPECIFICATION_AT );

            // add the objectClass attribute if needed
            addAttribute( attrs, SchemaConstants.OBJECT_CLASS_AT );

            // add the cn attribute as required for the Rdn
            addAttribute( attrs, SchemaConstants.CN_AT );

            // -------------------------------------------------------------------
            // set standard operational attributes for the subentry
            // -------------------------------------------------------------------
            addAttribute( attrs, SchemaConstants.CREATE_TIMESTAMP_AT );
            addAttribute( attrs, SchemaConstants.CREATORS_NAME_AT );
            addAttribute( attrs, SchemaConstants.MODIFY_TIMESTAMP_AT );
            addAttribute( attrs, SchemaConstants.MODIFIERS_NAME_AT );
            addAttribute( attrs, SchemaConstants.ENTRY_UUID_AT );
            addAttribute( attrs, SchemaConstants.ENTRY_DN_AT );
        }

        Entry result = new ClonedServerEntry( attrs );

        return result;
    }
}