diff --git a/AI/Paper/Accurate_Timing_Path_Delay_Learning_Using_Feature_Enhancer_with_Effective_Capacitance.pdf b/AI/Paper/Accurate_Timing_Path_Delay_Learning_Using_Feature_Enhancer_with_Effective_Capacitance.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9f0fca911f380b6a34f87c7fe9cb6a0b7ef40903 Binary files /dev/null and b/AI/Paper/Accurate_Timing_Path_Delay_Learning_Using_Feature_Enhancer_with_Effective_Capacitance.pdf differ diff --git a/AI/Paper/PCT-Cap_ Point Cloud Transformer for Accurate 3D Capacitance Extraction.pdf b/AI/Paper/PCT-Cap_ Point Cloud Transformer for Accurate 3D Capacitance Extraction.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7df7fd0e8aeab8032a57a719f92000ba371e35aa Binary files /dev/null and b/AI/Paper/PCT-Cap_ Point Cloud Transformer for Accurate 3D Capacitance Extraction.pdf differ diff --git a/AI/codes/2024-07/.keep b/AI/codes/2024-07/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/C++/codes/2024-07/.keep b/C++/codes/2024-07/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git "a/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.10.cpp" "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.10.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..2041c24c23f84196f3d08ad5514d8ddbfe2648c8 --- /dev/null +++ "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.10.cpp" @@ -0,0 +1,39 @@ +#include + +using namespace std; + + +typedef double (*function)(double, double); + +double add(double x, double y); +double subtract(double x, double y); +double calculate(double x, double y, function func); + +int main() { + function func[] = {add, subtract}; + double x, y; + while (true) { + cout << "Enter two numbers : "; + if (!(cin >> x >> y)) break; + for (int i = 0; i < 2; i++) { + cout << calculate(x, y, func[i]) << endl; + } + } + + return 0; +} + +double add(double x, double y) { + cout << "Result of add: " ; + return x+y; +} + +double subtract(double x, double y) { + cout << "Result of subtract: "; + return x-y; +} + + +double calculate(double x, double y, function func) { + return func(x, y); +} diff --git "a/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.5.cpp" "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.5.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..912610d781beb202bc4007d4d6c72071e63b7788 --- /dev/null +++ "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.5.cpp" @@ -0,0 +1,26 @@ +#include + +using namespace std; + +long int factorial(unsigned n); + +int main() { + int n = 0; + while (true) { + cout << "Please enter a integer number: "; + if (!(cin >> n) || n < 0) break; + cout << "factorial: " << factorial(n) << endl; + } + + return 0; +} + +long int factorial(unsigned n) { + if (n > 0) + return n * factorial(n-1); + else { + return 1; + } +} + + diff --git "a/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.6.cpp" "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.6.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..75ef0785d0cc46ec5b924bfe9ec5b69b39d87ed9 --- /dev/null +++ "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter7/7.6.cpp" @@ -0,0 +1,51 @@ +#include + +using namespace std; +const int max_length = 20; +int Fill_array(double arr[], int length); +void Show_array(const double arr[], int length); +void Reverse_array(double arr[], int length); + +int main() { + double arr[max_length] = {}; + int length = max_length; + length = Fill_array(arr, length); + Show_array(arr, length); + Reverse_array(arr, length); + Show_array(arr, length); + Reverse_array(arr+1, length-2); + Show_array(arr, length); + + return 0; +} + +int Fill_array(double arr[], int length) { + double temp; + int i; + for (i = 0; i < length; i++) { + cout << "Enter a double type value (other to quit): "; + if (!(cin >> temp)) break; + arr[i] = temp; + } + return i; +} + +void Show_array(const double arr[], int length) { + cout << "array: "; + for (int i = 0; i < length; i++) { + cout << arr[i] << " "; + } + cout << endl; +} + +void Reverse_array(double arr[], int length) { + int start = 0; + int end = length - 1; + while (start < end) { + double temp = arr[start]; + arr[start] = arr[end]; + arr[end] = temp; + start++; + end--; + } +} \ No newline at end of file diff --git "a/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.3.cpp" "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.3.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..b818a8576d917ea9fb1d5fb5a3446e4369548076 --- /dev/null +++ "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.3.cpp" @@ -0,0 +1,25 @@ +#include +#include + +using namespace std; + +string& toUpperCase(string& str); + +int main() { + string input; + while (true) { + cout << "Enter a string (q to quit): "; + getline(cin, input); + if (input == "q") break; + cout << toUpperCase(input) << endl; + } + cout << "Bye." << endl; + return 0; +} + +string& toUpperCase(string& str) { + for (char& c : str) { + c = toupper(c); + } + return str; +} diff --git "a/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.5.cpp" "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.5.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..fce2eedbc1443ddda173741a34f2e1b9c95eb7b8 --- /dev/null +++ "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.5.cpp" @@ -0,0 +1,29 @@ +#include + +using namespace std; + +template +T max5 (T arr[5]); + +int main() { + int intArray[5] = {4, 6, 1, 7, 2}; + double doubleArray[5] = {2.1, 1.2, 5.7, 3.8, 4.1}; + + int maxInt = max5(intArray); + cout << "Max element in intArray: " << maxInt << endl; + double maxDouble = max5(doubleArray); + cout << "Max element in doubleArray: " << maxDouble << endl; + + return 0; +} + +template +T max5(T arr[5]) { + T max = arr[0]; + for (int i = 1; i < 5; i++) { + if (arr[i] > max) { + max = arr[i]; + } + } + return max; +} \ No newline at end of file diff --git "a/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.7.cpp" "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.7.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..17c20f0a3a65d66c86eb562928bdb5e25cf35de6 --- /dev/null +++ "b/C++/codes/2024-07/\345\210\230\350\260\246/C++PrimerPlusExercises/Chapter8/8.7.cpp" @@ -0,0 +1,66 @@ +#include + +using namespace std; + +template +T SumArray(T arr[], int n); + +template +T SumArray(T * arr[], int n); + +struct debts { + char name[50]; + double amount; +}; + +int main() { + int thing[6] = { 13, 31, 103, 301, 310, 130 }; + int int_sum = 0; + struct debts mr_E[3] = + { + {"Ima Wolfe", 2400.0}, + {"Ura Foxe", 1300.0}, + {"Iby Stout", 1800.0} + }; + double *pd[3]; + double double_sum = 0.0; + + for (int i = 0; i < 3; i++) + { + pd[i] = &mr_E[i].amount; + } + + int_sum = SumArray(thing, 6); + double_sum = SumArray(pd, 3); + + cout << "Sum of things: " << int_sum << endl; + cout << "Sum of debts: " << double_sum << endl; + + return 0; +} + +template +T SumArray(T arr[], int n) +{ + T sum = 0; + + for (int i = 0; i < n; i++) + { + sum += arr[i]; + } + + return sum; +} + +template +T SumArray(T * arr[], int n) +{ + T sum = 0; + + for (int i = 0; i < n; i++) + { + sum += *(arr[i]); + } + + return sum; +} \ No newline at end of file diff --git a/EDA/codes/2024-07/.keep b/EDA/codes/2024-07/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Rust/codes/2024-07/.keep b/Rust/codes/2024-07/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391