Skip to content

Instantly share code, notes, and snippets.

View armendk's full-sized avatar
🎯
Focusing

armendk

🎯
Focusing
View GitHub Profile
@armendk
armendk / BibleVSHarry.ipynb
Created October 18, 2021 20:27 — forked from SandroLuck/BibleVSHarry.ipynb
TutorialTextClassification
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
### pip install python-Levenshtein
import pandas as pd, numpy as np
from Levenshtein import distance
df = pd.read_csv("20210103_hundenamen.csv")
print(f"Shape: {df.shape}")
### Create a new column for storing Levenshtein distance to 'Luca' scores
df["levenshtein_dist_Luca"] = np.vectorize(lambda name: distance("Luca", name))(df["HUNDENAME"])
@armendk
armendk / UAgentInfo.java
Created July 18, 2016 23:27 — forked from bryanjswift/UAgentInfo.java
User Agent detection in Java
/* *******************************************
// LICENSE INFORMATION
// The code, "Detecting Smartphones Using PHP"
// by Anthony Hand, is licensed under a Creative Commons
// Attribution 3.0 United States License.
//
// Updated 01 March 2010 by Bryan J Swift
// - Remove un-needed if statements instead just returning the boolean
// inside the if clause
//
@armendk
armendk / app.py
Last active September 1, 2015 13:32 — forked from vgoklani/app.py
Using Flask to output Python data to High Charts
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}