2018年 10月 の投稿一覧

“reason”: “Unknown tokenizer type [kuromoji_tokenizer] for [ja_text_tokenizer]”

Elastic CloudにMappingの設定を行なったらエラー
kuromoji_tokenizerがインストールされていないって言われただけだった。


dp$  curl -u elastic:password -X PUT https://8a3bfb8c88***********.us-west1.gcp.cloud.es.io/test_index -d @./mapping.json -H 'Content-Type: application/json' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1326  100   271  100  1055    335   1304 --:--:-- --:--:-- --:--:--  1304
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Unknown tokenizer type [kuromoji_tokenizer] for [ja_text_tokenizer]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Unknown tokenizer type [kuromoji_tokenizer] for [ja_text_tokenizer]"
  },
  "status": 400
}

Cordovaでweb3.jsを使ってkeyStoreの生成を行なうと処理が重くてUIが固まったのでミリ秒で測ってみた。

Cordovaでweb3.jsを使ってアカウント生成から、keyStoreの生成まで行なうと処理が重くてUIが固まったのでミリ秒で測ってみた。


self.prevPointTime = null;
self.log      = [];
self.bench    = function( message , obj ){
console.log( message , obj );
  if( !self.prevPointTime ){
   self.prevPointTime = new Date();
   }
  self.log.push( { message : message , time: ( new Date().getTime() )  - self.prevPointTime.getTime() } );
   self.prevPointTime = new Date();
}

//アカウント生成
self.bench( "web3 -> start create" , null );
var account = self.web3.eth.accounts.create();
self.bench( "web3 -> end create" , account );

//キーストア生成
self.bench( "web3 -> start encrypt" , null );
var key = self.web3.eth.accounts.encrypt( account.privateKey , password );
self.bench( "web3 -> end encrypt" , key );

console.log( self.log );
1: {message: "web3 -> start create", time: 0}
2: {message: "web3 -> end create", time: 51}
3: {message: "web3 -> start encrypt", time: 0}
4: {message: "web3 -> end encrypt", time: 1829}  < -- 1800ミリ秒は重いな。。

ChromeでもCordovaでも差はなくただただencryptが重い。
setTimeoutにしても結局シングルスレッドだし、keyStore形式の必要はないので
encryptの部分を別の暗号化にしてみる。

ebayでNT68676を購入-追跡番号はトラッキングできないし、不良品でセラーにクレーム

埃?でショートして、ボン!!という内臓グラボのコンデンサ爆発とともに、煙がファンから出てきたiMacをモニターとして使えないかな?と調べていみると、どうやらうちのiMacのモニターはフィリップス製のLM201WE3-TLF1というモデルみたいです。

汎用的なLCDコントローラ NT68676を使えばHDMIやD-sub入力のモニターとして使えるようなので、ebayでNT68676のLM201WE3-TLF1対応LCDコントローラを購入しました。



Panel LM201WE3-TLF1 HDMI + DVI + VGA NT68676 LCD Converter Board Kit

NT68676はプログラムによって対応するモニターが変わるのですが、シリアルケーブルなど持っていない場合は目的のモニターにNT68676をプログラム設定済みの商品を探しましょう。
日本のamazonでもありますが、1万くらいして(結局支那から届くみたいです)、ebay(こっちも支那から)なら3000円くらいです。

ebayでNT68676買ってみました。

Hi 〇〇, the seller is preparing to ship your order.
Click here to access order details border=
Tracking Number: RT39〇〇〇〇〇〇HK

RT番号HKなんで香港郵政です、がもちろん調べても出ません。
Tracking number providedは番号が決まっただけなんで、出荷したわけではありません。
それに中国人などは代理店経由であったり、出荷連絡から数日はトラッキングできません。
その辺りは承知していましたが、10日以上たってもトラッキングできないのでOrder -> More actions -> Contact sellerから連絡したら、1日くらいで返信がありました。

Dear friend:
Thank you for shopping with us. We felt very sorry about this. In fact the item has been sent to you by Hongkong Post after you bought
and the tracking number is: RT39〇〇〇〇〇〇HK

and we can see it was on the way to your country.
And I am an honest and responsible seller, I absolutely will not let my buyer interest lost, I hope you can cooperate wait for a period of time, if still not received the product, or receive the products have any problems, I will be responsible for my buyers, I can resend the item to you or give you a refund.
We do not want to give you a bad buying experience even when the shipping is out of our control. i also hope you can understand and help me about this uncontrollable factor, Your satisfaction is my incentive to work.
If you have any other suggestion or request, please also tell me,i will try my best to meet your need.
Thanks a lot.
Have a nice day!

でたよ、「安心してくださいメール」、まだトラッキングサイトに表示されないことを伝えるとまた2日あとくらいに

sorry about this
and yes, we can see the tracking information is as following:

https://www.hongkongpost.hk/en/mail_tracking/index.html
tracking number is: RT39〇〇〇〇〇〇HK

and a good news is that we can see it has the newest tracking information about 5th Oct.
so i sincerely hope you can help to wait for the item is ok
and please do not worry, if have any problem, please tell me, i am sure will be responsible for you
i also hope you can understand and help me about this uncontrollable factor
have a nice day, thank you!!

2週間以上たってやっと、トラッキング可能になりました。さすがチャイナクオリティ。。

いろいろあって1ヶ月はギリギリかからなかったけど届きましたが
HDMIでFireStickTVやD-SUBで試しても、色が反転している?
写真をとって送ると、Menuを押しながら起動(ファクトリーモード?)でLVDSModeとGain,Offsetを指示通りにしろとスクリーンショットが送られてきました。
起動してみると、全然メニュー違うけど、LVDSやGainとOffsetを合わせてみても治らない。
それもメールすると

oh, sorry about this
and if still happened as this
maybe the programme can not compatible with this screen

so you may need to make a new programme on the board
so hope you can help to confirm whether do you know how to make a new programme on the board
and if ok,we can send the programme to your email
please confirm
have a nice day, thank you!

ここに到るまで何回スクリーンショットおくって状況説明したか。。。
そろそろ「have a nice day, thank you!」がムカついてきました。
いやいや商品名「Panel LM201WE3-TLF1 HDMI + DVI + VGA NT68676 LCD Converter Board Kit」だからさ。。。
LM201WE3-TLF1と互換性なかったらなんなんだよ。。

シリアルケーブルも、書き込みプログラムも持ってないし、さっさと正しい商品送らないと、ebayに詐欺だって連絡するって伝えて
ついでに偽商品で迷惑だから、EMSで送れよって伝えましたが華麗にスルーされました。

We can make another new program on the board is ok
And we can resend to you by Hongkong Post with a tracking number
Thank you

いいから早く送れよと連絡

Ok
Thank you so much
Have a nice time

全然nice timeじゃねーよ。

いまここ。

AppCleaner が macOS Mojaveにしたら落ちる。

使ってるバージョンが古かったみたい。
AppCleanerの更新チェックは失敗したので、ダウンロードして上書き

AppCleaner Version 3.0 Beta 2 (3505) → Version 3.4 (3804)


https://freemacsoft.net/appcleaner/
Downloads
Version 3.4
Supports macOS 10.10 to 10.13
Version 2.3
Supports macOS 10.6 to 10.9
Version 1.2.2
Supports macOS 10.4 to 10.5

Elastic CloudにElasticsearchPhpでデータ登録 – Error Content-Type header [application/octet-stream] is not supported


$params = [
    'index' => 'test_index',
    'type'  => 'test_type',
    'id'    => 1,
    'body'  => [ "title" => "タイトルだよ" ]
    ];
$response = $client->index($params);
var_dump( $response );

で実行


$php elastic.php
PHP Fatal error:  Uncaught Elasticsearch\Common\Exceptions\BadRequest400Exception: {"error":"Content-Type header [application/octet-stream] is not supported","status":406} in /Users/dp/ElasticsearchPhp/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:669
Stack trace:

ContentTypeがダメか、Curlの時は注意してましたが、Elasticsearch-PHP [6.0] のマニュアルに指定ってあったかな?

引用:https://dev.classmethod.jp/server-side/elasticsearch/elasticsearch-6-breaking-changes/

Elasticsearch への API は Transport通信を除いて、HTTP(s) リクエストによって操作します。Elasticsearch 5系までは自動検出していた Content-Type ヘッダですが、Elasticsearch 6系より指定が必須となりました。

下記のようにClietにCurlのパラメータ指定を追加してOK


$params = [
    'index' => 'test_index',
    'type'  => 'test_type',
    'id'    => 1,
    'body'  => [ "title" => "タイトルだよ" ]
    'client' => [
        'curl'  => [
            CURLOPT_HTTPHEADER => [
                'Content-type: application/json',
            ]
        ]
    ]
];
$response = $client->index($params);
var_dump( $response );

Elastic CloudにElasticsearchPhpでindex作成メモ


require_once __DIR__ . "/vendor/autoload.php";
use Elasticsearch\ClientBuilder;

$hosts = [[
    'host' => '今回はGCPで作った.us-west1.gcp.cloud.es.io',
    'port' => '9243',
    'scheme' => 'https',
    'user' => 'elastic',
    'pass' => 'elastic cloudで作成時もしくはSecurityから再発行'
    ]];

$client = ClientBuilder::create()->setHosts( $hosts )->build();
$params = [
    'index' => 'test_index'
];
$response = $client->indices()->create( $params );
var_dump( $response );

$php elasticphp.php
array(3) {
  ["acknowledged"]=>
  bool(true)
  ["shards_acknowledged"]=>
  bool(true)
  ["index"]=>
  string(14) "test_index"
}

ブラウザからアクセス


$https://****.us-west1.gcp.cloud.es.io:9243/test_index

{
"test_index": {
"aliases": {},
"mappings": {},
"settings": {
"index": {
"creation_date": "1539144639943",
"number_of_shards": "5",
"number_of_replicas": "1",
"uuid": "emZtlTPUsssexa-hgfIr7w",
"version": {
"created": "6040299"
},
"provided_name": "test_index"
}
}
}
}

ElasticsearchにWordPressのRSS/atomを投入するのに初期設定メモ


dp@elasticsearch-1-vm:~$curl -XPUT 'localhost:9200/mytest_index'
{"acknowledged":true,"shards_acknowledged":true,"index":"mytest_index"}
dp@elasticsearch-1-vm:~$ curl -X GET 'localhost:9200/mytest_index?pretty'
{
  "usedoore_index" : {
    "aliases" : { },
    "mappings" : { },
    "settings" : {
      "index" : {
        "creation_date" : "1538907897984",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "pAkv7kWAQJKUnxyy91M9PA",
        "version" : {
          "created" : "6040099"
        },
        "provided_name" : "mytest_index"
      }
    }
  }
}