2018年12月20日 星期四

我常用的Visual Studio 熱鍵(HOTKEY)

Cntl+alt+F10 快速使用use 的對話方塊

Cntl+K,C     mark 所選範圍
Cntl+K,U     unmark 所選範圍

Cntl+-       like Eclipse Cntl+Q


Ctrl+Shift+U 文字轉換為大寫
Ctrl+U       轉換為小寫

C#.NET 不一致的存取範圍

今天把一個CLASS 變更為PUBLIC CLASS 後,出現了這樣的錯誤。主要是說List<Company> 不一致的存取範圍。看了很久終於知道。

原來的Company 不是PUBLIC CLASS。

所以把Company Class 改為PUBLIC CLASS 後就正常了。

Java String format 格式備忘

%s字符串类型"mingrisoft"
%c字符类型'm'
%b布尔类型true
%d整数类型(十进制)99
%x整数类型(十六进制)FF
%o整数类型(八进制)77
%f浮点类型99.99
%a十六进制浮点类型FF.35AE
%e指数类型9.38e+5
%g通用浮点类型(f和e类型中较短的)
%h散列码
%%百分比类型
%n换行符
%tx日期与时间类型(x代表不同的日期与时间转换符

2018年7月27日 星期五

WINDOWS 10 同時使用Hyper-V 與 Oracle Virtual Box

根據自己使用經驗比較習慣Virtual Box 的操作,但因為工作關係,有時還是會使用Hyper-V。
我自己的環境是先安裝好Virtual Box,再啟用Windows 10 的Hyper-V功能。

啟用Hyper-V 功能後,原來的Virtual Box 會被迫無法使用vcpu-core,Guest OS 也被限制為
32位元模式。

可利用開機選單強迫關閉Hyper-V 功能。

1. 以管理員身份執行CMD
2. bcedit .copy {current} /d "windows 10 without Hyper-V"
會取得一個序號
3. bcedit /set {序號} hypervisorlaunchtype OFF

-----------------------------------------------------------------------------
可自行研究bcedit 的指令。


2018年7月18日 星期三

使用Windows PowerShell VHDX 轉換為VHD

指令

PS C:/>Convert-VHD –Path c:\test\MY-VM.vhdx –DestinationPath c:\test\MY-NEW-VM.vhd



先確認有開啟"適用於Winwos PowerShell的Hyper-V 模組

1. 開始->設定->應用程式

2. 點選程式與功能(依解析度不同,可能在右邊或下方))



3. 開啟適用於Windows PowerShell 的 Hyper-V 模組

強制修改 WINDOWS 10 繁體中文語系

前一段時間為了解決報稅軟體亂碼問題,將自己的語系改為中文(澳門特別行政區)
不巧在升級Windows 10 TO 1803 後,語系不能再移除了。

找了很多方法都無法改為中文(台灣)。

後來找到一個方式測試是OK的--

進powershell

執行

$1 = New-WinUserLanguageList zh-TW
Set-WinUserLanguageList $1

重開機就好了。


2018年6月13日 星期三

[DB] Informix System Columns 應用



select * from SYSTABLES, SYSCOLUMNS 
where tabname your condition
and SYSTABLES.tabid = SYSCOLUMNS.tabid

因為工作環境關係, 用WHERE 條件式的JOIN 語法.


Table 1. The SYSCOLUMNS table
ColumnTypeExplanation
colnameVARCHAR(128)Column name
tabidINTEGERIdentifying code of table containing the column
colnoSMALLINTColumn number
The system sequentially assigns this (from left to right within each table).
coltypeSMALLINTCode indicating the data type of the column:
  • 0 = CHAR
  • 1 = SMALLINT
  • 2 = INTEGER
  • 3 = FLOAT
  • 4 = SMALLFLOAT
  • 5 = DECIMAL
  • 6 = SERIAL 1
  • 7 = DATE
  • 8 = MONEY
  • 9 = NULL
  • 10 = DATETIME
  • 11 = BYTE
  • 12 = TEXT
  • 13 = VARCHAR
  • 14 = INTERVAL
  • 15 = NCHAR
  • 16 = NVARCHAR
  • 17 = INT8
  • 18 = SERIAL8 1
  • 19 = SET
  • 20 = MULTISET
  • 21 = LIST
  • 22 = ROW (unnamed)
  • 23 = COLLECTION
  • 40 = LVARCHAR fixed-length opaque types 2
  • 41 = BLOB, BOOLEAN, CLOB variable-length opaque types 2
  • 43 = LVARCHAR (client-side only)
  • 45 = BOOLEAN
  • 52 = BIGINT
  • 53 = BIGSERIAL 1
  • 2061 = IDSSECURITYLABEL 2, 3
  • 4118 = ROW (named)
collengthAny of the following data types:
  • Integer-based
  • Varying-length character
  • Time
  • Fixed-point
  • Simple-large-object
  • IDSSECURITYLABEL
The value depends on the data type of the column. For some data types, the value is the column length (in bytes). See Storing Column Length for more information.
colminINTEGERMinimum column length (in bytes)
colmaxINTEGERMaximum column length (in bytes)
extended_idINTEGERData type code, from the sysxtdtypestable, of the data type specified in the coltype column
seclabelidINTEGERThe label ID of the security label associated with the column if it is a protected column. NULL otherwise.
colattrSMALLINT
HIDDEN
1 - Hidden column
ROWVER
2 - Row version column
ROW_CHKSUM
4 - Row key column
ER_CHECKVER
8 - ER row version column
UPGRD1_COL
16 - ER auto primary key column
UPGRD2_COL
32 - ER auto primary key column
UPGRD3_COL
64 - ER auto primary key column
PK_NOTNULL
128 - NOT NULL by PRIMARY 

[DB] Informix SystemTable 應用

Informix 中,可以用下列的指令取得Table Name,

select tabname from systables
where tabname your condition

Table 1. SYSTABLES table column descriptions
ColumnTypeExplanation
tabnameVARCHAR(128)Name of table, view, synonym, or sequence
ownerCHAR(32)Owner of table (user informix for system catalog tables and usernamefor database tables)
partnumINTEGERPhysical storage location code
tabidSERIALSystem-assigned sequential identifying number
rowsizeSMALLINTMaximum row size in bytes ( < 32,768)
ncolsSMALLINTNumber of columns in the table
nindexesSMALLINTNumber of indexes on the table
nrowsFLOATNumber of rows in the table
createdDATEDate when table was created or last modified
versionINTEGERNumber that changes when table is altered
tabtypeCHAR(1)Code indicating the type of table object:
  • T = Table
  • E = External Table
  • V = View
  • Q = Sequence
  • P = Private synonym
  • S = Public synonym
(Type S is unavailable in an ANSI-compliant database.)
locklevelCHAR(1)Lock mode for the table:
  • B = Page and row level
  • P = Page level
  • R = Row level
npusedFLOATNumber of data pages that have ever been initialized in the tablespace by the database server
fextsizeINTEGERSize of initial extent (in KB)
nextsizeINTEGERSize of all subsequent extents (in KB)
flagsSMALLINTCodes for classifying permanent tables:
ROWID
1 - Has rowid column defined
UNDER
2 - Table created under a supertable
VIEWREMOTE
4 - View is based on a remote table
CDR
8 - Has CDRCOLS defined
RAW
16 - (Informix) RAW table
EXTERNAL
32- External table
AUDIT
64 - Audit table attribute - FGA
AQT
128 - View is an AQT for DWA offloading
VIRTAQT
256 - View is a virtual AQT
siteVARCHAR(128)Reserved for future use
dbnameVARCHAR(128)Reserved for future use
type_xidINTEGERCode from sysxtdtypes.extended_idfor typed tables, or 0 for untyped tables
am_idINTEGERAccess method code (key to sysamstable)
NULL or 0 indicates built-in storage manager
pagesizeINTEGERThe pagesize, in bytes, of the dbspace (or dbspaces, if the table is fragmented) where the table data resides.
ustlowtsDATETIME YEAR TO FRACTION (5)When table, row, and page-count statistics were last recorded
secpolicyidINTEGERID of the SECURITY policy attached to the table. NULL for non-protected tables
protgranularityCHAR(1)LBAC granularity level:
  • R: Row level granularity
  • C: Column level granularity
  • B: Both column and row granularity
  • Blank for non-protected tables
statlevelCHAR(1)Statistics level
  • T = table
  • F = fragment
  • A = automatic
statchangeSMALLINTFor internal use only

2018年6月11日 星期一

使用notepad++ 把傳統命名改為JAVA 命名

傳統的命名方式為

cust_name, user_email 等.

JAVA變數命名為駝峰式命名 Camel-Case 也稱為駝峰式大小寫.

可以使用notepad++ 正規表示法取代的方法變更命名.


Before:

cust_name, user_email

尋找內容:[_]{1,1}([a-z])
取代為:\U$1


After:
custName, userEmail

2018年5月29日 星期二

Linux 備忘錄

1. 常用指令
1.1 關機

sudo shutdown -r

是指重開機, 預設會在[FIXME]時間後重開機
可以使用shutdown -c 取消.

而sudo shutdown -r -t 0

是指不等待, 立刻重新開機.



2. 網路相關

2-1 設定search domain
/etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search yourdomain.com.tw


3. 輸入法
安裝倉頡

sudo apt-get install fcitx-table-cangjie3

安裝完畢後, 先登出系統,
之後重新登入糸統後, 在上方工具列處點選鍵盤工具設定。






Ads

Seo Services