Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
package com.google.devrel.samples.gmstest.app; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.view.View; |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
import cv2.cv as cv | |
import tesseract | |
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE) | |
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY) | |
api = tesseract.TessBaseAPI() | |
api.Init(".","eng",tesseract.OEM_DEFAULT) | |
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz") | |
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD) | |
tesseract.SetCvImage(gray,api) | |
print api.GetUTF8Text() |
template <typename Source> | |
struct auto_cast_helper { | |
Source const& value; | |
explicit auto_cast_helper(Source const& value) : value(value) { } | |
template <typename Target> | |
operator Target() const { | |
return static_cast<Target>(value); | |
} |
To toast:
brew install imagemagick
)$ bundle install
$ ./get_token [user] [pass]
$ export GHUSER=[myuser]
enum class dna_strand : char { | |
positive = '+', | |
negative = '-' | |
}; | |
std::ostream& operator <<(std::ostream& out, dna_strand strand) { | |
return out << static_cast<char>(strand); | |
} | |
std::istream& operator >>(std::istream& in, dna_strand& strand) { |
/* | |
Grep.js | |
Author : Nic da Costa ( @nic_daCosta ) | |
Created : 2012/11/14 | |
Version : 0.2 | |
(c) Nic da Costa | |
License : MIT, GPL licenses | |
Overview: | |
Basic function that searches / filters any object or function and returns matched properties. |
#ifndef TEXT_STRING_HPP | |
#define TEXT_STRING_HPP | |
#include <algorithm> | |
#include <cstring> | |
#include <iterator> | |
#include <memory> | |
#include <iosfwd> | |
namespace text { |
module Y { | |
interface Anim extends Base { | |
} | |
interface App extends App_Base, App_Content, App_Transitions, PjaxContent { | |
(config?: any); | |
package main | |
import ( | |
"bufio" | |
"container/list" | |
"flag" | |
"fmt" | |
"net/http" | |
"io" | |
"os" |