As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
require 'base64' | |
require 'open-uri' | |
require 'net/http' | |
require 'net/https' | |
require 'json' | |
class OCR | |
attr_reader :api_key, :image_url | |
def self.scan(api_key:, image_url:) |
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
package main | |
// These benchmarks are used to compare how fast it is to read a set of space separated numbers from a string | |
// using different techniques. | |
// The primary motiviation for this came when writing some code for hackerrank and realizing that the parsing of numbers | |
// for large input sets was actually the bottleneck | |
// | |
// For stable results, it is recommended to increase the runtime allocated for benchmarking, such as | |
// go test -v -run none -bench . -benchtime 5s |
#!/bin/bash | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
RAILS_ENV=production rake db:setup | |
# produces the error below.....hmmm.....it's a no-worky | |
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory | |
# hstore postgresql extension needs to be installed, so.... | |
sudo apt-get install postgresql-contrib | |
# now your extension should be available to enable so log in with psql | |
psql -d yourproject_production -U yourdbuser -W |
require 'Benchmark' | |
def balanced_delimiters?(text) | |
openers = [] | |
matchers = { | |
')' => '(', | |
']' => '[', | |
'}' => '{' | |
} | |
text.chars.each do |char| |
require 'rblineprof' | |
module Rblineprof | |
module ConsoleHelpers | |
include Rblineprof::Helpers | |
def lineprof_block(options = {}, &block) | |
profile = lineprof(rblineprof_profiler_regex(options[:lineprofiler])) do | |
ret = yield | |
end |
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
bg: | |
devise: | |
confirmations: | |
confirmed: "Вашият профил беше успешно потвърден. Влязохте успешно в него." | |
send_instructions: "Ще получите писмо с инструкции как да потвърдите вашия профил до няколко минути." | |
send_paranoid_instructions: "Ако вашият имейл адрес съществува в базата ни, ще получите там инструкции как да потвърдите вашия профил." | |
failure: | |
already_authenticated: "Вече сте влязъл в профила си." |
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% end %> |