This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://xxxx:8080/api/v2/multipart/att HTTP/1.1 | |
Content-Type: multipart/form-data; boundary=apiclient-1458318856973 | |
User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 5 - 5.1.0 - API 22 - 1080x1920 Build/LMY47D) | |
Host: xxxx:8080 | |
Connection: Keep-Alive | |
Accept-Encoding: gzip | |
Content-Length: 7980 | |
--apiclient-1458318856973 | |
Content-Disposition: form-data; name="json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.apache.spark.test | |
import org.apache.spark.{HashPartitioner, RangePartitioner, SparkContext, SparkConf} | |
import org.apache.spark.SparkContext._ | |
import scala.collection.mutable.{ArrayBuffer, ListBuffer} | |
/** | |
* Partitioner Test | |
*/ | |
object PartitionerTest { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Solution498 { | |
def findDiagonalOrder(matrix: Array[Array[Int]]): Array[Int] = { | |
if (matrix.length == 0 || matrix(0).length == 0) Array.empty[Int] | |
else { | |
val (row, column) = (matrix.length - 1, matrix(0).length - 1) | |
var flag = true | |
(0 to row + column).flatMap { sum => | |
val (low, high) = (0 max (sum - column), row min sum) | |
val range = if (flag) (high to low by -1) else (low to high) | |
flag = !flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Solution { | |
def powMod(x: Int, y: Int, mod: Int): Int = { | |
if (y == 0) 1 | |
else { | |
val half = powMod(x, y / 2, mod) | |
if (y % 2 == 0) half * half % mod | |
else (half * half % mod) * (x % mod) % mod | |
} | |
} |
OlderNewer