text:
package com.sun.jini.test.spec.url.file.integrity;

// com.sun.jini.qa.harness
import com.sun.jini.qa.harness.QAConfig; // base class for QAConfig

// java.util
import java.util.logging.Level;

// davis packages
import net.jini.url.file.FileIntegrityVerifier;

// Abstract ProvidesIntegrity Test
import com.sun.jini.test.spec.url.util.AbstractProvidesIntegrity;

/**
 *

 *
 * Purpose:
 *   This test verifies the behavior of the
 *   {@link FileIntegrityVerifier#providesIntegrity(URL)} method.
 *   {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *   should return:
 *     true   if the specified URL uses the "file" protocol and
 *            the host is null, empty, "~", or "localhost";
 *     false  otherwise.
 *   The method throws:
 *     {@link NullPointerException} - if the URL is null
 *
 * Test Cases:
 *   This test invokes
 *   {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *   with different URL objects.
 *   The cases:
 *     - testcase1: (FILE URL object)
 *         protocol of URL: {@link #tc1_prot}
 *         host     of URL: {@link #tc1_host}
 *         file     of URL: {@link #tc1_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc1_expected}.
 *     - testcase2: (FILE URL object)
 *         protocol of URL: {@link #tc2_prot}
 *         host     of URL: {@link #tc2_host}
 *         file     of URL: {@link #tc2_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc2_expected}.
 *     - testcase3: (FILE URL object)
 *         protocol of URL: {@link #tc3_prot}
 *         host     of URL: {@link #tc3_host}
 *         file     of URL: {@link #tc3_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc3_expected}.
 *     - testcase4: (FILE URL object)
 *         protocol of URL: {@link #tc4_prot}
 *         host     of URL: {@link #tc4_host}
 *         file     of URL: {@link #tc4_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc4_expected}.
 *     - testcase5: (FILE URL object)
 *         protocol of URL: {@link #tc5_prot}
 *         host     of URL: {@link #tc5_host}
 *         file     of URL: {@link #tc5_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc5_expected}.
 *     - testcase6: (HTTPMD URL object)
 *         protocol of URL: {@link #tc6_prot}
 *         host     of URL: {@link #tc6_host}
 *         file     of URL: {@link #tc6_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc6_expected}.
 *     - testcase7: (HTTPS URL object)
 *         protocol of URL: {@link #tc7_prot}
 *         host     of URL: {@link #tc7_host}
 *         file     of URL: {@link #tc7_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc7_expected}.
 *     - testcase8: (HTTP URL object)
 *         protocol of URL: {@link #tc8_prot}
 *         host     of URL: {@link #tc8_host}
 *         file     of URL: {@link #tc8_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       returns {@link #tc8_expected}.
 *     - testcase9: (URL object = null)
 *         protocol of URL: {@link #tc9_prot}
 *         host     of URL: {@link #tc9_host}
 *         file     of URL: {@link #tc9_file}
 *       It's expected that
 *       {@link FileIntegrityVerifier#providesIntegrity(URL)} method
 *       throws {@link #tc9_expected}.
 *
 * Infrastructure:
 *     - {@link AbstractProvidesIntegrity}
 *         abstract class that is extended by {@link ProvidesIntegrity} class
 *     - {@link com.sun.jini.test.spec.url.util.AbstractProvidesIntegrity.TestItem}
 *         auxiliary class that describes a Test Case
 *     - {@link ProvidesIntegrity}
 *         performs actions
 *
 * Actions:
 *   Jini Harness does the following before running the test:
 *     - setting java.protocol.handler.pkgs property to
 *       net.jini.url to enable HTTPMD urls creating
 *       ({@link net.jini.url.httpmd.Handler} is used as HTTPMD Protocol
 *       handler).
 *   Test performs the following steps:
 *     - creating {@link FileIntegrityVerifier} object,
 *     - in each Test Case the test does the following:
 *       1) constructing a
 *          {@link com.sun.jini.test.spec.url.util.AbstractProvidesIntegrity.TestItem}
 *          object,
 *       2) invoking
 *          {@link FileIntegrityVerifier#providesIntegrity(URL)}
 *          method for the specified URL object,
 *       3) comparing
 *          {@link FileIntegrityVerifier#providesIntegrity(URL)}
 *          result (true, false or exception) with the expected result from
 *          the
 *          {@link com.sun.jini.test.spec.url.util.AbstractProvidesIntegrity.TestItem}
 *          object.
 *
 *

 */
public class ProvidesIntegrity extends AbstractProvidesIntegrity {

    /**
     * Protocol for test case 1.
     */
    protected static final String tc1_prot = "file";

    /**
     * Host for test case 1.
     */
    protected static final String tc1_host = null;

    /**
     * File for test case 1.
     */
    protected static final String tc1_file = "/file.jar";

    /**
     * Expected result for test case 1.
     */
    protected static final String tc1_expected = "true";

    /**
     * Protocol for test case 2.
     */
    protected static final String tc2_prot = "file";

    /**
     * Host for test case 2.
     */
    protected static final String tc2_host = "";

    /**
     * File for test case 2.
     */
    protected static final String tc2_file = "/file.jar";

    /**
     * Expected result for test case 2.
     */
    protected static final String tc2_expected = "true";

    /**
     * Protocol for test case 3.
     */
    protected static final String tc3_prot = "file";

    /**
     * Host for test case 3.
     */
    protected static final String tc3_host = "~";

    /**
     * File for test case 3.
     */
    protected static final String tc3_file = "/file.jar";

    /**
     * Expected result for test case 3.
     */
    protected static final String tc3_expected = "true";

    /**
     * Protocol for test case 4.
     */
    protected static final String tc4_prot = "file";

    /**
     * Host for test case 4.
     */
    protected static final String tc4_host = "localhost";

    /**
     * File for test case 4.
     */
    protected static final String tc4_file = "/file.jar";

    /**
     * Expected result for test case 4.
     */
    protected static final String tc4_expected = "true";

    /**
     * Protocol for test case 5.
     */
    protected static final String tc5_prot = "file";

    /**
     * Host for test case 5.
     */
    protected static final String tc5_host = "remotehost";

    /**
     * File for test case 5.
     */
    protected static final String tc5_file = "/file.jar";

    /**
     * Expected result for test case 5.
     */
    protected static final String tc5_expected = "false";

    /**
     * Protocol for test case 6.
     */
    protected static final String tc6_prot = "httpmd";

    /**
     * Host for test case 6.
     */
    protected static final String tc6_host = "remotehost";

    /**
     * File for test case 6.
     */
    protected static final String tc6_file =
            "/file.jar;md5=abcdefABCDEF0123456789";

    /**
     * Expected result for test case 6.
     */
    protected static final String tc6_expected = "false";

    /**
     * Protocol for test case 7.
     */
    protected static final String tc7_prot = "https";

    /**
     * Host for test case 7.
     */
    protected static final String tc7_host = "remotehost";

    /**
     * File for test case 7.
     */
    protected static final String tc7_file = "/file.jar";

    /**
     * Expected result for test case 7.
     */
    protected static final String tc7_expected = "false";

    /**
     * Protocol for test case 8.
     */
    protected static final String tc8_prot = "http";

    /**
     * Host for test case 8.
     */
    protected static final String tc8_host = "remotehost";

    /**
     * File for test case 8.
     */
    protected static final String tc8_file = "/file.jar";

    /**
     * Expected result for test case 8.
     */
    protected static final String tc8_expected = "false";

    /**
     * Protocol for test case 9.
     */
    protected static final String tc9_prot = null;

    /**
     * Host for test case 9.
     */
    protected static final String tc9_host = null;

    /**
     * File for test case 9.
     */
    protected static final String tc9_file = null;

    /**
     * Expected result for test case 9.
     */
    protected static final String tc9_expected =
            "java.lang.NullPointerException.class";

    /**
     * Test Cases Protocols.
     */
    protected static final String[] tc_prot = {
                                               tc1_prot,
                                               tc2_prot,
                                               tc3_prot,
                                               tc4_prot,
                                               tc5_prot,
                                               tc6_prot,
                                               tc7_prot,
                                               tc8_prot,
                                               tc9_prot
                                             };

    /**
     * Test Cases Hosts.
     */
    protected static final String[] tc_host = {
                                               tc1_host,
                                               tc2_host,
                                               tc3_host,
                                               tc4_host,
                                               tc5_host,
                                               tc6_host,
                                               tc7_host,
                                               tc8_host,
                                               tc9_host
                                             };

    /**
     * Test Cases Files.
     */
    protected static final String[] tc_file = {
                                               tc1_file,
                                               tc2_file,
                                               tc3_file,
                                               tc4_file,
                                               tc5_file,
                                               tc6_file,
                                               tc7_file,
                                               tc8_file,
                                               tc9_file
                                             };

    /**
     * Test Cases expected results.
     */
    protected static final String[] tc_expected = {
                                                    tc1_expected,
                                                    tc2_expected,
                                                    tc3_expected,
                                                    tc4_expected,
                                                    tc5_expected,
                                                    tc6_expected,
                                                    tc7_expected,
                                                    tc8_expected,
                                                    tc9_expected
                                                  };

    /**
     * {@link FileIntegrityVerifier FileIntegrityVerifier} object.
     */
    protected static final FileIntegrityVerifier verifier = new
            FileIntegrityVerifier();

    /**
     *

     * This method performs all preparations.
     * These preparations include the following:
     *   - creating
     *     {@link com.sun.jini.test.spec.url.util.AbstractProvidesIntegrity.TestItem}
     *     object for each test case.
     * Test parameters:
     *    - protocol of {@link java.net.URL URL} object,
     *    - host of {@link java.net.URL URL} object,
     *    - file of {@link java.net.URL URL} object,
     *    - expected result (boolean value or Exception class).
     *

     */
    public void setup(QAConfig config) throws Exception {
        /* Creating TestItem objects */
        for (int i = 0; i < tc_prot.length; i++) {
            items.add(i, new TestItem("TestCase" + (i + 1),
                                      tc_prot[i],
                                      tc_host[i],
                                      tc_file[i],
                                      tc_expected[i]));
        }
    }

    /**
     * Checking test assertion.
     * Invoking
     * {@link FileIntegrityVerifier#providesIntegrity(URL)},
     * and comparing the returned boolean value (or thrown Exception) with
     * the expected result.
     *
     * @param ti {@link com.sun.jini.test.spec.url.util.AbstractProvidesIntegrity.TestItem}
     *           object that descibes a Test Case
     * @return true (if the returned result is equal to
     *         the expected one) or false otherwise
     */
    public boolean checker(TestItem ti) {
        try {
            logger.log(Level.FINE, "providesIntegrity(" + ti.getURL() + ")");
            logger.log(Level.FINE,
                    "Protocol of URL: " + ti.getURL().getProtocol());
            logger.log(Level.FINE, "Host     of URL: " + ti.getURL().getHost());
            boolean realRes = verifier.providesIntegrity(ti.getURL());

            /* Comparing boolean values */
            return ti.compare(realRes);
        } catch (Exception e) {

            /* Comparing 2 Exception objects */
            return ti.compare(e);
        }
    }
}


text:
package me.vilsol.nmswrapper.wraps.unparsed;

import me.vilsol.nmswrapper.*;
import me.vilsol.nmswrapper.reflections.*;
import me.vilsol.nmswrapper.wraps.*;

@ReflectiveClass(name = "ItemBow")
public class NMSItemBow extends NMSItem {

    public NMSItemBow(Object nmsObject){
        super(nmsObject);
    }

    /**
     * TODO Find correct name
     * @see net.minecraft.server.v1_9_R1.ItemBow#a(net.minecraft.server.v1_9_R1.ItemStack, net.minecraft.server.v1_9_R1.World, net.minecraft.server.v1_9_R1.EntityHuman)
     */
    @ReflectiveMethod(name = "a", types = {NMSItemStack.class, NMSWorld.class, NMSEntityHuman.class})
    public NMSItemStack a(NMSItemStack itemStack, NMSWorld world, NMSEntityHuman entityHuman){
        return new NMSItemStack(NMSWrapper.getInstance().exec(nmsObject, itemStack, world, entityHuman));
    }

    /**
     * TODO Find correct name
     * @see net.minecraft.server.v1_9_R1.ItemBow#b()
     */
    @ReflectiveMethod(name = "b", types = {})
    public int b(){
        return (int) NMSWrapper.getInstance().exec(nmsObject);
    }

    /**
     * TODO Find correct name
     * @see net.minecraft.server.v1_9_R1.ItemBow#d(net.minecraft.server.v1_9_R1.ItemStack)
     */
    @ReflectiveMethod(name = "d", types = {NMSItemStack.class})
    public int d(NMSItemStack itemStack){
        return (int) NMSWrapper.getInstance().exec(nmsObject, itemStack);
    }

    /**
     * TODO Find correct name
     * @see net.minecraft.server.v1_9_R1.ItemBow#e(net.minecraft.server.v1_9_R1.ItemStack)
     */
    @ReflectiveMethod(name = "e", types = {NMSItemStack.class})
    public NMSEnumAnimation e(NMSItemStack itemStack){
        return new NMSEnumAnimation(NMSWrapper.getInstance().exec(nmsObject, itemStack));
    }

}

redpajama_set_name: RedPajamaGithub


text:
Ember.Handlebars.registerBoundHelper('currentPlayerIcon', function (a, b, options) {
  if (a == b) {
    return new Handlebars.SafeString('

');
  } else {
    return '';
  }
});


text:
package org.apache.spark.sql.kafka010

import java.{util => ju}
import java.io._
import java.nio.charset.StandardCharsets

import org.apache.commons.io.IOUtils
import org.apache.kafka.common.TopicPartition

import org.apache.spark.SparkEnv
import org.apache.spark.internal.Logging
import org.apache.spark.scheduler.ExecutorCacheTaskLocation
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.UnsafeRow
import org.apache.spark.sql.execution.streaming.{HDFSMetadataLog, SerializedOffset, SimpleStreamingScanConfig, SimpleStreamingScanConfigBuilder}
import org.apache.spark.sql.execution.streaming.sources.RateControlMicroBatchReadSupport
import org.apache.spark.sql.kafka010.KafkaSourceProvider.{INSTRUCTION_FOR_FAIL_ON_DATA_LOSS_FALSE, INSTRUCTION_FOR_FAIL_ON_DATA_LOSS_TRUE}
import org.apache.spark.sql.sources.v2.{CustomMetrics, DataSourceOptions}
import org.apache.spark.sql.sources.v2.reader._
import org.apache.spark.sql.sources.v2.reader.streaming.{MicroBatchReadSupport, Offset, SupportsCustomReaderMetrics}
import org.apache.spark.sql.types.StructType
import org.apache.spark.util.UninterruptibleThread

/**
 * A [[MicroBatchReadSupport]] that reads data from Kafka.
 *
 * The [[KafkaSourceOffset]] is the custom [[Offset]] defined for this source that contains
 * a map of TopicPartition -> offset. Note that this offset is 1 + (available offset). For
 * example if the last record in a Kafka topic "t", partition 2 is offset 5, then
 * KafkaSourceOffset will contain TopicPartition("t", 2) -> 6. This is done keep it consistent
 * with the semantics of `KafkaConsumer.position()`.
 *
 * Zero data lost is not guaranteed when topics are deleted. If zero data lost is critical, the user
 * must make sure all messages in a topic have been processed when deleting a topic.
 *
 * There is a known issue caused by KAFKA-1894: the query using Kafka maybe cannot be stopped.
 * To avoid this issue, you should make sure stopping the query before stopping the Kafka brokers
 * and not use wrong broker addresses.
 */
private[kafka010] class KafkaMicroBatchReadSupport(
    kafkaOffsetReader: KafkaOffsetReader,
    executorKafkaParams: ju.Map[String, Object],
    options: DataSourceOptions,
    metadataPath: String,
    startingOffsets: KafkaOffsetRangeLimit,
    failOnDataLoss: Boolean)
  extends RateControlMicroBatchReadSupport with SupportsCustomReaderMetrics with Logging {

  private val pollTimeoutMs = options.getLong(
    "kafkaConsumer.pollTimeoutMs",
    SparkEnv.get.conf.getTimeAsSeconds("spark.network.timeout", "120s") * 1000L)

  private val maxOffsetsPerTrigger =
    Option(options.get("maxOffsetsPerTrigger").orElse(null)).map(_.toLong)

  private val rangeCalculator = KafkaOffsetRangeCalculator(options)

  private var endPartitionOffsets: KafkaSourceOffset = _

  /**
   * Lazily initialize `initialPartitionOffsets` to make sure that `KafkaConsumer.poll` is only
   * called in StreamExecutionThread. Otherwise, interrupting a thread while running
   * `KafkaConsumer.poll` may hang forever (KAFKA-1894).
   */
  override def initialOffset(): Offset = {
    KafkaSourceOffset(getOrCreateInitialPartitionOffsets())
  }

  override def latestOffset(start: Offset): Offset = {
    val startPartitionOffsets = start.asInstanceOf[KafkaSourceOffset].partitionToOffsets
    val latestPartitionOffsets = kafkaOffsetReader.fetchLatestOffsets()
    endPartitionOffsets = KafkaSourceOffset(maxOffsetsPerTrigger.map { maxOffsets =>
      rateLimit(maxOffsets, startPartitionOffsets, latestPartitionOffsets)
    }.getOrElse {
      latestPartitionOffsets
    })
    endPartitionOffsets
  }

  override def fullSchema(): StructType = KafkaOffsetReader.kafkaSchema

  override def newScanConfigBuilder(start: Offset, end: Offset): ScanConfigBuilder = {
    new SimpleStreamingScanConfigBuilder(fullSchema(), start, Some(end))
  }

  override def planInputPartitions(config: ScanConfig): Array[InputPartition] = {
    val sc = config.asInstanceOf[SimpleStreamingScanConfig]
    val startPartitionOffsets = sc.start.asInstanceOf[KafkaSourceOffset].partitionToOffsets
    val endPartitionOffsets = sc.end.get.asInstanceOf[KafkaSourceOffset].partitionToOffsets

    // Find the new partitions, and get their earliest offsets
    val newPartitions = endPartitionOffsets.keySet.diff(startPartitionOffsets.keySet)
    val newPartitionInitialOffsets = kafkaOffsetReader.fetchEarliestOffsets(newPartitions.toSeq)
    if (newPartitionInitialOffsets.keySet != newPartitions) {
      // We cannot get from offsets for some partitions. It means they got deleted.
      val deletedPartitions = newPartitions.diff(newPartitionInitialOffsets.keySet)
      reportDataLoss(
        s"Cannot find earliest offsets of ${deletedPartitions}. Some data may have been missed")
    }
    logInfo(s"Partitions added: $newPartitionInitialOffsets")
    newPartitionInitialOffsets.filter(_._2 != 0).foreach { case (p, o) =>
      reportDataLoss(
        s"Added partition $p starts from $o instead of 0. Some data may have been missed")
    }

    // Find deleted partitions, and report data loss if required
    val deletedPartitions = startPartitionOffsets.keySet.diff(endPartitionOffsets.keySet)
    if (deletedPartitions.nonEmpty) {
      reportDataLoss(s"$deletedPartitions are gone. Some data may have been missed")
    }

    // Use the end partitions to calculate offset ranges to ignore partitions that have
    // been deleted
    val topicPartitions = endPartitionOffsets.keySet.filter { tp =>
      // Ignore partitions that we don't know the from offsets.
      newPartitionInitialOffsets.contains(tp) || startPartitionOffsets.contains(tp)
    }.toSeq
    logDebug("TopicPartitions: " + topicPartitions.mkString(", "))

    // Calculate offset ranges
    val offsetRanges = rangeCalculator.getRanges(
      fromOffsets = startPartitionOffsets ++ newPartitionInitialOffsets,
      untilOffsets = endPartitionOffsets,
      executorLocations = getSortedExecutorList())

    // Reuse Kafka consumers only when all the offset ranges have distinct TopicPartitions,
    // that is, concurrent tasks will not read the same TopicPartitions.
    val reuseKafkaConsumer = offsetRanges.map(_.topicPartition).toSet.size == offsetRanges.size

    // Generate factories based on the offset ranges
    offsetRanges.map { range =>
      KafkaMicroBatchInputPartition(
        range, executorKafkaParams, pollTimeoutMs, failOnDataLoss, reuseKafkaConsumer)
    }.toArray
  }

  override def createReaderFactory(config: ScanConfig): PartitionReaderFactory = {
    KafkaMicroBatchReaderFactory
  }

  // TODO: figure out the life cycle of custom metrics, and make this method take `ScanConfig` as
  // a parameter.
  override def getCustomMetrics(): CustomMetrics = {
    KafkaCustomMetrics(
      kafkaOffsetReader.fetchLatestOffsets(), endPartitionOffsets.partitionToOffsets)
  }

  override def deserializeOffset(json: String): Offset = {
    KafkaSourceOffset(JsonUtils.partitionOffsets(json))
  }

  override def commit(end: Offset): Unit = {}

  override def stop(): Unit = {
    kafkaOffsetReader.close()
  }

  override def toString(): String = s"KafkaV2[$kafkaOffsetReader]"

  /**
   * Read initial partition offsets from the checkpoint, or decide the offsets and write them to
   * the checkpoint.
   */
  private def getOrCreateInitialPartitionOffsets(): PartitionOffsetMap = {
    // Make sure that `KafkaConsumer.poll` is only called in StreamExecutionThread.
    // Otherwise, interrupting a thread while running `KafkaConsumer.poll` may hang forever
    // (KAFKA-1894).
    assert(Thread.currentThread().isInstanceOf[UninterruptibleThread])

    // SparkSession is required for getting Hadoop configuration for writing to checkpoints
    assert(SparkSession.getActiveSession.nonEmpty)

    val metadataLog =
      new KafkaSourceInitialOffsetWriter(SparkSession.getActiveSession.get, metadataPath)
    metadataLog.get(0).getOrElse {
      val offsets = startingOffsets match {
        case EarliestOffsetRangeLimit =>
          KafkaSourceOffset(kafkaOffsetReader.fetchEarliestOffsets())
        case LatestOffsetRangeLimit =>
          KafkaSourceOffset(kafkaOffsetReader.fetchLatestOffsets())
        case SpecificOffsetRangeLimit(p) =>
          kafkaOffsetReader.fetchSpecificOffsets(p, reportDataLoss)
      }
      metadataLog.add(0, offsets)
      logInfo(s"Initial offsets: $offsets")
      offsets
    }.partitionToOffsets
  }

  /** Proportionally distribute limit number of offsets among topicpartitions */
  private def rateLimit(
      limit: Long,
      from: PartitionOffsetMap,
      until: PartitionOffsetMap): PartitionOffsetMap = {
    val fromNew = kafkaOffsetReader.fetchEarliestOffsets(until.keySet.diff(from.keySet).toSeq)
    val sizes = until.flatMap {
      case (tp, end) =>
        // If begin isn't defined, something's wrong, but let alert logic in getBatch handle it
        from.get(tp).orElse(fromNew.get(tp)).flatMap { begin =>
          val size = end - begin
          logDebug(s"rateLimit $tp size is $size")
          if (size > 0) Some(tp -> size) else None
        }
    }
    val total = sizes.values.sum.toDouble
    if (total < 1) {
      until
    } else {
      until.map {
        case (tp, end) =>
          tp -> sizes.get(tp).map { size =>
            val begin = from.get(tp).getOrElse(fromNew(tp))
            val prorate = limit * (size / total)
            // Don't completely starve small topicpartitions
            val off = begin + (if (prorate < 1) Math.ceil(prorate) else Math.floor(prorate)).toLong
            // Paranoia, make sure not to return an offset that's past end
            Math.min(end, off)
          }.getOrElse(end)
      }
    }
  }

  private def getSortedExecutorList(): Array[String] = {

    def compare(a: ExecutorCacheTaskLocation, b: ExecutorCacheTaskLocation): Boolean = {
      if (a.host == b.host) {
        a.executorId > b.executorId
      } else {
        a.host > b.host
      }
    }

    val bm = SparkEnv.get.blockManager
    bm.master.getPeers(bm.blockManagerId).toArray
      .map(x => ExecutorCacheTaskLocation(x.host, x.executorId))
      .sortWith(compare)
      .map(_.toString)
  }

  /**
   * If `failOnDataLoss` is true, this method will throw an `IllegalStateException`.
   * Otherwise, just log a warning.
   */
  private def reportDataLoss(message: String): Unit = {
    if (failOnDataLoss) {
      throw new IllegalStateException(message + s". $INSTRUCTION_FOR_FAIL_ON_DATA_LOSS_TRUE")
    } else {
      logWarning(message + s". $INSTRUCTION_FOR_FAIL_ON_DATA_LOSS_FALSE")
    }
  }

  /** A version of [[HDFSMetadataLog]] specialized for saving the initial offsets. */
  class KafkaSourceInitialOffsetWriter(sparkSession: SparkSession, metadataPath: String)
    extends HDFSMetadataLog[KafkaSourceOffset](sparkSession, metadataPath) {

    val VERSION = 1

    override def serialize(metadata: KafkaSourceOffset, out: OutputStream): Unit = {
      out.write(0) // A zero byte is written to support Spark 2.1.0 (SPARK-19517)
      val writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))
      writer.write("v" + VERSION + "\n")
      writer.write(metadata.json)
      writer.flush
    }

    override def deserialize(in: InputStream): KafkaSourceOffset = {
      in.read() // A zero byte is read to support Spark 2.1.0 (SPARK-19517)
      val content = IOUtils.toString(new InputStreamReader(in, StandardCharsets.UTF_8))
      // HDFSMetadataLog guarantees that it never creates a partial file.
      assert(content.length != 0)
      if (content(0) == 'v') {
        val indexOfNewLine = content.indexOf("\n")
        if (indexOfNewLine > 0) {
          val version = parseVersion(content.substring(0, indexOfNewLine), VERSION)
          KafkaSourceOffset(SerializedOffset(content.substring(indexOfNewLine + 1)))
        } else {
          throw new IllegalStateException(
            s"Log file was malformed: failed to detect the log file version line.")
        }
      } else {
        // The log was generated by Spark 2.1.0
        KafkaSourceOffset(SerializedOffset(content))
      }
    }
  }
}

/** A [[InputPartition]] for reading Kafka data in a micro-batch streaming query. */
private[kafka010] case class KafkaMicroBatchInputPartition(
    offsetRange: KafkaOffsetRange,
    executorKafkaParams: ju.Map[String, Object],
    pollTimeoutMs: Long,
    failOnDataLoss: Boolean,
    reuseKafkaConsumer: Boolean) extends InputPartition

private[kafka010] object KafkaMicroBatchReaderFactory extends PartitionReaderFactory {
  override def createReader(partition: InputPartition): PartitionReader[InternalRow] = {
    val p = partition.asInstanceOf[KafkaMicroBatchInputPartition]
    KafkaMicroBatchPartitionReader(p.offsetRange, p.executorKafkaParams, p.pollTimeoutMs,
      p.failOnDataLoss, p.reuseKafkaConsumer)
  }
}

/** A [[PartitionReader]] for reading Kafka data in a micro-batch streaming query. */
private[kafka010] case class KafkaMicroBatchPartitionReader(
    offsetRange: KafkaOffsetRange,
    executorKafkaParams: ju.Map[String, Object],
    pollTimeoutMs: Long,
    failOnDataLoss: Boolean,
    reuseKafkaConsumer: Boolean) extends PartitionReader[InternalRow] with Logging {

  private val consumer = KafkaDataConsumer.acquire(
    offsetRange.topicPartition, executorKafkaParams, reuseKafkaConsumer)

  private val rangeToRead = resolveRange(offsetRange)
  private val converter = new KafkaRecordToUnsafeRowConverter

  private var nextOffset = rangeToRead.fromOffset
  private var nextRow: UnsafeRow = _

  override def next(): Boolean = {
    if (nextOffset < rangeToRead.untilOffset) {
      val record = consumer.get(nextOffset, rangeToRead.untilOffset, pollTimeoutMs, failOnDataLoss)
      if (record != null) {
        nextRow = converter.toUnsafeRow(record)
        nextOffset = record.offset + 1
        true
      } else {
        false
      }
    } else {
      false
    }
  }

  override def get(): UnsafeRow = {
    assert(nextRow != null)
    nextRow
  }

  override def close(): Unit = {
    consumer.release()
  }

  private def resolveRange(range: KafkaOffsetRange): KafkaOffsetRange = {
    if (range.fromOffset < 0 || range.untilOffset < 0) {
      // Late bind the offset range
      val availableOffsetRange = consumer.getAvailableOffsetRange()
      val fromOffset = if (range.fromOffset < 0) {
        assert(range.fromOffset == KafkaOffsetRangeLimit.EARLIEST,
          s"earliest offset ${range.fromOffset} does not equal ${KafkaOffsetRangeLimit.EARLIEST}")
        availableOffsetRange.earliest
      } else {
        range.fromOffset
      }
      val untilOffset = if (range.untilOffset < 0) {
        assert(range.untilOffset == KafkaOffsetRangeLimit.LATEST,
          s"latest offset ${range.untilOffset} does not equal ${KafkaOffsetRangeLimit.LATEST}")
        availableOffsetRange.latest
      } else {
        range.untilOffset
      }
      KafkaOffsetRange(range.topicPartition, fromOffset, untilOffset, None)
    } else {
      range
    }
  }
}

/**
 * Currently reports per topic-partition lag.
 * This is the difference between the offset of the latest available data
 * in a topic-partition and the latest offset that has been processed.
 */
private[kafka010] case class KafkaCustomMetrics(
    latestOffsets: Map[TopicPartition, Long],
    processedOffsets: Map[TopicPartition, Long]) extends CustomMetrics {
  override def json(): String = {
    JsonUtils.partitionLags(latestOffsets, processedOffsets)
  }

  override def toString: String = json()
}


text:
function updateConfig(e) {
    e.preventDefault();
    $("#alert").removeClass("alert").removeClass("alert-danger").html("");
    var sqlNoOfRows = $("#sqlNoOfRows").val();
    var sqlToExecute = $("#sql").val();
    var viewName = $("#name").val();
    var activityName = $("#activity").val();
    var id = $("#vId").val();
    var sqlOrderBy = $("#sqlOrderBy").val();
    var noOfRowsPerPage = $("#noOfRowsPerPage").val();
    var currentFiltersCleared = $("#currentFiltersCleared").val();
    var proceed = true;
    if (viewName === '') {
        $("#alert").addClass("alert").addClass("alert-danger").html('Invalid View Name');
        proceed = false;
    }
    if (sqlToExecute === '') {
        $("#alert").addClass("alert").addClass("alert-danger").html('Invalid Sql Statement');
        proceed = false;
    }
    if (proceed) {
        var url = $("#btnUpdateConfig").data("url");
        $.ajax({
            url: url,
            method: "POST",
            data: { activityName: activityName, sqlNoOfRows: sqlNoOfRows, sqlToExecute: sqlToExecute, viewName: viewName, id: id, sqlOrderBy: sqlOrderBy, noOfRowsPerPage: noOfRowsPerPage, viewFilterParameters: selectedConditions, currentFiltersCleared: currentFiltersCleared },
            success: function (data, textStatus, jqXHR) {
                if (data.Success === true) {
                    loadActivityView(data.Data);
                    $("#notif").addClass("alert").addClass("alert-success").removeClass("alert-danger").html('View Created Successfully');
                    $("#bamModal").modal("hide");
                } else {
                    $("#alert").addClass("alert").addClass("alert-danger").html(data.Error);
                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert('unexpected error.');
            }
        });
    }
}

function addCondition(event) {
    event.preventDefault();

    var paramName = $('#parameter').val();
    var paramType = $('#type').val();
    var displayName = $('#displayName').val();
    var counter = selectedConditions.length + 1;
    var data = { "Name": paramName, "DisplayName": displayName, "ParameterType": paramType };

    if ($.inArray(data, selectedConditions) === -1) {
        selectedConditions.push(data);
        $('#tblSelectedConditions')
            .append(
                "
" +
                "" +
                paramName +
                "	" +
                "" +
                paramType +
                "	" +
                "" +
                displayName +
                "	" +
                "<button class='btn btn-danger btn-xs' onclick='removeSelectedCondition(" + counter + ")'></button>	" +
                "
"
            );
    }

    $('#parameter').val('');
    $('#displayName').val('');
}

function removeSelectedCondition(counter) {
    selectedConditions.splice(counter, 1);
    $('#dat_' + counter).remove();
}

function removeAllParameters(event) {
    event.preventDefault();
    $("#tblSelectedConditions").find("tr:gt(1)").remove();
    $("#currentFiltersCleared").val("true");
    $("#filterRow").show();
}


text:
using NUnit.Framework;
using JordiBisbal.EventManager;
using UnityEngine.Events;
using UnityEngine;

public class EventManagerTest {
    [Test]
    public void testInvalidEventNameException() {
        InvalidEventNameException exception = Assert.Throws<InvalidEventNameException>(delegate () {
            EventManager eventManager = new EventManager();
            UnityAction<object> listener = message => { };
            eventManager.StartListening("event ", listener);
        });
        Assert.AreEqual("Invalid event name \"event \"", exception.Message);
    }

    [Test]
    public void testMisconfiguredException() {
        MissConfiguredException exception = Assert.Throws<MissConfiguredException>(delegate () {
            EventManager eventManager = new EventManager();
            eventManager.AllwaysUpdate();
        });
        Assert.AreEqual("No time delegate has been provided for this eventManager", exception.Message);
    }

    [Test]
    public void testListening() {
        EventManager eventManager = new EventManager();
        UnityAction<object> listener = message => {};
        eventManager.StartListening("event", listener);
        Assert.AreEqual(1, eventManager.ListenerCount("event"));
    }

    [Test]
    public void testStopListening() {
        EventManager eventManager = new EventManager();
        UnityAction<object> listener = message => { };
        eventManager.StartListening("event", listener);
        Assert.AreEqual(1, eventManager.ListenerCount("event"));
        eventManager.StopListening("event", listener);
        Assert.AreEqual(0, eventManager.ListenerCount("event"));
    }

    [Test]
    public void testStopListeningBySubcriber() {
        EventManager eventManager = new EventManager();
        Object subscriber = GetTarget();
        UnityAction<object> listener = message => { };
        eventManager.StartListening(subscriber, "event", listener);
        Assert.AreEqual(1, eventManager.ListenerCount("event"));
        eventManager.StopListening(subscriber);
        Assert.AreEqual(0, eventManager.ListenerCount("event"));
    }

    [Test]
    public void testStopListeningBySubcriberMultiple() {
        EventManager eventManager = new EventManager();
        Object subscriber = GetTarget();
        UnityAction<object> listener = message => { };
        UnityAction<object> listener2 = message => { };
        eventManager.StartListening(subscriber, "event", listener);
        eventManager.StartListening(subscriber, "event", listener2);
        Assert.AreEqual(2, eventManager.ListenerCount("event"));
        eventManager.StopListening(subscriber);
        Assert.AreEqual(0, eventManager.ListenerCount("event"));
    }

    [Test]
    public void testStopListeningBySubcriberMixedTarget() {
        EventManager eventManager = new EventManager();
        Object subscriber = GetTarget();
        Object target = GetTarget();
        UnityAction<object> listener = message => { };
        UnityAction<object> listener2 = message => { };
        eventManager.StartListening(subscriber, "event", listener, target);
        eventManager.StartListening(subscriber, "event", listener2);
        Assert.AreEqual(1, eventManager.ListenerCount("event"));
        Assert.AreEqual(1, eventManager.ListenerCount("event", target));
        Assert.AreEqual(2, eventManager.ListenerCount());
        eventManager.StopListening(subscriber);
        Assert.AreEqual(0, eventManager.ListenerCount("event"));
        Assert.AreEqual(0, eventManager.ListenerCount("event", target));
        Assert.AreEqual(0, eventManager.ListenerCount());
    }

    [Test]
    public void testCount() {
        EventManager eventManager = new EventManager();
        Object subscriber = GetTarget();
        Object target = GetTarget();
        UnityAction<object> listener = message => { };
        UnityAction<object> listener2 = message => { };
        UnityAction<object> listener3 = message => { };
        eventManager.StartListening(subscriber, "event", listener, target);
        eventManager.StartListening(subscriber, "event", listener2);
        eventManager.StartListening(subscriber, "event", listener3);
        Assert.AreEqual(2, eventManager.ListenerCount("event"));
        Assert.AreEqual(1, eventManager.ListenerCount("event", target));
        Assert.AreEqual(3, eventManager.ListenerCount());
        eventManager.StopListening(subscriber);
        Assert.AreEqual(0, eventManager.ListenerCount("event"));
        Assert.AreEqual(0, eventManager.ListenerCount("event", target));
        Assert.AreEqual(0, eventManager.ListenerCount());
    }

    [Test]
    public void testListeningTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        UnityAction<object> listener = message => { };
        eventManager.StartListening("event", listener, target);
        Assert.AreEqual(1, eventManager.ListenerCount("event", target));
    }

    [Test]
    public void testStopListeningTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        UnityAction<object> listener = message => { };
        eventManager.StartListening("event", listener, target);
        Assert.AreEqual(1, eventManager.ListenerCount("event", target));
        eventManager.StopListening("event", listener, target);
        Assert.AreEqual(0, eventManager.ListenerCount("event", target));
    }

    [Test]
    public void testListeningButNotTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        UnityAction<object> listener = message => { };
        eventManager.StartListening("event", listener);
        Assert.AreEqual(0, eventManager.ListenerCount("event", target));
    }

    private static Object GetTarget() {
        Object target = new GameObject("target");
        return target;
    }

    [Test]
    public void testListeningTargetedButTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        UnityAction<object> listener = message => { };
        eventManager.StartListening("event", listener, target);
        Assert.AreEqual(0, eventManager.ListenerCount("event"));
    }

    [Test]
    public void testListeningAndReceiving() {
        EventManager eventManager = new EventManager();
        bool called = false;
        UnityAction<object> listener = message => { called = true; };
        eventManager.StartListening("event", listener);
        eventManager.TriggerEvent("event", null);
        Assert.True(called);
    }

    [Test]
    public void testListeningWithSubscriberAndReceiving() {
        Object subscriber = GetTarget();
        EventManager eventManager = new EventManager();
        bool called = false;
        UnityAction<object> listener = message => { called = true; };
        eventManager.StartListening(subscriber, "event", listener);
        eventManager.TriggerEvent("event", null);
        Assert.True(called);
    }

    [Test]
    public void testListeningAndReceivingTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        bool called = false;
        UnityAction<object> listener = message => { called = true; };
        eventManager.StartListening("event", listener, target);
        eventManager.TriggerEvent("event", null, target);
        Assert.True(called);
    }

    [Test]
    public void testListeningNotTargetedAndNotReceivingTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        bool called = false;
        UnityAction<object> listener = message => { called = true; };
        eventManager.StartListening("event", listener);
        eventManager.TriggerEvent("event", null, target);
        Assert.False(called);
    }

    [Test]
    public void testListeningTargetedAndNotReceivingNotTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        bool called = false;
        UnityAction<object> listener = message => { called = true; };
        eventManager.StartListening("event", listener, target);
        eventManager.TriggerEvent("event", null);
        Assert.False(called);
    }

    [Test]
    public void testMessageIsSend() {
        EventManager eventManager = new EventManager();
        string receivedMessage = "";
        UnityAction<object> listener = message => { receivedMessage = (string) message; };
        eventManager.StartListening("event", listener);
        eventManager.TriggerEvent("event", "test message");
        Assert.AreEqual("test message", receivedMessage);
    }

    [Test]
    public void testMessageIsSendTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();
        string receivedMessage = "";
        UnityAction<object> listener = message => { receivedMessage = (string)message; };
        eventManager.StartListening("event", listener, target);
        eventManager.TriggerEvent("event", "test message", target);
        Assert.AreEqual("test message", receivedMessage);
    }

    [Test]
    public void testCountsMessageListenerTargeted() {
        Object target = GetTarget();
        EventManager eventManager = new EventManager();

        UnityAction<object> listener  = message => { };
        UnityAction<object> listener2 = message => { };
        UnityAction<object> listener3 = message => { };

        Assert.AreEqual(0, eventManager.ListenerCount("event", target));
        eventManager.StartListening("event", listener, target);
        Assert.AreEqual(1, eventManager.ListenerCount("event", target));
        eventManager.StartListening("event", listener2, target);
        Assert.AreEqual(2, eventManager.ListenerCount("event", target));
        eventManager.StartListening("event", listener3, target);
        Assert.AreEqual(3, eventManager.ListenerCount("event", target));
        eventManager.StopListening("event", listener2, target);
        Assert.AreEqual(2, eventManager.ListenerCount("event", target));
    }

    [Test]
    public void testCountsMessageListenerNotTargeted() {
        EventManager eventManager = new EventManager();

        UnityAction<object> listener = message => { };
        UnityAction<object> listener2 = message => { };
        UnityAction<object> listener3 = message => { };

        Assert.AreEqual(0, eventManager.ListenerCount("event"));
        eventManager.StartListening("event", listener);
        Assert.AreEqual(1, eventManager.ListenerCount("event"));
        eventManager.StartListening("event", listener2);
        Assert.AreEqual(2, eventManager.ListenerCount("event"));
        eventManager.StartListening("event", listener3);
        Assert.AreEqual(3, eventManager.ListenerCount("event"));
        eventManager.StopListening("event", listener2);
        Assert.AreEqual(2, eventManager.ListenerCount("event"));
    }

    [Test]
    public void testCountsMessageListeneingTwice() {
        EventManager eventManager = new EventManager();

        UnityAction<object> listener = message => { };

        Assert.AreEqual(0, eventManager.ListenerCount("event"));
        eventManager.StartListening("event", listener);
        Assert.AreEqual(1, eventManager.ListenerCount("event"));
        eventManager.StartListening("event", listener);
        Assert.AreEqual(2, eventManager.ListenerCount("event"));
        eventManager.StopListening("event", listener);
        Assert.AreEqual(1, eventManager.ListenerCount("event"));
    }

    [Test]
    public void testDelayedEventIsNotSentBeforeTime() {
        bool received = false;
        UnityAction<object> listener = message => { received = (string)message == "test"; };
        float time = 1000;

        EventManager eventManager = new EventManager(() => { return time; });

        eventManager.StartListening("event", listener);
        eventManager.TriggerEventAfter(1.0f, "event", "test");
        Assert.False(received);
        eventManager.AllwaysUpdate();
        Assert.False(received);
    }

    [Test]
    public void testDelayedEventIsSentAfterExactTime() {
        bool received = false;
        UnityAction<object> listener = message => { received = (string)message == "test"; };
        float time = 1000;

        EventManager eventManager = new EventManager(() => { return time; });

        eventManager.StartListening("event", listener);
        eventManager.TriggerEventAfter(1.0f, "event", "test");
        time = 1001;
        eventManager.AllwaysUpdate();
        Assert.True(received);
    }

    [Test]
    public void testDelayedEventIsSentAfterExtraTime() {
        bool received = false;
        UnityAction<object> listener = message => { received = (string)message == "test"; };
        float time = 1000;

        EventManager eventManager = new EventManager(() => { return time; });

        eventManager.StartListening("event", listener);
        eventManager.TriggerEventAfter(1.0f, "event", "test");
        time = 10001;
        eventManager.AllwaysUpdate();
        Assert.True(received);
    }

    [Test]
    public void testFlushedDelayedTargetedEventAreNotSent() {
        bool received = false;
        UnityAction<object> listener = message => { received = (string)message == "test"; };
        float time = 1000;
        Object target = GetTarget();

        EventManager eventManager = new EventManager(() => { return time; });

        eventManager.StartListening("event", listener, target);
        eventManager.TriggerEventAfter(1.0f, "event", "test", target);
        time = 10001;
        eventManager.FlushDelayedEvents("event");
        eventManager.AllwaysUpdate();
        Assert.True(received);
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>10 frases que los hombres deben saber~ — El blog de Lau~</title>
    <link href="https://fonts.googleapis.com/css?family=Droid+Sans:400,700" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/assets/main.css">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="apple-touch-icon" href="/images/logo.png"/>
    <link href="/feed.xml" rel="alternate" type="application/rss+xml" title="El blog de Lau~" />
    <meta name="title" content="10 frases que los hombres deben saber~ ">
    <link rel="canonical" href="http://lauravanessa.com/2008/06/14/10-frases-que-los-hombres-deben-saber/">

    <meta property="og:title" content="10 frases que los hombres deben saber~ "/>
    <meta property="og:url" content="http://lauravanessa.com/2008/06/14/10-frases-que-los-hombres-deben-saber/"/>

    <meta property="og:description" content=" "/>
    <meta name="description" content=" "/>

    <meta property="og:site_name" content="El blog de Lau~">

            Blog

                By <address>Laura Vanessa Morales</address> —
                <time pubdate datetime="2008-14-June" title="June 14, 2008">June 14, 2008</time>

10 frases que los hombres deben saber~

Dicen que las mujeres somos muy complicadas de entender. Después que todos los hombres lean esta lista, ya no habrá misterio :D A partir de hoy todo será paz y amor, sólo deben recordar el real significado de estas frases:

1.  Ok (Ooook):

Esta es la palabra que las mujeres utilizan para finalizar una discusión cuando han decidido que ellas tienen la razón y ahora debes callarte.

2. Cinco minutos:

Si se está arreglando, significa media hora. Son cinco minutos (literales) sólo si te han concedido cinco minutos adicionales para terminar de ver el partido (léase cualquier pasatiempo inutil) antes de salir de compras.

3. Nada:

Es la calma antes de la tormenta. Significa 'algo'. Y deberías estar totalmente alerta. Discusiones que empiezan con 'nada', normalmente acaban con 'Ok' (Ver punto 1).

4. No hay problema:

También 'adelante, hazlo' o 'no, no me molesta'. Es un reto, y para nada darte permiso. Ni se te ocurra hacerlo!

5. Gran suspiro:

En realidad, es una palabra pero habitualmente los hombres no la entienden. Un suspiro alto y claro significa que ella piensa que eres idiota y se pregunta por qué esta perdiendo el tiempo discutiendo sobre 'nada' (Ver punto 3 para entender el significado de 'nada')

6. Muy bien:

Esta es una de las frases mas peligrosas que una mujer puede decir a un hombre. Muy bien significa que ella meditara cuidadosamente antes de decidir cómo y cuándo pagarás por tu equivocación.

7. Gracias:

Una mujer te agradece algo. No preguntes. No dudes. Solo di 'de nada'.

8. Como quieras:

También 'da igual', 'es lo mismo', 'si tu lo dices'. Es la forma femenina de mandarte a la mierda.

9. Tranquilo, no te preocupes, déjalo así:

Otra frase peligrosa que significa que aunque la mujer le ha dicho al hombre en repetidas ocasiones que haga algo, finalmente lo esta haciendo ella misma. Esto más tarde empujará al hombre a preguntar 'qué pasa?' (Para saber la respuesta de la mujer, ver punto 3).

10. Aaahhhh

Cuando la mujer le pregunta algo y el hombre da una explicación tonta o no creíble. Ella sólo dice 'Aaaahhh' pero sabe que la respuesta no la convenció y ten por seguro que seguirá indagando.

        Tweet

Respuestas a "10 frases que los hombres deben saber~"

comment number 1 by: heymacrina

               June 14th, 2008 at 9:51 am

este… en algunas no estoy de acuerdo…

 Ok (Ooook): lo utilizo como diciendo "si tu lo dices" en un sentido de broma y qué divertido… aunque todo depende de la entonación.

Tranquilo, no te preocupes, déjalo así: para mi esta es la frase más peligrosa… porque lo utilizo cuando estoy  enojada o fastidiada para no hacer hígado y decirme a mi misma "es un idiota… veamos que haces después para analizar si esto funciona o no".

después de estas estoy de acuerdo con tus puntos =)

comment number 2 by: Juanitho

               June 14th, 2008 at 1:07 pm

muy buen diccionario mujer->español->hombre, las mismas fraces usa mi chicayeye y los mismos significados pero no vale ustedes las mujeres siempre tiene la de ganar… yo trato de darle siempre la razon a mi chicayeye para no discutir pero a veces es aburrido, uno se convierte en un simple titere que hace lo que sea por estar con ustedes.

comment number 3 by: Slayer_X

               June 14th, 2008 at 1:55 pm

LIES!!!!!

Ni siqueira se aplica en el 50% de la población femenina disponbile para el flirteo xD

comment number 4 by: Illi.Pro

               June 14th, 2008 at 3:49 pm

8. Como quieras:

También 'da igual', 'es lo mismo', 'si tu lo dices'. Es la forma femenina de mandarte a la mierda.

Esa me la han dicho 942512313 veces :(! ahora entiendo porque.. xD buen post!

comment number 5 by: Droper

               June 14th, 2008 at 5:40 pm

Eres una geek de tu genero :)

comment number 6 by: drmad

               June 15th, 2008 at 9:28 am

"Nada" es la frase que más detesto de las chicas. Es como usar la religión para responder una pregunta científica :-) No hay forma de seguir argumentando si una chica se cierra en esa frase. Recuerdo un texto de Gabriel García Marquez: "Las mujeres dicen que los problemas de la pareja se resuelven con el diálogo. Es al revés: Problema que se dialoga, termina en pleito con seguridad. Hay que hacer confianza y olvidarlo, y seguir pa'lante."

comment number 7 by: c

               June 15th, 2008 at 2:37 pm

yo detesto sobre todo el "ok" me trae espantosos recuerdos

comment number 8 by: uchari

               June 15th, 2008 at 3:08 pm

lol me trajo muchos recuerdos… pero creo que algunos de los sentidos cambian cuando la mujer se casa… estas palabras son mas comunes en la solteria… cuando uno se casa uno aprendio los trucos para q el hombre haga los mismos gestos con su pareja.

comment number 9 by: bocadelcielo

               June 15th, 2008 at 3:09 pm

Demasiado cierto! Chevere tu blog!

comment number 10 by: lauvmg

               June 15th, 2008 at 5:36 pm

@uchari eso suena genial :)

comment number 11 by: Arcano de Manrique

               June 16th, 2008 at 8:29 am

Yo sólo me pregunto: ¿por qué en vez de decir "nada" o "ahh" dicen "me jode esto"?

Tan fácil y sencillo …

Varias peleas se evitarían por eso.

Por ello concuerdo con drmad. Hacer confianza, olvidar nomás. Si no, como diría el Gallo Claudio: "¡ay, la que me espera!"

comment number 12 by: Catalina

               June 16th, 2008 at 10:57 am

Motivos por los que una dice "nada": Porque estás pensando "este sujeto no se da cuenta que la fregó y encima está esperando que se lo explique en versión for dummies".

Empezar por el nada en lugar de explotar directamente puede ser bueno, si sirve para tomar un respiro. Pero al final, las cosas como son, decirlas sin más, y listo.

comment number 13 by: Miguel Chambergo

               June 16th, 2008 at 4:24 pm

Muy complicado, de repente si intentas con una infografía, quizás lo entienda. Quizás…

comment number 14 by: chanyenmadrid

               June 17th, 2008 at 1:34 am

jajaj hermana q buena! Se lo voy a recomendar a todos los hombres para que comprendan mejor a sus chicas  : Q Bonito caracho, pero sas q… Tampoco debe ser siempre xq llega el momento que hay q poner los problemas sobre la mesa pa solucionarlos, xq sino es aburrido verse siempre en las mismas y los problemas crecen y crecen y se acumulan y algun dia explotara.. no se los guarden mucho :P …. estoy traumada no? jajajajaj

            <address>

Written by Laura Vanessa Morales

                Soy curiosa, me gusta la tecnología, me gusta aprender, uso linux, estoy tratando de aprender python, me interesa saber cómo pasan las cosas en internet, me gusta salir, pasear, conversar, bailar, observar el comportamiento de la gente, escuchar, me gustan los beatles, depeche mode, placebo, the cure, me gusta salir en bicicleta, mecerme en mi hamaca, estar frente al mar, ah, y soy periodista.

            </address>

        © 2015

            Lauvmg ·
            Blog ·

Incorporated theme by Inc


text:
<?php

namespace Mappers\Model\IndicadorEstacion;

use Mappers\Model\IndicadorEstacion\IndicadorEstacion;

class IndicadorEstacion
{

    protected $id_indicador = null;

    protected $id_estacion = null;

    protected $valor = null;

    protected $fecha = null;

    /**
     * Setea el parametro id_indicador
     *
     * @param int $id_indicador
     */
    public function setId_indicador($id_indicador)
    {
        $this->id_indicador = $id_indicador;
    }

    /**
     * Retorna el parametro id_indicador
     *
     * @return string
     */
    public function getId_indicador()
    {
        return $this->id_indicador;
    }

    /**
     * Setea el parametro id_estacion
     *
     * @param int $id_estacion
     */
    public function setId_estacion($id_estacion)
    {
        $this->id_estacion = $id_estacion;
    }

    /**
     * Retorna el parametro id_estacion
     *
     * @return string
     */
    public function getId_estacion()
    {
        return $this->id_estacion;
    }

    /**
     * Setea el parametro valor
     *
     * @param int $valor
     */
    public function setValor($valor)
    {
        $this->valor = $valor;
    }

    /**
     * Retorna el parametro valor
     *
     * @return string
     */
    public function getValor()
    {
        return $this->valor;
    }

    /**
     * Setea el parametro fecha
     *
     * @param Zend/Date $fecha
     */
    public function setFecha($fecha)
    {
        $this->fecha = $fecha;
    }

    /**
     * Retorna el parametro fecha
     *
     * @return string
     */
    public function getFecha()
    {
        return $this->fecha;
    }

}


text:
/*
|-----------------------------------------------
| Plus feed-component admin application.
|-----------------------------------------------
|
| The file is entry.
|
| @author Seven Du <shiweidu@outlook.com>
|
*/

import React from 'react';
import { render } from 'react-dom';
import { HashRouter as Router } from 'react-router-dom';
import theme from './theme';
import { MuiThemeProvider } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import App from 'App';

/**
 * The app entry component.
 *
 * @return {Function}
 * @author Seven Du <shiweidu@outlook.com>
 */

const Main = () => (
  <React.Fragment>
    <CssBaseline />
    <MuiThemeProvider theme={theme}>
      <Router>
        <App />
      </Router>
    </MuiThemeProvider>
  </React.Fragment>
);

document.addEventListener('DOMContentLoaded', () => {
  // Rende app.
  render(
    <Main />,
    document.getElementById('app')
  );

});


text:
package cz.zajezdy.data.bengine.cache;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.common.collect.ImmutableMap;

import cz.zajezdy.data.bengine.RuleEngine;
import cz.zajezdy.data.bengine.configuration.Configuration;

/**
 * <pre>
 *
 * {
 * 	@code
 * 	// use the cache as follows:
 * 	RuleEngine re = RuleEngineCache.createInstance(ruleEngineProviderInstance).getLockedRuleEngine("myconfig.json");
 * 	// do something with the rule engine ...
 * 	// unlock the object when you are done
 * 	RuleEngineCache.get().unlock(re);
 * }
 *
 * </pre>
 *
 * @author Florian Beese, David Kovar
 *
 */
public class RuleEngineCache {

	@SuppressWarnings("rawtypes")
	private Map<String, Configuration> configurationCache = new HashMap<String, Configuration>();

	private Map<String, List<RuleEngine>> engineCache = new HashMap<String, List<RuleEngine>>();
	private Set<RuleEngine> lockedEngines = new HashSet<RuleEngine>();
	private Map<String, CacheStatistic> cacheStatistics = new HashMap<String, CacheStatistic>();
	private RuleEngineProvider engineProvider = null;

	private RuleEngineCache() {

	}

	/**
	 * Create a new instance of RuleEngineCache for a specific RuleEngineProvider.
	 * Provided RuleEngineProvider will be used, to retrieve the configuration files,
	 * deserialize the configuration and create the engine if needed.
	 * You may use BasicRuleEngineProvider for easier usage.
	 *
	 * @param engineProvider The rule engine provider, which the cache uses
	 *            to create new rule engines.
	 */
	public static RuleEngineCache createInstance(RuleEngineProvider engineProvider) {
		final RuleEngineCache instance = new RuleEngineCache();
		instance.engineProvider = engineProvider;
		return instance;
	}

	/**
	 * Provides a RuleEngine object and locks the instance in the cache.
	 * The cache will not return this instance to any requester as long
	 * as it has not been unlocked (see {@link #unlock(RuleEngine)}).
	 *
	 * @see #unlock(RuleEngine)
	 *
	 * @param key The key in the cache - normally the configuration file name.
	 * @return a RuleEngine instance, that was built using the registered
	 *         RuleEngineProvider or was retrieved from the cache
	 */
	public RuleEngine getLockedRuleEngine(String key) throws IOException {
		RuleEngine re = null;
		while (true) {
			re = lookupEngineCache(key);
			if (re == null) {
				@SuppressWarnings("rawtypes")
				Configuration configuration = lookupConfigCache(key);
				if (configuration == null) {
					String jsonConfig = engineProvider.getConfigurationContent(key);
					configuration = engineProvider.deserialize(jsonConfig);
					cacheConfiguration(key, configuration);
				}
				re = engineProvider.getEngine(configuration);
				cacheEngine(key, re);
			}
			if (tryLockEngine(re)) {
				break;
			}
		}
		CacheStatistic cacheStatistic = cacheStatistics.get(key);
		cacheStatistic.incrementAccessCount();
		return re;
	}

	/**
	 * Unlocks the ruleEngine object. The cache will then use this object again,
	 * to deliver it when calling getLockedRuleEngine().
	 *
	 * @see cz.zajezdy.data.bengine.cache.RuleEngineCache#getLockedRuleEngine(String key)
	 *
	 * @param ruleEngine The ruleEngine object to be unlocked.
	 */
	public void unlock(RuleEngine ruleEngine) {
		lockedEngines.remove(ruleEngine);
	}

	/**
	 * Invalidates the cache for this key.
	 * After this call, the cache for this key will be empty and built up again
	 * with its next request.
	 *
	 * @param key The key in the cache - normally the configuration file name.
	 */
	public synchronized void invalidate(String key) {
		if (configurationCache.containsKey(key)) {
			configurationCache.remove(key);
			List<RuleEngine> engines = engineCache.get(key);
			lockedEngines.removeAll(engines);
			engineCache.remove(key);
			cacheStatistics.remove(key);
		}
	}

	/**
	 * Invalidate all cache items in this cache
	 * After this call, the cache is empty
	 */
	public void invalidateAll() {
		Set<String> keys = new HashSet<>(configurationCache.keySet());
		keys.forEach(this::invalidate);
	}

	public List<CacheStatistic> getStatistics() {
		List<CacheStatistic> list = new ArrayList<CacheStatistic>();
		list.addAll(cacheStatistics.values());
		return list;
	}

	public ImmutableMap<String, CacheStatistic> getStatisticsMap() {
		return ImmutableMap.copyOf(cacheStatistics);
	}

	private synchronized boolean tryLockEngine(RuleEngine ruleEngine) {
		if (lockedEngines.contains(ruleEngine)) {
			return false;
		}
		lockedEngines.add(ruleEngine);
		return true;
	}

	private synchronized void cacheEngine(String key, RuleEngine ruleEngine) {
		if (!engineCache.containsKey(key)) {
			engineCache.put(key, new ArrayList<RuleEngine>());
		}
		List<RuleEngine> engines = engineCache.get(key);
		engines.add(ruleEngine);
		CacheStatistic cacheStatistic = cacheStatistics.get(key);
		cacheStatistic.incrementEngineCount();
	}

	private synchronized RuleEngine lookupEngineCache(String key) {
		// TODO: try to improve multithreading here...
		// some way to improve synchronized?
		if (engineCache.containsKey(key)) {
			List<RuleEngine> engines = engineCache.get(key);
			for (RuleEngine re : engines) {
				if (!lockedEngines.contains(re)) {
					return re;
				}
			}
		}
		return null;
	}

	@SuppressWarnings("rawtypes")
	private Configuration lookupConfigCache(String key) {
		if (configurationCache.containsKey(key)) {
			return configurationCache.get(key);
		}
		return null;
	}

	private synchronized void cacheConfiguration(String key, @SuppressWarnings("rawtypes") Configuration configuration) {
		cacheStatistics.put(key, new CacheStatistic(key));
		configurationCache.put(key, configuration);
	}
}


text:
- In an empty region of a domain with editing rights.

## Steps
Press 'n' key to advance step by step

### Step 1
- Set up scene
### Step 2
- Texture
### Step 3
- Full Resolution
- ![](./ExpectedImage_00000.png)
### Step 4
- Update Mip
### Step 5
- Mip
- ![](./ExpectedImage_00001.png)
### Step 6
- Cleanup Texture
### Step 7
- Clean up after test


text:
rabbitmq-akka-streams
=====================

Experimenting with Akka Stream and RabbitMQ client.


text:
/*************************************************************************/
/*  node_dock.cpp                                                        */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "node_dock.h"

#include "editor_node.h"
#include "editor_scale.h"

void NodeDock::show_groups() {
	groups_button->set_pressed(true);
	connections_button->set_pressed(false);
	groups->show();
	connections->hide();
}

void NodeDock::show_connections() {
	groups_button->set_pressed(false);
	connections_button->set_pressed(true);
	groups->hide();
	connections->show();
}

void NodeDock::_bind_methods() {
}

void NodeDock::_notification(int p_what) {
	if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
		connections_button->set_icon(get_theme_icon(SNAME("Signals"), SNAME("EditorIcons")));
		groups_button->set_icon(get_theme_icon(SNAME("Groups"), SNAME("EditorIcons")));
	}
}

NodeDock *NodeDock::singleton = nullptr;

void NodeDock::update_lists() {
	connections->update_tree();
}

void NodeDock::set_node(Node *p_node) {
	connections->set_node(p_node);
	groups->set_current(p_node);

	if (p_node) {
		if (connections_button->is_pressed()) {
			connections->show();
		} else {
			groups->show();
		}

		mode_hb->show();
		select_a_node->hide();
	} else {
		connections->hide();
		groups->hide();
		mode_hb->hide();
		select_a_node->show();
	}
}

NodeDock::NodeDock() {
	singleton = this;

	set_name("Node");
	mode_hb = memnew(HBoxContainer);
	add_child(mode_hb);
	mode_hb->hide();

	connections_button = memnew(Button);
	connections_button->set_flat(true);
	connections_button->set_text(TTR("Signals"));
	connections_button->set_toggle_mode(true);
	connections_button->set_pressed(true);
	connections_button->set_h_size_flags(SIZE_EXPAND_FILL);
	connections_button->set_clip_text(true);
	mode_hb->add_child(connections_button);
	connections_button->connect("pressed", callable_mp(this, &NodeDock::show_connections));

	groups_button = memnew(Button);
	groups_button->set_flat(true);
	groups_button->set_text(TTR("Groups"));
	groups_button->set_toggle_mode(true);
	groups_button->set_pressed(false);
	groups_button->set_h_size_flags(SIZE_EXPAND_FILL);
	groups_button->set_clip_text(true);
	mode_hb->add_child(groups_button);
	groups_button->connect("pressed", callable_mp(this, &NodeDock::show_groups));

	connections = memnew(ConnectionsDock(EditorNode::get_singleton()));
	connections->set_undoredo(EditorNode::get_undo_redo());
	add_child(connections);
	connections->set_v_size_flags(SIZE_EXPAND_FILL);
	connections->hide();

	groups = memnew(GroupsEditor);
	groups->set_undo_redo(EditorNode::get_undo_redo());
	add_child(groups);
	groups->set_v_size_flags(SIZE_EXPAND_FILL);
	groups->hide();

	select_a_node = memnew(Label);
	select_a_node->set_text(TTR("Select a single node to edit its signals and groups."));
	select_a_node->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
	select_a_node->set_v_size_flags(SIZE_EXPAND_FILL);
	select_a_node->set_valign(Label::VALIGN_CENTER);
	select_a_node->set_align(Label::ALIGN_CENTER);
	select_a_node->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART);
	add_child(select_a_node);
}


text:
const faviconHandler = require('./favicon-handler.js');
const homeHandler = require('./home-handler.js');
const staticFileHandler = require('./static-file-handler.js');

module.exports = [faviconHandler, homeHandler, staticFileHandler];