This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lucene/analysis/kuromoji/build.xml b/lucene/analysis/kuromoji/build.xml | |
index 0bce4b4..adc6f2d 100644 | |
--- a/lucene/analysis/kuromoji/build.xml | |
+++ b/lucene/analysis/kuromoji/build.xml | |
@@ -17,7 +17,7 @@ | |
limitations under the License. | |
--> | |
-<project name="analyzers-kuromoji" default="default" xmlns:ivy="antlib:org.apache.ivy.ant"> | |
+<project name="analyzers-kuromoji-ipadic-neologd" default="default" xmlns:ivy="antlib:org.apache.ivy.ant"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ガンマ補正 | |
def self.lut(i, gamma) | |
(i.to_f/255.0) ** (1.0/gamma) * 255.0 | |
end | |
#ガンマ補正された画像を生成 | |
def self.gamma_correction_img(img, gamma = GAMMA_DEFAULT) | |
gamma_correction_img = CvMat.new(img.rows, img.cols, CV_8U, 1) | |
(0...img.rows).each do |y| | |
(0...img.cols).each do |x| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global] | |
# 認証周りの設定 | |
aws-access-key-id: AWS_ACCESS_KEY | |
aws-secret-access-key-id: AWS_SECRET_KEY | |
# リージョンの設定 | |
region: ap-northeast-1 | |
# DynamoDBが自動調節をチェックする頻度(秒) | |
check-interval: 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
cache_directories: | |
- ~/dynamodb pre: | |
- bash circleci.sh | |
- cd ~/dynamodb/; java -Xms256m -Xmx256m -Djava.library.path=DynamoDBLocal_lib -jar DynamoDBLocal.jar | |
background: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
if [ ! -d ~/dynamodb ]; | |
then | |
mkdir ~/dynamodb cd ~/dynamodb | |
wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz | |
tar zxf dynamodb_local_latest.tar.gz | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
records = dynamodb.get_item({ table_name: 'crawled_items', key: {"original_url" => 'http://example.com/item', "taskgroup_id" => '0001'} }) | |
records.item.each do |key, value| | |
puts "#{key}: #{value}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
record = { original_url: 'http://example.com/item', taskgroup_id: '0001', title: 'sample', price: 1000 } | |
dynamodb.put_item({ table_name: 'crawled_items', item: record }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dynamodb = DynamoDB.instance | |
dynamodb.create_table({ | |
table_name: 'crawled_items', | |
key_schema: [ | |
{ attribute_name: 'original_url', key_type: 'HASH', }, | |
{ attribute_name: 'taskgroup_id', key_type: 'RANGE', }, | |
], | |
attribute_definitions: [ | |
{ attribute_name: 'original_url', attribute_type: 'S', }, | |
{ attribute_name: 'taskgroup_id', attribute_type: 'S', }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'aws-sdk' | |
class DynamoDB | |
@@dynamodb = nil | |
def self.instance | |
return @@dynamodb if @@dynamodb | |
credentials = Aws::Credentials.new('aws_access_key', 'aws_secret_key') | |
dynamo_config = { region: 'ap-northeast-1', credentials: credentials, } | |
if Rails.env != 'production' #本番環境以外ではDynamoDB Localを利用 | |
dynamo_config[:endpoint] = "http://localhost:8000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install aws-sdk |
NewerOlder