text:
#ifndef TFNAMESPACE_H
#define TFNAMESPACE_H

class TWebApplication;

/*!
  \namespace Tf
  \brief The Tf namespace contains miscellaneous identifiers used
  throughout the library of TreeFrog Framework.
*/
namespace Tf {
enum QuotedStrSplitBehavior {
    SplitWhereverSep = 0,
    SplitSkipQuotedString,
};

enum CaseSensitivity {
    CaseInsensitive = Qt::CaseInsensitive,
    CaseSensitive = Qt::CaseSensitive,
};

enum HttpMethod {
    Invalid = 0,
    Get,
    Head,
    Post,
    Options,
    Put,
    Delete,
    Trace,
    Connect,
    Patch,
};

enum HttpStatusCode {
    // Informational 1xx
    Continue = 100,
    SwitchingProtocols = 101,
    // Successful 2xx
    OK = 200,
    Created = 201,
    Accepted = 202,
    NonAuthoritativeInformation = 203,
    NoContent = 204,
    ResetContent = 205,
    PartialContent = 206,
    // Redirection 3xx
    MultipleChoices = 300,
    MovedPermanently = 301,
    Found = 302,
    SeeOther = 303,
    NotModified = 304,
    UseProxy = 305,
    TemporaryRedirect = 307,
    // Client Error 4xx
    BadRequest = 400,
    Unauthorized = 401,
    PaymentRequired = 402,
    Forbidden = 403,
    NotFound = 404,
    MethodNotAllowed = 405,
    NotAcceptable = 406,
    ProxyAuthenticationRequired = 407,
    RequestTimeout = 408,
    Conflict = 409,
    Gone = 410,
    LengthRequired = 411,
    PreconditionFailed = 412,
    RequestEntityTooLarge = 413,
    RequestURITooLong = 414,
    UnsupportedMediaType = 415,
    RequestedRangeNotSatisfiable = 416,
    ExpectationFailed = 417,
    // Server Error 5xx
    InternalServerError = 500,
    NotImplemented = 501,
    BadGateway = 502,
    ServiceUnavailable = 503,
    GatewayTimeout = 504,
    HTTPVersionNotSupported = 505,
};

// Common options for AJAX
enum AjaxOption {
    Asynchronous = 0,  // true or false, default:true
    ContentType,  // default:"application/x-www-form-urlencoded"
    Encoding,  // default:"UTF-8"
    Method,  // Tf::Get or Tf::Post, default:Post
    Parameters,  // Default:null
    PostBody,  // Specific contents for the request body on a 'post' method
    RequestHeaders,  // See Prototype API docs
    EvalJS,  // true or false, default:true
    EvalJSON,  // true or false, default:true
    SanitizeJSON,  // true or false, See Prototype API docs
};

enum AjaxEvent {
    Create = 100,  // Before request is initiated
    Uninitialized,  // Immediately after request is initiated and before loading
    Loading,  // When the remote response is being loaded by the browser
    Loaded,  // When the browser has finished loading the remote response
    Interactive,  // When the user can interact with the remote response, even though it has not finished loading
    Success,  // When the XMLHttpRequest is completed, and the HTTP status code is in the 2XX range
    Failure,  // When the XMLHttpRequest is completed, and the HTTP status code is not in the 2XX range
    Complete,  // When the XMLHttpRequest is complete (fires after success or failure, if they are present)
};

enum ValidationRule {
    Required = 0,  // This value is required.
    MaxLength,  // This value is too long.
    MinLength,  // This value is too short.
    IntMax,  // This value is too big.
    IntMin,  // This value is too small.
    DoubleMax,  // This value is too big.
    DoubleMin,  // This value is too small.
    EmailAddress,  // This value is not email address.
    Url,  // This value is invalid URL.
    Date,  // This value is invalid date.
    Time,  // This value is invalid time.
    DateTime,  // This value is invalid date or time.
    Pattern,  // This value is bad format.
    Custom,

    // Add new rules before this line
    RuleCount
};

enum EscapeFlag {
    Compatible = 0,  // Converts double-quotes and leaves single-quotes alone.
    Quotes,  // Converts both double and single quotes.
    NoQuotes,  // Leaves both double and single quotes unconverted.
};

enum SortOrder {
    AscendingOrder = Qt::AscendingOrder,
    DescendingOrder = Qt::DescendingOrder,
};

enum AppAttribute {
    ListenPort = 0,
    InternalEncoding,
    HttpOutputEncoding,
    Locale,
    MultiProcessingModule,
    UploadTemporaryDirectory,
    SqlDatabaseSettingsFiles,
    MongoDbSettingsFile,
    SqlQueriesStoredDirectory,
    DirectViewRenderMode,
    SystemLogFile,
    SqlQueryLogFile,
    ApplicationAbortOnFatal,
    LimitRequestBody,
    EnableCsrfProtectionModule,
    EnableHttpMethodOverride,
    SessionName,
    SessionStoreType,
    SessionAutoIdRegeneration,
    SessionLifeTime,  // obsolete
    SessionCookiePath,
    SessionGcProbability,
    SessionGcMaxLifeTime,
    SessionSecret,
    SessionCsrfProtectionKey,
    MPMThreadMaxAppServers,
    MPMThreadMaxThreadsPerAppServer,
    MPMEpollMaxAppServers,
    SystemLogFilePath,
    SystemLogLayout,
    SystemLogDateTimeFormat,
    AccessLogFilePath,
    AccessLogLayout,
    AccessLogDateTimeFormat,
    ActionMailerDeliveryMethod,
    ActionMailerCharacterSet,
    ActionMailerDelayedDelivery,
    ActionMailerSmtpHostName,
    ActionMailerSmtpPort,
    ActionMailerSmtpAuthentication,
    ActionMailerSmtpUserName,
    ActionMailerSmtpPassword,
    ActionMailerSmtpEnablePopBeforeSmtp,
    ActionMailerSmtpPopServerHostName,
    ActionMailerSmtpPopServerPort,
    ActionMailerSmtpPopServerEnableApop,
    ActionMailerSendmailCommandLocation,
    //
    HttpKeepAliveTimeout,
    RedisSettingsFile,
    LDPreload,
    JavaScriptPath,
    ActionMailerSmtpEnableSTARTTLS,  // obsolete
    ListenAddress,
    //
    SessionCookieMaxAge,
    SessionCookieDomain,
    //
    CacheSettingsFile,
    CacheBackend,
    CacheGcProbability,
    CacheEnableCompression,
    //
    SessionCookieSameSite,
    //
    EnableForwardedForHeader,
    TrustedProxyServers,
    ActionMailerSmtpRequireTLS,
};

// Reason codes why a web socket has been closed
enum CloseCode {
    NormalClosure = 1000,
    GoingAway = 1001,
    ProtocolError = 1002,
    UnsupportedData = 1003,
    Reserved = 1004,
    NoStatusRcvd = 1005,
    AbnormalClosure = 1006,
    InvalidFramePayloadData = 1007,
    PolicyViolation = 1008,
    MessageTooBig = 1009,
    MandatoryExtension = 1010,
    InternalError = 1011,
    ServiceRestart = 1012,
    TryAgainLater = 1013,
    TLSHandshake = 1015,
};

enum LogPriority {
    FatalLevel = 0,  //!< Severe error events that will presumably lead the app to abort.
    ErrorLevel,  //!< Error events that might still allow the app to continue running.
    WarnLevel,  //!< Potentially harmful situations.
    InfoLevel,  //!< Informational messages that highlight the progress of the app.
    DebugLevel,  //!< Informational events that are most useful to debug the app.
    TraceLevel,  //!< Finer-grained informational events than the DEBUG.
};

enum class KvsEngine {
    MongoDB = 0,
    Redis,
    CacheKvs,  // For internal use
    Num  // = 3
};
}

/*!
  \namespace TSql
  \brief The TSql namespace contains miscellaneous identifiers used
  throughout the SQL library.
*/
namespace TSql {
enum ComparisonOperator {
    Invalid = 0,
    Equal,  // = val
    NotEqual,  // <> val
    LessThan,  // < val
    GreaterThan,  // > val
    LessEqual,  // <= val
    GreaterEqual,  // >= val
    IsNull,  // IS NULL
    IsEmpty,  // (column IS NULL OR column = '')
    IsNotNull,  // IS NOT NULL
    IsNotEmpty,  // column IS NOT NULL AND column <> ''
    Like,  // LIKE val
    NotLike,  // NOT LIKE val
    LikeEscape,  // LIKE val1 ESCAPE val2
    NotLikeEscape,  // NOT LIKE val1 ESCAPE val2
    ILike,  // ILIKE val
    NotILike,  // NOT ILIKE  val
    ILikeEscape,  // ILIKE val1 ESCAPE val2
    NotILikeEscape,  // NOT ILIKE val1 ESCAPE val2
    In,  // IN (val1, ...)
    NotIn,  // NOT IN (val1, ...)
    Between,  // BETWEEN val1 AND val2
    NotBetween,  // NOT BETWEEN val1 AND val2
    Any,  // ANY (val1, ...)
    All,  // ALL (val1, ...)
};

enum JoinMode {
    InnerJoin = 0,
    LeftJoin,
    RightJoin,
};
}

/*!
  \namespace TMongo
  \brief The TMongo namespace contains miscellaneous identifiers used
  throughout the MongoDB library.
*/
namespace TMongo {
enum ComparisonOperator {
    Invalid = 0,
    Equal = TSql::Equal,  // == val
    NotEqual = TSql::NotEqual,  // != val
    LessThan = TSql::LessThan,  // < val
    GreaterThan = TSql::GreaterThan,  // > val
    LessEqual = TSql::LessEqual,  // <= val
    GreaterEqual = TSql::GreaterEqual,  // >= val
    Exists = 100,  // $exists : true
    NotExists,  // $exists : false
    All,  // $all : [ val1, ... ]
    In,  // $in : [ val1, ... ]
    NotIn,  // $nin : [ val1, ... ]
    Mod,  // $mod : [ val1, val2 ]
    Size,  // $size : val
    Type,  // $type : val
};
}

#endif  // TFNAMESPACE_H


text:
package com.xlythe.textmanager.text.smil;

import org.w3c.dom.DOMException;
import org.w3c.dom.Element;

public interface SMILElement extends Element {
    /**
     *  The unique id.
     * @exception DOMException
     *    NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.
     */
    String getId();
    void setId(String id)
            throws DOMException;

}

redpajama_set_name: RedPajamaGithub


text:
package com.unipad.utils;

import android.content.Context;
import android.text.TextUtils;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.unipad.singlebrain.App;
import com.unipad.singlebrain.R;
import com.unipad.singlebrain.home.bean.RuleGame;
import com.unipad.common.Constant;
import com.unipad.common.widget.HIDDialog;

public class ToastUtil {

    private static Toast toast;

    public static void showToast(String text) {
        if (toast == null) {
            toast = Toast.makeText(App.getContext(), text,
                    Toast.LENGTH_SHORT);
            toast.setGravity(Gravity.CENTER, 0, 0);
        } else {
            toast.setText(text);
        }
        toast.show();
    }

    public static void showToast(int textId) {
        String text = App.getContext().getResources().getString(textId);
        showToast(text);
    }

    public static HIDDialog createOnlyConfigDlg(Context mContext, String key, View.OnClickListener listener) {
        final HIDDialog dialog = new HIDDialog(mContext, key);
        dialog.setContentView(HIDDialog.ENUM_DIALOG_VIEW.ONE_BUTTON_VIEW);
        dialog.setText("");
        dialog.setFirstBTListener(listener);
        return dialog;
    }

    /**
     * 创建等待对话框
     *
     * @param mContext
     * @param message  显示信息
     * @return HIDDialog
     */
    public static HIDDialog createWaitingDlg(Context mContext, String message, String id) {
        HIDDialog WaitingDialog = new HIDDialog(mContext, R.style.dialog_wait, id);
        if (null == message) {
            message = mContext.getString(R.string.ui_please_wait);
        }

        WaitingDialog.setContentView(R.layout.ui_waiting,
                (int) mContext.getResources().getDimension(R.dimen.wait_dialog_width), (int) mContext.getResources()
                        .getDimension(R.dimen.wait_dialog_height));

        // 必须放在设置 view之后,自定义的view是不能设置该方法的,注释掉
        ((TextView) WaitingDialog.findViewById(R.id.dialog_text)).setText(message);
        Window win = WaitingDialog.getWindow();
        WindowManager.LayoutParams lp = win.getAttributes();
        win.setGravity(Gravity.CENTER_VERTICAL);

        win.setAttributes(lp);
        // HLog.v(TAG, "~~~~~~~~create waite dialog...the dialog id:" + id + "~~~the message:" + message);
        return WaitingDialog;
    }

    public static HIDDialog createRuleDialog(Context mContext, String id, RuleGame rule)
    {
        HIDDialog.dismissAll();
       final HIDDialog WaitingDialog = new HIDDialog(mContext,R.style.DialogTheme, id);
        WaitingDialog.setContentView(R.layout.first_login_dialog);

       // WaitingDialog.setTitle(Constant.getProjectName(rule.getProjectId()) + "规则:");
        String tip = "记忆规则:\n\n"+rule.getMemeryTip()+"\n\n回忆规则:\n\n"+rule.getReCallTip()+"\n\n计分规则:\n\n"+rule.getCountRule()+"\n";
        ((TextView)WaitingDialog.findViewById(R.id.txt_msg)).setGravity(Gravity.LEFT);
        ((TextView)WaitingDialog.findViewById(R.id.txt_msg)).setText(tip);
        ((TextView)WaitingDialog.findViewById(R.id.dialog_title)).setText(Constant.getProjectName(rule.getProjectId()) + "规则:");
        ((TextView)WaitingDialog.findViewById(R.id.txt_pname)).setVisibility(View.GONE);
        ((ImageView)WaitingDialog.findViewById(R.id.img_close)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                WaitingDialog.dismiss();
            }
        });

        Display d = WaitingDialog.getWindow().getWindowManager().getDefaultDisplay();  //为获取屏幕宽、高
        WindowManager.LayoutParams p = WaitingDialog.getWindow().getAttributes();  //获取对话框当前的参数值
        p.height = (int) (d.getHeight() * 0.5);   //高度设置为屏幕的
        p.width = (int) (d.getWidth() * 0.5 );    //宽度设置为屏幕的
        WaitingDialog.getWindow().setAttributes(p);     //设置生效
        return WaitingDialog;
    }

    public static HIDDialog createTipDialog(Context mContext, String id,String contentTip){
        final HIDDialog WaitingDialog = new HIDDialog(mContext, id);
        WaitingDialog.setContentView(R.layout.show_tip_dlg);

        // WaitingDialog.setTitle(Constant.getProjectName(rule.getProjectId()) + "规则:");
        ((TextView)WaitingDialog.findViewById(R.id.dialog_tip_content)).setText(contentTip);

        return WaitingDialog;
    }

    public static HIDDialog createOkAndCancelDialog(Context mContext, String id,String contentTip,View.OnClickListener confirmListener){
        final HIDDialog dialog =  new HIDDialog(mContext, id);
        dialog.setContentView(HIDDialog.ENUM_DIALOG_VIEW.TWO_BUTTON_VIEW);
        dialog.setTitle("");
        dialog.setText(contentTip);
        dialog.setFirstBTText(mContext.getString(R.string.cancel));
        dialog.setFirstBTListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

        dialog.setSecondBTText(mContext.getString(R.string.confirm));
        dialog.setSecondBTListener(confirmListener);
        return dialog;
    }

    public static HIDDialog createOnlyOkDialog(Context mContext, String id,String tittle,String contentTip,String buttonText,View.OnClickListener confirmListener){
        final HIDDialog dialog =  new HIDDialog(mContext, id);
        dialog.setContentView(HIDDialog.ENUM_DIALOG_VIEW.ONE_BUTTON_VIEW);
        dialog.setTitle(tittle);
        dialog.setText(contentTip);
        if (TextUtils.isEmpty(buttonText)) {
            buttonText = mContext.getString(R.string.confirm);
        }
        dialog.setFirstBTText(buttonText);
        dialog.setFirstBTListener(confirmListener);
        return dialog;
    }
}


text:
@interface PodsDummy_Pods_MSWatchKitNotifications_MSWatchKitNotifications : NSObject
@end
@implementation PodsDummy_Pods_MSWatchKitNotifications_MSWatchKitNotifications
@end


text:
<!DOCTYPE html>

    <title>Part 4, Chapter 1: Shellfish Languages Again | The Voyages of Doctor Dolittle | Hugh Lofting | Lit2Go ETC</title>
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/screenless.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/printless.css" type="text/css" media="print" title="no title" charset="utf-8">

          Lit2Go

<form action="http://etc.usf.edu/lit2go/search/"><input type="text" name="q" placeholder="Search" value=""></form>

Authors

Books

Genres

Collections

Readability

      The Voyages of Doctor Dolittle

      by Hugh Lofting

      Part 4, Chapter 1: Shellfish Languages Again

        Additional Information

            Year Published:
            1922

            Language:
            English

            Country of Origin:
            England

            Source:
            Lofting, H. (1922). The Voyages of Doctor Dolittle. London, England: Lippincott Publishing.

            Readability:

                Flesch–Kincaid Level:
                4.2

            Word Count:
            1,369

            Genre:
            Fantasy

            Keywords:
            20th century literature, british literature, children's literature

            ✎ Cite This

  Share
  |

Downloads

          Audio

            APA

            MLA

            Chicago

            Lofting, H. (1922). Part 4, Chapter 1: Shellfish Languages Again. The Voyages of Doctor Dolittle (Lit2Go Edition). Retrieved February 15, 2016, from http://etc.usf.edu/lit2go/122/the-voyages-of-doctor-dolittle/2193/part-4-chapter-1-shellfish-languages-again/

            Lofting, Hugh. "Part 4, Chapter 1: Shellfish Languages Again." The Voyages of Doctor Dolittle. Lit2Go Edition. 1922. Web. <http://etc.usf.edu/lit2go/122/the-voyages-of-doctor-dolittle/2193/part-4-chapter-1-shellfish-languages-again/>. February 15, 2016.

            Hugh Lofting, "Part 4, Chapter 1: Shellfish Languages Again," The Voyages of Doctor Dolittle, Lit2Go Edition, (1922), accessed February 15, 2016, http://etc.usf.edu/lit2go/122/the-voyages-of-doctor-dolittle/2193/part-4-chapter-1-shellfish-languages-again/.

Back

Next

                  <audio controls style="width:99%;">
            <source src="http://etc.usf.edu/lit2go/audio/mp3/the-voyages-of-doctor-dolittle-038-part-4-chapter-1-shellfish-languages-again.2193.mp3" type="audio/mpeg" />
                          <source src="http://etc.usf.edu/lit2go/audio/ogg/the-voyages-of-doctor-dolittle-038-part-4-chapter-1-shellfish-languages-again.2193.ogg" type="audio/ogg" />
                        The embedded audio player requires a modern internet browser. You should visit Browse Happy and update your internet browser today!
          </audio>

	Miranda, the Purple Bird-of-Paradise had prophesied rightly when she had foretold a good spell of weather. For three weeks the good ship Curlew plowed her way through smiling seas before a steady powerful wind.

	I suppose most real sailors would have found this part of the voyage dull. But not I. As we got further South and further West the face of the sea seemed different every day. And all the little things of a voyage which an old hand would have hardly bothered to notice were matters of great interest for my eager eyes.

	We did not pass many ships. When we did see one, the Doctor would get out his telescope and we would all take a look at it. Sometimes he would signal to it, asking for news, by hauling up little colored flags upon the mast; and the ship would signal back to us in the same way. The meaning of all the signals was printed in a book which the Doctor kept in the cabin. He told me it was the language of the sea and that all ships could understand it whether they be English, Dutch, or French.

	Our greatest happening during those first weeks was passing an iceberg. When the sun shone on it it burst into a hundred colors, sparkling like a jeweled palace in a fairy-story. Through the telescope we saw a mother polar bear with a cub sitting on it, watching us. The Doctor recognized her as one of the bears who had spoken to him when he was discovering the North Pole. So he sailed the ship up close and offered to take her and her baby on to the Curlew if she wished it. But she only shook her head, thanking him; she said it would be far too hot for the cub on the deck of our ship, with no ice to keep his feet cool. It had been indeed a very hot day; but the nearness of that great mountain of ice made us all turn up our coat-collars and shiver with the cold.

	During those quiet peaceful days I improved my reading and writing a great deal with the Doctor's help. I got on so well that he let me keep the ship's log. This is a big book kept on every ship, a kind of diary, in which the number of miles run, the direction of your course and everything else that happens is written down.

	The Doctor too, in what spare time he had, was nearly always writing—in his note-books. I used to peep into these sometimes, now that I could read, but I found it hard work to make out the Doctor's handwriting. Many of these note-books seemed to be about sea things. There were six thick ones filled full with notes and sketches of different seaweeds; and there were others on sea birds; others on sea worms; others on seashells. They were all some day to be re-written, printed and bound like regular books.

	One afternoon we saw, floating around us, great quantities of stuff that looked like dead grass. The Doctor told me this was gulf-weed. A little further on it became so thick that it covered all the water as far as the eye could reach; it made the Curlew look as though she were moving across a meadow instead of sailing the Atlantic.

	Crawling about upon this weed, many crabs were to be seen. And the sight of them reminded the Doctor of his dream of learning the language of the shellfish. He fished several of these crabs up with a net and put them in his listening-tank to see if he could understand them. Among the crabs he also caught a strange-looking, chubby, little fish which he told me was called a Silver Fidgit.

	After he had listened to the crabs for a while with no success, he put the fidgit into the tank and began to listen to that. I had to leave him at this moment to go and attend to some duties on the deck. But presently I heard him below shouting for me to come down again.

	"Stubbins," he cried as soon as he saw me—"a most extraordinary thing—Quite unbelievable—I'm not sure whether I'm dreaming—Can't believe my own senses. I—I—I—"

	"Why, Doctor," I said, "what is it?—What's the matter?"

	"The fidgit," he whispered, pointing with a trembling finger to the listening-tank in which the little round fish was still swimming quietly, "he talks English! And—and—and HE WHISTLES TUNES—English tunes!"

	"Talks English!" I cried—"Whistles!—Why, it's impossible."

	"It's a fact," said the Doctor, white in the face with excitement. "It's only a few words, scattered, with no particular sense to them—all mixed up with his own language which I can't make out yet. But they're English words, unless there's something very wrong with my hearing—And the tune he whistles, it's as plain as anything—always, the same tune. Now you listen and tell me what you make of it. Tell me everything you hear. Don't miss a word."

	I went to the glass tank upon the table while the Doctor grabbed a note-book and a pencil. Undoing my collar I stood upon the empty packing-case he had been using for a stand and put my right ear down under the water.

	For some moments I detected nothing at all—except, with my dry ear, the heavy breathing of the Doctor as he waited, all stiff and anxious, for me to say something. At last from within the water, sounding like a child singing miles and miles away, I heard an unbelievably thin, small voice.

	"Ah!" I said.

	"What is it?" asked the Doctor in a hoarse, trembly whisper. "What does he say?"

	"I can't quite make it out," I said. "It's mostly in some strange fish language—Oh, but wait a minute!—Yes, now I get it—'No smoking'.... 'My, here's a queer one!' 'Popcorn and picture postcards here.... This way out.... Don't spit'—What funny things to say, Doctor!—Oh, but wait!—Now he's whistling the tune."

	"What tune is it?" gasped the Doctor.

	"John Peel."

	"Ah hah," cried the Doctor, "that's what I made it out to be." And he wrote furiously in his note-book.

	I went on listening.

	"This is most extraordinary," the Doctor kept muttering to himself as his pencil went wiggling over the page—"Most extraordinary—but frightfully thrilling. I wonder where he—"

	"Here's some more," I cried—"some more English.... 'THE BIG TANK NEEDS CLEANING'.... That's all. Now he's talking fish-talk again."

	"The big tank!" the Doctor murmured frowning in a puzzled kind of way. "I wonder where on earth he learned—"

	Then he bounded up out of his chair.

	"I have it," he yelled, "this fish has escaped from an aquarium. Why, of course! Look at the kind of things he has learned: 'Picture postcards'—they always sell them in aquariums; 'Don't spit'; 'No smoking'; 'This way out'—the things the attendants say. And then, 'My, here's a queer one!' That's the kind of thing that people exclaim when they look into the tanks. It all fits. There's no doubt about it, Stubbins: we have here a fish who has escaped from captivity. And it's quite possible—not certain, by any means, but quite possible—that I may now, through him, be able to establish communication with the shellfish. This is a great piece of luck."

Back

Next

            This collection of children's literature is a part of the Educational Technology Clearinghouse and is funded by various grants.

            Copyright © 2006—2016 by the Florida Center for Instructional Technology, College of Education, University of South Florida.

License

Credits

FAQ

Giving

This document was downloaded from Lit2Go, a free online collection of stories and poems in Mp3 (audiobook) format published by the Florida Center for Instructional Technology. For more information, including classroom activities, readability data, and original sources, please visit http://etc.usf.edu/lit2go/122/the-voyages-of-doctor-dolittle/2193/part-4-chapter-1-shellfish-languages-again/.

Lit2Go: The Voyages of Doctor Dolittle

Part 4, Chapter 1: Shellfish Languages Again


text:
package org.javadev.effects;

import java.awt.Component;

/**
 * @author Luca Lutterotti
 * @author Sam Berlin
 * @author Dmitry Markman
 */

public interface Animation {

    /**
     * Draws an animation moving from 'first' to 'last'.
     * AnimationListener listens to the animation and is notified
     * when the animation is finished.
     * @return a Component which the animation is drawn on.
     */
    public Component animate(Component first, Component last, AnimationListener listener);

    /**
     * set direction of the animation.
     * meaning of the param direction is the function of every particulatr animator
     * @param direction
     */
    public void setDirection(boolean direction);

    /**
     * set duration of the animation.
     * @param duration duration of the animation in the ms
     */
    public void setAnimationDuration(int duration);

}


text:
'use strict';

var gulp = require('gulp');

var wiredep = require('wiredep').stream;

// inject bower components
gulp.task('wiredep', function () {
  return gulp.src('app/*.html')
    .pipe(wiredep({
      directory: 'app/bower_components'
    }))
    .pipe(gulp.dest('app'));
});


text:
package org.magicnexus.classes.game;

import org.magicnexus.classes.game.event.DrawEvent;
import org.magicnexus.classes.game.event.GameBeginEvent;
import org.magicnexus.classes.game.event.GameEndEvent;
import org.magicnexus.classes.game.event.StackableEntersStackEvent;
import org.magicnexus.classes.game.event.turn.BeginningCleanupStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningDeclareAttackersStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningDeclareBlockersStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningDrawStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningEndCombatStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningEndOfTurnStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningEnterCombatStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningInitiativeCombatDamageStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningMainStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningRegularCombatDamageStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningUntapStepEvent;
import org.magicnexus.classes.game.event.turn.BeginningUpkeepStepEvent;
import org.magicnexus.classes.game.event.zone.CardEntersHandEvent;
import org.magicnexus.classes.game.event.zone.CardLeaveLibraryEvent;
import org.magicnexus.classes.game.zone.Battlefield;
import org.magicnexus.classes.game.zone.CommandZone;
import org.magicnexus.classes.game.zone.Exile;
import org.magicnexus.classes.game.zone.Graveyard;
import org.magicnexus.classes.game.zone.Hand;
import org.magicnexus.classes.game.zone.Library;
import org.magicnexus.interfaces.game.IDeck;
import org.magicnexus.interfaces.game.IDeckLine;
import org.magicnexus.interfaces.game.IGame;
import org.magicnexus.interfaces.game.IGameEvent;
import org.magicnexus.interfaces.game.IPlayer;
import org.magicnexus.interfaces.game.zone.IBattlefield;
import org.magicnexus.interfaces.game.zone.ICommand;
import org.magicnexus.interfaces.game.zone.IExile;
import org.magicnexus.interfaces.game.zone.IGraveyard;
import org.magicnexus.interfaces.game.zone.IHand;
import org.magicnexus.interfaces.game.zone.ILibrary;

public class Player implements IPlayer
{

	private String name = null;
	private IGame game = null;
	private IDeck deck = null;
	private ILibrary library = null;
	private IGraveyard graveyard = null;
	private IExile exile = null;
	private IHand hand = null;
	private ICommand command = null;
	private IBattlefield battlefield = null;
	private Integer lifePoints = 20;
	private Integer poisonCounters = 0;

	public Player(String name)
	{
		this.name = name;
		library = new Library(this);
		graveyard = new Graveyard(this);
		exile = new Exile(this);
		hand = new Hand(this);
		command = new CommandZone(this);
		battlefield = new Battlefield(this);

		lifePoints = 20;
		poisonCounters = 0;

	}

	@Override
	public void setDeck(IDeck deck)
	{
		this.deck = deck;
		for(IDeckLine line:deck.getMainDeck())
		{
			for(int i = 0; i<line.getQuantity(); i++)
			{
				getLibrary().accept(line.getCard());
			}
		}
		getLibrary().shuffle();
	}

	@Override
	public IDeck getDeck()
	{
		return this.deck;
	}

	@Override
	public void setGame(IGame game)
	{
		this.game = game;
	}

	@Override
	public IGame getGame()
	{
		return game;
	}

	@Override
	public ILibrary getLibrary()
	{
		return library;
	}

	@Override
	public IGraveyard getGraveyard()
	{
		return graveyard;
	}

	@Override
	public IExile getExile()
	{
		return exile;
	}

	@Override
	public IHand getHand()
	{
		return hand;
	}

	@Override
	public ICommand getCommand()
	{
		return command;
	}

	@Override
	public IBattlefield getBattlefield()
	{
		return battlefield;
	}

	@Override
	public String getName()
	{
		return name;
	}

	@Override
	public Integer getLifePoints()
	{
		return lifePoints;
	}

	@Override
	public Integer getPoisonCounters()
	{
		return poisonCounters;
	}

	@Override
	public void handle(IGameEvent event)
	{
		event.beHandledBy(this);
	}

	@Override
	public void handleGameBegin(GameBeginEvent event)
	{
		this.draw(7);
	}

	protected void draw(int qty)
	{
		for(int i = 0; i < qty; i++)
		{
			this.game.handle(new DrawEvent(this));
		}
	}

	public void handle(BeginningDrawStepEvent event)
	{
		if(event.getPlayer() == this)
		{
			this.getGame().handle(new DrawEvent(this));
		}
	}

	@Override
	public void handleDraw(DrawEvent event)
	{
		if(event.isValid())
		{
			CardLeaveLibraryEvent popevent = getLibrary().pop();
			if(popevent.isValid())
			{
				getHand().put(popevent.getCard());
			}
		}
	}

	@Override
	public void handleCardEntersHand(CardEntersHandEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleCardLeaveLibrary(CardLeaveLibraryEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleGameEnd(GameEndEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleStackableEntersStack(StackableEntersStackEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginCleanupStep(BeginningCleanupStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginDeclareAttackersStep(
			BeginningDeclareAttackersStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginDrawStep(BeginningDrawStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginDeclareBlockersStep(
			BeginningDeclareBlockersStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginEndCombatStep(BeginningEndCombatStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginEndOfTurnStep(BeginningEndOfTurnStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginEnterCombatStep(BeginningEnterCombatStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginInitiativeCombatDamageStep(
			BeginningInitiativeCombatDamageStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginMainStep(BeginningMainStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginRegularCombatDamageStep(
			BeginningRegularCombatDamageStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginUntapStep(BeginningUntapStepEvent event)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void handleBeginUpkeepStep(BeginningUpkeepStepEvent event)
	{
		// TODO Auto-generated method stub

	}

}


text:
export const actionTypes = {
  SCROLL: 'SCROLL',
  FETCH_BOOKINGS: 'FETCH_BOOKINGS',
};

export const updateScrollPosition =
  ({ nodeHeight, position }) => {
    const xPosition = (position / nodeHeight) * 100;
    if (xPosition < 2) {
      return {
        type: actionTypes.SCROLL,
        data: 2,
      };
    } else if (xPosition > 94) {
      return {
        type: actionTypes.SCROLL,
        data: 94,
      };
    }
    return {
      type: actionTypes.SCROLL,
      data: xPosition,
    };
  };

export const updateCalendarMonths =
  ({ months }) => ({
    type: actionTypes.FETCH_BOOKINGS,
    data: months,
  });

const initialState = {
  scrollPosition: 2,
  calendarMonths: [],
};

export const upcomingCalendar =
  (state = initialState, action) => {
    switch (action.type) {
      case actionTypes.SCROLL:
        return { ...state, scrollPosition: action.data };
      case action.FETCH_BOOKINGS:
        return { ...state, months: action.data };
      default:
        return state;
    }
  };


text:
require 'rails_helper'

RSpec.describe WorkoutStravaUpdaterService do

  describe '.new' do
    let(:workout) { instance_double(Workout) }
    let(:activity) { mock_strava_activity }
    subject { described_class.new(workout, activity) }
    it 'returns a new instance with attributes set' do
      expect(subject.workout).to eq(workout)
      expect(subject.activity).to eq(activity)
    end
  end

  context 'validation' do
    let(:workout) { instance_double(Workout, kind: 'cycling') }
    it 'requires the activity type to match the workout kind' do
      expect(described_class.new(workout, mock_strava_activity(type: 'Run'))).to_not be_valid
      expect(described_class.new(workout, mock_strava_activity(type: 'Ride'))).to be_valid
    end
    it 'sets the errors attribute when invalid' do
      updater = described_class.new(workout, mock_strava_activity(type: 'Run'))
      updater.valid?
      expect(updater.errors).to_not be_nil
      expect(updater.errors.messages).to_not be_empty
    end
  end

  describe '#update_workout' do
    subject { described_class.new(workout, activity) }
    context 'when valid' do
      let(:user) { FactoryGirl.create(:user, time_zone: 'Brasilia', locale: 'pt') }
      let(:workout) { FactoryGirl.create(:workout, user: user, kind: 'cycling', scheduled_on: '2015-10-26') }
      let(:activity) { mock_strava_activity(type: 'Ride') }
      it 'changes the workout with the data from strava and sets the workout as done' do
        expect(subject.update_workout).to be_truthy
        workout.reload
        expect(workout.name).to eq('12/12/2012 San Francisco')
        expect(workout.observations).to eq('the best ride ever')
        expect(workout.occurred_on).to eq(Date.new(2015,10,26)) # because of time zone
        expect(workout.distance).to eq(28688.1)
        expect(workout.elapsed_time).to eq(6303)
        expect(workout.moving_time).to eq(5784)
        expect(workout.speed_avg).to eq(17.856) # 4.96 m/s
        expect(workout.speed_max).to eq(49.68) # 13.8 m/s
        expect(workout.cadence_avg).to eq(69)
        expect(workout.calories).to eq(390)
        expect(workout.elevation_gain).to eq(853.0)
        expect(workout.temperature_avg).to eq(23.0)
        expect(workout.power_avg).to eq(136.4)
        expect(workout.energy_output).to eq(788.7)
        expect(workout.heart_rate_avg).to eq(150)
        expect(workout.heart_rate_max).to eq(182)
      end
      it 'saves the raw activity data to the workout' do
        expect(workout.strava_data).to be_empty
        expect(subject.update_workout).to be_truthy
        expect(workout.strava_data).to_not be_empty
        expect(workout.strava_data).to eq(activity)
      end
      it 'preserves name and observations if set' do
        workout.name = 'previous name'
        workout.observations = 'previous observations'
        expect(subject.update_workout).to be_truthy
        workout.reload
        expect(workout.name).to eq('previous name')
        expect(workout.observations).to eq('previous observations')
      end
      it 'saves the workout' do
        expect(workout).to receive(:save!).and_return(true)
        expect(subject.update_workout).to be_truthy
      end
    end
    context 'when invalid' do
      let(:workout) { FactoryGirl.build(:workout, kind: 'cycling') }
      let(:activity) { mock_strava_activity(type: 'Run') }
      it 'returns false' do
        expect(subject.update_workout).to be_falsy
      end
      it 'does not change the workout' do
        expect(workout).to_not receive(:save)
        subject.update_workout
        expect(workout.occurred_on).to be_nil
      end
    end
  end

  def mock_strava_activity(overrides={})
    {
      id: 421201541,
      resource_state: 2,
      external_id: "garmin_push_939552911",
      upload_id: 471162968,
      athlete: {id: 2871350, resource_state: 1},
      name: "12/12/2012 San Francisco",
      description: "the best ride ever",
      distance: 28688.1,
      moving_time: 5784,
      elapsed_time: 6303,
      total_elevation_gain: 853.0,
      type: "Ride",
      start_date: "2015-10-27T01:07:55Z",
      start_date_local: "2015-10-26T23:07:55Z",
      timezone: "(GMT-03:00) America/Sao_Paulo",
      start_latlng: [-22.962627, -43.217705],
      end_latlng: [-22.962734, -43.217789],
      location_city: "Rio de Janeiro",
      location_state: "Rio de Janeiro",
      location_country: "Brazil",
      start_latitude: -22.962627,
      start_longitude: -43.217705,
      achievement_count: 18,
      kudos_count: 15,
      comment_count: 0,
      athlete_count: 4,
      photo_count: 0,
      trainer: false,
      commute: false,
      manual: false,
      private: false,
      flagged: false,
      gear_id: "b1234276",
      average_speed: 4.96,
      max_speed: 13.8,
      calories: 390.5,
      average_cadence: 69.2,
      average_temp: 23.0,
      average_watts: 136.4,
      kilojoules: 788.7,
      device_watts: false,
      average_heartrate: 150.0,
      max_heartrate: 182.0,
      total_photo_count: 0,
      has_kudoed: false,
      map: {
        id: "a421201541",
        summary_polyline: "...",
        resource_state: 2
      },
    }.merge(overrides).with_indifferent_access
  end

end


text:
'use strict';

describe('Controller: TagAddCtrl', function () {

  // load the controller's module
  beforeEach(module('amApp'));
  beforeEach(module('templates'));

  var createController,
    scope,
    $rootScope,
    $mdDialog,
    $httpBackend,
    $controller;

  beforeEach(inject(function ($injector) {

    $rootScope = $injector.get('$rootScope');

    scope = $rootScope.$new();

    $httpBackend = $injector.get('$httpBackend');

    $controller = $injector.get('$controller');

    $mdDialog = {
      hide: jasmine.createSpy('$mdDialog.close'),
      cancel: jasmine.createSpy('$mdDialog.dismiss'),
      result: {
        then: jasmine.createSpy('$mdDialog.result.then')
      }
    };

    createController = function(MockTagList){
      return $controller('TagListCtrl',{
        '$scope' : scope,
        '$mdDialog' : $mdDialog,
        'tagList' : MockTagList
      });
    };
  }));

  it('should attach a list of awesomeThings to the scope', function () {

  });

});


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <include layout="@layout/common_top_bar_layout"/>
    <com.chinaztt.fda.test.ViewDragHelper.ViewGragOne
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TextView
        android:id="@+id/tv_one"
        android:layout_width="120dp"
        android:layout_height="120dp"
        android:layout_margin="10dp"
        android:text="TV_ONE"
        android:gravity="center"
        android:background="@color/color_1"/>
        <TextView
            android:id="@+id/tv_two"
            android:layout_width="120dp"
            android:layout_height="120dp"
            android:layout_marginTop="200dp"
            android:layout_marginLeft="50dp"
            android:text="TV_TWO"
            android:gravity="center"
            android:background="@color/color_3"/>
    </com.chinaztt.fda.test.ViewDragHelper.ViewGragOne>
</LinearLayout>


text:
{% comment %} {% load progress_bar %} {% endcomment %}
{% load static %}

<!DOCTYPE html>

    {% comment %} {% progress_bar_media %} {% endcomment %}

	<form id="abc" action="" enctype="multipart/form-data" method="post" >
		{{ form }}
		{% comment %} {% progress_bar %} {% endcomment %}
		<input type="submit" />
	</form>


text:
Your linux distro needs to be using systemd, for example Ubuntu 15.04 and later; tested on 16.04.
You will need the file `fredboat.service`, which you can find at https://github.com/Frederikam/FredBoat/tree/master/FredBoat

Edit the `fredboat.service` file:
Set the `WorkingDirectory` with your path to the folder where your FredBoat jar and the config and credentials files are located.
You might also need to edit the path to your java executable. You can find that path by running `which java` in your commandline. The default is `/usr/bin/java`.

Some of the following commands may require to be run with `sudo`.

Copy `fredboat.service` to `/etc/systemd/system/`.
```sh
cp fredboat.service /etc/systemd/system/
```

Run this to have systemd recognize the new service we just added:
```sh
systemctl daemon-reload
```

Enabling the service will have your machine run Fredboat automatically after a reboot:
```sh
systemctl enable fredboat.service
```

To disable automatic start after a reboot:
```sh
systemctl disable fredboat.service
```

Run this to start FredBoat:
```sh
systemctl start fredboat.service
```

To stop FredBoat you can run:
```sh
systemctl stop fredboat.service
```
You will find the log of the bot in your FredBoat path, called `fredboat.log`.
To see what's happening there for troubleshooting you can run this command in a terminal while
starting/stopping the bot in another:
```sh
tail -f fredboat.log
```

Troubleshooting systemd can be done by using:
```sh
systemctl status fredboat.service
```


text:
%-------------------------------------------------------------------------------
%	SECTION TITLE
%-------------------------------------------------------------------------------
\cvsection{Notable Projects}

%-------------------------------------------------------------------------------
%	CONTENT
%-------------------------------------------------------------------------------
\begin{cventries}

\cventry
    {Binarized Recurrent Neural Network} % Role
    {BRNN} % Event
    {} % Location
    {Summer 2017 - Now} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Trying to binarize RNNs so they could be run on mobile devices and bring offline NLP to masses}
      \end{cvitems}
    }

\cventry
    {My Bachelor of Science Thesis} % Role
    {Emoji Prediction} % Event
    {} % Location
    {Spring 2017} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Emoji prediction for Persian and English with a recurrent deep model trained over bilingual word vectors}
      \end{cvitems}
    }

\cventry
    {Modular Android Keyboard} % Role
    {Agah Keyboard} % Event
    {} % Location
    {Fall 2016 - Winter 2017} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Design and implementation of a modular android keyboard based on AOSP with Swipe feature and a 3-gram language model}
      \end{cvitems}
    }

%---------------------------------------------------------
  \cventry
    {F1's Augmented Reality Experience} % Role
    {F1-AR} % Event
    {} % Location
    {Summer 2014} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Augmented Reality for ACM's student branch using OpenCV.}
      \end{cvitems}
    }

  \cventry
    {3D Soccer Simulation} % Role
    {Triple-A} % Event
    {} % Location
    {Spring and Summer 2011} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Omni-directional walk.}
        \item {Multi-power kick.}
      \end{cvitems}
    }

    \cventry
    {Mixed Reality Soccer Simulation} % Role
    {Triple-A} % Event
    {} % Location
    {Fall 2010} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Participated in Iran Open 2010.}
      \end{cvitems}
    }

%---------------------------------------------------------
\end{cventries}


text:
"use strict";
(function ()
{
this.ReassignObjectsSystemUserRequest = function (userId,reassignPrincipal){
///
/// Contains the data that is needed to reassign all records that are owned by a specified user to another security principal (user or team).
///
///<param name="userId"  type="String">
/// Sets the ID of the user for which you want to reassign all records.
///</param>
///<param name="reassignPrincipal"  type="Sdk.EntityReference">
/// Sets the security principal (user or team) that is the new owner for the records.
///</param>
if (!(this instanceof Sdk.ReassignObjectsSystemUserRequest)) {
return new Sdk.ReassignObjectsSystemUserRequest(userId, reassignPrincipal);
}
Sdk.OrganizationRequest.call(this);

  // Internal properties
var _userId = null;
var _reassignPrincipal = null;

// internal validation functions

function _setValidUserId(value) {
 if (Sdk.Util.isGuid(value)) {
  _userId = value;
 }
 else {
  throw new Error("Sdk.ReassignObjectsSystemUserRequest UserId property is required and must be a String.")
 }
}

function _setValidReassignPrincipal(value) {
 if (value instanceof Sdk.EntityReference) {
  _reassignPrincipal = value;
 }
 else {
  throw new Error("Sdk.ReassignObjectsSystemUserRequest ReassignPrincipal property is required and must be a Sdk.EntityReference.")
 }
}

//Set internal properties from constructor parameters
  if (typeof userId != "undefined") {
   _setValidUserId(userId);
  }
  if (typeof reassignPrincipal != "undefined") {
   _setValidReassignPrincipal(reassignPrincipal);
  }

  function getRequestXml() {
return ["<d:request>",
        "",

          "",
            "UserId",
           (_userId == null) ? "" :
           ["", _userId, ""].join(""),
          "",

          "",
            "ReassignPrincipal",
           (_reassignPrincipal == null) ? "" :
           ["", _reassignPrincipal.toValueXml(), ""].join(""),
          "",

        "",
        "",
        "ReassignObjectsSystemUser",
      "</d:request>"].join("");
  }

  this.setResponseType(Sdk.ReassignObjectsSystemUserResponse);
  this.setRequestXml(getRequestXml());

  // Public methods to set properties
  this.setUserId = function (value) {
  ///
  /// Sets the ID of the user for which you want to reassign all records.
  ///
  ///<param name="value" type="String">
  /// The ID of the user for which you want to reassign all records.
  ///</param>
   _setValidUserId(value);
   this.setRequestXml(getRequestXml());
  }

  this.setReassignPrincipal = function (value) {
  ///
  /// Sets the security principal (user or team) that is the new owner for the records.
  ///
  ///<param name="value" type="Sdk.EntityReference">
  /// The security principal (user or team) that is the new owner for the records.
  ///</param>
   _setValidReassignPrincipal(value);
   this.setRequestXml(getRequestXml());
  }

 }
 this.ReassignObjectsSystemUserRequest.__class = true;

this.ReassignObjectsSystemUserResponse = function (responseXml) {
  ///
  /// Response to ReassignObjectsSystemUserRequest
  ///
  if (!(this instanceof Sdk.ReassignObjectsSystemUserResponse)) {
   return new Sdk.ReassignObjectsSystemUserResponse(responseXml);
  }
  Sdk.OrganizationResponse.call(this)

  // This message returns no values

 }
 this.ReassignObjectsSystemUserResponse.__class = true;
}).call(Sdk)

Sdk.ReassignObjectsSystemUserRequest.prototype = new Sdk.OrganizationRequest();
Sdk.ReassignObjectsSystemUserResponse.prototype = new Sdk.OrganizationResponse();


text:
<?php if ($sf_params->get('itemcategory')): ?>
    <?php slot('robots') ?>noindex,nofollow<?php end_slot() ?>
<?php endif ?>
<div class="category_wrapper">
    <?php echo __("Category") ?>:
    <select onchange="gotoItemcategory(this.value)">
        <option value="<?php echo ItemcategoryPeer::getUrl($module_action, 'index')?>"> <?php echo __("All") ?><?php if (!$sf_params->get('itemcategory')): ?> (<?php echo (int)$items_count_total ?>)<?php endif ?></option>
        <?php foreach($itemcategory_tree as $element): ?>
            <?php include_partial('itemcategory/tree_element', array('module_action'=>$module_action, 'element'=>$element, 'item_type_list'=>$item_type_list) ); ?>
        <?php endforeach ?>
    </select>
</div>


text:
package org.jboss.netty.handler.codec.spdy;

/**
 * A SPDY Protocol SYN_REPLY Frame
 */
public interface SpdySynReplyFrame extends SpdyHeadersFrame {
    // Tag interface
}


text: export { TreeView as default } from "./";


text:
@interface JvBAnimator : NSObject <UIViewControllerAnimatedTransitioning> //adopt AnimatedTransitioning protocol

@end


text:
@interface MRLoadingView : UIView
{
    CAShapeLayer *_progressLayer;
}

- (void)startLoading;
- (void)endLoading;

@end


text:
@echo off
vcredist_x86.exe
mkdir "C:\Program Files\CactaiGotchi"
copy CactaiGotchi.exe "C:\Program Files\CactaiGotchi"
copy openal32.dll "C:\Program Files\CactaiGotchi"
copy OpenSans.ttf "C:\Program Files\CactaiGotchi"
copy sfml-audio-2.dll "C:\Program Files\CactaiGotchi"
copy sfml-graphics-2.dll "C:\Program Files\CactaiGotchi"
copy sfml-network-2.dll "C:\Program Files\CactaiGotchi"
copy sfml-system-2.dll "C:\Program Files\CactaiGotchi"
copy sfml-window-2.dll "C:\Program Files\CactaiGotchi"
mkdir "C:\Program Files\CactaiGotchi\img"
copy img\back.png "C:\Program Files\CactaiGotchi\img"
copy img\cactaifood.png "C:\Program Files\CactaiGotchi\img"
copy img\cactstill1grey.png "C:\Program Files\CactaiGotchi\img"
copy img\cactstill2grey.png "C:\Program Files\CactaiGotchi\img"
copy img\dripping-honey.png "C:\Program Files\CactaiGotchi\img"
copy img\droplets.png "C:\Program Files\CactaiGotchi\img"
copy img\flame.png "C:\Program Files\CactaiGotchi\img"
copy img\fluffy-cloud.png "C:\Program Files\CactaiGotchi\img"
copy img\gameover.png "C:\Program Files\CactaiGotchi\img"
copy img\howto.png "C:\Program Files\CactaiGotchi\img"
copy img\title.png "C:\Program Files\CactaiGotchi\img"


text:
use na::{self, DVectorSliceMut, Isometry3, RealField, Translation3, Unit, Vector3};

use crate::joint::{Joint, PrismaticJoint};
use crate::math::{JacobianSliceMut, Velocity};
use crate::object::{BodyPartHandle, Multibody, MultibodyLink};
use crate::solver::{ConstraintSet, GenericNonlinearConstraint, IntegrationParameters};

/// A joint that allows two translational degrees of freedom.
#[derive(Copy, Clone, Debug)]
pub struct RectangularJoint<N: RealField> {
    prism1: PrismaticJoint<N>,
    prism2: PrismaticJoint<N>,
}

impl<N: RealField> RectangularJoint<N> {
    /// Creates a new rectangular joint allowing relative translations anlon the two provided axii.Isometry3
    ///
    /// Both axii are expressed in the local coordinate frame on the attached multibody links.
    pub fn new(axis1: Unit<Vector3<N>>, axis2: Unit<Vector3<N>>, offset1: N, offset2: N) -> Self {
        RectangularJoint {
            prism1: PrismaticJoint::new(axis1, offset1),
            prism2: PrismaticJoint::new(axis2, offset2),
        }
    }
}

impl<N: RealField> Joint<N> for RectangularJoint<N> {
    #[inline]
    fn ndofs(&self) -> usize {
        2
    }

    fn body_to_parent(&self, parent_shift: &Vector3<N>, body_shift: &Vector3<N>) -> Isometry3<N> {
        let t = Translation3::from(parent_shift - body_shift)
            * self.prism1.translation()
            * self.prism2.translation();
        Isometry3::from_parts(t, na::one())
    }

    fn update_jacobians(&mut self, body_shift: &Vector3<N>, vels: &[N]) {
        self.prism1.update_jacobians(body_shift, vels);
        self.prism2.update_jacobians(body_shift, &[vels[1]]);
    }

    fn jacobian(&self, transform: &Isometry3<N>, out: &mut JacobianSliceMut<N>) {
        self.prism1.jacobian(transform, &mut out.columns_mut(0, 1));
        self.prism2.jacobian(transform, &mut out.columns_mut(1, 1));
    }

    fn jacobian_dot(&self, _: &Isometry3<N>, _: &mut JacobianSliceMut<N>) {}

    fn jacobian_dot_veldiff_mul_coordinates(
        &self,
        _: &Isometry3<N>,
        _: &[N],
        _: &mut JacobianSliceMut<N>,
    ) {
    }

    fn jacobian_mul_coordinates(&self, vels: &[N]) -> Velocity<N> {
        self.prism1.jacobian_mul_coordinates(vels)
            + self.prism2.jacobian_mul_coordinates(&[vels[1]])
    }

    fn jacobian_dot_mul_coordinates(&self, _: &[N]) -> Velocity<N> {
        Velocity::zero()
    }

    fn default_damping(&self, out: &mut DVectorSliceMut<N>) {
        self.prism1.default_damping(&mut out.rows_mut(0, 1));
        self.prism2.default_damping(&mut out.rows_mut(1, 1));
    }

    fn integrate(&mut self, parameters: &IntegrationParameters<N>, vels: &[N]) {
        self.prism1.integrate(parameters, vels);
        self.prism2.integrate(parameters, &[vels[1]]);
    }

    fn apply_displacement(&mut self, disp: &[N]) {
        self.prism1.apply_displacement(disp);
        self.prism2.apply_displacement(&[disp[1]]);
    }

    #[inline]
    fn clone(&self) -> Box<dyn Joint<N>> {
        Box::new(*self)
    }

    fn num_velocity_constraints(&self) -> usize {
        self.prism1.num_velocity_constraints() + self.prism2.num_velocity_constraints()
    }

    fn velocity_constraints(
        &self,
        parameters: &IntegrationParameters<N>,
        multibody: &Multibody<N>,
        link: &MultibodyLink<N>,
        assembly_id: usize,
        dof_id: usize,
        ext_vels: &[N],
        ground_j_id: &mut usize,
        jacobians: &mut [N],
        constraints: &mut ConstraintSet<N, (), (), usize>,
    ) {
        self.prism1.velocity_constraints(
            parameters,
            multibody,
            link,
            assembly_id,
            dof_id,
            ext_vels,
            ground_j_id,
            jacobians,
            constraints,
        );
        self.prism2.velocity_constraints(
            parameters,
            multibody,
            link,
            assembly_id,
            dof_id + 1,
            ext_vels,
            ground_j_id,
            jacobians,
            constraints,
        );
    }

    fn num_position_constraints(&self) -> usize {
        // NOTE: we don't test if constraints exist to simplify indexing.
        2
    }

    fn position_constraint(
        &self,
        i: usize,
        multibody: &Multibody<N>,
        link: &MultibodyLink<N>,
        handle: BodyPartHandle<()>,
        dof_id: usize,
        jacobians: &mut [N],
    ) -> Option<GenericNonlinearConstraint<N, ()>> {
        if i == 0 {
            self.prism1
                .position_constraint(0, multibody, link, handle, dof_id, jacobians)
        } else {
            self.prism2
                .position_constraint(0, multibody, link, handle, dof_id + 1, jacobians)
        }
    }
}

prismatic_motor_limit_methods_1!(RectangularJoint, prism1);
prismatic_motor_limit_methods_2!(RectangularJoint, prism2);


text:
CREATE TABLE IF NOT EXISTS `bx_market_scores` (
  `object_id` int(11) NOT NULL default '0',
  `count_up` int(11) NOT NULL default '0',
  `count_down` int(11) NOT NULL default '0',
  UNIQUE KEY `object_id` (`object_id`)
);

CREATE TABLE IF NOT EXISTS `bx_market_scores_track` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `object_id` int(11) NOT NULL default '0',
  `author_id` int(11) NOT NULL default '0',
  `author_nip` int(11) unsigned NOT NULL default '0',
  `type` varchar(8) NOT NULL default '',
  `date` int(11) NOT NULL default '0',
  PRIMARY KEY (`id`),
  KEY `vote` (`object_id`, `author_nip`)
);

-- FORMS
UPDATE `sys_objects_form` SET `submit_name`='a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}' WHERE `object`='bx_market';

-- COMMENTS
UPDATE `sys_objects_cmts` SET `Html`='3' WHERE `Name`='bx_market';

-- SCORES
DELETE FROM `sys_objects_score` WHERE `name`='bx_market';
INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES
('bx_market', 'bx_market', 'bx_market_scores', 'bx_market_scores_track', '604800', '0', 'bx_market_products', 'id', 'author', 'score', 'sc_up', 'sc_down', 'BxMarketScore', 'modules/boonex/market/classes/BxMarketScore.php');


text:
package test.gov.nih.nci.cacoresdk.domain.onetomany.unidirectional;

import java.util.Collection;
import java.util.Iterator;

import gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.KeyChain;
import gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.LatchKey;
import gov.nih.nci.system.applicationservice.ApplicationException;
import gov.nih.nci.system.query.cql.CQLAssociation;
import gov.nih.nci.system.query.cql.CQLAttribute;
import gov.nih.nci.system.query.cql.CQLObject;
import gov.nih.nci.system.query.cql.CQLPredicate;
import gov.nih.nci.system.query.cql.CQLQuery;
import test.gov.nih.nci.cacoresdk.SDKTestBase;
import gov.nih.nci.system.dao.orm.translator.CQL2HQL;
import gov.nih.nci.system.query.hibernate.HQLCriteria;

public class O2MUnidirectionalTest extends SDKTestBase
{
	public static String getTestCaseName()
	{
		return "One to Many Unidirectional Test Case";
	}

	/**
	 * Uses Nested Search Criteria for search
	 * Verifies that the results are returned
	 * Verifies size of the result set
	 * Verifies that none of the attribute is null
	 *
	 * @throws ApplicationException
	 */
	public void testEntireObjectNestedSearch1() throws ApplicationException
	{
		KeyChain searchObject = new KeyChain();
		Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.KeyChain",searchObject );

		assertNotNull(results);
		assertEquals(5,results.size());

		for(Iterator i = results.iterator();i.hasNext();)
		{
			KeyChain result = (KeyChain)i.next();
			assertNotNull(result);
			assertNotNull(result.getId());
			assertNotNull(result.getName());
		}
	}

	/**
	 * Uses Nested Search Criteria for search
	 * Verifies that the results are returned
	 * Verifies size of the result set
	 * Verifies that none of the attribute is null
	 *
	 * @throws ApplicationException
	 */
	public void testEntireObjectNestedSearch2() throws ApplicationException
	{
		LatchKey searchObject = new LatchKey();
		Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.LatchKey",searchObject );

		assertNotNull(results);
		assertEquals(3,results.size());

		for(Iterator i = results.iterator();i.hasNext();)
		{
			LatchKey result = (LatchKey)i.next();
			assertNotNull(result);
			assertNotNull(result.getId());
			assertNotNull(result.getType());
		}
	}

	/**
	 * Uses Nested Search Criteria for search
	 * Verifies that the results are returned
	 * Verifies size of the result set
	 * erifies that the associated object is null
	 *
	 * @throws ApplicationException
	 */
	public void testZeroAssociatedObjectsNestedSearch1() throws ApplicationException
	{
		KeyChain searchObject = new KeyChain();
		searchObject.setId(new Integer(4));
		Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.KeyChain",searchObject );

		assertNotNull(results);
		assertEquals(1,results.size());

		Iterator i = results.iterator();
		KeyChain result = (KeyChain)i.next();
		assertNotNull(result);
		assertNotNull(result.getId());
		assertNotNull(result.getName());

		Collection keyCollection = result.getKeyCollection();
		assertEquals(0, keyCollection.size());
	}

	/**
	 * Uses Nested Search Criteria for search to get associated object
	 * Verifies that the results are returned
	 * Verifies size of the result set is 0
	 *
	 * @throws ApplicationException
	 */
	public void testZeroAssociatedObjectsNestedSearch2() throws ApplicationException
	{
		KeyChain searchObject = new KeyChain();
		searchObject.setId(new Integer(4));
		Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.LatchKey",searchObject );

		assertNotNull(results);
		assertEquals(0,results.size());
	}

	/**
	 * Uses Nested Search Criteria for search
	 * Verifies that the results are returned
	 * Verifies size of the result set
	 * Verifies that none of the attribute is null
	 * Verifies that the associated object has required Id
	 *
	 * @throws ApplicationException
	 */
	public void testOneAssociatedObjectNestedSearch1() throws ApplicationException
	{
		KeyChain searchObject = new KeyChain();
		searchObject.setId(new Integer(1));
		Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.KeyChain",searchObject );

		assertNotNull(results);
		assertEquals(1,results.size());

		Iterator i = results.iterator();
		KeyChain result = (KeyChain)i.next();
		assertNotNull(result);
		assertNotNull(result.getId());
		assertNotNull(result.getName());

		Collection keyCollection = result.getKeyCollection();
		assertEquals(true, keyCollection.size()>0);

		Iterator j = keyCollection.iterator();
		LatchKey key = (LatchKey)j.next();
		assertNotNull(key);
		assertNotNull(key.getId());
		assertNotNull(key.getType());
		assertEquals(new Integer(1),key.getId());
	}

	/**
	 * Uses Nested Search Criteria for search to get associated object
	 * Verifies that the results are returned
	 * Verifies size of the result set
	 * Verifies that none of the attribute is null
	 * Verified the Id attribute's value of the returned object
	 *
	 * @throws ApplicationException
	 */
	public void testOneAssociatedObjectNestedSearch2() throws ApplicationException
	{
		KeyChain searchObject = new KeyChain();
		searchObject.setId(new Integer(1));
		Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.LatchKey",searchObject );

		assertNotNull(results);
		assertEquals(1,results.size());

		Iterator i = results.iterator();
		LatchKey key = (LatchKey)i.next();
		assertNotNull(key);
		assertNotNull(key.getId());
		assertNotNull(key.getType());
		assertEquals(new Integer(1),key.getId());
	}

	/**
	 * Uses CQL Criteria for search
	 * Verifies that the results are returned
	 * Verifies size of the result set
	 * Verifies that none of the attribute is null
	 * Verifies that the associated object has required Id
	 *
	 * @throws ApplicationException
	 */
	public void testNoAssociationCQL() throws ApplicationException
	{
		boolean flag = false;
		try
		{
			CQLQuery cqlQuery = new CQLQuery();
			CQLObject target = new CQLObject();

			CQLAssociation association = new CQLAssociation();
			association.setName("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.KeyChain");
			association.setAttribute(new CQLAttribute("id",CQLPredicate.EQUAL_TO,"1"));

			target.setName("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.LatchKey");
			target.setAssociation(association);
			cqlQuery.setTarget(target);

		CQL2HQL converter = new CQL2HQL(getClassCache());
		HQLCriteria hqlCriteria = converter.translate(cqlQuery, false, false);

		Collection results = getApplicationService().query(hqlCriteria);
			assertNotNull(results);

		}
		catch(ApplicationException e)
		{
			flag = true;
		}

		assertTrue(flag);
	}

	/**
	 * Uses CQL Criteria for search
	 * Verifies that the results are returned
	 * Verifies size of the result set
	 * Verifies that none of the attribute is null
	 * Verifies that the associated object has required Id
	 *
	 * @throws ApplicationException
	 */
	public void testOneAssociatedObjectCQL() throws ApplicationException
	{
		CQLQuery cqlQuery = new CQLQuery();
		CQLObject target = new CQLObject();

		CQLAssociation association = new CQLAssociation();
		association.setName("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.KeyChain");
		association.setAttribute(new CQLAttribute("id",CQLPredicate.EQUAL_TO,"1"));
		association.setSourceRoleName("keyCollection");

		target.setName("gov.nih.nci.cacoresdk.domain.onetomany.unidirectional.LatchKey");
		target.setAssociation(association);
		cqlQuery.setTarget(target);

		CQL2HQL converter = new CQL2HQL(getClassCache());
		HQLCriteria hqlCriteria = converter.translate(cqlQuery, false, false);

		Collection results = getApplicationService().query(hqlCriteria);

		assertNotNull(results);
		assertEquals(1,results.size());

		Iterator i = results.iterator();
		LatchKey key = (LatchKey)i.next();
		assertNotNull(key);
		assertNotNull(key.getId());
		assertNotNull(key.getType());
		assertEquals(new Integer(1),key.getId());
	}
}


text:
<com.tle.beans.hierarchy.HierarchyTopic>
  <id>216965</id>
  <uuid>33ecf7c7-24a6-f01d-d83e-38e9782c3803</uuid>
  <listPosition>4</listPosition>
  <keyResources/>
  <showResults>true</showResults>
  <inheritFreetext>false</inheritFreetext>
  <addIdefs/>
  <addSchemas/>
  <inhIdefs/>
  <inhSchemas/>
  <name>
    <id>216966</id>
    <strings>
      <entry>
        <string>en_AU</string>
        <com.tle.beans.entity.LanguageString>
          <id>216967</id>
          <locale>en_AU</locale>
          <priority>2</priority>
          <text>Some Children Hidden</text>
          <bundle reference="../../../.."/>
        </com.tle.beans.entity.LanguageString>
      </entry>
    </strings>
  </name>
  <subtopicsSectionName>
    <id>216970</id>
    <strings>
      <entry>
        <string>en</string>
        <com.tle.beans.entity.LanguageString>
          <id>216971</id>
          <locale>en</locale>
          <priority>1</priority>
          <text>A name</text>
          <bundle reference="../../../.."/>
        </com.tle.beans.entity.LanguageString>
      </entry>
    </strings>
  </subtopicsSectionName>
  <resultsSectionName>
    <id>216968</id>
    <strings>
      <entry>
        <string>en</string>
        <com.tle.beans.entity.LanguageString>
          <id>216969</id>
          <locale>en</locale>
          <priority>1</priority>
          <text>Results</text>
          <bundle reference="../../../.."/>
        </com.tle.beans.entity.LanguageString>
      </entry>
    </strings>
  </resultsSectionName>
  <hideSubtopicsWithNoResults>true</hideSubtopicsWithNoResults>
  <attributes/>
</com.tle.beans.hierarchy.HierarchyTopic>


text:
package gobblin.azkaban;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.UUID;

import javax.annotation.Nullable;

import azkaban.jobExecutor.AbstractJob;

import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.io.Closer;

import gobblin.configuration.ConfigurationKeys;
import gobblin.configuration.State;
import gobblin.metrics.GobblinMetrics;
import gobblin.metrics.RootMetricContext;
import gobblin.metrics.Tag;
import gobblin.runtime.JobException;
import gobblin.runtime.JobLauncher;
import gobblin.runtime.JobLauncherFactory;
import gobblin.runtime.app.ApplicationException;
import gobblin.runtime.app.ApplicationLauncher;
import gobblin.runtime.app.ServiceBasedAppLauncher;
import gobblin.runtime.listeners.EmailNotificationJobListener;
import gobblin.runtime.listeners.JobListener;
import gobblin.util.TimeRangeChecker;
import gobblin.util.hadoop.TokenUtils;

import static org.apache.hadoop.security.UserGroupInformation.HADOOP_TOKEN_FILE_LOCATION;

/**
 * A utility class for launching a Gobblin Hadoop MR job through Azkaban.
 *
 *

 *   By default, this class will use the {@link gobblin.runtime.mapreduce.MRJobLauncher} to launch and run
 *   the Gobblin job unless a different job launcher type is explicitly specified in the job configuration
 *   using {@link ConfigurationKeys#JOB_LAUNCHER_TYPE_KEY}.
 *

 *
 *

 *   If the Azkaban job type is not contained in {@link #JOB_TYPES_WITH_AUTOMATIC_TOKEN}, the launcher assumes that
 *   the job does not get authentication tokens from Azkaban and it will negotiate them itself.
 *   See {@link TokenUtils#getHadoopTokens} for more information.
 *

 *
 * @author Yinan Li
 */
public class AzkabanJobLauncher extends AbstractJob implements ApplicationLauncher, JobLauncher {

  private static final Logger LOG = Logger.getLogger(AzkabanJobLauncher.class);

  public static final String GOBBLIN_LOG_LEVEL_KEY = "gobblin.log.levelOverride";

  private static final String HADOOP_FS_DEFAULT_NAME = "fs.default.name";
  private static final String AZKABAN_LINK_JOBEXEC_URL = "azkaban.link.jobexec.url";
  private static final String MAPREDUCE_JOB_CREDENTIALS_BINARY = "mapreduce.job.credentials.binary";

  private static final String HADOOP_JAVA_JOB = "hadoopJava";
  private static final String JAVA_JOB = "java";
  private static final String GOBBLIN_JOB = "gobblin";
  private static final Set<String> JOB_TYPES_WITH_AUTOMATIC_TOKEN = Sets.newHashSet(HADOOP_JAVA_JOB, JAVA_JOB, GOBBLIN_JOB);

  private final Closer closer = Closer.create();
  private final JobLauncher jobLauncher;
  private final JobListener jobListener = new EmailNotificationJobListener();
  private final Properties props;
  private final ApplicationLauncher applicationLauncher;

  public AzkabanJobLauncher(String jobId, Properties props) throws Exception {
    super(jobId, LOG);

    if (props.containsKey(GOBBLIN_LOG_LEVEL_KEY)) {
      Level logLevel = Level.toLevel(props.getProperty(GOBBLIN_LOG_LEVEL_KEY), Level.INFO);
      Logger.getLogger("gobblin").setLevel(logLevel);
    }

    this.props = new Properties();
    this.props.putAll(props);

    Configuration conf = new Configuration();

    String fsUri = conf.get(HADOOP_FS_DEFAULT_NAME);
    if (!Strings.isNullOrEmpty(fsUri)) {
      if (!this.props.containsKey(ConfigurationKeys.FS_URI_KEY)) {
        this.props.setProperty(ConfigurationKeys.FS_URI_KEY, fsUri);
      }
      if (!this.props.containsKey(ConfigurationKeys.STATE_STORE_FS_URI_KEY)) {
        this.props.setProperty(ConfigurationKeys.STATE_STORE_FS_URI_KEY, fsUri);
      }
    }

    // Set the job tracking URL to point to the Azkaban job execution link URL
    this.props.setProperty(ConfigurationKeys.JOB_TRACKING_URL_KEY,
        Strings.nullToEmpty(conf.get(AZKABAN_LINK_JOBEXEC_URL)));

    if (props.containsKey(JOB_TYPE) && JOB_TYPES_WITH_AUTOMATIC_TOKEN.contains(props.getProperty(JOB_TYPE))) {
      // Necessary for compatibility with Azkaban's hadoopJava job type
      // http://azkaban.github.io/azkaban/docs/2.5/#hadoopjava-type
      LOG.info(
          "Job type " + props.getProperty(JOB_TYPE) + " provides Hadoop tokens automatically. Using provided tokens.");
      if (System.getenv(HADOOP_TOKEN_FILE_LOCATION) != null) {
        this.props.setProperty(MAPREDUCE_JOB_CREDENTIALS_BINARY, System.getenv(HADOOP_TOKEN_FILE_LOCATION));
      }
    } else {
      // see javadoc for more information
      LOG.info(String.format("Job type %s does not provide Hadoop tokens. Negotiating Hadoop tokens.",
          props.getProperty(JOB_TYPE)));
      File tokenFile = TokenUtils.getHadoopTokens(new State(props));
      System.setProperty(HADOOP_TOKEN_FILE_LOCATION, tokenFile.getAbsolutePath());
      System.setProperty(MAPREDUCE_JOB_CREDENTIALS_BINARY, tokenFile.getAbsolutePath());
      this.props.setProperty(MAPREDUCE_JOB_CREDENTIALS_BINARY, tokenFile.getAbsolutePath());
      this.props.setProperty("env." + HADOOP_TOKEN_FILE_LOCATION, tokenFile.getAbsolutePath());
    }

    List<Tag<?>> tags = Lists.newArrayList();
    tags.addAll(Tag.fromMap(AzkabanTags.getAzkabanTags()));
    RootMetricContext.get(tags);
    GobblinMetrics.addCustomTagsToProperties(this.props, tags);

    // If the job launcher type is not specified in the job configuration,
    // override the default to use the MAPREDUCE launcher.
    if (!this.props.containsKey(ConfigurationKeys.JOB_LAUNCHER_TYPE_KEY)) {
      this.props.setProperty(ConfigurationKeys.JOB_LAUNCHER_TYPE_KEY,
          JobLauncherFactory.JobLauncherType.MAPREDUCE.toString());
    }

    // Create a JobLauncher instance depending on the configuration. The same properties object is
    // used for both system and job configuration properties because Azkaban puts configuration
    // properties in the .job file and in the .properties file into the same Properties object.
    this.jobLauncher = this.closer.register(JobLauncherFactory.newJobLauncher(this.props, this.props));

    // Since Java classes cannot extend multiple classes and Azkaban jobs must extend AbstractJob, we must use composition
    // verses extending ServiceBasedAppLauncher
    this.applicationLauncher =
        this.closer.register(new ServiceBasedAppLauncher(this.props, "Azkaban-" + UUID.randomUUID()));
  }

  @Override
  public void run() throws Exception {
    if (isCurrentTimeInRange()) {
      try {
        start();
        launchJob(this.jobListener);
      } finally {
        try {
          stop();
        } finally {
          close();
        }
      }
    }
  }

  @Override
  public void cancel() throws Exception {
    try {
      cancelJob(this.jobListener);
    } finally {
      try {
        stop();
      } finally {
        close();
      }
    }
  }

  @Override
  public void start() throws ApplicationException {
    this.applicationLauncher.start();
  }

  @Override
  public void stop() throws ApplicationException {
    this.applicationLauncher.stop();
  }

  @Override
  public void launchJob(@Nullable JobListener jobListener) throws JobException {
    this.jobLauncher.launchJob(jobListener);
  }

  @Override
  public void cancelJob(@Nullable JobListener jobListener) throws JobException {
    this.jobLauncher.cancelJob(jobListener);
  }

  @Override
  public void close() throws IOException {
    this.closer.close();
  }

  /**
   * Uses the properties {@link ConfigurationKeys#AZKABAN_EXECUTION_DAYS_LIST},
   * {@link ConfigurationKeys#AZKABAN_EXECUTION_TIME_RANGE}, and
   * {@link TimeRangeChecker#isTimeInRange(List, String, String, DateTime)} to determine if the current job should
   * continue its execution based on the extra scheduled parameters defined in the config.
   *
   * @return true if this job should be launched, false otherwise.
   */
  private boolean isCurrentTimeInRange() {
    Splitter splitter = Splitter.on(",").omitEmptyStrings().trimResults();

    if (this.props.contains(ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST)
        && this.props.contains(ConfigurationKeys.AZKABAN_EXECUTION_TIME_RANGE)) {

      List<String> executionTimeRange =
          splitter.splitToList(this.props.getProperty(ConfigurationKeys.AZKABAN_EXECUTION_TIME_RANGE));
      List<String> executionDays =
          splitter.splitToList(this.props.getProperty(ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST));
      Preconditions.checkArgument(executionTimeRange.size() == 2, "The property "
          + ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST + " should be a comma separated list of two entries");

      return TimeRangeChecker.isTimeInRange(executionDays, executionTimeRange.get(0), executionTimeRange.get(1),
          new DateTime(DateTimeZone.forID(ConfigurationKeys.PST_TIMEZONE_NAME)));
    }

    return true;
  }
}