* Download dataset at:
* https://drive.google.com/folderview?id=0B8DR8_DnlFdQM0diSnZJNnZTYlE&usp=sharing
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
private class MyTimer extends CountDownTimer { | |
public MyTimer(final long millisInFuture, final long countDownInterval) { | |
super(millisInFuture, countDownInterval); | |
} | |
@Override | |
public void onTick(final long milliSecondsStillLeftToFinish) { | |
long seconds = milliSecondsStillLeftToFinish / 1000; | |
long mins = seconds / 60; |
From the stack overflow question here, If we have a code like this,
public class testprog {
static void f (int x) {
System.out.println ("num is " + (x+0)); // <- step into
}
static void g (int x) {
-> f(x); // <----------------------------------- current location
Execution failed for task ':app:clean'. Unable to delete file: ...\app\build\intermediates\exploded.....jars\classes.jar
For this File > Invalidate Cache & Restart
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
# Written to calculate value of x such that x**x**x = 10 | |
# Corresponding Quora answer: https://www.quora.com/If-x-x-x-10-what-is-x/answer/DurgaSwaroop-Perla | |
factor = 100000000 | |
def direction(a, b): | |
if abs(a - b) < (a / factor): | |
return 0 | |
elif a - b < 0: | |
return -1 |
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 bs4 import BeautifulSoup as bs | |
import urllib.request as ureq | |
# Website url | |
freblogg_url = 'http://freblogg.com' | |
# Fetch the website | |
website = ureq.urlopen(freblogg_url).read() | |
# Parse the html of the site with soup |
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
import spark.Request; | |
import javax.servlet.MultipartConfigElement; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.Part; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.nio.file.Files; | |
import java.nio.file.Path; |
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
import org.apache.spark.sql.Dataset; | |
import org.apache.spark.sql.Row; | |
import org.apache.spark.sql.SparkSession; | |
import static org.apache.spark.sql.functions.col; | |
import static org.apache.spark.sql.functions.desc; | |
public class DataSetMain { | |
public static void main(String[] args) { | |
// Initialize Sparksession |
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
#!/bin/bash | |
shopt -s expand_aliases | |
source ~/.bashrc | |
[ $# -eq 0 ] && { | |
echo "Title argument missing" | |
echo "Usage: blog-it <article-title>"; | |
exit 1; | |
} |
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
import sys, subprocess, os.path, time | |
# alias m2h="python ~\Desktop\30DaysOfBlogging\m2h.py" | |
# Run the script with `m2h <markdown file>` | |
# One argument, which is the name of the to be created markdown file | |
if len(sys.argv) is not 2: | |
print("ERROR: One and only one argument needed. Markdown file") | |
sys.exit() |
OlderNewer