2019/05/30

English talk memo 20180529

selfish
selfless

outgoing
extroverted
introverted

be tired of watermelon,i am sick of it(i am sick of you?)
be tried from my work

have no courage to admit that he is a gay

an honest man

second hand goods ,new goods

confident

i am angry with
be furious with

everyone is stubborn.

fill many application forms

a modest person

a plate with nazi icon

He is a military man

the dragon is like some fighter plane

she has been hurt a lot by her husband

his mother has no vitality.like some plant

the main guy's wife wants to be conquered by someone.

divorce with his wife.

beat someone up for something.

using candid camera

investment exams

her favorite fruit is durian. 榴莲
dragon fruit 火龙果
avocado

schoolmate, alumni 校友

plum wine 梅酒

violent 暴力的

obsessed with something 迷上了什么事情

loose weight

infant 婴儿

miserable 悲惨的な





i am an engineer. i go to work almost everyday.
i am waiting for you.
i have already told you the detail.
i have always been wanting to go there.

i came to japan 11 years ago.
i was doing my homework at that time.
She said she had told you.
she had been wait for three hours when you came.

i will fly to the USA tomorrow.
i will be doing my homework tomorrow 7 am.
i will have finished my homework tomorrow.
i will have been working for an hour when you come to see me tomorrow 7 am.

she said she was going to buy a new car(she would buy a new car).
she said she could not come here because she would be having a meeting.
i would have told you yesterday( but i forgot it.)
what would Jim have been working on after 11 pm yesterday







2019/03/27

gin,appengine,graphql test


gin+GAE+graphql のテスト下記で行けった。


appEngineTestInstance
->instance.NewRequest
gin.Context(request)
context.Set(key value)

```
ins, _ := aetest.NewInstance(nil)
req, _ := ins.NewRequest("", "", nil)

var context *gin.Context
context = &gin.Context{Request: req}
b, _ := json.Marshal(x.y{z: "1"})
context.Set("key", b)
```

2019/03/18

2019/03/05

Removing packages installed with go get

juse delete the source and package
麻烦,要是有一个命令就好了,找一下

It's safe to just delete the source directory and compiled package file. Find the source directory under $GOPATH/src and the package file under $GOPATH/pkg/<architecture>, for example: $GOPATH/pkg/windows_amd64.


example
go get github.com/golang/mock/mockgen


go clean -i github.com/golang/mock/mockgen

The -i flag causes clean to remove the corresponding installed
archive or binary (what 'go install' would create).

The -n flag causes clean to print the remove commands it would execute,
but not run them.

The -r flag causes clean to be applied recursively to all the
dependencies of the packages named by the import paths.


The -x flag causes clean to print remove commands as it executes them.

不知道安装的packagePath的话,找一下$GOPATH/pkg/windows_amd64啥的

2019/03/04

go gin validator omitempty

細かくて面倒

・Pointer推奨、nilとZeroValueを区別するため
・bindingはpointerに対しても有効
・omtiemptyが必須ね。。

type XXXRequest struct {
Adate *time.Time `json:"aDate,omitempty" time_format:"2006-01-02”` 
B *float64`json:"b,omitempty" binding:"omitempty,min=-90,max=90”` 
C *float64 `json:"c,omitempty" binding:"omitempty,min=-180,max=180”`
}

2019/02/25

swagger 更新されない

Swagger.yamlを修正しても、8090をアクセスして変更されない
docker-componseでup ,down変わらない
docker image,containerでrmで変わらない

BrowerのCacheが。。。。
迷惑だから、勝手にCacheしないてを言いたい
(cmd shift r常識の、面倒)

2019/02/21

golang pointer compare

Pointer values are comparable. Two pointer values are equal if they point to the same variable or if both have value nil

2019/02/18

jmeter org.apache.commons.httpclient.NoHttpResponseException

規律的に半分が上記のエラーになった。
良くわからない、
Server側が一方的に拒否した?
HttpHeaderの設定で、KeepAliveをOffして、治った。
今回のテスト対象がnginx + djangoなので、keepaliveの設定が悪い疑惑!
また調べる。
https://road288.hatenablog.com/entry/2017/12/13/095408
https://qiita.com/edward999th/items/bc730faed3ca38760a26
https://www.ibm.com/developerworks/jp/opensource/library/os-django/index.html

2019/02/11

http options

投石问路

   サーバーがサポートするリクエストメソッドを調べるには、curlを使用してOPTIONS要求を発行します。
curl -X OPTIONS http://example.org -i
レスポンスには、許可されたメソッドを持つ Allow ヘッダが含まれています:
HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST
Cache-Control: max-age=604800
Date: Thu, 13 Oct 2016 11:45:00 GMT
Expires: Thu, 20 Oct 2016 11:45:00 GMT
Server: EOS (lax004/2813)
x-ec-custom-error: 1
Content-Length: 0

2019/02/10

gke cloudsql

  • create serviceAccount with cloudsql privelage
  • down cloudsql json key
  • create kubectl secert
    ```
    kubectl create secret generic cloudsql-oauth-credentials --from-file=credentails.json=.json
    ```
  • deployment.yaml
    ```
    volumes:
      - name: cloudsql-oauth-credentials
        secret:
          secretName: cloudsql-oauth-credentials
    
      - name: ssl-certs
        hostPath:
          path: /etc/ssl/certs
    
      - name: cloudsql
        emptyDir: {}
    
    
    - name: cloudsql-proxy
      image: gcr.io/cloudsql-docker/gce-proxy:1.11
      command: ["/cloud_sql_proxy",
                "-instances=projectName:region:instance=tcp:3306",
                "-credential_file=/secrets/cloudsql/credentials.json"]
      ports:
        - containerPort: 3306
          protocol: TCP
      securityContext:
        runAsUser: 2  # non-root user    allowPrivilegeEscalation: false
      volumeMounts:
        - name: cloudsql-oauth-credentials
          mountPath: /secrets/cloudsql
          readOnly: true
    ```