text:
module Lesson04 where

import Helper
import System.Random.Shuffle

-- Let's make our game a little bit more interesting: we're going to
-- add in some money. We'll have a limited form of betting, by giving
-- the player some money at the start of the game, and letting him bet
-- against the house. We haven't yet written the rules for determining
-- who won the game, so we'll have to trust the user for now. Don't
-- worry, we'll fix that later. (We'll also eventually let you play
-- against other human players too.)

-- What we want is to have some variable that keeps track of how much
-- money the player has. But as I've mentioned previously, there's no
-- way to change a value. The way we emulate changing values is by
-- having a function that takes input representing the money the
-- player has, and changing the value we input over time.

-- So let's get started with a function that let's a player play one
-- hand of poker, and returns how much the player won or lost in
-- the bet.
playHand = do
    shuffled <- shuffleM deck
    let (player, rest) = splitAt 5 shuffled
        dealer = take 5 rest
    putStrLn ("Your hand is: " ++ show player)
    putStrLn "Enter your wager"
    bet <- readLn
    putStrLn ("The dealer has: " ++ show dealer)
    putStrLn "Did you win? (y/n)"
    answer <- getLine
    if answer == "y"
        then return bet     -- you won
        else return (- bet) -- you lost

-- Now that we know how to play a single hand, let's write our "main loop."
-- This is the function that our game will live in. We call it a loop because
-- it will run itself multiple times. We'll see how this is done at the end
-- of the function.
--
-- The function takes one argument: the number of chips the player has when
-- starting this round.
playGame chips = do
    putStrLn ("Your current chip count: " ++ show chips)
    chipChange <- playHand
    let newChips = chips + chipChange
    if newChips > 0
        -- We have some chips left, so let's play the game again based on the
        -- new chip count.
        then playGame newChips
        else putStrLn "You're out of chips. Goodbye!"

-- Finally, we still need to have a main function. This function will start our
-- game off with an initial number of chips (let's say 10).
main = playGame 10

{-

Exercises:

1. The user is currently allowed to entered negative bets, which shouldn't be
   allowed. Change it so that, if the user enters a negative bet, he/she is
   asked to enter a non-negative number. Hint: to do this, you'll need to replace
   readLn in playHand with a separate function that you're going to write.

2. The user is allowed to enter bets larger than his/her total number of chips.
   Make a similar modification as done in the previous exercise to prevent this.
   Note that you'll need to modify the playHand function so it takes the total
   number of chips as an argument.

Behind the scenes:

FIXME to be written, should talk about recursion

-}


text:
'use strict';

var stormpath = require('stormpath');

var createSession = require('./create-session');
var expandAccount = require('./expand-account');

/**
 * This callback, when called, will simply continue processing the HTTP
 * request.
 *
 * @callback nextCallback
 * @private
 */

/**
 * Attempts to retrieve a user object from either the session, a user's API
 * keys, or a user's OAuth tokens, making it available in the current context.
 * If a user cannot be found, nothing will be done and the request will
 * continue processing.
 *
 * @method
 * @private
 *
 * @param {Object} req - The http request.
 * @param {Object} res - The http response.
 * @param {nextCallback} next - The callback which is called to continue
 *   processing the request.
 */
module.exports = function (req, res, next) {
  var application = req.app.get('stormpathApplication');
  var client = req.app.get('stormpathClient');
  var logger = req.app.get('stormpathLogger');

  // In the event this has already been run (this can happen due to Express
  // routing logic) -- don't re-run this function.
  if (req.user) {
    return next();
  }

  if (req.cookies && req.cookies.idSiteSession) {
    var accountHref = req.cookies.idSiteSession;

    client.getAccount(accountHref, function (err, account) {
      if (err) {
        logger.info('Failed to get account from idSiteSession cookie.');
        return next();
      }

      if (account.status !== 'ENABLED') {
        logger.info('Account for idSiteSession cookie is not ENALBED.');
        return next();
      }

      expandAccount(req.app, account, function (err, expandedAccount) {
        if (err) {
          logger.info('Failed to expand the user\'s account.');
          return next();
        }

        res.locals.user = expandedAccount;
        req.user = expandedAccount;
        next();
      });
    });
  } else if (req.cookies && req.cookies.access_token) {
    var authenticator = new stormpath.JwtAuthenticator(application);

    authenticator.authenticate(req.cookies.access_token, function (err, authenticationResult) {
      if (err) {
        logger.info('Failed to authenticate the request. Invalid access_token found.');

        if (!req.cookies.refresh_token) {
          return next();
        }

        return new stormpath.OAuthRefreshTokenGrantRequestAuthenticator(application).authenticate({ refresh_token: req.cookies.refresh_token }, function (err, refreshGrantResponse) {
          if (err) {
            logger.info('Failed to refresh an access_token given a refresh_token.');
            return next();
          }

          refreshGrantResponse.getAccount(function (err, account) {
            if (err) {
              logger.info('Failed to get account from refreshGrantResponse.');
              return next();
            }

            if (account.status !== 'ENABLED') {
              logger.info('Account for refresh_token cookie is not ENALBED.');
              return next();
            }

            expandAccount(req.app, account, function (err, expandedAccount) {
              if (err) {
                logger.info('Failed to expand the user\'s account.');
                return next();
              }

              res.locals.user = expandedAccount;
              req.user = expandedAccount;

              if (refreshGrantResponse.grantedScopes) {
                res.locals.permissions = refreshGrantResponse.grantedScopes;
                req.user = expandedAccount;
                req.permissions = refreshGrantResponse.grantedScopes;
              }

              createSession(refreshGrantResponse, account, req, res);
              next();
            });
          });
        });
      }

      req.accessToken = authenticationResult.accessToken;
      authenticationResult.getAccount(function (err, account) {
        if (err) {
          logger.info('Failed to get account ' + authenticationResult.account.href);
          return next();
        }

        if (account.status !== 'ENABLED') {
          logger.info('Account for access_token cookie is not ENALBED.');
          return next();
        }

        expandAccount(req.app, account, function (err, expandedAccount) {
          if (err) {
            logger.info('Failed to expand the user\'s account.');
            return next();
          }

          res.locals.user = expandedAccount;
          req.user = expandedAccount;

          if (authenticationResult.grantedScopes) {
            res.locals.permissions = authenticationResult.grantedScopes;
            req.user = expandedAccount;
            req.permissions = authenticationResult.grantedScopes;
          }

          next();
        });
      });
    });
  } else if (req.cookies && req.cookies.refresh_token) {
    new stormpath.OAuthRefreshTokenGrantRequestAuthenticator(application).authenticate({ refresh_token: req.cookies.refresh_token }, function (err, refreshGrantResponse) {
      if (err) {
        logger.info('Failed to refresh an access_token given a refresh_token.');
        return next();
      }

      refreshGrantResponse.getAccount(function (err, account) {
        if (err) {
          logger.info('Failed to get account from refreshGrantResponse.');
          return next();
        }

        if (account.status !== 'ENABLED') {
          logger.info('Account for refresh_token cookie is not ENALBED.');
          return next();
        }

        expandAccount(req.app, account, function (err, expandedAccount) {
          if (err) {
            logger.info('Failed to expand the user\'s account.');
            return next();
          }

          res.locals.user = expandedAccount;
          req.user = expandedAccount;

          if (refreshGrantResponse.grantedScopes) {
            res.locals.permissions = refreshGrantResponse.grantedScopes;
            req.user = expandedAccount;
            req.permissions = refreshGrantResponse.grantedScopes;
          }

          createSession(refreshGrantResponse, account, req, res);
          next();
        });
      });
    });
  } else {
    application.authenticateApiRequest({ request: req }, function (err, result) {
      if (err) {
        logger.info('Failed to authenticate the incoming request.');
        return next();
      }

      result.getAccount(function (err, account) {
        if (err) {
          logger.info('Failed to get account.');
          return next();
        }

        if (account.status !== 'ENABLED') {
          logger.info('Account is not ENALBED.');
          return next();
        }

        expandAccount(req.app, account, function (err, expandedAccount) {
          if (err) {
            logger.info('Failed to expand the user\'s account.');
            return next();
          }

          res.locals.user = expandedAccount;
          req.user = expandedAccount;

          next();
        });
      });
    });
  }
};

redpajama_set_name: RedPajamaGithub


text:
package org.apereo.cas.webauthn;

import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.yubico.data.CredentialRegistration;
import com.yubico.internal.util.JacksonCodecs;
import com.yubico.webauthn.RegisteredCredential;
import lombok.experimental.UtilityClass;
import org.apache.commons.lang3.StringUtils;

/**
 * This is {@link WebAuthnUtils}.
 *
 * @author Misagh Moayyed
 * @since 6.3.0
 */
@UtilityClass
public class WebAuthnUtils {
    private static final ObjectMapper MAPPER = JacksonCodecs
        .json()
        .addMixIn(CredentialRegistration.class, CredentialRegistrationMixin.class)
        .addMixIn(CredentialRegistration.CredentialRegistrationBuilder.class, CredentialRegistrationBuilderMixin.class)
        .addMixIn(RegisteredCredential.class, RegisteredCredentialMixin.class)
        .addMixIn(RegisteredCredential.RegisteredCredentialBuilder.class, RegisteredCredentialBuilderMixin.class)
        .findAndRegisterModules()
        .setDefaultPrettyPrinter(new DefaultPrettyPrinter())
        .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

    /**
     * Gets mapper instance.
     *
     * @return the instance
     */
    public static ObjectMapper getObjectMapper() {
        return MAPPER;
    }

    @JsonDeserialize(builder = CredentialRegistration.CredentialRegistrationBuilder.class)
    private static class CredentialRegistrationMixin {
    }

    @JsonPOJOBuilder(withPrefix = StringUtils.EMPTY)
    private static class CredentialRegistrationBuilderMixin {
    }

    @JsonDeserialize(builder = RegisteredCredential.RegisteredCredentialBuilder.class)
    private static class RegisteredCredentialMixin {
    }

    @JsonPOJOBuilder(withPrefix = StringUtils.EMPTY)
    private static class RegisteredCredentialBuilderMixin {
    }

}


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace Log4JParserNet
{
    public sealed class FilterNot
        : Filter
        , IEquatable<FilterNot>
    {
        public Filter Child { get; }

        public FilterNot (Filter child)
        {
            if (child == null)
            {
                throw new ArgumentNullException (nameof (child));
            }

            Child = child;
        }

        public override bool Equals (object obj)
            => obj is FilterNot other && Equals (other);

        public bool Equals (FilterNot other)
            => other != null && Equals (Child, other.Child);

        public override int GetHashCode ()
            => -1938063594 + Child.GetHashCode ();

        internal override HandleGraph<FilterHandle> Build (Encoding encoding)
        {
            HandleGraph<FilterHandle> child = null;
            FilterHandle primaryFilter = null;

            // There can be a maximum of 3 exceptions if filter initialization fails:
            // * Initial exception that caused the initialization to fail.
            // * Exception raised when calling primaryFilter.Dispose ().
            // * Exception raised when calling child.Dispose ().
            var cleanupErrors = new List<Exception> (3);

            try
            {
                child = Child.Build (encoding);

                Log4JParserC.Log4JFilterInitNot (out primaryFilter, child.Handle);

                return HandleGraph.Composite (primaryFilter, child);
            }
            catch (Exception initEx)
            {
                cleanupErrors.Add (initEx);
                Disposable.TryDispose (primaryFilter, cleanupErrors);
                Disposable.TryDispose (child, cleanupErrors);

                if (cleanupErrors.Count > 1)
                {
                    throw new AggregateException (cleanupErrors);
                }

                throw;
            }
        }

        public override void AcceptVisitor (IFilterVisitor visitor)
            => (visitor ?? throw new ArgumentNullException (nameof (visitor))).Visit (this);
    }
}


text:
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page

class WorkspaceRealTimeStatisticsList(ListResource):

    def __init__(self, version, workspace_sid):
        """
        Initialize the WorkspaceRealTimeStatisticsList

        :param Version version: Version that contains the resource
        :param workspace_sid: The SID of the Workspace

        :returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsList
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsList
        """
        super(WorkspaceRealTimeStatisticsList, self).__init__(version)

        # Path Solution
        self._solution = {'workspace_sid': workspace_sid, }

    def get(self):
        """
        Constructs a WorkspaceRealTimeStatisticsContext

        :returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsContext
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsContext
        """
        return WorkspaceRealTimeStatisticsContext(
            self._version,
            workspace_sid=self._solution['workspace_sid'],
        )

    def __call__(self):
        """
        Constructs a WorkspaceRealTimeStatisticsContext

        :returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsContext
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsContext
        """
        return WorkspaceRealTimeStatisticsContext(
            self._version,
            workspace_sid=self._solution['workspace_sid'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsList>'

class WorkspaceRealTimeStatisticsPage(Page):

    def __init__(self, version, response, solution):
        """
        Initialize the WorkspaceRealTimeStatisticsPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param workspace_sid: The SID of the Workspace

        :returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsPage
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsPage
        """
        super(WorkspaceRealTimeStatisticsPage, self).__init__(version, response)

        # Path Solution
        self._solution = solution

    def get_instance(self, payload):
        """
        Build an instance of WorkspaceRealTimeStatisticsInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsInstance
        """
        return WorkspaceRealTimeStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsPage>'

class WorkspaceRealTimeStatisticsContext(InstanceContext):

    def __init__(self, version, workspace_sid):
        """
        Initialize the WorkspaceRealTimeStatisticsContext

        :param Version version: Version that contains the resource
        :param workspace_sid: The SID of the Workspace to fetch

        :returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsContext
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsContext
        """
        super(WorkspaceRealTimeStatisticsContext, self).__init__(version)

        # Path Solution
        self._solution = {'workspace_sid': workspace_sid, }
        self._uri = '/Workspaces/{workspace_sid}/RealTimeStatistics'.format(**self._solution)

    def fetch(self, task_channel=values.unset):
        """
        Fetch the WorkspaceRealTimeStatisticsInstance

        :param unicode task_channel: Only calculate real-time statistics on this TaskChannel

        :returns: The fetched WorkspaceRealTimeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsInstance
        """
        data = values.of({'TaskChannel': task_channel, })

        payload = self._version.fetch(method='GET', uri=self._uri, params=data, )

        return WorkspaceRealTimeStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsContext {}>'.format(context)

class WorkspaceRealTimeStatisticsInstance(InstanceResource):

    def __init__(self, version, payload, workspace_sid):
        """
        Initialize the WorkspaceRealTimeStatisticsInstance

        :returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsInstance
        """
        super(WorkspaceRealTimeStatisticsInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_sid': payload.get('account_sid'),
            'activity_statistics': payload.get('activity_statistics'),
            'longest_task_waiting_age': deserialize.integer(payload.get('longest_task_waiting_age')),
            'longest_task_waiting_sid': payload.get('longest_task_waiting_sid'),
            'tasks_by_priority': payload.get('tasks_by_priority'),
            'tasks_by_status': payload.get('tasks_by_status'),
            'total_tasks': deserialize.integer(payload.get('total_tasks')),
            'total_workers': deserialize.integer(payload.get('total_workers')),
            'workspace_sid': payload.get('workspace_sid'),
            'url': payload.get('url'),
        }

        # Context
        self._context = None
        self._solution = {'workspace_sid': workspace_sid, }

    @property
    def _proxy(self):
        """
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: WorkspaceRealTimeStatisticsContext for this WorkspaceRealTimeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsContext
        """
        if self._context is None:
            self._context = WorkspaceRealTimeStatisticsContext(
                self._version,
                workspace_sid=self._solution['workspace_sid'],
            )
        return self._context

    @property
    def account_sid(self):
        """
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        """
        return self._properties['account_sid']

    @property
    def activity_statistics(self):
        """
        :returns: The number of current Workers by Activity
        :rtype: list[dict]
        """
        return self._properties['activity_statistics']

    @property
    def longest_task_waiting_age(self):
        """
        :returns: The age of the longest waiting Task
        :rtype: unicode
        """
        return self._properties['longest_task_waiting_age']

    @property
    def longest_task_waiting_sid(self):
        """
        :returns: The SID of the longest waiting Task
        :rtype: unicode
        """
        return self._properties['longest_task_waiting_sid']

    @property
    def tasks_by_priority(self):
        """
        :returns: The number of Tasks by priority
        :rtype: dict
        """
        return self._properties['tasks_by_priority']

    @property
    def tasks_by_status(self):
        """
        :returns: The number of Tasks by their current status
        :rtype: dict
        """
        return self._properties['tasks_by_status']

    @property
    def total_tasks(self):
        """
        :returns: The total number of Tasks
        :rtype: unicode
        """
        return self._properties['total_tasks']

    @property
    def total_workers(self):
        """
        :returns: The total number of Workers in the Workspace
        :rtype: unicode
        """
        return self._properties['total_workers']

    @property
    def workspace_sid(self):
        """
        :returns: The SID of the Workspace
        :rtype: unicode
        """
        return self._properties['workspace_sid']

    @property
    def url(self):
        """
        :returns: The absolute URL of the Workspace statistics resource
        :rtype: unicode
        """
        return self._properties['url']

    def fetch(self, task_channel=values.unset):
        """
        Fetch the WorkspaceRealTimeStatisticsInstance

        :param unicode task_channel: Only calculate real-time statistics on this TaskChannel

        :returns: The fetched WorkspaceRealTimeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsInstance
        """
        return self._proxy.fetch(task_channel=task_channel, )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsInstance {}>'.format(context)


text:
package com.intellij.dvcs;

import com.intellij.dvcs.repo.Repository;
import com.intellij.dvcs.repo.RepositoryManager;
import com.intellij.dvcs.ui.DvcsBundle;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.CheckinProjectPanel;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.NonFocusableCheckBox;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcsUtil.VcsUtil;
import consulo.logging.Logger;

import javax.annotation.Nonnull;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Provides a checkbox to amend current commit to the previous commit.
 * Selecting a checkbox loads the previous commit message from the provider, and substitutes current message in the editor,
 * unless it was already modified by user.
 */
public abstract class AmendComponent {

  private static final Logger LOG = Logger.getInstance(AmendComponent.class);

  @Nonnull
  private final RepositoryManager<? extends Repository> myRepoManager;
  @Nonnull
  private final CheckinProjectPanel myCheckinPanel;
  @Nonnull
  private final JCheckBox myAmend;
  @Nonnull
  private final String myPreviousMessage;

  @javax.annotation.Nullable
  private Map<VirtualFile, String> myMessagesForRoots;
  @javax.annotation.Nullable
  private String myAmendedMessage;

  public AmendComponent(@Nonnull Project project,
                        @Nonnull RepositoryManager<? extends Repository> repoManager,
                        @Nonnull CheckinProjectPanel panel) {
    this(project, repoManager, panel, DvcsBundle.message("commit.amend"));
  }

  public AmendComponent(@Nonnull Project project,
                        @Nonnull RepositoryManager<? extends Repository> repoManager,
                        @Nonnull CheckinProjectPanel panel,
                        @Nonnull String title) {
    myRepoManager = repoManager;
    myCheckinPanel = panel;
    myAmend = new NonFocusableCheckBox(title);
    myAmend.setMnemonic('m');
    myAmend.setToolTipText(DvcsBundle.message("commit.amend.tooltip"));
    myPreviousMessage = myCheckinPanel.getCommitMessage();

    myAmend.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        if (myAmend.isSelected()) {
          if (myPreviousMessage.equals(myCheckinPanel.getCommitMessage())) { // if user has already typed something, don't revert it
            if (myMessagesForRoots == null) {
              loadMessagesInModalTask(project); // load all commit messages for all repositories
            }
            String message = constructAmendedMessage();
            if (!StringUtil.isEmptyOrSpaces(message)) {
              myAmendedMessage = message;
              substituteCommitMessage(myAmendedMessage);
            }
          }
        }
        else {
          // there was the amended message, but user has changed it => not reverting
          if (myCheckinPanel.getCommitMessage().equals(myAmendedMessage)) {
            myCheckinPanel.setCommitMessage(myPreviousMessage);
          }
        }
      }
    });
  }

  @javax.annotation.Nullable
  private String constructAmendedMessage() {
    Set<VirtualFile> selectedRoots = getVcsRoots(getSelectedFilePaths()); // get only selected files
    LinkedHashSet<String> messages = ContainerUtil.newLinkedHashSet();
    if (myMessagesForRoots != null) {
      for (VirtualFile root : selectedRoots) {
        String message = myMessagesForRoots.get(root);
        if (message != null) {
          messages.add(message);
        }
      }
    }
    return DvcsUtil.joinMessagesOrNull(messages);
  }

  public void refresh() {
    myAmend.setSelected(false);
  }

  @Nonnull
  public Component getComponent() {
    return myAmend;
  }

  @Nonnull
  public JCheckBox getCheckBox() {
    return myAmend;
  }

  private void loadMessagesInModalTask(@Nonnull Project project) {
    try {
      myMessagesForRoots = ProgressManager.getInstance().runProcessWithProgressSynchronously(this::getLastCommitMessages,
                                                                                "Reading Commit Message...", true, project);
    }
    catch (VcsException e) {
      Messages.showErrorDialog(project, "Couldn't load commit message of the commit to amend.\n" + e.getMessage(),
                               "Commit Message not Loaded");
      LOG.info(e);
    }
  }

  private void substituteCommitMessage(@Nonnull String newMessage) {
    if (!StringUtil.equalsIgnoreWhitespaces(myPreviousMessage, newMessage)) {
      VcsConfiguration.getInstance(myCheckinPanel.getProject()).saveCommitMessage(myPreviousMessage);
      myCheckinPanel.setCommitMessage(newMessage);
    }
  }

  @javax.annotation.Nullable
  private Map<VirtualFile, String> getLastCommitMessages() throws VcsException {
    Map<VirtualFile, String> messagesForRoots = new HashMap<>();
    // load all vcs roots visible in the commit dialog (not only selected ones), to avoid another loading task if selection changes
    for (VirtualFile root : getAffectedRoots()) {
      String message = getLastCommitMessage(root);
      messagesForRoots.put(root, message);
    }
    return messagesForRoots;
  }

  @Nonnull
  protected Collection<VirtualFile> getAffectedRoots() {
    return myRepoManager.getRepositories().stream().
            filter(repo -> !repo.isFresh()).
            map(Repository::getRoot).
            filter(root -> myCheckinPanel.getRoots().contains(root)).
            collect(Collectors.toList());
  }

  @Nonnull
  private List<FilePath> getSelectedFilePaths() {
    return ContainerUtil.map(myCheckinPanel.getFiles(), VcsUtil::getFilePath);
  }

  @Nonnull
  protected abstract Set<VirtualFile> getVcsRoots(@Nonnull Collection<FilePath> files);

  @javax.annotation.Nullable
  protected abstract String getLastCommitMessage(@Nonnull VirtualFile repo) throws VcsException;

  public boolean isAmend() {
    return myAmend.isSelected();
  }
}


text:
#ifndef BODYPARSER_HPP
#define BODYPARSER_HPP

#include <iosfwd>
#include <map>
#include <string>
#include <vector>

#include <utils/noninstantiable.hpp>

#include "body.hpp"

class BodyParser : private utils::noninstantiable
{
public:
    static Body parse(std::string name, std::istream& in);

    /**
     * @brief parseFromFile parse the file data/name.dat to create the according body
     * @param fileName
     * @return
     * @throw std::invalid_argument if the file doesn't exist in the data folder
     */
    static Body parseFromFile(std::string name);

private:
    using string_container_t = std::vector<std::string>;

    static std::string createFileName(const std::string& name);

    /**
     * @brief parseLineWithTwoValues
     * @param line
     * @return
     * @post res.size() == 2
     */
    static std::map<std::string, std::string> parseLineWithTwoValues(std::string line);

    static std::pair<std::string, std::string> parsePairKeyValue(const std::string& line);

    static Body::mass_t findMass(const string_container_t& lines);

    static Body::length_t findRadius(const string_container_t& lines);

    static Body::position_vector_t findPosition(const string_container_t& lines);

    static Body::velocity_vector_t findVelocity(const string_container_t& lines);

    static double parsePowerOfTen(std::string str);
};

#endif // BODYPARSER_HPP


text:
package org.testobject.kernel.platform.robot;

/**
 *
 * @author nijkamp
 *
 */
public interface Window {
    class Builder {
    	public static Window mock() {
    		return new Window() {

    		};
    	}
    }
}


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

<title>Gyroscope</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="date" content="2018-04-24">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

SEARCH:
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package ev3dev.sensors.arduino.bn055.model

Class Gyroscope

<map id="G" name="G">
<area shape="rect" id="node1_0" href="./BNO055Response.html" title="ev3dev.sensors.arduino.bn055.model.BNO055Response" alt="" coords="16,11,205,137"/>
<area shape="rect" id="node1" href="./BNO055Response.html" title="<TABLE>" alt="" coords="5,5,216,143"/>
<area shape="rect" id="node2_1" href="./Gyroscope.html" title="ev3dev.sensors.arduino.bn055.model.Gyroscope" alt="" coords="64,196,157,293"/>
<area shape="rect" id="node2" href="./Gyroscope.html" title="<TABLE>" alt="" coords="53,191,168,299"/>
</map>

java.lang.Object

ev3dev.sensors.arduino.bn055.model.Gyroscope

public class Gyroscope
extends java.lang.Object

Created by jabrena on 12/8/17.

Field Summary

Fields

Modifier and Type
Field and Description

private float
x

private float
y

private float
z

Constructor Summary

Constructors

Constructor and Description

Gyroscope()

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

x

private final float x

y

private final float y

z

private final float z

Constructor Detail

Gyroscope

public Gyroscope()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<?php

use lasa\Container;
use lasa\db\DB;
use lasa\db\DataSource;

define("__TESTS_DIR__", __DIR__);
require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php';

call_user_func(function () {

	$c = Container::getInstance();

	/**
	 * テスト用のDBの設定
	 */
	DB::connection([
		"driver" => "mysql",
		"host" => "127.0.0.1",
		"database" => "phpunit_test",
		"port" => "3305",
		"username" => "root",
		"password" => "root",
		"encoding" => "utf-8"
	]);

	DB::configure("cache_dir", sys_get_temp_dir() . "/lasaphptest");

	$c->share("pdo", function () {
		$pdo = new PDO('mysql:host=localhost; dbname=phpunit_test', 'root', '');
		return $pdo;
	});
});

trait DBTestBase {

	function getDataSource() {
		return DataSource::getDataSource();
	}

	function getColumns($tableName) {
		$res = $this->getDataSource()->executeQuery("show columns from sample_table");
		$columns = [];
		foreach ($res as $row) {
			$columns[$row["Field"]] = $row;
		}
		return $columns;
	}

	function getTableNames() {
		$res = $this->getDataSource()->executeQuery("show tables");
		$tables = [];
		foreach ($res as $row) {
			foreach ($row as $tableName) {
				$tables[] = $tableName;
			}
		}
		return $tables;
	}

	function deleteAllTables() {
		$tables = $this->getTableNames();
		foreach ($tables as $table) {
			$this->getDataSource()->executeUpdateQuery("drop table if exists ${table}");
		}
	}
}

trait ViewTestBase {

	private $loader;

	/**
	 *
	 * @param unknown $loader
	 * @return \lasa\view\Engine
	 */
	function getEngine($loader, $options = []) {
		return new \lasa\view\Engine($loader, [
			"cache" => sys_get_temp_dir() . "/lasaphptest",
			"debug" => (isset($options["debug"])) ? $options["debug"] : false,
		]);
	}

	function getViewLoader($dir, $options = []) {
		return $this->getEngine(new \lasa\view\loader\FileLoader($dir), $options);
	}

	function getView($template, Closure $func) {

		if (!$this->loader) {
			$this->loader = new \lasa\view\loader\ArrayLoader();
		}
		$loader = $this->loader;
		$key = "view-" . count($loader) . "-" . rand();
		$loader[$key] = [$template, $func];

		$engine = $this->getEngine($loader);
		$view = $engine->load($key);
		return $view;
	}
}

function clean_tmp_dir($dir) {
	$files = scandir($dir);
	foreach ($files as $file) {
		if ($file[0] == ".") continue;
		$path = $dir . DIRECTORY_SEPARATOR . $file;
		if (is_file($path)) {
			unlink($path);
		}
	}
}


text:
require File.expand_path(File.join(File.dirname(__FILE__), %w{1.rb}))

Eye.application("bla") do
  working_dir "/tmp"

  process_1(self, "11")
  process_1(self, "12")
end


text:
description: Error messages for the self change password API.
public: false
topics:
  - errors
  - passwords
contentType: reference
useCase: error-management
---
# Self Change Password Errors

Below you will find the errors codes and possible solutions to various errors that can occur with the self change password api.

## Error Format

Error messages are returned in the standard format:

```json
{
  "error": "error_code",
  "error_description": "the description of the error.",
  "error_uri": "https://auth0.com/docs/errors/dbconnections/self_change_password"
}
```

## Error Codes

### `invalid_request`

This error results when you supply invalid parameters. Error messages will describe the issue such as a required parameter or invalid format.

### `invalid_user_password`

This error results from a bad `username`/`email` and `old_password` combination being sent. Retry the request with the correct username and `old_password`.

### `change_password_error`

This error results from various conditions with the underlying identity provider. Generally, this happens when you are using a custom database and have not implemented the change password script.


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

<TITLE>
Class Hierarchy
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

All Classes

Hierarchy For All Packages

Package Hierarchies:
net.tinyos.sim.script.reflect

Class Hierarchy

class java.lang.Object

class org.python.core.PyObject (implements java.io.Serializable)

class org.python.core.PyDictionary (implements org.python.core.ClassDictInit)

class net.tinyos.sim.script.reflect.Packets

class net.tinyos.sim.script.reflect.SimReflect

class net.tinyos.sim.script.reflect.Commands
class net.tinyos.sim.script.reflect.Interp
class net.tinyos.sim.script.reflect.Mote
class net.tinyos.sim.script.reflect.Radio
class net.tinyos.sim.script.reflect.Sim

      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

All Classes


text:
package io.kubernetes.client.openapi.models;

import io.kubernetes.client.fluent.VisitableBuilder;

public class V1DeploymentBuilder extends V1DeploymentFluentImpl<V1DeploymentBuilder>
    implements VisitableBuilder<V1Deployment, V1DeploymentBuilder> {
  public V1DeploymentBuilder() {
    this(false);
  }

  public V1DeploymentBuilder(Boolean validationEnabled) {
    this(new V1Deployment(), validationEnabled);
  }

  public V1DeploymentBuilder(V1DeploymentFluent<?> fluent) {
    this(fluent, false);
  }

  public V1DeploymentBuilder(V1DeploymentFluent<?> fluent, Boolean validationEnabled) {
    this(fluent, new V1Deployment(), validationEnabled);
  }

  public V1DeploymentBuilder(V1DeploymentFluent<?> fluent, V1Deployment instance) {
    this(fluent, instance, false);
  }

  public V1DeploymentBuilder(
      V1DeploymentFluent<?> fluent, V1Deployment instance, Boolean validationEnabled) {
    this.fluent = fluent;
    fluent.withApiVersion(instance.getApiVersion());

    fluent.withKind(instance.getKind());

    fluent.withMetadata(instance.getMetadata());

    fluent.withSpec(instance.getSpec());

    fluent.withStatus(instance.getStatus());

    this.validationEnabled = validationEnabled;
  }

  public V1DeploymentBuilder(V1Deployment instance) {
    this(instance, false);
  }

  public V1DeploymentBuilder(V1Deployment instance, Boolean validationEnabled) {
    this.fluent = this;
    this.withApiVersion(instance.getApiVersion());

    this.withKind(instance.getKind());

    this.withMetadata(instance.getMetadata());

    this.withSpec(instance.getSpec());

    this.withStatus(instance.getStatus());

    this.validationEnabled = validationEnabled;
  }

  V1DeploymentFluent<?> fluent;
  Boolean validationEnabled;

  public V1Deployment build() {
    V1Deployment buildable = new V1Deployment();
    buildable.setApiVersion(fluent.getApiVersion());
    buildable.setKind(fluent.getKind());
    buildable.setMetadata(fluent.getMetadata());
    buildable.setSpec(fluent.getSpec());
    buildable.setStatus(fluent.getStatus());
    return buildable;
  }
}


text:
export type TypeRule = {
    ruleType: "ITEM_TYPE";
    matchType: TypeRuleMatchType;
};

export type TypeRuleMatchType =
    | "PAYMENT"
    | "PAYMENT_RECEIVED"
    | "PAYMENT_SENT"
    | "REGULAR_PAYMENT"
    | "MASTERCARD_PAYMENT"
    | "REQUEST"
    | "REQUEST_INQUIRY"
    | "REQUEST_RESPONSE"
    | "BUNQ_ME_TAB";

export default TypeRule;


text:
<!DOCTYPE html>

<meta charset="UTF-8"/>
<link href="default.css" rel="stylesheet" type="text/css" />

  人口
  1
  ,
  7
  0
  0
  万
  の
  永世
  中立
  国
  。

It's a stable neutral country with a population of 17 million.


text:
package org.alfresco.jive.community.impl;

import com.jivesoftware.community.objecttype.ObjectTypeUtils;

/**
 * This class TODO
 *
 * @author
 * @version $Id: CmisStorageUtil.java 41626 2012-09-14 23:59:00Z wabson $
 *
 */
public class CmisStorageUtil
{

    private CmisStorageUtil()
    {
    }

    public static String getStorageKey(CmisBinaryBody binaryBody)
    {
        return binaryBody.getCmisObjectId();
    }

    public static String getContainerStorageKey(CmisBinaryBody binaryBody)
    {
        return binaryBody.getCmisObjectId();
    }

    public static String getStorageKey(int objectType, long objectID)
    {
        return ObjectTypeUtils.getJiveObjectType(objectType).getCode() + "-" + objectID;
    }
}


text:
p::first-letter {
	-webkit-initial-letter: 2;
	initial-letter: 2;
}
::first-letter {
	-webkit-initial-letter: 3;
	initial-letter: 3;
}


text:
name: External Source Code
about: Submit a proposal to integrate external source code
title: ''
labels: TSC
assignees: ''

---

## Origin

Name of project hosting the original open source code
Provide a link to the source

## Purpose

Brief description of what this software does

## Mode of integration

Describe whether you'd like to integrate this exernal component in the main tree
or as a module, and why. If the mode of integration is a module, suggest a
repository name for the module

## Pull Request

Pull request (if any) with the actual implementation of the integration, be it
in the main tree or as a module (pointing to your own fork for now). Make sure
the PR is correctly labeled as "DNM"

## Description

Long description that will help reviewers discuss suitability of the
component to solve the problem at hand (there may be a better options
available.)

What is its primary functionality (e.g., SQLLite is a lightweight
database)?

What problem are you trying to solve? (e.g., a state store is
required to maintain ...)

Why is this the right component to solve it (e.g., SQLite is small,
easy to use, and has a very liberal license.)

# Dependencies

What other components does this package depend on?

Will the Zephyr project have a direct dependency on the component, or
will it be included via an abstraction layer with this component as a
replaceable implementation?

## Revision

Version or SHA you would like to integrate initially

## License

Please use an SPDX identifier (https://spdx.org/licenses/), such as
``BSD-3-Clause``


text: export { _ormSchema as default } from 'miragejs';


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField(unique=True, max_length=255)),
                ('description', models.CharField(max_length=255)),
                ('content', models.TextField()),
                ('published', models.BooleanField(default=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-created'],
            },
            bases=(models.Model,),
        ),
    ]


text:
var identity = require('./identity')
var each = require('./each')

module.exports = function toArray(obj, fn) {
	if (!fn) { fn = identity }
	var result = []
	each(obj, function(val, key) {
		result.push(fn(val, key))
	})
	return result
}


text:
@protocol CDRSharedExampleGroupPool
@end

typedef void (^CDRSharedExampleGroupBlock)(NSDictionary *);
typedef void (^CDRSharedExampleContextProviderBlock)(NSMutableDictionary *);

#ifdef __cplusplus
extern "C" {
#endif
void sharedExamplesFor(NSString *, CDRSharedExampleGroupBlock);
CDR_OVERLOADABLE void itShouldBehaveLike(NSString *);
CDR_OVERLOADABLE void itShouldBehaveLike(NSString *, CDRSharedExampleContextProviderBlock);
#ifdef __cplusplus
}
#endif

@interface CDRSharedExampleGroupPool : NSObject <CDRSharedExampleGroupPool>
@end

@interface CDRSharedExampleGroupPool (SharedExampleGroupDeclaration)
- (void)declareSharedExampleGroups;
@end

#define SHARED_EXAMPLE_GROUPS_BEGIN(name)                                \
@interface SharedExampleGroupPoolFor##name : CDRSharedExampleGroupPool   \
@end                                                                     \
@implementation SharedExampleGroupPoolFor##name                          \
- (void)declareSharedExampleGroups {

#define SHARED_EXAMPLE_GROUPS_END                                        \
}                                                                        \
@end


text:
#include "config.h"

#if ENABLE(MEDIA_STREAM)

#include <public/WebMediaStreamComponent.h>
#include <public/WebMediaStreamDescriptor.h>
#include <public/WebRTCStatsRequest.h>
#include <public/WebRTCStatsResponse.h>

#include "RTCStatsRequest.h"
#include "RTCStatsResponse.h"
#include <wtf/PassOwnPtr.h>

using namespace WebCore;

namespace WebKit {

WebRTCStatsRequest::WebRTCStatsRequest(const PassRefPtr<RTCStatsRequest>& request)
    : m_private(request)
{
}

void WebRTCStatsRequest::assign(const WebRTCStatsRequest& other)
{
    m_private = other.m_private;
}

void WebRTCStatsRequest::reset()
{
    m_private.reset();
}

WebRTCStatsResponse WebRTCStatsRequest::createResponse() const
{
    return WebRTCStatsResponse(m_private->createResponse());
}

bool WebRTCStatsRequest::hasSelector() const
{
    return m_private->hasSelector();
}

const WebMediaStreamDescriptor WebRTCStatsRequest::stream() const
{
    return WebMediaStreamDescriptor(m_private->stream());
}

const WebMediaStreamComponent WebRTCStatsRequest::component() const
{
    return WebMediaStreamComponent(m_private->component());
}

void WebRTCStatsRequest::requestSucceeded(const WebRTCStatsResponse& response) const
{
    m_private->requestSucceeded(response);
}

} // namespace WebKit

#endif // ENABLE(MEDIA_STREAM)


text:
package de.ailis.xadrian.support;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;

/**
 * Iterator which iterates over multiple collections
 *
 * @param <T>
 *            The collection type
 *
 * @author Klaus Reimer (k@ailis.de)
 */
public class MultiIterator<T> implements Iterator<T>
{
    /** Iterator over all iterators */
    private final Iterator<Iterator<T>> iterators;

    /** Current iterator. Null if end of wrapped collections is reached. */
    private Iterator<T> current;

    /**
     * Creates iterator which iterates over all specified collections
     *
     * @param collections
     *            The collections to iterate
     */
    public MultiIterator(final Collection<T>[] collections)
    {
        final List<Iterator<T>> iterators =
            new ArrayList<Iterator<T>>(collections.length);
        for (final Collection<T> collection: collections)
        {
            iterators.add(collection.iterator());
        }
        this.iterators = iterators.iterator();
        if (this.iterators.hasNext())
            this.current = this.iterators.next();
        else
            this.current = null;
    }

    /**
     * @see java.util.Iterator#hasNext()
     */
    @Override
    public boolean hasNext()
    {
        if (this.current == null) return false;
        return this.current.hasNext();

    }

    /**
     * @see java.util.Iterator#next()
     */
    @Override
    public T next()
    {
        if (this.current == null)
            throw new NoSuchElementException("No more elements");

        final T next = this.current.next();
        while (this.current != null && !this.current.hasNext())
            if (this.iterators.hasNext())
                this.current = this.iterators.next();
            else
                this.current = null;
        return next;
    }

    /**
     * @see java.util.Iterator#remove()
     */
    @Override
    public void remove()
    {
        throw new UnsupportedOperationException("Read-only iterator");
    }
}


text:
package org.usfirst.frc.team5518.function;

import org.usfirst.frc.team5518.framework.RobotFunction;
import org.usfirst.frc.team5518.robot.Robot;
import org.usfirst.frc.team5518.robot.RobotMap;

import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.RobotDrive.MotorType;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class DriveTrain extends RobotFunction {

	public static final double kDefaultSensitivity = 0.70;

	private RobotDrive m_robot;

	private float speed_factor;

	public DriveTrain(String name) {
		super(name);
	}

	@Override
	public void initialize() {
		m_robot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR, RobotMap.REAR_LEFT_MOTOR,
				RobotMap.FRONT_RIGHT_MOTOR, RobotMap.REAR_RIGHT_MOTOR);
		m_robot.setExpiration(RobotDrive.kDefaultExpirationTime);  // set expiration time for motor movement if error occurs
		m_robot.setSafetyEnabled(true);  // enable safety so motors don't burn out
		m_robot.setInvertedMotor(MotorType.kFrontRight, true);
		//m_robot.setInvertedMotor(MotorType.kFrontLeft, true);
		m_robot.setInvertedMotor(MotorType.kRearRight, true);
		//m_robot.setInvertedMotor(MotorType.kRearLeft, true);

	}

	@Override
	public void start() {

		if (Robot.jOi.getJoystick().getRawButton(RobotMap.BTN_TRIGGER))
			speed_factor = 0.35f;
		else
			speed_factor = 0.85f;

		m_robot.mecanumDrive_Cartesian(Robot.jOi.getJoystick().getRawAxis(RobotMap.X_AXIS)*speed_factor,
				Robot.jOi.getJoystick().getRawAxis(RobotMap.Y_AXIS)*speed_factor,
				Robot.jOi.getJoystick().getRawAxis(RobotMap.Z_AXIS)*speed_factor, 0);

	}

	@Override
	public void outputHandler() {
		log();
	}

	@Override
	protected void log() {
		super.log();
		SmartDashboard.putNumber("Joystick X Axis", Robot.jOi.getJoystick().getRawAxis(RobotMap.X_AXIS));
		SmartDashboard.putNumber("Joystick Y Axis", Robot.jOi.getJoystick().getRawAxis(RobotMap.Y_AXIS));
		SmartDashboard.putNumber("Joystick Z Axis", Robot.jOi.getJoystick().getRawAxis(RobotMap.Z_AXIS));
	}

	// *********************** HELPER FUNCTIONS **************************

	/**
	 * Set maximum power of RobotDrive system
	 */
	public void setMaxPower(double power) {
		m_robot.setMaxOutput(power);
	}

	/*
	 * Set turn sensitivity/radius of RobotDrive system
	 */
	public void setSensitivity(double sensitivity) {
		m_robot.setSensitivity(sensitivity);
	}

	public void drive(double x, double y, double rotation) {
		m_robot.mecanumDrive_Cartesian(x, y, rotation, 0);
	}

}


text:
package com.android.camera.data;

import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.Log;
import android.view.View;

import com.android.camera.ui.FilmStripView;
import com.android.camera.util.PhotoSphereHelper;

/**
 * A LocalData that does nothing but only shows a view.
 */
public class SimpleViewData implements LocalData {
    private static final String TAG = "CAM_SimpleViewData";

    private final int mWidth;
    private final int mHeight;
    private final View mView;
    private final long mDateTaken;
    private final long mDateModified;

    public SimpleViewData(
            View v, int width, int height,
            int dateTaken, int dateModified) {
        mView = v;
        mWidth = width;
        mHeight = height;
        mDateTaken = dateTaken;
        mDateModified = dateModified;
    }

    @Override
    public long getDateTaken() {
        return mDateTaken;
    }

    @Override
    public long getDateModified() {
        return mDateModified;
    }

    @Override
    public String getTitle() {
        return "";
    }

    @Override
    public int getWidth() {
        return mWidth;
    }

    @Override
    public int getHeight() {
        return mHeight;
    }

    @Override
    public int getOrientation() {
        return 0;
    }

    @Override
    public int getViewType() {
        return FilmStripView.ImageData.VIEW_TYPE_REMOVABLE;
    }

    @Override
    public String getPath() {
        return "";
    }

    @Override
    public Uri getContentUri() {
        return Uri.EMPTY;
    }

    @Override
    public int getLocalDataType() {
        return LOCAL_VIEW;
    }

    @Override
    public LocalData refresh(ContentResolver resolver) {
        return null;
    }

    @Override
    public boolean isUIActionSupported(int action) {
        return false;
    }

    @Override
    public boolean isDataActionSupported(int action) {
        return false;
    }

    @Override
    public boolean delete(Context c) {
        return false;
    }

    @Override
    public View getView(Activity activity, int width, int height, Drawable placeHolder,
            LocalDataAdapter adapter) {
        return mView;
    }

    @Override
    public void prepare() {
        // do nothing.
    }

    @Override
    public void recycle() {
        // do nothing.
    }

    @Override
    public void isPhotoSphere(Context context, PanoramaSupportCallback callback) {
        // Not a photo sphere panorama.
        callback.panoramaInfoAvailable(false, false);
    }

    @Override
    public void viewPhotoSphere(PhotoSphereHelper.PanoramaViewHelper helper) {
        // do nothing.
    }

    @Override
    public void onFullScreen(boolean fullScreen) {
        // do nothing.
    }

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

    @Override
    public MediaDetails getMediaDetails(Context context) {
        return null;
    }

    @Override
    public double[] getLatLong() {
        return null;
    }

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

    @Override
    public String getMimeType() {
        return null;
    }

    @Override
    public boolean rotate90Degrees(Context context, LocalDataAdapter adapter,
            int currentDataId, boolean clockwise) {
        // We don't support rotation for SimpleViewData.
        Log.w(TAG, "Unexpected call in rotate90Degrees()");
        return false;
    }

    @Override
    public long getSizeInBytes() {
        return 0;
    }

    @Override
    public long getContentId() {
        return -1;
    }
}


text:
package com.arthurivanets.graphalgorithmsvisualization.util;

public interface CSVConvertable<T> {

	public T fromCSV(String csvData);

	public String toCSV();

}