2024年3月10日 星期日

vscode 上使用 verilog

 文章收集:

在 VSCode 上使用 Verilog 開發並模擬硬體
https://hkt999.medium.com/%E5%9C%A8-vscode-%E4%B8%8A%E4%BD%BF%E7%94%A8-verilog-%E9%96%8B%E7%99%BC%E4%B8%A6%E6%A8%A1%E6%93%AC%E7%A1%AC%E9%AB%94-f915735e47b0

一定學得會!!! 在vscode上架設易於開發verilog/system verilog的環境之教學(win10環境)

https://www.dcard.tw/f/nctu/p/235935287

2024年2月24日 星期六

[Node-RED] study

 不錯的網站資料,有時間可以學習學習:

https://hackmd.io/6whOr3M9Rg6ibRejkVYbtQ

2024年1月24日 星期三

[C#]頁畫捲入/移出效果

 找到的不錯範例,感覺蠻強的,找時間實作一下

https://blog.csdn.net/YouyoMei/article/details/100776043

2024年1月14日 星期日

MQTT study

 不錯的文章

| ESP32 教學 | 認識 MQTT 與安裝 Mosquitto Windows 版本
https://jimirobot.tw/esp32-mosquitto-windows-mqtt-tutorial/

Practical MQTT with Steve
http://www.steves-internet-guide.com/

2023年10月14日 星期六

[C#]study

 //數字分隔符號

int x1=0b1_0011_0001;

float f=50_666.8f;


//一個字串如果內部有逸出字元,若是在字串雙引號左邊加上@字元,可以防止逸出字元被轉譯

string str1=@"D:\Python\ch1.";


//匿名資料類別(Anonymous Type)是一種唯讀資料,其內容不可被更改,使用var宣告

var stu=new {ID=1,Name="Jiln"};

var score=new{Math=80,Physics=92,English=95}

Console.WriteLine($"編號:{stu.ID} 姓名:{stu.Name}");


//"??="複合運算式,這個符號稱Null-coalescing assignment,中文可以解釋為空白併賦值

x??0 //如果x是null,則設定x等於0

z=x??0 //x是null則z=0,否則z是x原值


//Convert.ToString(int value,int toBase) 這個方法可以將指定的數值轉成相等的字串

Convert.ToString(x,int toBase:2);//2進位

Convert.ToString(x,int toBase:8);//8進位

Convert.ToString(x,int toBase:16);//16進位


//TryParse 用法

string name,score;

int sc;

name=Console.ReadLine();

score=Console.ReadLine();

Int32.TrysParse(score,out sc);

Console.WriteLine($"{name} 成績是 {sc}"};


Random rmd=new Random(int seed);//隨機樹的種子植,如果想要每次執行接獲得一樣的隨機數

Random rmd=new Random(100);


//object 陣列

object[] ball={"James",38,36,35,26,28}


//宣告不規則陣列與設定初值

int[][] sc=new int[3][];

sc[0]=new int[] {90,80,95};

sc[1]=new int[] {30,22};

sc[2]=new int[] {95,90,85,87};



int[][] sc=

{

new int[] {90,80,95}

new int[] {30,22}

new int[] {95,90,85,87}

}


//.NET的集合

ArrayList arrlist=new ArrayList()-可以動態增減,可以有不同的元素資料型態,一維陣列


HashTable ht=new HashTable()-元素用"鍵/值"方式配對儲存(python的字典)

ht.add("Spring","春季");

ht["Spring"]="春天"

建立HashTable 也可以使用整數當鍵


//如果將ref關鍵字改為out也可以傳遞位址資訊,這時可以不需要初始化變數值

CountA(mystr,out num)

//唯獨關鍵字 in

void UsaToNt(int money,in double rate,out double rtn)

{

...

}

UsaToNt(money,rate,out dollar)


//函數呼叫-可變動數量參數 params  只限定一維陣列

void UseParam1(params int[] arr)

{

....

}

void UseParam2(param object[] arr)

{

 ....

}


//函數傳遞二維振烈資料-只傳遞名稱,然後由二維的GeLength()屬性獲得列嶼行數

void Average(int[,] sc)

{

int rows=sc.GetLength(0);

int cols=sc.GetLength(1);

}


//匿名陣列-用完就不再需要,此時可以考慮不要宣告陣列,直接用匿名陣列方式處理,將匿名陣列當作參數傳遞

add(new int[]{1,2,3,4,5});


//Expression-Bodied Method(表達式主體方法),是指一個函數如果只有一行內容,可以將函數用下式表達

ReturnType FuncName(arg1,arg2,...argn)=>expression

int add(int x,int y)=>x+y


//dynamic 函數與參數-在程式編譯階段不做資料檢查,在程式執行階段才做資料檢查

dynamic AddDynamic(dynamic a,dynamic b)

{

return a+b;

}

Console.WriteLine($"3+5={AddDynamic(3,5)}");

Console.WriteLine($"3.2+5.3={AddDynamic(3.2,5,3)}");


//readonly 除了建構子所設資料外,則此結構的所有成員資料只能讀取,無法更改內容

public readlony struct coords

{

public coords(double x,double y)

{

X=x;

Y=y;

}

public double x {get;init:}

public double Y {get;init:}

}


//with 關鍵字-可以複製結構實體的特定欄位資料,然後予以修改

var p1=new coords(2,5);

var p2=p1 with {x=5};


//enum

enum WeekDays

{

Sunday,

Monday,

Tuesday,

Wendnesday

}

Console.writeLine($"Sunday:{(int)WeekDays.Sunday}");


2023年1月12日 星期四

[C#] 小技巧


操作說明:使用相對值指定轉換的原點

https://learn.microsoft.com/zh-tw/dotnet/desktop/wpf/graphics-multimedia/how-to-specify-the-origin-of-a-transform-by-using-relative-values?view=netframeworkdesktop-4.8


circule prgress bar

https://rumble.com/vlc451-wpf-controls-19-circlular-radial-progressbar-hd-2020-vs2019.html


WPF上下标

https://blog.csdn.net/kevinshift/article/details/90550260



WPF – Add a Watermark to a native WPF TextBox

https://code.4noobz.net/wpf-add-a-watermark-to-a-native-wpf-textbox/



WPF 自定义CheckBox样式

https://www.cnblogs.com/xiaomingg/p/8727700.html


Working with a WPF RepeatButton using C# and XAML
https://www.c-sharpcorner.com/uploadfile/mahesh/wpf-repeatbutton/
 
【C#/WPF】用Thumb做可拖拽的UI控件
https://www.cnblogs.com/guxin/p/csharp-wpf-drag-and-drop-ui-control-by-thumb.html




2023年1月10日 星期二