text:
package org.foliage.guava.common.collect;

import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.concurrent.ConcurrentMap;

import org.foliage.guava.common.annotations.GwtCompatible;

/**
 * A concurrent map which forwards all its method calls to another concurrent map. Subclasses should
 * override one or more methods to modify the behavior of the backing map as desired per the decorator pattern.
 *
 *
{@code default} method warning: This class forwards calls to only some {@code
 * default} methods. Specifically, it forwards calls only for methods that existed before
 * {@code default} methods were introduced. For newer methods, like {@code forEach}, it inherits
 * their default implementations. When those implementations invoke methods, they invoke methods on
 * the {@code ForwardingConcurrentMap}.
 *
 * @author Charles Fry
 * @since 2.0
 */
@GwtCompatible
public abstract class ForwardingConcurrentMap<K, V> extends ForwardingMap<K, V>
    implements ConcurrentMap<K, V> {

  /** Constructor for use by subclasses. */
  protected ForwardingConcurrentMap() {}

  @Override
  protected abstract ConcurrentMap<K, V> delegate();

  @CanIgnoreReturnValue
  @Override
  public V putIfAbsent(K key, V value) {
    return delegate().putIfAbsent(key, value);
  }

  @CanIgnoreReturnValue
  @Override
  public boolean remove(Object key, Object value) {
    return delegate().remove(key, value);
  }

  @CanIgnoreReturnValue
  @Override
  public V replace(K key, V value) {
    return delegate().replace(key, value);
  }

  @CanIgnoreReturnValue
  @Override
  public boolean replace(K key, V oldValue, V newValue) {
    return delegate().replace(key, oldValue, newValue);
  }
}


text:
#include <flux/testing/TestSuite>
#include <flux/stdio>
#include <flux/Property>

using namespace flux;
using namespace flux::testing;

int changedNotices = 0;

class Shape: public Object, public Recipient
{
public:
    static Ref<Shape> create() { return new Shape; }

    Property<String> name;
    Property<int> x;
    Property<int> y;

protected:
    Shape(): x(0), y(0) {
        fout() << "Shape::Shape()" << nl;
        name->valueChanged()->connect(this, &Shape::onNameChanged);
    }
    ~Shape() {
        fout() << "Shape::~Shape()" << nl;
    }

private:
    void onNameChanged(String newName) {
        fout("name = \"%%\"\n") << name;
        ++changedNotices;
    }
};

class Observer: public Object, public Recipient
{
public:
    static Ref<Observer> create(Shape *shape) { return new Observer(shape); }

private:
    Observer(Shape *shape) {
        fout() << "Observer::Observer()" << nl;
        shape->x->valueChanged()->connect(this, &Observer::onXChanged);
        shape->y->valueChanged()->connect(this, &Observer::onYChanged);
    }

    ~Observer() {
        fout() << "Observer::~Observer()" << nl;
    }

    void onXChanged(int value) {
        fout("x = %%\n") << value;
        ++changedNotices;
    }
    void onYChanged(int value) {
        fout("y = %%\n") << value;
        ++changedNotices;
    }
};

class ChangedNotices: public TestCase
{
    void run()
    {
        Ref<Shape> shape = Shape::create();
        Ref<Observer> observer = Observer::create(shape);
        shape->name = "circle1";
        shape->x = 7;
        shape->y = 93;
        shape->y = 93;
        observer = 0;
        shape->x = 8;
        FLUX_VERIFY(changedNotices == 3);
    }
};

int main(int argc, char **argv)
{
    FLUX_TESTSUITE_ADD(ChangedNotices);

    return testSuite()->run(argc, argv);
}

redpajama_set_name: RedPajamaGithub


text:
using log4net;
using SoftFX.Extended;
using SoftFX.Extended.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;

namespace RHost.Shared
{
    public class FdkConnector
    {
        static readonly ILog Log = LogManager.GetLogger(typeof(FdkConnector));
        public string Address { get; set; }
        public string Login { get; set; }
        public string Password { get; set; }
        public FdkConnectLogic ConnectLogic { get; private set; }

        public bool IsConnected { get; set; }

        List<SymbolInfo> _symbols = new List<SymbolInfo>();

        public FdkConnector()
        {
        }

        public bool Connect()
        {
            ConnectLogic.Feed.SessionInfo += OnSessionInfo;
            ConnectLogic.Feed.SymbolInfo += OnSymbolInfo;
            ConnectLogic.Feed.Logon += OnLogon;
            ConnectLogic.Feed.Logout += OnLogout;
            var connectionSuccessful = ConnectLogic.DoConnect();
            if (!connectionSuccessful)
            {
                Log.Warn("");
                return false;
            }
            var start = DateTime.Now;
            while (!IsConnected && (DateTime.Now - start).Seconds < 5)
            {
                Thread.Sleep(100);
            }

            return IsConnected;
        }

        public void Disconnect()
        {
            if (!IsConnected)
                return;
            //_logger.Warn("FdkConnector.Disconnecting");
            ConnectLogic.Dispose();
            IsConnected = false;
        }

        void OnSymbolInfo(object sender, SymbolInfoEventArgs e)
        {
            _symbols = e.Information.ToList();
            Log.Debug(string.Format("Symbols information is received. Symbols count = {0}", _symbols.Count));

            // to us means also that symbols are already availiable
            IsConnected = true;
        }

        void OnSessionInfo(object sender, SessionInfoEventArgs e)
        {
            Log.Debug(e.Information);
        }
        void OnLogon(object sender, LogonEventArgs e)
        {
            Log.Debug(string.Format("OnLogon(): {0}", e));
        }
        void OnLogout(Object sender, LogoutEventArgs e)
        {
            //_logger.InfoFormat("OnLogout() ");
            IsConnected = false;
        }

        public Bar GetClosestBar(string symbol, DateTime startTime)
        {
            var bars = new Bars(ConnectLogic.Feed, symbol, PriceType.Bid, BarPeriod.S1, startTime, 1);
            var bar = bars.FirstOrDefault();
            return bar;
        }

        public List<SymbolInfo> GetSymbols()
        {
            return _symbols;
        }

        public Bar GetHistorical(string symbol)
        {
            var bars = ConnectLogic.Storage.Online.GetBars(symbol, PriceType.Ask, BarPeriod.M1, DateTime.Now, -1000).ToArray();
            /*
            var bars = new Bars(_connectLogic.Storage.Online, symbol,
                PriceType.Bid, BarPeriod.S1, DateTime.Now, -1000);
             */
            var bar = bars.FirstOrDefault();
            return bar;
        }
    }
}


text:
#include "effects/GrDisableColorXP.h"
#include "GrProcessor.h"
#include "gl/GrGLXferProcessor.h"
#include "gl/builders/GrGLFragmentShaderBuilder.h"
#include "gl/builders/GrGLProgramBuilder.h"

/**
 * This xfer processor disables color writing. Thus color and coverage and ignored and no blending
 * occurs. This XP is usful for things like stenciling.
 */
class DisableColorXP : public GrXferProcessor {
public:
    static GrXferProcessor* Create() {
        return SkNEW(DisableColorXP);
    }

    ~DisableColorXP() override {};

    const char* name() const override { return "Disable Color"; }

    GrGLXferProcessor* createGLInstance() const override;

private:
    DisableColorXP();

    GrXferProcessor::OptFlags onGetOptimizations(const GrProcOptInfo& colorPOI,
                                                 const GrProcOptInfo& coveragePOI,
                                                 bool doesStencilWrite,
                                                 GrColor* color,
                                                 const GrCaps& caps) override {
        return GrXferProcessor::kIgnoreColor_OptFlag | GrXferProcessor::kIgnoreCoverage_OptFlag;
    }

    void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;

    void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override;

    bool onIsEqual(const GrXferProcessor& xpBase) const override {
        return true;
    }

    typedef GrXferProcessor INHERITED;
};

///////////////////////////////////////////////////////////////////////////////

class GLDisableColorXP : public GrGLXferProcessor {
public:
    GLDisableColorXP(const GrProcessor&) {}

    ~GLDisableColorXP() override {}

    static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}

private:
    void emitOutputsForBlendState(const EmitArgs& args) override {
        // This emit code should be empty. However, on the nexus 6 there is a driver bug where if
        // you do not give gl_FragColor a value, the gl context is lost and we end up drawing
        // nothing. So this fix just sets the gl_FragColor arbitrarily to 0.
        GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
        fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary);
    }

    void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) override {}

    typedef GrGLXferProcessor INHERITED;
};

///////////////////////////////////////////////////////////////////////////////

DisableColorXP::DisableColorXP() {
    this->initClassID<DisableColorXP>();
}

void DisableColorXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
    GLDisableColorXP::GenKey(*this, caps, b);
}

GrGLXferProcessor* DisableColorXP::createGLInstance() const {
    return SkNEW_ARGS(GLDisableColorXP, (*this));
}

void DisableColorXP::onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const {
    blendInfo->fWriteColor = false;
}

///////////////////////////////////////////////////////////////////////////////

GrDisableColorXPFactory::GrDisableColorXPFactory() {
    this->initClassID<GrDisableColorXPFactory>();
}

GrXferProcessor*
GrDisableColorXPFactory::onCreateXferProcessor(const GrCaps& caps,
                                               const GrProcOptInfo& colorPOI,
                                               const GrProcOptInfo& covPOI,
                                               bool hasMixedSamples,
                                               const DstTexture* dst) const {
    return DisableColorXP::Create();
}

GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);

GrXPFactory* GrDisableColorXPFactory::TestCreate(GrProcessorTestData*) {
    return GrDisableColorXPFactory::Create();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>ActiveSupport::Cache::Strategy::LocalCache::LocalStore</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../css/github.css" type="text/css" media="screen" />

            Ruby on Rails 4.2.1

            Class
            ActiveSupport::Cache::Strategy::LocalCache::LocalStore

                <

                    ActiveSupport::Cache::Store

/Users/Bonobo/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache.rb

Simple memory backed cache. This cache is not thread safe and is intended
only for serving as a temporary memory cache for a single thread.

Methods

C

                clear

D

                delete_entry

N

                new

R

                read_entry

W

                write_entry

Class Public methods

              new()

            Link

                Source:
                show

# File ../../../../.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache.rb, line 37
def initialize
  super
  @data = {}
end

Instance Public methods

              clear(options = nil)

            Link

                Source:
                show

# File ../../../../.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache.rb, line 47
def clear(options = nil)
  @data.clear
end

              delete_entry(key, options)

            Link

                Source:
                show

# File ../../../../.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache.rb, line 60
def delete_entry(key, options)
  !!@data.delete(key)
end

              read_entry(key, options)

            Link

                Source:
                show

# File ../../../../.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache.rb, line 51
def read_entry(key, options)
  @data[key]
end

              write_entry(key, value, options)

            Link

                Source:
                show

# File ../../../../.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache.rb, line 55
def write_entry(key, value, options)
  @data[key] = value
  true
end


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

    <title>Server warmup page.</title>

Server warmup page

This is a server warmup page, that should not be otherwise seen. Please got tho the Homepage

Sorry for the mixup.


text:
module Lita
  module Adapters
    class Slack < Adapter
      class MessageHandler
        def initialize(robot, robot_id, data)
          @robot = robot
          @robot_id = robot_id
          @data = data
          @type = data["type"]
        end

        def handle
          case type
          when "hello"
            handle_hello
          when "message"
            handle_message
          when "user_change", "team_join"
            handle_user_change
          when "bot_added", "bot_changed"
            handle_bot_change
          when "error"
            handle_error
          else
            handle_unknown
          end
        end

        private

        attr_reader :data
        attr_reader :robot
        attr_reader :robot_id
        attr_reader :type

        def body
          normalized_message = if data["text"]
            data["text"].sub(/^\s*<@#{robot_id}>/, "@#{robot.mention_name}")
          end

          attachment_text = Array(data["attachments"]).map do |attachment|
            if attachment['actions']
              parse_attachment_with_actions(attachment)
            else
              attachment["text"]
            end
          end

          ([normalized_message] + attachment_text).compact.join("\n")
        end

        # https://api.slack.com/actions
        def parse_attachment_with_actions(attachment)
          lines = []
          lines << attachment["text"]
          Array(attachment["actions"]).map do |field|
            lines << field["name"]
            lines << field["text"]
            lines << field["value"]
          end
          lines.compact.map(&:strip).reject(&:empty?)
        end

        def channel
          data["channel"]
        end

        def dispatch_message(user)
          source = Source.new(user: user, room: channel)
          source.private_message! if channel && channel[0] == "D"
          message = Message.new(robot, body, source)
          message.command! if source.private_message?
          log.debug("Dispatching message to Lita from #{user.id}.")
          robot.receive(message)
        end

        def from_self?(user)
          if data["subtype"] == "bot_message"
            robot_user = User.find_by_name(robot.name)

            robot_user && robot_user.id == user.id
          end
        end

        def handle_bot_change
          log.debug("Updating user data for bot.")
          UserCreator.create_user(SlackUser.from_data(data["bot"]), robot, robot_id)
        end

        def handle_error
          error = data["error"]
          code = error["code"]
          message = error["msg"]
          log.error("Error with code #{code} received from Slack: #{message}")
        end

        def handle_hello
          log.info("Connected to Slack.")
          robot.trigger(:connected)
        end

        def handle_message
          return unless supported_subtype?

          user = User.find_by_id(data["user"]) || User.create(data["user"])

          return if from_self?(user)

          dispatch_message(user)
        end

        def handle_unknown
          unless data["reply_to"]
            log.debug("#{type} event received from Slack and will be ignored.")
          end
        end

        def handle_user_change
          log.debug("Updating user data.")
          UserCreator.create_user(SlackUser.from_data(data["user"]), robot, robot_id)
        end

        def log
          Lita.logger
        end

        # Types of messages Lita should dispatch to handlers.
        def supported_message_subtypes
          %w(bot_message me_message)
        end

        def supported_subtype?
          subtype = data["subtype"]

          if subtype
            supported_message_subtypes.include?(subtype)
          else
            true
          end
        end
      end
    end
  end
end


text:
In order to hide support workspace and issue tabs, you should ensure that
"disabledFeatures" config variable contains "support".


text:
package net.dougqh.jak.repl;

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

final class ResetCommand extends FixedIdCommand {
	static final String ID = "reset";
	static final ResetCommand INSTANCE = new ResetCommand();

	private ResetCommand() {
		super( ID );
	}

	@Override
	final boolean run(
		final JakRepl repl,
		final String command,
		final List< String > args )
		throws IOException
	{
		checkNoArguments( args );

		repl.resetProgram();
		return true;
	}
}


text:
@interface ZSpriteAnimation : ZSprite
@property (strong) NSMutableDictionary* dictAnimations; //<Key>: animation name <Value>: [duration, sprite idx 0, sprite idx 1...]
@property (assign) float timeElapsed;
@property (assign) int   activeSprite; //The sprite that's NOT hidden
@property (strong) NSString* currentAnimationName;
@property (assign) int  currentAnimationIndex;
@property (assign) BOOL isAnimationLooped;

- (void) loadSpritesFromFilenames:(NSString*) firstFile, ...;
- (void) loadSpritesFromArrayOfFiles:(NSArray*) arrayFiles;
- (void) setActiveSpriteByIndex:(int)index;
- (void) defineAnimationNamed:(NSString *)name OfDuration:(float)secs AsSpriteIndices:(int)firstIndex, ...;
- (void) playAnimation:(NSString*)name Looped:(BOOL)isLooped;
- (BOOL) isPlaying;
- (void) stopAnimation;

@end


text:
DEFINE_int32(num_rows, 2100, "the first row to update");
DEFINE_int32(num_delta_files, 3, "number of delta files");

using std::is_sorted;
using std::shared_ptr;
using std::string;
using std::unique_ptr;
using std::vector;

namespace kudu {
namespace tablet {

using cfile::ReaderOptions;
using fs::ReadableBlock;
using fs::WritableBlock;

class TestDeltaCompaction : public KuduTest {
 public:
  TestDeltaCompaction()
      : deltafile_idx_(0),
        schema_(CreateSchema()) {
  }

  static Schema CreateSchema() {
    SchemaBuilder builder;
    CHECK_OK(builder.AddColumn("val", UINT32));
    return builder.Build();
  }

  Status GetDeltaFileWriter(gscoped_ptr<DeltaFileWriter>* dfw,
                            BlockId* block_id) const {
    unique_ptr<WritableBlock> block;
    RETURN_NOT_OK(fs_manager_->CreateNewBlock({}, &block));
    *block_id = block->id();
    dfw->reset(new DeltaFileWriter(std::move(block)));
    RETURN_NOT_OK((*dfw)->Start());
    return Status::OK();
  }

  Status GetDeltaFileReader(const BlockId& block_id,
                            shared_ptr<DeltaFileReader>* dfr) const {
    unique_ptr<ReadableBlock> block;
    RETURN_NOT_OK(fs_manager_->OpenBlock(block_id, &block));
    shared_ptr<DeltaFileReader> delta_reader;
    return DeltaFileReader::Open(std::move(block), REDO, ReaderOptions(), dfr);
  }

  virtual void SetUp() OVERRIDE {
    KuduTest::SetUp();
    SeedRandom();
    fs_manager_.reset(new FsManager(env_, GetTestPath("fs_root")));
    ASSERT_OK(fs_manager_->CreateInitialFileSystemLayout());
    ASSERT_OK(fs_manager_->Open());
  }

 protected:
  int64_t deltafile_idx_;
  Schema schema_;
  gscoped_ptr<FsManager> fs_manager_;
};

TEST_F(TestDeltaCompaction, TestMergeMultipleSchemas) {
  vector<Schema> schemas;
  SchemaBuilder builder(schema_);
  schemas.push_back(builder.Build());

  // Add an int column with default
  uint32_t default_c2 = 10;
  ASSERT_OK(builder.AddColumn("c2", UINT32, false, &default_c2, &default_c2));
  schemas.push_back(builder.Build());

  // add a string column with default
  Slice default_c3("Hello World");
  ASSERT_OK(builder.AddColumn("c3", STRING, false, &default_c3, &default_c3));
  schemas.push_back(builder.Build());

  vector<shared_ptr<DeltaStore> > inputs;

  faststring buf;
  int row_id = 0;
  int curr_timestamp = 0;
  int deltafile_idx = 0;
  for (const Schema& schema : schemas) {
    // Write the Deltas
    BlockId block_id;
    gscoped_ptr<DeltaFileWriter> dfw;
    ASSERT_OK(GetDeltaFileWriter(&dfw, &block_id));

    // Generate N updates with the new schema, some of them are on existing
    // rows others are on new rows (see kNumUpdates and kNumMultipleUpdates).
    // Each column will be updated with value composed by delta file id
    // and update number (see update_value assignment).
    size_t kNumUpdates = 10;
    size_t kNumMultipleUpdates = kNumUpdates / 2;
    DeltaStats stats;
    for (size_t i = 0; i < kNumUpdates; ++i) {
      buf.clear();
      RowChangeListEncoder update(&buf);
      for (size_t col_idx = schema.num_key_columns(); col_idx < schema.num_columns(); ++col_idx) {
        ColumnId col_id = schema.column_id(col_idx);
        DCHECK_GE(col_id, 0);

        stats.IncrUpdateCount(col_id, 1);
        const ColumnSchema& col_schema = schema.column(col_idx);
        int update_value = deltafile_idx * 100 + i;
        switch (col_schema.type_info()->physical_type()) {
          case UINT32:
            {
              uint32_t u32_val = update_value;
              update.AddColumnUpdate(col_schema, col_id, &u32_val);
            }
            break;
          case BINARY:
            {
              string s = std::to_string(update_value);
              Slice str_val(s);
              update.AddColumnUpdate(col_schema, col_id, &str_val);
            }
            break;
          default:
            FAIL() << "Type " << DataType_Name(col_schema.type_info()->type()) << " Not Supported";
            break;
        }
      }

      // To simulate multiple updates on the same row, the first N updates
      // of this new schema will always be on rows [0, 1, 2, ...] while the
      // others will be on new rows. (N is tunable by changing kNumMultipleUpdates)
      DeltaKey key((i < kNumMultipleUpdates) ? i : row_id, Timestamp(curr_timestamp));
      RowChangeList row_changes = update.as_changelist();
      ASSERT_OK(dfw->AppendDelta<REDO>(key, row_changes));
      ASSERT_OK(stats.UpdateStats(key.timestamp(), row_changes));
      curr_timestamp++;
      row_id++;
    }

    dfw->WriteDeltaStats(stats);
    ASSERT_OK(dfw->Finish());
    shared_ptr<DeltaFileReader> dfr;
    ASSERT_OK(GetDeltaFileReader(block_id, &dfr));
    inputs.push_back(dfr);
    deltafile_idx++;
  }

  // Merge
  const Schema& merge_schema = schemas.back();
  RowIteratorOptions opts;
  opts.projection = &merge_schema;
  unique_ptr<DeltaIterator> merge_iter;
  ASSERT_OK(DeltaIteratorMerger::Create(inputs, opts, &merge_iter));
  gscoped_ptr<DeltaFileWriter> dfw;
  BlockId block_id;
  ASSERT_OK(GetDeltaFileWriter(&dfw, &block_id));
  ASSERT_OK(WriteDeltaIteratorToFile<REDO>(merge_iter.get(),
                                           ITERATE_OVER_ALL_ROWS,
                                           dfw.get()));
  ASSERT_OK(dfw->Finish());

  shared_ptr<DeltaFileReader> dfr;
  ASSERT_OK(GetDeltaFileReader(block_id, &dfr));
  DeltaIterator* raw_iter;
  ASSERT_OK(dfr->NewDeltaIterator(opts, &raw_iter));
  gscoped_ptr<DeltaIterator> scoped_iter(raw_iter);

  vector<string> results;
  ASSERT_OK(DebugDumpDeltaIterator(REDO, scoped_iter.get(), merge_schema,
                                          ITERATE_OVER_ALL_ROWS, &results));
  for (const string &str : results) {
    VLOG(1) << str;
  }
  ASSERT_TRUE(is_sorted(results.begin(), results.end()));
}

} // namespace tablet
} // namespace kudu


text:
<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Wed May 11 15:51:17 KST 2016-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="RoughMapDAO">

	<resultMap id="RoughMap" type="egovframework.com.uss.ion.rmm.service.RoughMapVO">
		<result property="roughMapId" column="ROUGHMAP_ID"/>
		<result property="roughMapSj" column="ROUGHMAPSJ"/>
		<result property="roughMapAddress" column="ROUGHMAPADDRESS"/>
		<result property="la" column="LA"/>
		<result property="lo" column="LO"/>
		<result property="markerLa" column="MARKERLA"/>
		<result property="markerLo" column="MARKERLO"/>
		<result property="infoWindow" column="INFOWINDOW"/>
		<result property="zoomLevel" column="ZOOMLEVEL"/>
		<result property="frstRegisterPnttm" column="FRST_REGIST_PNTTM"/>
		<result property="frstRegisterId" column="FRST_REGISTER_ID"/>
		<result property="lastUpdusrPnttm" column="LAST_UPDT_PNTTM"/>
		<result property="lastUpdusrId" column="LAST_UPDUSR_ID"/>
	</resultMap>

	<select id="selectRoughMapList" parameterType="egovframework.com.uss.ion.rmm.service.RoughMapDefaultVO" resultType="egovMap">

			SELECT
				ROUGHMAP_ID,
				ROUGHMAPSJ,
				ROUGHMAPADDRESS,
				DATE_FORMAT(LAST_UPDT_PNTTM,'%Y-%m-%d') LAST_UPDT_PNTTM
			FROM
				COMTNROUGHMAP
			WHERE
				1 = 1

			<if test="searchCondition == 'roughMapSj'">AND
				ROUGHMAPSJ LIKE CONCAT ('%', #{searchKeyword},'%')
			</if>
			<if test="searchCondition == 'roughMapAddress'">AND
				ROUGHMAPADDRESS LIKE CONCAT ('%', #{searchKeyword},'%')
			</if>

			ORDER BY ROUGHMAP_ID DESC

			<if test="searchUseYn == ''">
				LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
			</if>
	</select>

	<select id="selectRoughMapListTotCnt" parameterType="egovframework.com.uss.ion.rmm.service.RoughMapDefaultVO" resultType="int">

			SELECT
				COUNT(ROUGHMAP_ID)
			FROM
				COMTNROUGHMAP
			WHERE
				1 = 1

			<if test="searchCondition == 'roughMapSj'">AND
				ROUGHMAPSJ LIKE CONCAT ('%', #{searchKeyword},'%')
			</if>
			<if test="searchCondition == 'roughMapAddress'">AND
				ROUGHMAPADDRESS LIKE CONCAT ('%', #{searchKeyword},'%')
			</if>
	</select>

 	<select id="selectRoughMapDetail" resultMap="RoughMap">

			SELECT
				ROUGHMAP_ID,
				ROUGHMAPSJ,
				ROUGHMAPADDRESS,
				LA,
				LO,
				MARKERLA,
				MARKERLO,
				INFOWINDOW,
				ZOOMLEVEL,
				FRST_REGIST_PNTTM,
				FRST_REGISTER_ID,
				LAST_UPDT_PNTTM,
				LAST_UPDUSR_ID
			FROM
				COMTNROUGHMAP
			WHERE
				ROUGHMAP_ID = #{roughMapId}

	</select>

 	<insert id="insertRoughMap">

			INSERT INTO COMTNROUGHMAP (
				ROUGHMAP_ID,
				ROUGHMAPSJ,
				ROUGHMAPADDRESS,
				LA,
				LO,
				MARKERLA,
				MARKERLO,
				INFOWINDOW,
				ZOOMLEVEL,
				FRST_REGIST_PNTTM,
				FRST_REGISTER_ID,
				LAST_UPDT_PNTTM,
				LAST_UPDUSR_ID)
			VALUES (
				#{roughMapId},
				#{roughMapSj},
				#{roughMapAddress},
				#{la},
				#{lo},
				#{markerLa},
				#{markerLo},
				#{infoWindow},
				#{zoomLevel},
				SYSDATETIME,
				#{frstRegisterId},
				SYSDATETIME,
				#{lastUpdusrId}
			)

	</insert>

	<update id="updateRoughMap">

			UPDATE
				COMTNROUGHMAP
			SET
				ROUGHMAPSJ = #{roughMapSj},
				ROUGHMAPADDRESS = #{roughMapAddress},
				LA = #{la},
				LO = #{lo},
				MARKERLA = #{markerLa},
				MARKERLO = #{markerLo},
				INFOWINDOW = #{infoWindow},
				ZOOMLEVEL = #{zoomLevel},
				LAST_UPDT_PNTTM = SYSDATETIME,
				LAST_UPDUSR_ID = #{lastUpdusrId}
 			WHERE
 				ROUGHMAP_ID = #{roughMapId}

	</update>

	<delete id="deleteRoughMap">

			DELETE FROM
				COMTNROUGHMAP
			WHERE
				ROUGHMAP_ID = #{roughMapId}

	</delete>
</mapper>


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
	xmlns:activiti="http://activiti.org/bpmn"
	targetNamespace="Examples">

	<signal id="alertSignal" name="alert" />
	<message id="invoiceMessage" name="newInvoice" />

	<process id="catchSignal">

		<sequenceFlow sourceRef="timerEvent" targetRef="task1" />
		<sequenceFlow sourceRef="signalEvent" targetRef="task2" />
		<sequenceFlow sourceRef="messageEvent" targetRef="task3" />

		<startEvent id="start" />

		<sequenceFlow sourceRef="start" targetRef="gw1" />

		<eventBasedGateway id="gw1" />

		<sequenceFlow sourceRef="gw1" targetRef="signalEvent" />
		<sequenceFlow sourceRef="gw1" targetRef="timerEvent" />
		<sequenceFlow sourceRef="gw1" targetRef="messageEvent" />

		<intermediateCatchEvent id="signalEvent" name="Alert">
			<signalEventDefinition signalRef="alertSignal" />
		</intermediateCatchEvent>

		<intermediateCatchEvent id="messageEvent" name="new invoice">
			<messageEventDefinition messageRef="invoiceMessage" />
		</intermediateCatchEvent>

		<intermediateCatchEvent id="timerEvent" name="Alert">
			<timerEventDefinition>
				<timeDuration>PT0S</timeDuration>
			</timerEventDefinition>
		</intermediateCatchEvent>

		<userTask id="task1" name="afterTimer" activiti:assignee="kermit"/>
		<userTask id="task2" name="afterSignal" activiti:assignee="kermit"/>
		<userTask id="task3" name="afterMessage" activiti:assignee="kermit"/>

		<sequenceFlow sourceRef="task1" targetRef="end" />
		<sequenceFlow sourceRef="task2" targetRef="end" />
		<sequenceFlow sourceRef="task3" targetRef="end" />

		<endEvent id="end" />

	</process>

</definitions>


text:
<!DOCTYPE html>
<html>
  <head>
    <title>Panoramic View of OptionalByte</title>
  </head>
  <body>
    <img src="OptionalByte.gif" style="width:70%;height:70%;" alt="" />
  </body>
</html>


text:
      Cluster
      <help-field key="pipeline.config.disableCluster.cluster"></help-field>

      <input type="text" required ng-model="stage.cluster"
        class="form-control input-sm" />

    Account

      <account-select-field component="stage" field="credentials" accounts="accounts" on-change="disableClusterStageCtrl.accountUpdated()" required></account-select-field>

    Zones

(Select an Account)

      <checkmap item-map="zones" selected-items="stage.zones"></checkmap>

      Disable Options

        Keep the
        <input type="number" min="0" required ng-model="stage.remainingEnabledServerGroups"
               class="form-control input-sm" style="width: 50px" />
        <select class="form-control input-sm"
                ng-model="stage.preferLargerOverNewer" style="width: 100px">
          <option value="true">largest</option>
          <option value="false">newest</option>
        </select>
        {{disableClusterStageCtrl.pluralize('server group', stage.remainingEnabledServerGroups)}} enabled.

  <platform-health-override ng-if="application.attributes.platformHealthOnlyShowOverride"
                            command="stage"
                            platform-health-type="'Google'"
                            label-text="Task Completion"
                            label-columns="2"
                            label-offset="col-md-offset-1">
  </platform-health-override>


text:
![Logo](https://raw.github.com/MrJul/ReSharper.EnhancedTooltip/master/Logo/Logo32.png "Logo") ReSharper.EnhancedTooltip
======

What's ReSharper.EnhancedTooltip?
--------------
It's a plugin for [JetBrains ReSharper](http://www.jetbrains.com/resharper/) that enhances the tooltip and parameter information popup.

- Colorizes tooltips and parameter information popups for C#.
- Displays icons for identifiers and issues in the tooltip.
- Uses the colors and font configured in Visual Studio.
- When working with JetBrains annotations, can display [CanBeNull] and [NotNull] attributes.
- Everything is configurable.

Installation
------------
Visual Studio 2012, 2013 and 2015 are supported.
ReSharper 10.0 must be installed.
(Note: older versions are still available for ReSharper 8.2, 9.0, 9.1 and 9.2.)

Install the plugin using the built-in Extension Manager from the ReSharper menu.

Tooltip Highlighting
--------------------
The tooltip that appears on mouse over is now syntax highlighted. Note that only the tooltips provided by ReSharper are currently colored.
![Tooltip Highlighting](https://raw.github.com/MrJul/ReSharper.EnhancedTooltip/master/Screenshots/Tooltip.png "Tooltip Highlighting")

Parameter Info Highlighting
---------------------------
The parameter information popup is now syntax highlighted.
The colors used for the types are either the ones having a name starting by _ReSharper_ if _Color identifiers_ is used, or the Visual Studio ones starting with _User Types_ otherwise.
![Parameter Info Highlighting](https://raw.github.com/MrJul/ReSharper.EnhancedTooltip/master/Screenshots/ParameterInfo.png "Parameter Info Highlighting")

Options
-------
Enhanced Tooltip provides many options to configure the display as you like.
The options page is located at ReSharper → Options → Environment → IntelliSense → Enhanced Tooltip.
![Options Page](https://raw.github.com/MrJul/ReSharper.EnhancedTooltip/master/Screenshots/Options.png "Options Page")

Current Limitations
-----------
- Colors only work in C# files. The standard tooltip and parameter information popup are used in other file types.
- The parameter information popup isn't highlighted for calls using named parameters.

Licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)


text:
class Account {
public:
    void calculate() { amount += amount * interestRate; }
    static double rate() { return interestRate; }
    static void setRate(double newRate) { interestRate = newRate; }
private:
    std::string owner;
    double amount;
    static double interestRate;
    static constexpr double todayRate = 6.5;
    static double initRate() { return todayRate; }
};

double Account::interestRate = initRate();

#endif


text:
package com.ouwenjie.note.activity;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.afollestad.materialdialogs.MaterialDialog;
import com.fourmob.datetimepicker.date.DatePickerDialog;
import com.ouwenjie.note.NoteApplication;
import com.ouwenjie.note.R;
import com.ouwenjie.note.adapter.ImageListAdapter;
import com.ouwenjie.note.db.NoteDatabaseHelper;
import com.ouwenjie.note.model.BaseNote;
import com.ouwenjie.note.receiver.NoteAlarmReceiver;
import com.ouwenjie.note.utils.ImageUtils;
import com.ouwenjie.note.utils.LogUtils;
import com.ouwenjie.note.helper.MyActivityManager;
import com.ouwenjie.note.utils.TimeUtils;
import com.sleepbot.datetimepicker.time.RadialPickerLayout;
import com.sleepbot.datetimepicker.time.TimePickerDialog;
import com.umeng.analytics.MobclickAgent;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

public class EditNoteActivity extends AppCompatActivity implements View.OnClickListener, DatePickerDialog.OnDateSetListener, TimePickerDialog.OnTimeSetListener {

    private static final String TAG = "EditNoteActivity";

    private static final int REQ_PICK_PHOTO = 100;
    private static final int REQ_SHOW_IMAGE = 101;
    private static final int REQ_TAKE_PHOTO = 102;

    public static final String DATEPICKER_TAG = "datepicker";
    public static final String TIMEPICKER_TAG = "timepicker";

    public static final boolean SHOW = true;
    public static final boolean HIDE = false;

    private RelativeLayout editNoteLayout;    // 编辑页面
    private LinearLayout editNoteToolsBar;  // 工具栏

    public static List<Uri> imageUriList = new ArrayList<>();
    private RecyclerView imageListRecyclerView;     // 图片列表
    private LinearLayoutManager linearLayoutManager;
    private ImageListAdapter adapter;

    private ImageView backImg;          // 工具栏 -- 返回
    private TextView dateTxt;           // 工具栏 -- 日期
    private TextView timeTxt;           // 工具栏 -- 时间
    private ImageView paletteImg;       // 工具栏 -- 调色板
    private ImageView alarmImg;         // 工具栏 -- 提醒
    private ImageView addedImg;         // 工具栏 -- 附件

    private PopupWindow selectColorWindow;    // 调色板 -- 弹出的窗口
    private PopupWindow insertPicWindow;        // 插入图片 -- 弹出的窗口

    private EditText contentEt;         // 内容编辑

    private BaseNote note;              // 正在编辑的NOTE

    private int bgColor = BaseNote.LIGHT_YELLOW;    // 当前的背景颜色

    private DatePickerDialog datePickerDialog;      // 日期选择器
    private TimePickerDialog timePickerDialog;      // 时间选择器

    private TextView alarmDate;                     // 已选择的日期
    private TextView alarmTime;                     // 已选择的时间

    private boolean imageListState = SHOW;          // 图片列表显示状态
    private ImageView hideImageList;
    private TextView imageListStateTxt;
    private ImageView showImageList;

    private LinearLayout alarmInfoLayout;       // 下方的信息栏
    private TextView alarmDateTime;             // 信息栏的内容
    private ImageView closeAlarm;               // 关闭信息栏

    private Uri photoUri;               // 拍照时保存的URI

    private NoteDatabaseHelper dbHelper = new NoteDatabaseHelper();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // If the Android version is lower than Jellybean, use this call to hide
        // the status bar.
        if(Build.VERSION.SDK_INT < 16) {
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }

        setContentView(R.layout.activity_edit_note);

        MyActivityManager.getInstance().addActivity(this);

        initWidget();
        initData();

        initImageListData();
        initRecyclerView();

        initDateTimePicker(savedInstanceState);

    }

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

        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);// 淡化status bar 和 navigation bar

        MobclickAgent.onPageStart("EditNoteActivity"); //统计页面(仅有Activity的应用中SDK自动调用,不需要单独写)
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd("EditNoteActivity"); // (仅有Activity的应用中SDK自动调用,不需要单独写)保证 onPageEnd 在onPause 之前调用,因为 onPause 中会保存信息
        MobclickAgent.onPause(this);
    }

    /**
     * 初始化布局控件
     */
    private void initWidget(){

        editNoteLayout = (RelativeLayout) findViewById(R.id.edit_note_layout);
        editNoteToolsBar = (LinearLayout) findViewById(R.id.edit_note_tools_bar);

        backImg = (ImageView) findViewById(R.id.back_img);
        dateTxt = (TextView) findViewById(R.id.note_date_tv);
        timeTxt = (TextView) findViewById(R.id.note_time_tv);
        paletteImg = (ImageView) findViewById(R.id.note_palette_img);
        alarmImg = (ImageView) findViewById(R.id.note_alarm_clock_img);
        addedImg = (ImageView) findViewById(R.id.note_added_img);

        imageListRecyclerView = (RecyclerView) findViewById(R.id.note_image_list_layout);

        contentEt = (EditText) findViewById(R.id.note_edit_content_et);

        hideImageList = (ImageView) findViewById(R.id.note_image_hide_img);
        imageListStateTxt = (TextView) findViewById(R.id.note_image_tip_tv);
        showImageList = (ImageView) findViewById(R.id.note_image_show_img);

        alarmInfoLayout = (LinearLayout) findViewById(R.id.alarm_info_layout);
        alarmDateTime = (TextView) findViewById(R.id.alarm_date_time_tv);
        closeAlarm = (ImageView) findViewById(R.id.close_alarm_img);

        backImg.setOnClickListener(this);
        paletteImg.setOnClickListener(this);
        alarmImg.setOnClickListener(this);
        addedImg.setOnClickListener(this);

        hideImageList.setOnClickListener(this);
        imageListStateTxt.setOnClickListener(this);
        showImageList.setOnClickListener(this);

        closeAlarm.setOnClickListener(this);

    }

    /**
     * 初始化画面数据,根据Note展示数据
     */
    private void initData(){

        long dbId = getIntent().getLongExtra(BaseNote.KEY_DB_ID,-1);
        if(dbId >= 0){
            note = dbHelper.get(dbId);
        }else{ // 新建的Note
            note = new BaseNote("");
            // 如是新建的"提醒",则一开始就弹出设置时间的窗口
            if(getIntent().getIntExtra(BaseNote.KEY_NOTE_TYPE,BaseNote.NOTE_TYPE_RECORD) == BaseNote.NOTE_TYPE_REMIND){
                showCustomView();
            }
        }

        setBgColor(note.getBgColor());              // 背景颜色
        contentEt.setText(note.getContent());       // 内容
        String[] lastChangedTime = note.getLastChangeDate().split(" ");
        dateTxt.setText(lastChangedTime[0]);        // 日期
        timeTxt.setText(lastChangedTime[1]);        // 时间

        if(note.getNoteState() == BaseNote.NOTE_STATE_INVALID){ // 如果是归档状态,则不可修改。
            contentEt.setFocusable(false);
        }else{
            contentEt.setFocusable(true);
        }

        if(note.getAlarmState() == BaseNote.NOTE_ALARM_STATE_VALID) {
            openAlarmLayout();
        } else{
            closeAlarmLayout();
        }
    }

    /**
     * 初始化 RecyclerView 列表
     */
    private void initRecyclerView() {

        linearLayoutManager = new LinearLayoutManager(this);
        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        imageListRecyclerView.setLayoutManager(linearLayoutManager);

        adapter = new ImageListAdapter(this, imageUriList);
        adapter.setItemOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveNoteState();

                int position = (int) v.getTag();
                Intent intent = new Intent(EditNoteActivity.this, ImageViewPagerActivity.class);
                intent.putExtra("ImageListPosition", position);
                intent.putExtra("UriString", note.getImageSet());
                startActivityForResult(intent, REQ_SHOW_IMAGE);
            }
        });
        imageListRecyclerView.setAdapter(adapter);
    }

    /**
     * 初始化 图片列表
     */
    private List<Uri> initImageListData() {
        imageUriList = new ArrayList<>();
        String imageUriSet = note.getImageSet();
        if(imageUriSet != null && !(imageUriSet.equals(""))) {
            String[] imageUriString = note.getImageSet().split(" ");
            if (imageUriString.length != 0) {
                showImageListLayout();
                for (String s : imageUriString) {
                    imageUriList.add(Uri.parse(s));
                }
            }
        }else {
            hideImageListLayout();
        }
        return imageUriList;
    }

    /**
     * 显示图片列表布局
     */
    private void showImageListLayout(){
        imageListRecyclerView.setVisibility(View.VISIBLE);
        findViewById(R.id.note_image_show_img).setVisibility(View.VISIBLE);
        findViewById(R.id.note_image_tip_tv).setVisibility(View.VISIBLE);
        showImageList();
    }

    /**
     * 隐藏图片列表布局
     */
    private void hideImageListLayout(){
        findViewById(R.id.note_image_list_layout).setVisibility(View.GONE);
        findViewById(R.id.note_image_hide_img).setVisibility(View.GONE);
        findViewById(R.id.note_image_tip_tv).setVisibility(View.GONE);
        findViewById(R.id.note_image_show_img).setVisibility(View.GONE);
    }

    /**
     * 显示闹钟信息栏
     */
    private void openAlarmLayout() {
        alarmImg.setImageResource(R.drawable.ic_alarm_on_black_24dp);   // 提醒Img
        alarmDateTime.setText(note.getAlarmDate());
        alarmInfoLayout.setVisibility(View.VISIBLE);
    }

    /**
     * 隐藏闹钟信息栏
     */
    private void closeAlarmLayout() {
        alarmImg.setImageResource(R.drawable.ic_alarm_off_black_24dp);
        alarmDateTime.setText("");
        alarmInfoLayout.setVisibility(View.INVISIBLE);
    }

    /**
     * 设置背景颜色
     * @param bgColor
     */
    private void setBgColor(int bgColor){
        this.bgColor = bgColor;

        switch (bgColor){
            case BaseNote.LIGHT_YELLOW:
                editNoteLayout.setBackgroundColor(getResources().getColor(R.color.light_yellow));
                editNoteToolsBar.setBackgroundColor(getResources().getColor(R.color.light_yellow_dark));
                break;
            case BaseNote.LIGHT_BLUE:
                editNoteLayout.setBackgroundColor(getResources().getColor(R.color.light_blue));
                editNoteToolsBar.setBackgroundColor(getResources().getColor(R.color.light_blue_dark));
                break;
            case BaseNote.LIGHT_GREEN:
                editNoteLayout.setBackgroundColor(getResources().getColor(R.color.light_green));
                editNoteToolsBar.setBackgroundColor(getResources().getColor(R.color.light_green_dark));
                break;
            case BaseNote.LIGHT_RED:
                editNoteLayout.setBackgroundColor(getResources().getColor(R.color.light_red));
                editNoteToolsBar.setBackgroundColor(getResources().getColor(R.color.light_red_dark));
                break;
            default:
                break;
        }
    }

    /**
     * 初始化日期时间选择器
     */
    private void initDateTimePicker(Bundle savedInstanceState){
        final Calendar calendar = Calendar.getInstance();

        datePickerDialog = DatePickerDialog.newInstance(this,
                calendar.get(Calendar.YEAR),
                calendar.get(Calendar.MONTH),
                calendar.get(Calendar.DAY_OF_MONTH),
                true);

        timePickerDialog = TimePickerDialog.newInstance(this,
                calendar.get(Calendar.HOUR_OF_DAY),
                calendar.get(Calendar.MINUTE),
                true,
                true);

        if (savedInstanceState != null) {
            DatePickerDialog dpd = (DatePickerDialog) getSupportFragmentManager().findFragmentByTag(DATEPICKER_TAG);
            if (dpd != null) {
                dpd.setOnDateSetListener(this);
            }

            TimePickerDialog tpd = (TimePickerDialog) getSupportFragmentManager().findFragmentByTag(TIMEPICKER_TAG);
            if (tpd != null) {
                tpd.setOnTimeSetListener(this);
            }
        }

    }

    /**
     * 弹出颜色选择的小窗口
     * @param v
     */
    private void showSelectColorWindow(View v) {

        if(selectColorWindow == null){
            LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            View selectColorView = inflater.inflate(R.layout.layout_select_color, null);

            // 获取 View 的宽高
            int w = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED);
            int h = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED);
            selectColorView.measure(w, h);
            int height = selectColorView.getMeasuredHeight();
            int width = selectColorView.getMeasuredWidth();

            // 4种颜色块 提供选择
            View b = selectColorView.findViewById(R.id.blue);
            View y = selectColorView.findViewById(R.id.yellow);
            View r = selectColorView.findViewById(R.id.red);
            View g = selectColorView.findViewById(R.id.green);

            b.setOnClickListener(this);
            y.setOnClickListener(this);
            r.setOnClickListener(this);
            g.setOnClickListener(this);

            selectColorWindow = new PopupWindow(selectColorView,width,height);
        }

        selectColorWindow.setFocusable(true);
        selectColorWindow.setOutsideTouchable(true);
        selectColorWindow.setAnimationStyle(R.style.AnimationFade);

        selectColorWindow.setBackgroundDrawable(new BitmapDrawable());

        WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);

        int xPos = windowManager.getDefaultDisplay().getWidth() - selectColorWindow.getWidth();

        selectColorWindow.showAsDropDown(v, 0, 10);

    }

    /**
     * 弹出选择提醒日期的Dialog
     */
    private void showCustomView() {

        MaterialDialog dialog = new MaterialDialog.Builder(this)
                .title("选择提醒的日期和时间")
                .customView(R.layout.dialog_select_alarm_clock, true)
                .positiveText("保存")
                .negativeText("取消")
                .neutralText("放弃")
                .callback(new MaterialDialog.ButtonCallback() {
                    @Override
                    public void onPositive(MaterialDialog dialog) {
                        cancelAlarmReceiver();  // 先取消上一个闹钟

                        //  保存 闹钟 的状态和时间日期
                        note.setNoteType(BaseNote.NOTE_TYPE_REMIND);    // 修改NOTE 的类型为 提醒
                        note.setAlarmState(BaseNote.NOTE_ALARM_STATE_VALID);    // 修改闹钟状态为 有效
                        note.setAlarmDate(alarmDate.getText().toString() + " " + alarmTime.getText().toString());
                        openAlarmLayout();

                        String[] ymd = alarmDate.getText().toString().split("-");
                        String[] hms = alarmTime.getText().toString().split(":");
                        setAlarmReceiver(ymd[0],ymd[1],ymd[2],hms[0],hms[1]);
                    }

                    @Override
                    public void onNegative(MaterialDialog dialog) {
                        note.setNoteType(BaseNote.NOTE_TYPE_RECORD);    // 修改NOTE 的类型为 记事
                        note.setAlarmState(BaseNote.NOTE_ALARM_STATE_INVALID);
                        closeAlarmLayout();
                        cancelAlarmReceiver();
                    }
                }).build();

        // 设置弹出的自定义窗口中的控件的属性和事件
        setAlarmText(dialog);

        dialog.setCanceledOnTouchOutside(false);
        dialog.show();

        saveNoteState();
    }

    /**
     * 设置dialog 中显示的提醒时间
     * @param dialog
     */
    private void setAlarmText(MaterialDialog dialog) {

        alarmDate = (TextView) dialog.getCustomView().findViewById(R.id.alarm_date_tv);
        alarmTime = (TextView) dialog.getCustomView().findViewById(R.id.alarm_time_tv);

        if( (note.getAlarmState() == BaseNote.NOTE_ALARM_STATE_INVALID) || (note.getAlarmState() == BaseNote.NOTE_ALARM_STATE_OLD) ) {
            alarmDate.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT));
            alarmTime.setText(TimeUtils.getCurrentTimeInString(new SimpleDateFormat("HH:mm")));
        }else if (note.getAlarmState() == BaseNote.NOTE_ALARM_STATE_VALID){
            String[] dates = note.getAlarmDate().split(" ");
            alarmDate.setText(dates[0]);
            alarmTime.setText(dates[1]);
        }

        alarmDate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                datePickerDialog.setVibrate(true);
                datePickerDialog.setYearRange(1985, 2028);
                datePickerDialog.setCloseOnSingleTapDay(false);
                datePickerDialog.show(getSupportFragmentManager(), DATEPICKER_TAG);
            }
        });

        alarmTime.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                timePickerDialog.setVibrate(true);
                timePickerDialog.setCloseOnSingleTapMinute(false);
                timePickerDialog.show(getSupportFragmentManager(), TIMEPICKER_TAG);
            }
        });

    }

    /**
     * 弹出选择插入图片的小窗口
     * @param v
     */
    private void showInsertPicWindow(View v) {

        if(insertPicWindow == null){
            LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View insertPicView = inflater.inflate(R.layout.layout_insert_pic, null);

            // 获取 View 的宽高
            int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
            int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
            insertPicView.measure(w, h);
            int height = insertPicView.getMeasuredHeight();
            int width = insertPicView.getMeasuredWidth();

            insertPicView.findViewById(R.id.take_photo_tv).setOnClickListener(this);
            insertPicView.findViewById(R.id.album_tv).setOnClickListener(this);

            insertPicWindow = new PopupWindow(insertPicView,width,height);
        }

        insertPicWindow.setFocusable(true);
        insertPicWindow.setOutsideTouchable(true);
        insertPicWindow.setAnimationStyle(R.style.AnimationFade);
        insertPicWindow.setBackgroundDrawable(new BitmapDrawable());

        WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
        int xPos = windowManager.getDefaultDisplay().getWidth() - insertPicWindow.getWidth();

        insertPicWindow.showAsDropDown(v, 0, 10);

    }

    /**
     * 展开图片列表
     */
    private void showImageList(){

        ObjectAnimator scaleYanimator =  ObjectAnimator.ofFloat(imageListRecyclerView, "scaleY", 0,1);
        ObjectAnimator.ofFloat(imageListRecyclerView, "pivotY", 0);
        scaleYanimator.setDuration(500);
        scaleYanimator.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animation) {
                imageListRecyclerView.setVisibility(View.VISIBLE);
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                hideImageList.setVisibility(View.VISIBLE);
                showImageList.setVisibility(View.GONE);
                imageListStateTxt.setText("隐藏图片列表");

            }

            @Override
            public void onAnimationCancel(Animator animation) {
            }

            @Override
            public void onAnimationRepeat(Animator animation) {}
        });
        scaleYanimator.start();
    }

    /**
     * 收起图片列表的动画
     */
    private void hideImageList(){

        ObjectAnimator scaleYanimator =  ObjectAnimator.ofFloat(imageListRecyclerView, "scaleY", 1, 0);
        ObjectAnimator.ofFloat(imageListRecyclerView, "pivotY", 0);
        scaleYanimator.setDuration(500);
        scaleYanimator.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animation) {
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                hideImageList.setVisibility(View.GONE);
                showImageList.setVisibility(View.VISIBLE);
                imageListStateTxt.setText("显示图片列表");

                imageListRecyclerView.setVisibility(View.GONE);
            }

            @Override
            public void onAnimationCancel(Animator animation) {
            }

            @Override
            public void onAnimationRepeat(Animator animation) {
            }
        });
        scaleYanimator.start();
    }

    private void takePhotoFromCamera() {

        String SDCardRoot = Environment.getExternalStorageDirectory().getPath() + File.separator;
        File fileDir = new File(SDCardRoot + "jideNote" + File.separator + "img" + File.separator);
        if (!fileDir.exists()) {
            fileDir.mkdir();  //如果不存在则创建
        }
        File file = new File(fileDir,ImageUtils.getTempFileName()+".jpg");
        try {
            file.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        photoUri = Uri.fromFile(file);
        LogUtils.e("get photoUri = " + photoUri.toString());

        Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
        startActivityForResult(cameraIntent, REQ_TAKE_PHOTO);
    }

    private void pickPhotoFromAlbum(){

        Intent albumIntent = new Intent();
        albumIntent.setAction(Intent.ACTION_PICK);
        albumIntent.setType("image/*");

        startActivityForResult(albumIntent, REQ_PICK_PHOTO);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
        LogUtils.e("requestCode = " + requestCode);
        switch (requestCode){
            case REQ_PICK_PHOTO:
                if(intent != null){
                    Uri uri = intent.getData();
                    LogUtils.e("REQ_PICK_PHOTO==",uri.toString());
                    note.addImageSet(uri);
                    initImageListData();
                    initRecyclerView();
//                    adapter.addItem(uri,imageUriList.size());
//                    showImageListLayout();
                }
                break;
            case REQ_SHOW_IMAGE:
                if(intent != null){
                    String uriString = intent.getStringExtra("UriString");
                    note.setImageSet(uriString);
                    initImageListData();
                    initRecyclerView();
                }
                break;
            case REQ_TAKE_PHOTO:
                if (resultCode == RESULT_OK) {
                    LogUtils.e("Result REQ_TAKE_PHOTO = " + photoUri.toString());

                    note.addImageSet(photoUri);
                    initImageListData();
                    initRecyclerView();
                }
                break;
            default:
                break;
        }
    }

    /**
     * 保存当前note 到数据库
     */
    private void saveNoteState(){
        note.setContent(contentEt.getText().toString());
        note.setLastChangeDate(TimeUtils.getCurrentTimeInString());
        note.setBgColor(bgColor);
        if(!NoteApplication.getNoteApplication(this).isVisitor()){
            note.setUserid(NoteApplication.getNoteApplication(this).getUser().getOpenid(this.getApplicationContext()));
        }
        dbHelper.sava(note);
//        note.save();
        LogUtils.e("Sava Note");
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode){
            case KeyEvent.KEYCODE_BACK:
                exitNoteEditor();
                break;
        }
        return super.onKeyDown(keyCode, event);
    }

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

    @Override
    protected void onDestroy() {
        super.onDestroy();
        MyActivityManager.getInstance().finishActivity(this.getClass());
    }

    /**
     * 退出编辑器Activity
     */
    private void exitNoteEditor(){

        String contentStr = contentEt.getText().toString();
        if(!contentStr.equals("")) {
            saveNoteState();
            setResult(RESULT_OK);
        }else{
            setResult(RESULT_CANCELED);
        }
        finish();
    }

    /**
     * 开启一个闹钟
     */
    private void setAlarmReceiver(String year,String month,String day,String hour,String minute ){

        Intent receiverIntent = new Intent(getApplicationContext(), NoteAlarmReceiver.class);
        long dbId = note.getId();
        LogUtils.e(TAG,"dbId ==> "+dbId);

        receiverIntent.putExtra(BaseNote.KEY_DB_ID,dbId );

        PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), note.getAlarmReqCode(), receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT);

        Calendar calendar = Calendar.getInstance();
        calendar.set(Integer.parseInt(year), Integer.parseInt(month)-1, Integer.parseInt(day), Integer.parseInt(hour), Integer.parseInt(minute));
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);

        LogUtils.e("YEAR MONTH DAY "+calendar.get(Calendar.YEAR)+"-"+calendar.get(Calendar.MONTH)+"-"+calendar.get(Calendar.DAY_OF_MONTH));
        LogUtils.e("HOUR MINUTE "+calendar.get(Calendar.HOUR_OF_DAY)+":"+calendar.get(Calendar.MINUTE));

        long time = calendar.getTimeInMillis();
        AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
        alarmManager.set(AlarmManager.RTC_WAKEUP, time, pendingIntent);
    }

    /**
     * 取消闹钟
     */
    private void cancelAlarmReceiver(){
        Intent intent = new Intent(getApplicationContext(), NoteAlarmReceiver.class);

        PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), note.getAlarmReqCode(), intent, PendingIntent.FLAG_UPDATE_CURRENT);

        /* 获取闹钟管理的实例 */
        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
        /* 取消 */
        am.cancel(pendingIntent);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.back_img:     // 退出
                exitNoteEditor();
                break;
            case R.id.note_palette_img:     // 调节背景颜色
                showSelectColorWindow(v);
                break;
            case R.id.blue:
                setBgColor(BaseNote.LIGHT_BLUE);    // 设置背景颜色为 蓝
                selectColorWindow.dismiss();
                break;
            case R.id.yellow:
                setBgColor(BaseNote.LIGHT_YELLOW);  // 设置背景颜色为 黄
                selectColorWindow.dismiss();
                break;
            case R.id.red:
                setBgColor(BaseNote.LIGHT_RED);     // 设置背景颜色为 红
                selectColorWindow.dismiss();
                break;
            case R.id.green:
                setBgColor(BaseNote.LIGHT_GREEN);   // 设置背景颜色为 绿
                selectColorWindow.dismiss();
                break;

            case R.id.note_alarm_clock_img:         // 设置闹钟
                showCustomView();
                break;
            case R.id.note_added_img:               // 添加附件(图片)
                pickPhotoFromAlbum();
//                showInsertPicWindow(v);   // 弹出popupWindow ,选择多种图片来源(暂时不开放)
                break;
            case R.id.note_image_tip_tv:            // 图片列表下方的文字,根据状态来改变图片列表的显示和隐藏
                if(imageListState == SHOW){
                    hideImageList();
                    imageListState = HIDE;
                }else {
                    showImageList();
                    imageListState = SHOW;
                }
                break;
//            case R.id.note_image_hide_img:
//                hideImageList();
//                break;
//            case R.id.note_image_show_img:
//                showImageList();
//                break;
            case R.id.take_photo_tv:                //拍照获取图片(该功能暂时屏蔽)
//                takePhotoFromCamera();
                insertPicWindow.dismiss();
                break;
            case R.id.album_tv:                     // 打开相册-选择图片
                pickPhotoFromAlbum();
                insertPicWindow.dismiss();
                break;
            case R.id.close_alarm_img:              // 闹钟状态栏的关闭按钮
                cancelAlarmReceiver();
                note.setNoteType(BaseNote.NOTE_TYPE_RECORD);    // 修改NOTE 的类型为 记事
                note.setAlarmState(BaseNote.NOTE_ALARM_STATE_INVALID);
                dbHelper.sava(note);
//                note.save();
                closeAlarmLayout();
                break;
            default:
                break;

        }
    }

    /**
     * 选择Alarm 日期时间的 回调方法
     * @param datePickerDialog  控件
     * @param year  选择的年份
     * @param month 选择的月份
     * @param day   选择的日期
     */
    @Override
    public void onDateSet(DatePickerDialog datePickerDialog, int year, int month, int day) {
        int realMonth = month+1;
        alarmDate.setText(year+"-"+realMonth+"-"+day);
    }

    @Override
    public void onTimeSet(RadialPickerLayout radialPickerLayout, int hourOfDay, int minute) {
        alarmTime.setText(hourOfDay+":"+minute);
    }
}


text:
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution

import json

class TipsFromUser(Choreography):

    def __init__(self, temboo_session):
        """
        Create a new instance of the TipsFromUser Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
        """
        super(TipsFromUser, self).__init__(temboo_session, '/Library/Foursquare/Users/TipsFromUser')

    def new_input_set(self):
        return TipsFromUserInputSet()

    def _make_result_set(self, result, path):
        return TipsFromUserResultSet(result, path)

    def _make_execution(self, session, exec_id, path):
        return TipsFromUserChoreographyExecution(session, exec_id, path)

class TipsFromUserInputSet(InputSet):
    """
    An InputSet with methods appropriate for specifying the inputs to the TipsFromUser
    Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
    """
    def set_Latitude(self, value):
        """
        Set the value of the Latitude input for this Choreo. ((optional, decimal) The latitude point of the user's location.)
        """
        super(TipsFromUserInputSet, self)._set_input('Latitude', value)
    def set_Limit(self, value):
        """
        Set the value of the Limit input for this Choreo. ((optional, integer) Number of results to return, up to 500.)
        """
        super(TipsFromUserInputSet, self)._set_input('Limit', value)
    def set_Longitude(self, value):
        """
        Set the value of the Longitude input for this Choreo. ((optional, decimal) The longitude point of the user's location.)
        """
        super(TipsFromUserInputSet, self)._set_input('Longitude', value)
    def set_OauthToken(self, value):
        """
        Set the value of the OauthToken input for this Choreo. ((required, string) The Foursquare API OAuth token string.)
        """
        super(TipsFromUserInputSet, self)._set_input('OauthToken', value)
    def set_Offset(self, value):
        """
        Set the value of the Offset input for this Choreo. ((optional, integer) Used to page through results.)
        """
        super(TipsFromUserInputSet, self)._set_input('Offset', value)
    def set_ResponseFormat(self, value):
        """
        Set the value of the ResponseFormat input for this Choreo. ((optional, string) The format that response should be in. Can be set to xml or json. Defaults to json.)
        """
        super(TipsFromUserInputSet, self)._set_input('ResponseFormat', value)
    def set_Sort(self, value):
        """
        Set the value of the Sort input for this Choreo. ((optional, string) Enter: recent, nearby, or popular. NEARBY requires geolat and geolong to be provided.)
        """
        super(TipsFromUserInputSet, self)._set_input('Sort', value)
    def set_UserID(self, value):
        """
        Set the value of the UserID input for this Choreo. ((optional, string) Identity of the user to get tips for. Defaults to "self" to get lists of the acting user.)
        """
        super(TipsFromUserInputSet, self)._set_input('UserID', value)

class TipsFromUserResultSet(ResultSet):
    """
    A ResultSet with methods tailored to the values returned by the TipsFromUser Choreo.
    The ResultSet object is used to retrieve the results of a Choreo execution.
    """

    def getJSONFromString(self, str):
        return json.loads(str)

    def get_Response(self):
        """
        Retrieve the value for the "Response" output from this Choreo execution. (The response from Foursquare. Corresponds to the ResponseFormat input. Defaults to JSON.)
        """
        return self._output.get('Response', None)

class TipsFromUserChoreographyExecution(ChoreographyExecution):

    def _make_result_set(self, response, path):
        return TipsFromUserResultSet(response, path)


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

package pl.acieslinski.moviefun.fragments;

import android.app.Service;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import de.greenrobot.event.EventBus;
import pl.acieslinski.moviefun.Application;
import pl.acieslinski.moviefun.R;
import pl.acieslinski.moviefun.models.Search;
import pl.acieslinski.moviefun.models.SearchEvent;
import pl.acieslinski.moviefun.utilities.SoftKeyboard;

/**
 * @author Arkadiusz Cieśliński 14.11.15.
 *         <acieslinski@gmail.com>
 */

public class SearchList extends PortableFragment {
    private static final int ANIMATION_INSERT_DURATION = 1000; // in millis

    protected SearchForm mSearchForm;
    @Bind(R.id.ll_container)
    protected LinearLayout mContainerLinearLayout;
    @Bind(R.id.rv_searches)
    protected RecyclerView mSearchesRecyclerView;
    protected SearchesAdapter mAdapter;
    protected RecyclerView.LayoutManager mLayoutManager;
    protected SoftKeyboard mSoftKeyboard;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // TODO execute in background thread
        List<Search> searches = Application.getInstance().getDatabaseManager().getSearches();
        mAdapter = new SearchesAdapter(searches);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_search_list, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        ButterKnife.bind(this, view);

        mSearchForm = (SearchForm) getChildFragmentManager().findFragmentById(R.id.fg_search_form);
        mSearchForm.setOnSearchButtonClickListener(mSearchButtonClickListener);

        mLayoutManager = new LinearLayoutManager(view.getContext());
        mSearchesRecyclerView.setLayoutManager(mLayoutManager);
        mSearchesRecyclerView.setAdapter(mAdapter);
        mSearchesRecyclerView.getItemAnimator().setAddDuration(ANIMATION_INSERT_DURATION);

        InputMethodManager inputMethodManager = (InputMethodManager) Application.getInstance().
                getApplicationContext().getSystemService(Service.INPUT_METHOD_SERVICE);
        mSoftKeyboard = new SoftKeyboard(mContainerLinearLayout, inputMethodManager);
    }

    private final View.OnClickListener mSearchButtonClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (mSearchForm.validateForm()) {
                mSoftKeyboard.closeSoftKeyboard(new SoftKeyboard.SoftKeyboardHideCallback() {
                    @Override
                    public void onSoftKeyboardHide() {
                        final Search search = mSearchForm.getSearch();

                        // TODO execute in background thread
                        if (Application.getInstance().getDatabaseManager().saveSearch(search)) {
                            mLayoutManager.smoothScrollToPosition(mSearchesRecyclerView, null, 0);
                            mAdapter.insert(search, 0);

                            mSearchesRecyclerView.postDelayed(() -> EventBus.getDefault().post(
                                    new SearchEvent(search)), ANIMATION_INSERT_DURATION);
                        } else {
                            EventBus.getDefault().post(new SearchEvent(search));
                        }
                    }
                });
            }
        }
    };

    protected class SearchesAdapter extends RecyclerView.Adapter<SearchesAdapter.ViewHolder> {
        private List<Search> mSearches;

        public SearchesAdapter(List<Search> searches) {
            mSearches = searches;
        }

        @Override
        public SearchesAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext()).inflate(
                    R.layout.fragment_search_form_research, parent, false);

            return new ViewHolder(view);
        }

        @Override
        public void onBindViewHolder(ViewHolder holder, int position) {
            Search search = mSearches.get(position);
            holder.setSearch(search);
        }

        @Override
        public int getItemCount() {
            return mSearches.size();
        }

        public void insert(Search search, final int position) {
            mSearches.add(position, search);

            if (isAdded()) {
                getActivity().runOnUiThread(() -> notifyItemInserted(position));
            }
        }

        protected class ViewHolder extends RecyclerView.ViewHolder {
            @Bind(R.id.tv_title)
            protected TextView mTitleTextView;
            @Bind(R.id.tv_details)
            protected TextView mDetailsTextView;
            @Bind(R.id.tv_date)
            protected TextView mDateTextView;
            @Bind(R.id.btn_search)
            protected ImageButton mSearchButton;

            public ViewHolder(View view) {
                super(view);

                ButterKnife.bind(this, view);
            }

            public void setSearch(final Search search) {
                mTitleTextView.setText(search.getSearch());
                mDetailsTextView.setText(search.getType().toString());

                if (!search.getYear().isEmpty()) {
                    String template = getResources().getString(R.string.details_with_year);
                    String details = mDetailsTextView.getText().toString();
                    mDetailsTextView.setText(String.format(template, details, search.getYear()));
                }

                Date date = search.getDate();
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(date);

                int month = calendar.get(Calendar.MONTH);
                int day = calendar.get(Calendar.DAY_OF_MONTH);
                String[] months = getResources().getStringArray(R.array.months);

                mDateTextView.setText(day + " " + capitalize(months[month]).substring(0, 3));

                mSearchButton.setOnClickListener((View v) -> {
                    EventBus.getDefault().post(new SearchEvent(search));
                });
            }

            private String capitalize(final String line) {
                return Character.toUpperCase(line.charAt(0)) + line.substring(1);
            }
        }
    }
}


text:
package org.redisson.connection;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import org.redisson.Config;
import org.redisson.MasterSlaveServersConfig;
import org.redisson.SingleServerConfig;
import org.redisson.client.RedisConnectionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.netty.util.concurrent.GlobalEventExecutor;
import io.netty.util.concurrent.ScheduledFuture;

public class SingleConnectionManager extends MasterSlaveConnectionManager {

    private final Logger log = LoggerFactory.getLogger(getClass());

    private final AtomicReference<InetAddress> currentMaster = new AtomicReference<InetAddress>();

    private ScheduledFuture<?> monitorFuture;

    public SingleConnectionManager(SingleServerConfig cfg, Config config) {
        MasterSlaveServersConfig newconfig = new MasterSlaveServersConfig();
        String addr = cfg.getAddress().getHost() + ":" + cfg.getAddress().getPort();
        newconfig.setRetryAttempts(cfg.getRetryAttempts());
        newconfig.setRetryInterval(cfg.getRetryInterval());
        newconfig.setTimeout(cfg.getTimeout());
        newconfig.setPingTimeout(cfg.getPingTimeout());
        newconfig.setPassword(cfg.getPassword());
        newconfig.setDatabase(cfg.getDatabase());
        newconfig.setClientName(cfg.getClientName());
        newconfig.setRefreshConnectionAfterFails(cfg.getRefreshConnectionAfterFails());
        newconfig.setMasterAddress(addr);
        newconfig.setMasterConnectionPoolSize(cfg.getConnectionPoolSize());
        newconfig.setSubscriptionsPerConnection(cfg.getSubscriptionsPerConnection());
        newconfig.setSlaveSubscriptionConnectionPoolSize(cfg.getSubscriptionConnectionPoolSize());

        init(newconfig, config);

        if (cfg.isDnsMonitoring()) {
            try {
                this.currentMaster.set(InetAddress.getByName(cfg.getAddress().getHost()));
            } catch (UnknownHostException e) {
                throw new RedisConnectionException("Unknown host", e);
            }
            log.debug("DNS monitoring enabled; Current master set to {}", currentMaster.get());
            monitorDnsChange(cfg);
        }
    }

    @Override
    protected void initEntry(MasterSlaveServersConfig config) {
        SingleEntry entry = new SingleEntry(0, MAX_SLOT, this, config);
        entry.setupMasterEntry(config.getMasterAddress().getHost(), config.getMasterAddress().getPort());
        entries.put(MAX_SLOT, entry);
    }

    private void monitorDnsChange(final SingleServerConfig cfg) {
        monitorFuture = GlobalEventExecutor.INSTANCE.scheduleWithFixedDelay(new Runnable() {
            @Override
            public void run() {
                try {
                    InetAddress master = currentMaster.get();
                    InetAddress now = InetAddress.getByName(cfg.getAddress().getHost());
                    if (!now.getHostAddress().equals(master.getHostAddress())) {
                        log.info("Detected DNS change. {} has changed from {} to {}", cfg.getAddress().getHost(), master.getHostAddress(), now.getHostAddress());
                        if (currentMaster.compareAndSet(master, now)) {
                            changeMaster(MAX_SLOT,cfg.getAddress().getHost(), cfg.getAddress().getPort());
                            log.info("Master has been changed");
                        }
                    }

                } catch (Exception e) {
                    log.error(e.getMessage(), e);
                }

            }

        }, cfg.getDnsMonitoringInterval(), cfg.getDnsMonitoringInterval(), TimeUnit.MILLISECONDS);
    }

    @Override
    public void shutdown() {
        if (monitorFuture != null) {
            monitorFuture.cancel(true);
        }
        super.shutdown();
    }
}


text:
package com.srotya.sidewinder.core.storage;

/**
 * {@link Exception} thrown when a requested item is not found. This is an
 * optimized exception therefore it doesn't capture stack trace.
 *
 * @author ambud
 */
public class ItemNotFoundException extends RejectException {

	private static final long serialVersionUID = 1L;

	public ItemNotFoundException() {
	}

	public ItemNotFoundException(String message, Throwable cause) {
		super(message, cause);
	}

	public ItemNotFoundException(String message) {
		super(message);
	}

	public ItemNotFoundException(Throwable cause) {
		super(cause);
	}

}


text:
Dupari.com

Сайт, который помогает найти себе отдых ! Благодаря функциям страны мира, вы можете посмотреть страны, их города, достопримечательности
и прочитать о них, еще вы можете посмотреть фотографии, которые сделали пользователи (ваши друзья) в instagram.

Когда вы уже определились со страной, благодаря нашему поиску вы можете найти легко и быстро найти самый дешевый билет!
Да, что там билет!!! За одно вы можете спланировать весь ваш отдых! Забронировав отель заранее, заказав трансфер от аэропорта до отеля, и
это все легко и просто!


text:
.. Extra Clang Tools documentation master file, created by
   sphinx-quickstart on Wed Feb 13 10:00:18 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

.. title:: Welcome to Extra Clang Tools's documentation!

Introduction
============
Welcome to the clang-tools-extra project which contains extra tools built using
Clang's tooling API's.

.. toctree::
   :maxdepth: 1

   ReleaseNotes

Contents
========
.. toctree::
   :maxdepth: 2

   clang-tidy/index
   include-fixer
   modularize
   pp-trace
   clang-rename
   clangd
   clang-doc

Indices and tables
==================

* :ref:`genindex`
* :ref:`search`


text:
cask 'font-aboriginal-sans' do
  version :latest
  sha256 :no_check

  url 'http://www.languagegeek.com/font/AboriginalSans.zip'
  name 'LanguageGeek Aboriginal Sans Serif'
  homepage 'http://www.languagegeek.com/font/fontdownload.html'

  font 'AboriginalSansREGULAR.ttf'
  font 'AboriginalSansBOLD.ttf'
  font 'AboriginalSansBOLDITALIC.ttf'
  font 'AboriginalSansITALIC.ttf'
end


text:
package org.elasticsearch.index.mapper;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import org.elasticsearch.Version;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.ParseFieldMatcher;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.compress.CompressedXContent;
import org.elasticsearch.common.geo.ShapesAvailability;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.AbstractIndexComponent;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.analysis.AnalysisService;
import org.elasticsearch.index.mapper.core.*;
import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper;
import org.elasticsearch.index.mapper.geo.GeoShapeFieldMapper;
import org.elasticsearch.index.mapper.internal.*;
import org.elasticsearch.index.mapper.ip.IpFieldMapper;
import org.elasticsearch.index.mapper.object.ObjectMapper;
import org.elasticsearch.index.mapper.object.RootObjectMapper;
import org.elasticsearch.index.settings.IndexSettings;
import org.elasticsearch.index.similarity.SimilarityLookupService;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptService;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

import static org.elasticsearch.index.mapper.MapperBuilders.doc;

/**
 *
 */
public class DocumentMapperParser extends AbstractIndexComponent {

    final MapperService mapperService;
    final AnalysisService analysisService;
    private static final ESLogger logger = Loggers.getLogger(DocumentMapperParser.class);
    private final SimilarityLookupService similarityLookupService;
    private final ScriptService scriptService;

    private final RootObjectMapper.TypeParser rootObjectTypeParser = new RootObjectMapper.TypeParser();

    private final Object typeParsersMutex = new Object();
    private final Version indexVersionCreated;
    private final ParseFieldMatcher parseFieldMatcher;

    private volatile ImmutableMap<String, Mapper.TypeParser> typeParsers;
    private volatile ImmutableMap<String, Mapper.TypeParser> rootTypeParsers;

    public DocumentMapperParser(Index index, @IndexSettings Settings indexSettings, MapperService mapperService, AnalysisService analysisService,
                                SimilarityLookupService similarityLookupService, ScriptService scriptService) {
        super(index, indexSettings);
        this.parseFieldMatcher = new ParseFieldMatcher(indexSettings);
        this.mapperService = mapperService;
        this.analysisService = analysisService;
        this.similarityLookupService = similarityLookupService;
        this.scriptService = scriptService;
        MapBuilder<String, Mapper.TypeParser> typeParsersBuilder = new MapBuilder<String, Mapper.TypeParser>()
                .put(ByteFieldMapper.CONTENT_TYPE, new ByteFieldMapper.TypeParser())
                .put(ShortFieldMapper.CONTENT_TYPE, new ShortFieldMapper.TypeParser())
                .put(IntegerFieldMapper.CONTENT_TYPE, new IntegerFieldMapper.TypeParser())
                .put(LongFieldMapper.CONTENT_TYPE, new LongFieldMapper.TypeParser())
                .put(FloatFieldMapper.CONTENT_TYPE, new FloatFieldMapper.TypeParser())
                .put(DoubleFieldMapper.CONTENT_TYPE, new DoubleFieldMapper.TypeParser())
                .put(BooleanFieldMapper.CONTENT_TYPE, new BooleanFieldMapper.TypeParser())
                .put(BinaryFieldMapper.CONTENT_TYPE, new BinaryFieldMapper.TypeParser())
                .put(DateFieldMapper.CONTENT_TYPE, new DateFieldMapper.TypeParser())
                .put(IpFieldMapper.CONTENT_TYPE, new IpFieldMapper.TypeParser())
                .put(StringFieldMapper.CONTENT_TYPE, new StringFieldMapper.TypeParser())
                .put(TokenCountFieldMapper.CONTENT_TYPE, new TokenCountFieldMapper.TypeParser())
                .put(ObjectMapper.CONTENT_TYPE, new ObjectMapper.TypeParser())
                .put(ObjectMapper.NESTED_CONTENT_TYPE, new ObjectMapper.TypeParser())
                .put(TypeParsers.MULTI_FIELD_CONTENT_TYPE, TypeParsers.multiFieldConverterTypeParser)
                .put(CompletionFieldMapper.CONTENT_TYPE, new CompletionFieldMapper.TypeParser())
                .put(GeoPointFieldMapper.CONTENT_TYPE, new GeoPointFieldMapper.TypeParser())
                .put(Murmur3FieldMapper.CONTENT_TYPE, new Murmur3FieldMapper.TypeParser());

        if (ShapesAvailability.JTS_AVAILABLE) {
            typeParsersBuilder.put(GeoShapeFieldMapper.CONTENT_TYPE, new GeoShapeFieldMapper.TypeParser());
        }

        typeParsers = typeParsersBuilder.immutableMap();

        rootTypeParsers = new MapBuilder<String, Mapper.TypeParser>()
                .put(SizeFieldMapper.NAME, new SizeFieldMapper.TypeParser())
                .put(IndexFieldMapper.NAME, new IndexFieldMapper.TypeParser())
                .put(SourceFieldMapper.NAME, new SourceFieldMapper.TypeParser())
                .put(TypeFieldMapper.NAME, new TypeFieldMapper.TypeParser())
                .put(AllFieldMapper.NAME, new AllFieldMapper.TypeParser())
                .put(ParentFieldMapper.NAME, new ParentFieldMapper.TypeParser())
                .put(RoutingFieldMapper.NAME, new RoutingFieldMapper.TypeParser())
                .put(TimestampFieldMapper.NAME, new TimestampFieldMapper.TypeParser())
                .put(TTLFieldMapper.NAME, new TTLFieldMapper.TypeParser())
                .put(UidFieldMapper.NAME, new UidFieldMapper.TypeParser())
                .put(VersionFieldMapper.NAME, new VersionFieldMapper.TypeParser())
                .put(IdFieldMapper.NAME, new IdFieldMapper.TypeParser())
                .put(FieldNamesFieldMapper.NAME, new FieldNamesFieldMapper.TypeParser())
                .immutableMap();
        indexVersionCreated = Version.indexCreated(indexSettings);
    }

    public void putTypeParser(String type, Mapper.TypeParser typeParser) {
        synchronized (typeParsersMutex) {
            typeParsers = new MapBuilder<>(typeParsers)
                    .put(type, typeParser)
                    .immutableMap();
        }
    }

    public void putRootTypeParser(String type, Mapper.TypeParser typeParser) {
        synchronized (typeParsersMutex) {
            rootTypeParsers = new MapBuilder<>(rootTypeParsers)
                    .put(type, typeParser)
                    .immutableMap();
        }
    }

    public Mapper.TypeParser.ParserContext parserContext() {
        return new Mapper.TypeParser.ParserContext(analysisService, similarityLookupService, mapperService, typeParsers, indexVersionCreated, parseFieldMatcher);
    }

    public DocumentMapper parse(String source) throws MapperParsingException {
        return parse(null, source);
    }

    public DocumentMapper parse(@Nullable String type, String source) throws MapperParsingException {
        return parse(type, source, null);
    }

    @SuppressWarnings({"unchecked"})
    public DocumentMapper parse(@Nullable String type, String source, String defaultSource) throws MapperParsingException {
        Map<String, Object> mapping = null;
        if (source != null) {
            Tuple<String, Map<String, Object>> t = extractMapping(type, source);
            type = t.v1();
            mapping = t.v2();
        }
        if (mapping == null) {
            mapping = Maps.newHashMap();
        }
        return parse(type, mapping, defaultSource);
    }

    public DocumentMapper parseCompressed(@Nullable String type, CompressedXContent source) throws MapperParsingException {
        return parseCompressed(type, source, null);
    }

    @SuppressWarnings({"unchecked"})
    public DocumentMapper parseCompressed(@Nullable String type, CompressedXContent source, String defaultSource) throws MapperParsingException {
        Map<String, Object> mapping = null;
        if (source != null) {
            Map<String, Object> root = XContentHelper.convertToMap(source.compressedReference(), true).v2();
            Tuple<String, Map<String, Object>> t = extractMapping(type, root);
            type = t.v1();
            mapping = t.v2();
        }
        if (mapping == null) {
            mapping = Maps.newHashMap();
        }
        return parse(type, mapping, defaultSource);
    }

    @SuppressWarnings({"unchecked"})
    private DocumentMapper parse(String type, Map<String, Object> mapping, String defaultSource) throws MapperParsingException {
        if (type == null) {
            throw new MapperParsingException("Failed to derive type");
        }

        if (defaultSource != null) {
            Tuple<String, Map<String, Object>> t = extractMapping(MapperService.DEFAULT_MAPPING, defaultSource);
            if (t.v2() != null) {
                XContentHelper.mergeDefaults(mapping, t.v2());
            }
        }

        Mapper.TypeParser.ParserContext parserContext = parserContext();
        // parse RootObjectMapper
        DocumentMapper.Builder docBuilder = doc(index.name(), indexSettings, (RootObjectMapper.Builder) rootObjectTypeParser.parse(type, mapping, parserContext), mapperService);
        Iterator<Map.Entry<String, Object>> iterator = mapping.entrySet().iterator();
        // parse DocumentMapper
        while(iterator.hasNext()) {
            Map.Entry<String, Object> entry = iterator.next();
            String fieldName = Strings.toUnderscoreCase(entry.getKey());
            Object fieldNode = entry.getValue();

            if ("transform".equals(fieldName)) {
                if (fieldNode instanceof Map) {
                    parseTransform(docBuilder, (Map<String, Object>) fieldNode, parserContext.indexVersionCreated());
                } else if (fieldNode instanceof List) {
                    for (Object transformItem: (List)fieldNode) {
                        if (!(transformItem instanceof Map)) {
                            throw new MapperParsingException("Elements of transform list must be objects but one was:  " + fieldNode);
                        }
                        parseTransform(docBuilder, (Map<String, Object>) transformItem, parserContext.indexVersionCreated());
                    }
                } else {
                    throw new MapperParsingException("Transform must be an object or an array but was:  " + fieldNode);
                }
                iterator.remove();
            } else {
                Mapper.TypeParser typeParser = rootTypeParsers.get(fieldName);
                if (typeParser != null) {
                    iterator.remove();
                    Map<String, Object> fieldNodeMap = (Map<String, Object>) fieldNode;
                    docBuilder.put((MetadataFieldMapper.Builder)typeParser.parse(fieldName, fieldNodeMap, parserContext));
                    fieldNodeMap.remove("type");
                    checkNoRemainingFields(fieldName, fieldNodeMap, parserContext.indexVersionCreated());
                }
            }
        }

        ImmutableMap<String, Object> attributes = ImmutableMap.of();
        if (mapping.containsKey("_meta")) {
            attributes = ImmutableMap.copyOf((Map<String, Object>) mapping.remove("_meta"));
        }
        docBuilder.meta(attributes);

        checkNoRemainingFields(mapping, parserContext.indexVersionCreated(), "Root mapping definition has unsupported parameters: ");

        return docBuilder.build(mapperService, this);
    }

    public static void checkNoRemainingFields(String fieldName, Map<String, Object> fieldNodeMap, Version indexVersionCreated) {
        checkNoRemainingFields(fieldNodeMap, indexVersionCreated, "Mapping definition for [" + fieldName + "] has unsupported parameters: ");
    }

    public static void checkNoRemainingFields(Map<String, Object> fieldNodeMap, Version indexVersionCreated, String message) {
        if (!fieldNodeMap.isEmpty()) {
            if (indexVersionCreated.onOrAfter(Version.V_2_0_0_beta1)) {
                throw new MapperParsingException(message + getRemainingFields(fieldNodeMap));
            } else {
                logger.debug(message + "{}", getRemainingFields(fieldNodeMap));
            }
        }
    }

    private static String getRemainingFields(Map<String, ?> map) {
        StringBuilder remainingFields = new StringBuilder();
        for (String key : map.keySet()) {
            remainingFields.append(" [").append(key).append(" : ").append(map.get(key)).append("]");
        }
        return remainingFields.toString();
    }

    private void parseTransform(DocumentMapper.Builder docBuilder, Map<String, Object> transformConfig, Version indexVersionCreated) {
        Script script = Script.parse(transformConfig, true, parseFieldMatcher);
        if (script != null) {
            docBuilder.transform(scriptService, script);
        }
        checkNoRemainingFields(transformConfig, indexVersionCreated, "Transform config has unsupported parameters: ");
    }

    private Tuple<String, Map<String, Object>> extractMapping(String type, String source) throws MapperParsingException {
        Map<String, Object> root;
        try (XContentParser parser = XContentFactory.xContent(source).createParser(source)) {
            root = parser.mapOrdered();
        } catch (Exception e) {
            throw new MapperParsingException("failed to parse mapping definition", e);
        }
        return extractMapping(type, root);
    }

    @SuppressWarnings({"unchecked"})
    private Tuple<String, Map<String, Object>> extractMapping(String type, Map<String, Object> root) throws MapperParsingException {
        if (root.size() == 0) {
            // if we don't have any keys throw an exception
            throw new MapperParsingException("malformed mapping no root object found");
        }
        String rootName = root.keySet().iterator().next();
        Tuple<String, Map<String, Object>> mapping;
        if (type == null || type.equals(rootName)) {
            mapping = new Tuple<>(rootName, (Map<String, Object>) root.get(rootName));
        } else {
            mapping = new Tuple<>(type, root);
        }
        return mapping;
    }
}


text:
<?php

namespace Magento\Bundle\Test\Constraint;

use Magento\Bundle\Test\Fixture\BundleProduct;
use Magento\Catalog\Test\Page\Product\CatalogProductView;
use Mtf\Client\Browser;
use Mtf\Constraint\AbstractConstraint;

/**
 * Class AssertBundlePriceView
 */
class AssertBundlePriceView extends AbstractConstraint
{
    /* tags */
    const SEVERITY = 'low';
    /* end tags */

    /**
     * Assert that displayed price view for bundle product on product page equals passed from fixture.
     *
     * @param CatalogProductView $catalogProductView
     * @param Browser $browser
     * @param BundleProduct $product
     * @return void
     */
    public function processAssert(
        CatalogProductView $catalogProductView,
        Browser $browser,
        BundleProduct $product
    ) {
        //Open product view page
        $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');

        //Process assertions
        $this->assertPrice($product, $catalogProductView);
    }

    /**
     * Assert prices on the product view Page
     *
     * @param BundleProduct $product
     * @param CatalogProductView $catalogProductView
     * @return void
     */
    protected function assertPrice(BundleProduct $product, CatalogProductView $catalogProductView)
    {
        $priceData = $product->getDataFieldConfig('price')['source']->getPreset();
        $priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();

        $priceLow = ($product->getPriceView() == 'Price Range')
            ? $priceBlock->getPriceFrom()
            : $priceBlock->getRegularPrice();

        \PHPUnit_Framework_Assert::assertEquals(
            $priceData['price_from'],
            $priceLow,
            'Bundle price From on product view page is not correct.'
        );

        if ($product->getPriceView() == 'Price Range') {
            \PHPUnit_Framework_Assert::assertEquals(
                $priceData['price_to'],
                $priceBlock->getPriceTo(),
                'Bundle price To on product view page is not correct.'
            );
        }
    }

    /**
     * Returns a string representation of the object
     *
     * @return string
     */
    public function toString()
    {
        return 'Bundle price on product view page is not correct.';
    }
}