Skip to content

Instantly share code, notes, and snippets.

{
"measure_config_mode": "historical",
"attribution": [
{
"variable": {
"index": "attribution_master",
"display_name": "Payer",
"name": "pynm"
},
"operator": "=",
{
"measure_id": "9ec4e0d0-99bb-4e0c-a829-fd1a6adc641c",
"is_deleted": false,
"name": "HEDIS Breast Cancer Screening",
"measure_category": "Quality",
"measure_code": {
"num": "201",
"type": {
"display_name": "NQF",
"name": "nqf"
@ajaybgupta
ajaybgupta / GenericSnippet.scala
Created April 4, 2018 09:19
Generics Example in Scala
/** Test One
*
* Created by Ajay Gupta on 04/04/18.
*/
object TestOne {
def main(args: Array[String]): Unit = {
val employee1 = Employee(1, "Sourab")
val employee2 = Employee(2, "Ajay")
val employeeStack = new Stack[Employee]
employeeStack.push(employee1)
object Global extends GlobalSettings {
override def onStart(application: play.api.Application) {
import scala.concurrent.duration._
import play.api.Play.current
for (warehouse <- Warehouse.find()) {
val actor = Akka.system.actorOf(
Props(new PickListActor(warehouse))
)
Akka.system.scheduler.schedule(
0.seconds, 30.minutes, actor, "send"
@ajaybgupta
ajaybgupta / HackerRankIO2.scala
Created November 29, 2017 03:16
Hacker Rank - Reading Input Data
def simpleArraySum(n: Int, ar: Array[Int]): Int = {
ar.sum
}
def main(args: Array[String]) {
val sc = new java.util.Scanner (System.in);
var n = sc.nextInt();
var ar = new Array[Int](n);
for(ar_i <- 0 to n-1) {
ar(ar_i) = sc.nextInt();
// object Solution{
object HackerRankIO {
def main(args: Array[String]) {
val inputStringList = io.Source.stdin.getLines().take(2).toList
println(solveMeFirst(inputStringList))
}
def solveMeFirst(intString:List[String]):Int={
intString.map(_.toInt).sum
}
}
import org.apache.spark._
import org.apache.spark.graphx._
val triplets = sc.textFile(path).flatMap { line =>
if (!line.isEmpty && line(0) != '#') {
val lineArray = line.split("\\s+")
if (lineArray.length < 2) {
None
} else {
val t = new EdgeTriplet[String, String]