2017/04/19

eclipse error

workspace\.metadata/.log

eclipse.exe -clean

治らない。。

marketplaceのおすすめがおるさい。。
general ->editer->関連付けられていないファイルのオープンを「text editor]にする

2017/02/06

python

import os
print(os.getcwd())
=>install directory!

import math
dir(math)
=>to see that in math module

from math import ceil
print ceil(4.5)
=>not necessary to use math.

import tkinter
import tkinter.filedialog
tk = tkinter.Tk()
tk.withdraw()        # 小ウィンドウを表示しないようにする。
args = { “initialdir” : “c:/”,
“filetypes” : [(“テキストファイル”, “*.txt”)],
“title” : “テスト”
}
print (tkinter.filedialog.askopenfilename(**args))
input(“press enter”)
=>open the file


myword=u"あいうえお”
=>japanese words is unicode 2 bytes
myword=myword.decode('utf-8')
->read in utf,out in utf

def my_methord():

2016/01/21

HttpResponse Stream


あまり情報がないので、
 
★The respone entity is always not null and is stream,so the 
  releaseConnection method cant be invoked always.
  
  
   final HttpEntity entity = response.getEntity(); 
  if (entity == null || !entity.isStreaming()) { 
 
★ 

  1. Using EntityUtils and HttpEntity
    HttpResponse response = httpClient.execute(new HttpGet(URL));
    HttpEntity entity = response.getEntity();
    String responseString = EntityUtils.toString(entity, "UTF-8");
    System.out.println(responseString);
  2. Using BasicResponseHandler
    HttpResponse response = httpClient.execute(new HttpGet(URL));
    String responseString = new BasicResponseHandler().handleResponse(response);
    System.out.println(responseString);
     
     
    基本なことね、恥ずかしい、全てのresponeはStreamみたいなので
    、また調べる 

2016/01/17

windows 印刷 job削除

windowsを再起動して治るが、時間かかります。
・service->Print Spoolー>再開
  トキドキうまくいく
・Ctl+Rー>spool、C:\Windows\System32\spoolにいく、
  PRINTTERS下の
  *.SHD
  *.SPL
を削除する、削除できない物はあり、先にPrint Spool Serviceを停止して。


・プリンターを再起動する

でもいっぱい印刷する時、時々とまるので、こまる
また調べる

・spool Serviceを停止して、プリンターの一覧もきえる
ーー>プリンターを削除できない

。。。。

2015/07/05

DAT 変換 ren

datとは、ファイル全般に対して用いられることがある汎用の拡張子である。ファイルタイプやアプリケーションの種類に関わらず使用される可能性がありま す。DATファイルとは、ファイル形式・拡張子の一つだが、標準化されたデータ形式ではなく、 アプリケーション独自の形式で保存されたデータのファイル名の拡張子などによく使われます。一般的なデータファイル、電子メールで添付ファイルとして winmail.datおよびVCDのビデオファイル三つの種類があります。

 XMediaRecode?
http://www.forest.impress.co.jp/library/software/xmediarecode/download_10952.html

REN *.bat *.mpge

VCDにあるDATファイルをMPEGを修正して、見えるようになった。。

2015/06/24

Charles ios

CharlesのFAQにある通り、iPhoneにSSL証明ををインストールする必要があります。iPhoneのSafariから http://charlesproxy.com/charles.crt にアクセスし、SSL証明書をインストールしてください。

2015/06/21

windows user 自動 ログイン

Crl+R

Windows7
control userpasswords2
==>ログインユーザーパスポートが必要、チェックアウトする

control userpasswords2出ない

rundll32 netplwiz.dll,UsersRunDll
 
 
 

2015/06/06

改行コード DB java client?

つまらないことですが、思う通り行かない困るね。。。
世の中そんなことが多いと思いますが、
そんなことに時間を取られて、結局つまらないね。。。

DBに下記をinsert
 "今日は土曜日。\n明日は日曜日"
改行したいです!!

javaでoutPutして見る
System.out.print(description);
==> "今日は土曜日。\n明日は日曜日"

値は\\nになっている。


じゃ。。。

DB  "今日は土曜日。rn明日は日曜日"
JAVA 
        product.setDescription(product.getDescription().replaceAll("rn", "\n"));
System.out.println(product.getDescription());
==>
OK!!

2015/06/03

log4j pattern

%c ログイベントのカテゴリー名を出力する。
%C ロギング要求を行うクラス名を出力する。
%d ログイベントの日時を出力する。
%d{HH:mm:ss} や %d{dd MMM yyyy HH}として、より柔軟に日時情報を出力することが出来る。
%F(*) ログ要求が発生したファイル名を出力する。
%l(*) ログが生成されたときに呼び出された位置(ソース名、行)を出力する。
%L(*) ロギング要求を行なった行番号を出力する。
%m ロギングイベントで設定されたメッセージを出力する。
%M(*) ログ要求が行なわれたメソッド名を出力する。
%n プラットフォーム依存の改行文字を出力する。
%p ログの優先度を出力します。
%r アプリケーションが開始してから、ログが出力されるまでの時間をミリ秒単位で出力する。
%t ログを生成したスレッドの名前を出力する。
%x ログが生成されたスレッドのNDC(ネスト化診断コンテキスト) を出力する。
%% %を出力する。


 例:
<PatternLayout>
                <Pattern>%d %c{1.} [%t] %m%n</Pattern>
  </PatternLayout>

2015/05/29

時間 intergerで表示 java

    long now = System.currentTimeMillis();
==>1432909782064 13桁!

十桁で時間を表示する?
例: 1336383401 (2012-05-07 09:36:41Z)
UNIX時間 
10ケタの秒数で年月日時分秒すべて表現する

何が違う????

秒の表示とミリ秒の表示かな!!?
10            13

じゃ、13桁の方を1000で割り、で比較できるね!!!