A Pen by Pramod Sripada on CodePen.
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 BatchJob { | |
def main(args: Array[String]): Unit = { | |
SparkUtils.setupLogging() | |
val sparkProps = config.Settings.SparkProps | |
val executionMode = args(0) match { | |
case dev => sparkProps.devExecutionMode | |
case cluster => sparkProps.clusterExecutionMode | |
} |
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 config | |
import com.typesafe.config.ConfigFactory | |
/** | |
* Created by Pramod on 6/1/2017. | |
*/ | |
object Settings { | |
private val config = ConfigFactory.load() |
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
// Encapsulate all related properties into separate key words | |
sparkproperties{ | |
dev.executionmode = "local[*]" | |
cluster.executionmode = "yarn-client" | |
} |
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
class Post(models.Model): | |
user = models.ForeignKey(User, on_delete=models.CASCADE) | |
description = models.CharField(max_length=1000) | |
image = models.ImageField(null=True) | |
''' | |
https://docs.djangoproject.com/en/1.10/topics/db/examples/many_to_many/ | |
https://docs.djangoproject.com/en/dev/topics/db/queries/#backwards-related-objects | |
http://stackoverflow.com/questions/2642613/what-is-related-name-used-for-in-django |
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
public List<Integer> rightSideView(TreeNode root) { | |
if(root==null) return new ArrayList(); | |
/*Initializing a ArrayList to return*/ | |
List<Integer> returnList = new ArrayList<Integer>(); | |
/*Initializing a Queue to hold elements*/ | |
Queue<TreeNode> q = new LinkedList<TreeNode>(); | |
/*Creating a dummy variable*/ | |
TreeNode current = null; | |
/*Adding the root and null into the Queue*/ | |
q.add(root); |
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
from pyspark import SparkConf, SparkContext | |
from pyspark.sql import SQLContext, Row | |
#Setting the application name and creating the spark context and sql context objects. | |
conf = SparkConf().setAppName("SparkSQL") | |
sc = SparkContext(conf = conf) | |
sqlContext = SQLContext(sc) | |
#The URL where the mysql database is hosted | |
jdbcUrl = 'jdbcUrl' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
A Pen by Pramod Sripada on CodePen.
Implementation of Tic Tac Toe game using JavaScript. The underlying artificial intelligence algorithm is MinMax .
A Pen by Pramod Sripada on CodePen.
NewerOlder