https://www.youtube.com/watch?v=w3eRlEhzAZk
http://www.techrepublic.com/blog/tr-dojo/set-up-a-free-ssh-server-on-windows-7-with-freesshd/
2017年8月14日 星期一
2017年6月20日 星期二
Delphi POS 增強功能 : 最後位置,第 N 次位置,出現次數
http://delphi.ktop.com.tw/board.php/00_01_21/post.php?action=usereply&cid=31&fid=79&tid=28123&rid=183889&iid=2207
這只是很簡單的增強 POS 功能的 function ,不知有沒人 POST 過類似的 PosEnd 是回傳 SubStr 在 S 最後一次出現的位置,若沒出現回傳 0 PosN 是回傳 SubStr 在 S 第 n 次出現的位置,若出現少於n次回傳 0 PosCount 是回傳 SubStr 在 S 出現的次數 放這些 Function 的 Unit 要加 use StrUtils
function PosEnd(Substr,S: string): Integer;
var
i : integer;
begin
i := 0;
repeat
result := i;
i := i 1;
i := PosEx(SubStr,S,i)
until i <= 0
end; function PosN(Substr,S: string; N : Integer): Integer;
var
i: integer;
begin
result := 0;
For i := 1 to N do
begin
result := result 1;
result := PosEx(SubStr,S,result);
end;
end; function PosCount(SubStr,S : string) : Integer;
var
i : integer;
begin
i := 0;
result := -1;
repeat
result := result 1;
i := i 1;
i := PosEx(SubStr,S,i)
until i <= 0
end;
| |
function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;
var
I,X: Integer;
Len, LenSubStr: Integer;
begin
if Offset = 1 then
Result := Pos(SubStr, S)
else
begin
I := Offset;
LenSubStr := Length(SubStr);
Len := Length(S) - LenSubStr 1;
while I <= Len do
begin
if S[I] = SubStr[1] then
begin
X := 1;
while (X < LenSubStr) and (S[I X] = SubStr[X 1]) do
Inc(X);
if (X = LenSubStr) then
begin
Result := I;
exit;
end;
end;
Inc(I);
end;
Result := 0;
end;
end;
Delphi Replace,InStr,Left,Right,LeftTrim,RightTrim,Reverse,Split,Replace,Mid Functions
https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=382&lngWId=7
!************************************** ! Name: Replace,InStr,Left,Right,LeftTrim,RightTrim,Reverse,Split,Replace,Mid Functions ! Description:This is just like the name says, The Following Vb functions for Delphi all coded/translated by me: RightTrim LeftTrem InStr Mid Left Right Replace Split Reverse ! By: telle (from psc cd) !************************************** unit Functions; interface uses Windows,Messages, SysUtils, Classes, Graphics,StdCtrls; function RightTrim(const s:String):String; function LeftTrim(const s:String):String; function InStr(Start: integer; Source: string; SourceToFind: string): integer; function Mid(Source: string; Start: integer; Length: integer): string; function Left(Source: string; Length: integer): string; function Right(Source: string; Lengths: integer): string; function Replace(sData: String; sSubstring: String; sNewsubstring: string): String; function Split(Source, Deli: string; StringList: TStringList): TStringList; function Reverse(Line: string): string; implementation function Reverse(Line: string): string; var i: integer; var a: string; begin For i := 1 To Length(Line) do begin a := Right(Line, i); Result := Result + Left(a, 1); end; end; function Split(Source, Deli: string; StringList: TStringList): TStringList; var EndOfCurrentString: byte; begin repeat EndOfCurrentString := Pos(Deli, Source); if EndOfCurrentString = 0 then StringList.add(Source) else StringList.add(Copy(Source, 1, EndOfCurrentString - 1)); Source := Copy(Source, EndOfCurrentString + length(Deli), length(Source) - EndOfCurrentString); until EndOfCurrentString = 0; result := StringList; end; function Replace(sData: String; sSubstring: String; sNewsubstring: string): String; var i: integer; lSub: Longint; lData: Longint; begin i := 1; lSub := Length(sSubstring); lData := Length(sData); repeat begin i := InStr(i, sData, sSubstring); If i = 0 Then begin sNewSubString := sData; Exit end Else sData := Copy(sData, 1, i - 1) + sNewsubstring + Copy(sData, i + lSub, lData); i := i + lSub; End; Until i > lData; Replace := sData; end; function Left(Source: string; Length: integer): string; begin Result := copy(Source,1,Length); end; function Right(Source: string; Lengths: integer): string; begin Result := copy(source,Length(Source) - Lengths,Lengths); end; function Mid(Source: string; Start: integer; Length: integer): string; begin Result := copy(Source,Start,Length); end; function InStr(Start: integer; Source: string; SourceToFind: string): integer; begin Result := pos(SourceToFind,copy(Source,Start,Length(Source) - (Start - 1))); end; function RightTrim(const s:String):String; var i:integer; begin i:=length(s); while (i>0) and (s[i]<=#32) do Dec(i); result:=Copy(s,1,i); end; function LeftTrim(const s:String):String; var i, L:integer; begin L:=length(s); i:=1; while (i<=L) and (s[i]<=#32) do Inc(i); result:=Copy(s,i, MaxInt); end; end.
2017年6月12日 星期一
Robocopy 指定不複製特定目錄
Robocopy 指定不複製特定目錄
robocopy E:\Copy_Source E:\Copy_Dest /s /maxage:7 /e /XD *back* *111*
rem /maxage:7 只要這一周修改的文件
pause
http://blog.xuite.net/dragonfly_7252/computer/223236655-Robocopy+%E6%8C%87%E4%BB%A4%E7%AF%84%E4%BE%8B%E5%8F%83%E8%80%83+(MIR%E5%95%8F%E9%A1%8C%E5%BE%88%E5%A4%9A%EF%BC%8C%E5%B0%8F%E5%BF%83%E4%BD%BF%E7%94%A8
http://ithelp.ithome.com.tw/questions/10175518
robocopy E:\Copy_Source E:\Copy_Dest /s /maxage:7 /e /XD *back* *111*
rem /maxage:7 只要這一周修改的文件
pause
http://blog.xuite.net/dragonfly_7252/computer/223236655-Robocopy+%E6%8C%87%E4%BB%A4%E7%AF%84%E4%BE%8B%E5%8F%83%E8%80%83+(MIR%E5%95%8F%E9%A1%8C%E5%BE%88%E5%A4%9A%EF%BC%8C%E5%B0%8F%E5%BF%83%E4%BD%BF%E7%94%A8
http://ithelp.ithome.com.tw/questions/10175518
2017年5月22日 星期一
Oracle
Oracle
SQLLDR装载换行符的小问题
利用 sqlldr 快速上傳資料
bat 檔案:
----------------------------------------------------------------------
SqlLdr.exe "user/pass@DB_Host control='DM_DATA.ctl' errors=100000 parallel=TRUE rows=1000 bindsize=6553600"
----------------------------------------------------------------------
DM_DATA.ctl:
----------------------------------------------------------------------
load data
infile 'DM_DATA.TXT'
into table TABLE_NAME_TMP
APPEND
fields terminated by '|'
(
USER_NAME
)
----------------------------------------------------------------------
DM_DATA.txt
----------------------------------------------------------------------
AAA
BBB
CCC
DDD
----------------------------------------------------------------------
大量匯入匯出 Oracle 資料表資料
Oracle Performance
l最好的刪除重複資料方法
- nDELETE FROM FXLOTDB E WHERE E.ROWID > (SELECT MIN(X.ROWID)
FROM FXLOTDB X WHERE X.LOT_ID = E.LOT_ID) - 多使用 Decode 提高 Query 時間
- l少用 *
- lcount(Lot_ID) >= count(*) >= count(1)
- l用 TRUNCATE 替代 DELETE 來刪除Table 資料
- l>= V.S <>
- l“C%” V.S “%C”
- l用 NOT EXISTS 替代 NOT IN
Oracale 錯誤編碼查詢
oracle index 查詢
Oracle 進階 by 日期展開查詢
select 'report_item' report_item,
to_char(sysdate -7,'MM/DD') ||'('|| to_char(sysdate -7,'Dy') || ')' d7,
to_char(sysdate -6,'MM/DD') ||'('|| to_char(sysdate -6,'Dy') || ')' d6,
to_char(sysdate -5,'MM/DD') ||'('|| to_char(sysdate -5,'Dy') || ')' d5,
to_char(sysdate -4,'MM/DD') ||'('|| to_char(sysdate -4,'Dy') || ')' d4,
to_char(sysdate -3,'MM/DD') ||'('|| to_char(sysdate -3,'Dy') || ')' d3,
to_char(sysdate -2,'MM/DD') ||'('|| to_char(sysdate -2,'Dy') || ')' d2,
to_char(sysdate -1,'MM/DD') ||'('|| to_char(sysdate -1,'Dy') || ')' d1
from dual
union all
select report_item,
to_char( sum(d7)) d7,
to_char( sum(d6)) d6,
to_char( sum(d5)) d5,
to_char( sum(d4)) d4,
to_char( sum(d3)) d3,
to_char( sum(d2)) d2,
to_char( sum(d1)) d1
from
(select report_item,decode(d,to_char(sysdate -7,'MM/DD'),CNT,0) d7,
decode(d,to_char(sysdate -6,'MM/DD'),CNT,0) d6,
decode(d,to_char(sysdate -5,'MM/DD'),CNT,0) d5,
decode(d,to_char(sysdate -4,'MM/DD'),CNT,0) d4,
decode(d,to_char(sysdate -3,'MM/DD'),CNT,0) d3,
decode(d,to_char(sysdate -2,'MM/DD'),CNT,0) d2,
decode(d,to_char(sysdate -1,'MM/DD'),CNT,0) d1
from
(select report_item,to_char(to_date(shift_dt,'yyyy/mm/dd'),'MM/DD') d,Level_3 CNT from f3cim.RPT_EMAP2_ESFABSUM_BT where shift_dt>= to_char(sysdate-7,'yyyy/mm/dd')
)
) group by report_item
case when
decode ( expression , search , result [, search , result]... [, default] )
任選固定資料
sSql := 'select ' +
stmp_ColumnSum +
','''' as "USER答案" ' +
' from ' +
'(' +
'(' +
'select a.* from ' +
'(' +
'select a.*,1 as ID from QUESTION_UT a ' +
'where ' +
'a.QUESTION_TYPE = ''是非'' and ' +
'a.PAPER_ID = ''' + cmb_Paper_ID02.Text + ''' and ' +
'a.DELETE_TIME is null ' +
'order by dbms_random.random ' +
') a where rownum <= ' + grd_Question_Num_Set00.Cells[ 2 , 1 ] + ' ' +
')' +
'union ' +
'(' +
'select a.* from ' +
'(' +
'select a.*,2 as ID from QUESTION_UT a ' +
'where ' +
'a.QUESTION_TYPE = ''單選'' and ' +
'a.PAPER_ID = ''' + cmb_Paper_ID02.Text + ''' and ' +
'a.DELETE_TIME is null ' +
'order by dbms_random.random ' +
') a where rownum <= ' + grd_Question_Num_Set00.Cells[ 2 , 2 ] + ' ' +
')' +
'union ' +
'(' +
'select a.* from ' +
'(' +
'select a.*,3 as ID from QUESTION_UT a ' +
'where ' +
'a.QUESTION_TYPE = ''複選'' and ' +
'a.PAPER_ID = ''' + cmb_Paper_ID02.Text + ''' and ' +
'a.DELETE_TIME is null ' +
'order by dbms_random.random ' +
') a where rownum <= ' + grd_Question_Num_Set00.Cells[ 2 , 3 ] + ' ' +
')' +
'union ' +
'(' +
'select a.* from ' +
'(' +
'select a.*,4 as ID from QUESTION_UT a ' +
'where ' +
'a.QUESTION_TYPE = ''填充'' and ' +
'a.PAPER_ID = ''' + cmb_Paper_ID02.Text + ''' and ' +
'a.DELETE_TIME is null ' +
'order by dbms_random.random ' +
') a where rownum <= ' + grd_Question_Num_Set00.Cells[ 2 , 4 ] + ' ' +
')' +
')' +
'order by ' +
'ID,QUESTION_ID ';
MRTG
MRTG
WIN2000 PRO 架設 MRTG 教學
MRTG
整合 Active Perl 及 IIS
MRTG
IIS下架構跨平台的Perl
MRTG
安裝 SNMP 服務
MRTG
ActivePerl For Windows 架設教學
MRTG
訂閱:
文章 (Atom)