yourFriend
yourFriend
CC#
Created by yourFriend on 3/30/2025 in #help
Error acquiring .NET when offline but works when online in VS Code
No description
5 replies
CC#
Created by yourFriend on 3/28/2025 in #help
In String constructor `String(Char*)`, `Char*` is character pointer or character array pointer?
No description
18 replies
CC#
Created by yourFriend on 3/17/2025 in #help
Book question. Explain this solution of Subset Sum problem.
Code: https://paste.mod.gg/hqxraqfhdgeg/0 Copy/pasted from last solution here: https://www.geeksforgeeks.org/subset-sum-problem-dp-25/ But I don't understand it. I want to understand what, why and how. My solution was to generate all combinations without repetition but its obviously very slow.
2 replies
CC#
Created by yourFriend on 3/14/2025 in #help
How to install dotnet runtime and sdks on debian virtual machine?
This should be simple like: 1. Add appropriate repository 2. Then sudo apt install But I'm not able to add repository. I tried sudo apt-add-repository https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb It shows following errors: 1. 403 Forbidden 2. 404 Not Found I'm new to linux
9 replies
CC#
Created by yourFriend on 3/5/2025 in #help
Need guidance on how to develop networks(not https) with fellow C# developers.
Hello, everyone. I'm going to start preparing seriously for job as .net full stack developer. Here's my game plan: 1. First 6 months: 1.1 Fundamentals 1.2 DSA 1.3 OOP 1.4 Asynchronous programming (optional) 1.5 Networking (optional) 2. Next 1 year: 2.1 SQL 2.2 ASP.NET Core 2.3 Some UI (haven't decided which one) . . . Haven't decided yet. 2. I have plenty of free and paid resources online. 3. Plenty of online certifications, like, w3school, MSDN, Coursera, Edx, Udemy, freeCodeCamp. hopefully they will be enough. 4. But how to develop networks with fellow devs. as I'm self studying at home and not in a university campus.
3 replies
CC#
Created by yourFriend on 3/1/2025 in #help
Is Merge Sort implementation wrong in Wikipedia?
https://en.wikipedia.org/wiki/Merge_sort In the below code: 1. iMiddle = (iEnd - iBegin) / 2 should be iMiddle = iBegin + (iEnd - iBegin) / 2 I guess. 2. In method TopDownMerge array B was sorted but never copied to array A.
// Array A[] has the items to sort; array B[] is a work array.
void TopDownMergeSort(A[], B[], n)
{
CopyArray(A, 0, n, B); // one time copy of A[] to B[]
TopDownSplitMerge(A, 0, n, B); // sort data from B[] into A[]
}

// Split A[] into 2 runs, sort both runs into B[], merge both runs from B[] to A[]
// iBegin is inclusive; iEnd is exclusive (A[iEnd] is not in the set).
void TopDownSplitMerge(B[], iBegin, iEnd, A[])
{
if (iEnd - iBegin <= 1) // if run size == 1
return; // consider it sorted
// split the run longer than 1 item into halves
iMiddle = (iEnd + iBegin) / 2; // iMiddle = mid point
// recursively sort both runs from array A[] into B[]
TopDownSplitMerge(A, iBegin, iMiddle, B); // sort the left run
TopDownSplitMerge(A, iMiddle, iEnd, B); // sort the right run
// merge the resulting runs from array B[] into A[]
TopDownMerge(B, iBegin, iMiddle, iEnd, A);
}

// Left source half is A[ iBegin:iMiddle-1].
// Right source half is A[iMiddle:iEnd-1 ].
// Result is B[ iBegin:iEnd-1 ].
void TopDownMerge(B[], iBegin, iMiddle, iEnd, A[])
{
i = iBegin, j = iMiddle;

// While there are elements in the left or right runs...
for (k = iBegin; k < iEnd; k++) {
// If left run head exists and is <= existing right run head.
if (i < iMiddle && (j >= iEnd || A[i] <= A[j])) {
B[k] = A[i];
i = i + 1;
} else {
B[k] = A[j];
j = j + 1;
}
}
}

void CopyArray(A[], iBegin, iEnd, B[])
{
for (k = iBegin; k < iEnd; k++)
B[k] = A[k];
}
// Array A[] has the items to sort; array B[] is a work array.
void TopDownMergeSort(A[], B[], n)
{
CopyArray(A, 0, n, B); // one time copy of A[] to B[]
TopDownSplitMerge(A, 0, n, B); // sort data from B[] into A[]
}

// Split A[] into 2 runs, sort both runs into B[], merge both runs from B[] to A[]
// iBegin is inclusive; iEnd is exclusive (A[iEnd] is not in the set).
void TopDownSplitMerge(B[], iBegin, iEnd, A[])
{
if (iEnd - iBegin <= 1) // if run size == 1
return; // consider it sorted
// split the run longer than 1 item into halves
iMiddle = (iEnd + iBegin) / 2; // iMiddle = mid point
// recursively sort both runs from array A[] into B[]
TopDownSplitMerge(A, iBegin, iMiddle, B); // sort the left run
TopDownSplitMerge(A, iMiddle, iEnd, B); // sort the right run
// merge the resulting runs from array B[] into A[]
TopDownMerge(B, iBegin, iMiddle, iEnd, A);
}

// Left source half is A[ iBegin:iMiddle-1].
// Right source half is A[iMiddle:iEnd-1 ].
// Result is B[ iBegin:iEnd-1 ].
void TopDownMerge(B[], iBegin, iMiddle, iEnd, A[])
{
i = iBegin, j = iMiddle;

// While there are elements in the left or right runs...
for (k = iBegin; k < iEnd; k++) {
// If left run head exists and is <= existing right run head.
if (i < iMiddle && (j >= iEnd || A[i] <= A[j])) {
B[k] = A[i];
i = i + 1;
} else {
B[k] = A[j];
j = j + 1;
}
}
}

void CopyArray(A[], iBegin, iEnd, B[])
{
for (k = iBegin; k < iEnd; k++)
B[k] = A[k];
}
10 replies
CC#
Created by yourFriend on 11/27/2024 in #help
How to stop git from tracking all a folder(.vscode) and everything inside it.
Git is init in root say RootFolder which contain multiple projects say P1, P2 and so on and each project folder has .vscode folder. I have tried this from RootFolder git rm --cached -r .vscode/ But it says fatal: pathspec '.vscode/' did not match any files However it works from parent folders i.e. P1, P2, etc. And I have got hundreds of them.
5 replies
CC#
Created by yourFriend on 11/25/2024 in #help
Do C# dev kit extension requires internet connection to work?
No description
7 replies
CC#
Created by yourFriend on 11/24/2024 in #help
How to open brace on new line by default for C# or any language in vs code?
I want this by default:
if(condition)
{
code here;
}
if(condition)
{
code here;
}
Instead of:
if(condition){
code here;
}
if(condition){
code here;
}
8 replies