顯示具有 程式 標籤的文章。 顯示所有文章
顯示具有 程式 標籤的文章。 顯示所有文章

2020年6月26日 星期五

iwr1642 mmWave


透過使用python coding 讀取iwr1642 的binary資料

測試demo code -> mmWave_Demo_Visualizer

要使用開發環境 -> MMWAVE-STUDIO



2020年6月4日 星期四

Range-based for Statement (C++)


自C ++ 11起,在C ++中添加了基於ange的for循環。它在一定範圍內執行for循環。 用作與傳統for循環等效的可讀性更高的for循環,可在一定範圍的值上運行,例如容器中的所有元素。



// range-based-for.cpp
// compile by using: cl /EHsc /nologo /W4
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    // Basic 10-element integer array.
    int x[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

    // Range-based for loop to iterate through the array.
    for( int y : x ) { // Access by value using a copy declared as a specific type.
                       // Not preferred.
        cout << y << " ";
    }
    cout << endl;

    // The auto keyword causes type inference to be used. Preferred.

    for( auto y : x ) { // Copy of 'x', almost always undesirable
        cout << y << " ";
    }
    cout << endl;

    for( auto &y : x ) { // Type inference by reference.
        // Observes and/or modifies in-place. Preferred when modify is needed.
        cout << y << " ";
    }
    cout << endl;

    for( const auto &y : x ) { // Type inference by const reference.
        // Observes in-place. Preferred when no modify is needed.
        cout << y << " ";
    }
    cout << endl;
    cout << "end of integer array test" << endl;
    cout << endl;

    // Create a vector object that contains 10 elements.
    vector<double> v;
    for (int i = 0; i < 10; ++i) {
        v.push_back(i + 0.14159);
    }

    // Range-based for loop to iterate through the vector, observing in-place.
    for( const auto &j : v ) {
        cout << j << " ";
    }
    cout << endl;
    cout << "end of vector test" << endl;
}

來源:https://docs.microsoft.com/zh-tw/cpp/cpp/range-based-for-statement-cpp?view=vs-2019

2020年5月31日 星期日

神经网络中,bias有什么用,为什么要设置bias,当加权和大于某值时,激活才有意义

神经网络中,当加权和大于0时,通过激活函数sigmoid压缩/映射,输出神经元的激活值
bias有什么用,为什么要设置bias,当加权和大于某值时,激活才有意义?''意义''是什么意思?

这里的回答都没有用最直观的方法解释。我们可以把问题先简化,为什么线性模型要加 bias?答案很简单,不加 bias 你的分类线(面)就必须过原点,这显然是不灵活的。有了bias我们就可以上下左右移动我们的线了。神经网络是一样的道理。

2020年3月17日 星期二

C# winform容器比較 panel ,TableLayout , FlowLayoutPanel , TableControl

C# winform容器比較 panel ,TableLayoutPanel , FlowLayoutPanel , TableControl - HackMD

C# winform容器比較 panel ,TableLayoutPanel , FlowLayoutPanel , TableControl

panel

  • 執行時期大小是固定無法調整
  • 沒有 Text 屬性,所以無法顯示面板的標題文字
  • 具有捲軸

GroupBox

  • 執行時期大小是固定無法調整
  • 有Text 屬性,可顯示框架的標題文字
  • 沒有捲軸,故當框架裡的控制項太多時較佔表單的空間

小結

panel跟GroupBox算是比較接近的控制項
最大的不同只有"TEXT"屬性而已,並且一開始就有分格線

FlowLayoutPanel

FlowLayoutPanel 控制項會以水平或垂直流向來排列它的內容。 其內容可以從某一資料列換行至下一個資料列,或從某一資料行換行至下一個資料行。 此外,也可裁剪該內容而不換行。

借用別人的圖

TableLayoutPanel

比起TableLayoutPanel,內部可以做一些排版,以及放一些其他的控制項

2020年3月8日 星期日

第一次寫 Linux kernel driver就上手

Linux Device Driver - HackMD

Linux Device Driver

第一次寫 Linux kernel driver就上手

連結

動手寫 Linux Driver

driver基本架構

在 driver 的基本架構中,

2020年2月29日 星期六

手把手建立第一個SQL程式

成果大概是這樣

2020年2月21日 星期五

模糊邏輯 程式範例: 倒車模擬 / fuzzy control sample

或者應該說模糊控制應用範例
透過使用python coding,應用fuzzy 控制車子輪軸角度,達到不論任何的起始位置、角度,都可以將車子開往正確的到車位置。並且使用matplotlib繪圖、tkinter做出簡單的gui方便使用者操作

2020年2月2日 星期日

overwrite override overload 還有encapsulation

最近我弟在讀計概,書裡講到了這幾個詞搞不清楚,我也有點忘了,所以也整理一下,建議就算是不熟悉程式的人還是盡量以記英文為主。


  1. overload(多載) : 相同的function名稱,根據不同的傳入參數來呼叫對應的function
  2. override(覆寫): 在繼承的時候覆寫父類別的function
  3. overwrite(重寫):  在繼承的時候利用指標轉型重寫父類別的function
  4. encapsulation(封裝): 用抽象的函式介面寫出架構,再用override/overwrite改寫細節

  • overload 

個人覺得overload最好懂,這就是相同的function名稱,根據不同的傳入參數來呼叫對應的function,就算是C也可以這樣寫喔。參考以下的code
#include<iostream>
using namespace std;

void PrintAdd(int X,int Y){
 cout &lt<"PrintIntAdd: " << X+Y << endl;
}
void PrintAdd(double X,double Y){
 cout &lt< "PrintdoubleAdd: " << X+Y <<endl;
}

int main()
{
    PrintAdd(1,2);
    PrintAdd(0.1,0.2);
    cin.get();
    return 0;
}



console output:
PrintIntAdd: 3
PrintdoubleAdd: 0.3