Implementation of a stylised version of the Free Code Camp's camper news(which currently has been discontinued). The data can be found here https://www.freecodecamp.com/news/hot/ Initially implemented using HTML, CSS, JQuery. For building of each story, added the required HTML as strings while looping through the JSON data This implementation makes use HandleBars templating. Using HandleBars was a quite a challenge on this data since, the data is an array of objects and also I needed the data to be modified before displaying to the user. Added a representative element for the JSON object for accessing it, and used Helper functions for the modification of data.
Implementation of Tic Tac Toe game using JavaScript. The underlying artificial intelligence algorithm is MinMax .
A Pen by Pramod Sripada on CodePen.
A Pen by Pramod Sripada on CodePen.
A Pen by Pramod Sripada on CodePen.
Loading
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
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' |
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
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
// 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
package config | |
import com.typesafe.config.ConfigFactory | |
/** | |
* Created by Pramod on 6/1/2017. | |
*/ | |
object Settings { | |
private val config = ConfigFactory.load() |
OlderNewer