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
/**************************************************************************** | |
* Author: Alberto Gutiérrez Jácome <[email protected]> | |
* Date: 16/09/2012 | |
* | |
* Compilation: javac KdTree.java | |
* Execution: not applicable | |
* Dependencies: Point2D.java RectHV.java StdDraw.java Queue.java | |
* | |
* Description: A mutable data type that uses a 2d-tree to represent a set of | |
* points in the unit square. A 2d-tree is a generalization of a BST to |
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.mllib.clustering.KMeans | |
import org.apache.spark.mllib.linalg.Vectors | |
import org.apache.spark.sql.SQLContext | |
import org.apache.spark.{SparkConf, SparkContext} | |
/** | |
* Created by taiwoadetiloye on 2016-04-01. | |
*/ | |
object kmeans extends App{ |
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
Sqoop is a tool designed to transfer data between Hadoop and relational database servers. For example between MySQL, Orable | |
to HDFS and HBASE | |
Clients access HBase through a Java API, a REST interface, a Thrift gateway, or the HBase shell command-line interface. |
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
"""Initialize app.""" | |
from flask import Flask | |
from .flask_py2neo import Py2Neo | |
from flask_login import LoginManager | |
from . import routes | |
from . import auth | |
db = Py2Neo() | |
login_manager = LoginManager() |
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
"""Initialize app.""" | |
from flask import Flask | |
from .flask_py2neo import Py2Neo | |
from flask_login import LoginManager | |
from . import routes | |
from . import auth | |
db = Py2Neo() | |
login_manager = LoginManager() |
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 __future__ import absolute_import | |
from flask import current_app | |
from py2neo import Graph | |
import os | |
username = os.environ.get('NEO4J_USERNAME') | |
password = os.environ.get('NEO4J_PASSWORD') | |
class Py2Neo(object): | |
def __init__(self, app=None): |
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
"""Database models""" | |
from . import db | |
from werkzeug.security import generate_password_hash, check_password_hash | |
from flask_login import UserMixin | |
from py2neo import Node | |
from py2neo.ogm import GraphObject, Property | |
from datetime import datetime | |
class User(UserMixin, GraphObject): | |
"""Model for user accounts.""" |
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
"""App entry point.""" | |
from application import create_app | |
app = create_app() | |
if __name__ == "__main__": | |
app.run(host='0.0.0.0', debug=True) |
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
### | |
## Author: Taiwo O. Adetiloye | |
## Date: Aug 28, 2020 | |
## Solution 1 | |
### | |
''' Corner cases | |
1. If the prefix_length is greater that the length of the key prefix, | |
then the formulation would be distorted | |
2. The dictionary is not ideal for situation where the |
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
create table seattle_emergence_calls( | |
incident_number varchar, | |
address varchar, | |
type varchar, | |
call_date varchar, | |
latitude varchar, | |
longitude varchar, | |
report_location varchar | |
); |
OlderNewer