Skip to content

Instantly share code, notes, and snippets.

@jonathan-nwosu
jonathan-nwosu / Python Machine learning summary tool
Last active December 30, 2019 14:17
Python web scraping and text summary tool - using simple machine learning techniques. Summarises articles from web pages.
from urllib import request
from bs4 import BeautifulSoup as bs
import re
import nltk
import heapq
url = 'https://en.wikipedia.org/wiki/facebook'
allParagraphContent = ""
htmlDoc = request.urlopen(url)
import csv, sqlite3
import pandas as pd
import numpy as np
con = sqlite3.connect("exercise_database.db")
query_one = pd.read_sql_query("SELECT iso, AVG(score) AS averageScore FROM reviews GROUP BY iso", con)
print(query_one)
@jonathan-nwosu
jonathan-nwosu / data_cleaning.py
Created September 10, 2019 19:59
Data cleaning using Numpy, Pandas and SQL lite
import csv, sqlite3
import pandas as pd
import numpy as np
# 1) Finding any missing data and removing row associated with data
def missing_data(data_path):
df = data_path.dropna(how='any').shape
'use strict';
const Restify = require('restify');
const server = Restify.createServer({
name: "NewsBot"
});
const request = require('request');
const PORT = process.env.PORT || 3000;
server.use(Restify.bodyParser());
server.use(Restify.jsonp());
@jonathan-nwosu
jonathan-nwosu / main.cpp
Created June 15, 2017 16:08
C++ linkedlist recursion
//
// main.cpp
//
// Created by Jonathan Nwosu on 05/04/2017.
// Copyright © 2017 Jonathan Nwosu. All rights reserved.
//
//searching through a linkedlist using recursion... (simply traversing)
#include <iostream>
<?php
$api_link = file_get_contents("https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=5&q=glossybox&key=AIzaSyD2dr0l03UuGH9gU2z9OD8X5kLY5kizAwE");
$encode = json_decode($api_link);
for ($i=0; $i < 5; $i++) {
$results = $encode->items[$i]->id->videoId;
@jonathan-nwosu
jonathan-nwosu / Matlab - basic matrix operations
Created May 19, 2017 19:34
Basic matrix operations on Matlab
%Question 1..
clear all
close all
clc
A = [20 -10 0 0 0 0 0 0
-10 20 -10 0 0 0 0 0
0 -10 15 -5 0 0 0 0
0 0 -5 10 -5 0 0 0
@jonathan-nwosu
jonathan-nwosu / AI - Sentiment Analysis application (PHP implementation)
Last active May 19, 2017 19:29
Note: APIs have been deprecated (Created in 2015)
<!doctype html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>My product (sentview)</title>
<link rel="stylesheet" type="text/css" href="sentiment_analysis.css">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Oldenburg">
<link href='http://fonts.googleapis.com/css?family=Squada+One' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Oswald:700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Oswald:500' rel='stylesheet' type='text/css'>
@jonathan-nwosu
jonathan-nwosu / index.php
Last active May 19, 2017 19:04
Monzo Bank challenge - API implementation PHP/JSON
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="A front-end template that helps you build fast, modern mobile web apps.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>Monzo Dashboard</title>
@jonathan-nwosu
jonathan-nwosu / Extremely basic binary search implementation - C++
Created May 19, 2017 19:00
Finding the number of occurrences of an integer in a sorted array using binary search
//
// main.cpp
// interview_questions
//
// Created by Jonathan Nwosu on 25/03/2017.
// Copyright © 2017 Jonathan Nwosu. All rights reserved.
//
#include <stdio.h>
#include <iostream>