I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
include README.md | |
global-include *.html | |
global-include *.js | |
global-include *.css | |
global-include *.json | |
global-include *.txt | |
global-include *.sql |
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |
from scapy.all import * | |
import requests | |
import time | |
MAGIC_FORM_URL = 'http://put-your-url-here' | |
def record_poop(): | |
data = { | |
"Timestamp": time.strftime("%Y-%m-%d %H:%M"), | |
"Measurement": 'Poopy Diaper' | |
} |
Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.
The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.
On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:
####### 1. A low-resolution photo of road signs
''' | |
Command line tool that takes a csv as input and exports | |
a statistical summary of the data points in html format. | |
''' | |
import pandas as pd | |
import pandas_profiling | |
import argparse | |
import os |
# Run `bin/bokeh serve` and in a new terminal run `python conway.py`. | |
# Based on https://github.com/thearn/game-of-life. | |
from bokeh.plotting import figure, curdoc | |
from bokeh.client import push_session | |
from numpy.fft import fft2, ifft2, fftshift | |
import numpy as np | |
def fft_convolve2d(x,y): |
// Paste in console | |
var getThings = function(){ | |
var divs = [...document.querySelectorAll("#manufacture__container > div")] | |
var things = divs.map(function(e){ | |
var result = {e}; | |
var spans = [...e.getElementsByTagName("span")] | |
spans.map(function(s){ | |
var str = s.innerText.replace(/[^/.0-9]/g, ''); | |
var a = str.split("/"); | |
var num = +a[0]; |
You know how sometimes you connect your Raspberry Pi to a wifi network and then you have absolutely no way of finding out its IP address (Zeroes are particularly bad for this)? Well, I fixed it. Paste the run-once-at-boot-time systemd
script into /etc/systemd/system/pivertiser.service
and enable it with sudo systemctl enable pivertiser.service
, paste the terrible bash hack into /home/pi/pivertiser.sh
and chmod +x /home/pi/pivertiser.sh
, then reboot your pi and it should show its face over here
Those addresses are stored in a hash keyed on hostname
, so clearly if you never rename your pi from raspberrypi
then this is an astonishingly terrible solution, but it's just solved a little problem for me. And you can of course run your own instance on Heroku if you want to