八月 25
<%# Eval("SDate", "{0:yyyy/MM/dd}") %>
// 0: 表示定義整個括號裡面的第 0 個變數要採用此日期格式。

// 以下為兩個變數的範例。
string s = String.Format("At {0}, the temperature is {1}°C.",
                         DateTime.Now, 20.4);
Console.WriteLine(s);
// Output similar to: 'At 4/10/2015 9:29:41 AM, the temperature is 20.4°C.'

【参考链接】

Jul 11
unit unit1;

interface

uses
  Windows, Messages....

type
  TFormName = (Casefm1, Casefm2, Casefm3);

function xxx(): Boolean;
var
  StrFormName: String;
  CaseFormName: TFormName;
begin
  StrFormName := 'Case' + vFormName; 
  // 將 FormName(物件) 與 TFormName(值) 做區隔。
  // (vFormName為帶有各FormName的字串變數)
  CaseFormName := TFormName(GetEnumValue(TypeInfo(TFormName), StrFormName));

  case CaseFormName of
    Casefm1:
      begin
        ..............
      end;

    Casefm2:
      begin
        ..............
      end;

    Casefm3: 
      begin
       ...............
      end;

【参考链接】

Jul 11

The Delphi menu font seems to always revert to the default (8, Tahoma) Issue,Someone abroad asked about it,But there's no solution。For now, the temporary solution I can think of is to set up a function key (Can be set as a hotkey),So that when the user encounters the font becoming small,They can manually reset the font size。(During testing, changing the Windows display scaling percentage can make the menu font revert to the default)

procedure Tmainform.N93Click(Sender: TObject);
begin
  Screen.MenuFont.Size := 12;
  xxxxxx.BringToFront; // 改變畫面焦點,以刷新選單畫面。
end;

【参考链接】

Jul 11
procedure TfmQAB.FormShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
if (Msg.CharCode = 116)  and (HiWord(GetKeyState(VK_CONTROL)) = 1)  then 
  begin
    ......
  end
end;

【参考链接】

Jul 11
var
  vTime, vTime1, vTime2: double;
begin
  vTime1 := GetTickCount();
  vTime2 := GetTickCount();
  vTime := (vTime2 - vTime1) / 1000;
  Showmessage(floatToStr(vTime) + 's');
end;

【参考链接】

一月 20

刚才在调试 CSS 语法时,不知道为什么,将分辨率模拟成手机分辨率后,版型没有显示 RWD 应有的效果,一开始以为 @media screen 语法没有生效,反复测试后,发现却是因为 width 语法没有跟着分辨率的比例变化 (已经设成 auto 或用 max-width)。后来试出是要关闭‘网页开发者’模式里的”触控模拟”功能,才会正常,目前还不知道为什么会这样影响。
继续浏览 »

可能 27

今天在查看系统日志时,看到 MariaDB 有一大堆错误信息,内容如下:

InnoDB: 表 mysql/innodb_index_stats 在列名 table_name 上存在长度不匹配. 请运行 mysql_upgrade

继续浏览 »

Apr 29

  SQL Server 預設會吃光作業系統的記憶體而在 SQL Server 專用的伺服器上一般也會建議盡量把記憶體都讓 SQL Server 使用一來提昇效率二來也降低硬碟的 IO 損耗不過若有特定的情況需要控制 SQL Server 的記憶體上限,可以通过 SQL Server Management Studio (SSMS) 来实现。

继续浏览 »

Apr 14
list1 = []
sizeNum = int(input("Please input the size of matrix: "))

for i in range(sizeNum):
    valueNum = int(input("Please input the value: "))
    list1.append(valueNum)

print(list1)
Apr 14
num = int(input("Please input a number: "))

for i in range(2, num):
    for j in range(2, i):
        if (i % j == 0):
            break
        
        if (i == j + 1):
            print(i)