yourFriend
Help with understanding this logic question.
After 1 pm sonething went wrong with the mechanism of a certain clock and at 1.30 pm it struck 2 hours. Then went on striking every half an hour in the routine way indicating wrong hours. Find out when did it strike the correct hour next? (A) 12.30 am (B) 11 pm (C) 6.30 pm (D) NeverAnswer (A) 12.30 am Problem I don't understand what struck 2 hours means? Also what striking every half an hour means?
11 replies
Regex to match text between nested tags
Question:
Write a program that extracts all the text without any tags and attribute values from an HTML document. Sample text: <html> <head><title>News</title></head> <body><p><a href="http://softuni.org">Software University</a>aims to provide free real-world practical training for young people who want to turn into skillful software engineers.</p></body> </html> Sample result: News Software University aims to provide free real-world practical training for young people who want to turn into skillful software engineers.I solved it without using Regex. Here's the code: https://paste.mod.gg/orqiwpelwkzq/0 But I was wondering what the regex pattern would look like for matching text within nested tags. :catderp: I have asked similar question but it didn't involve nested tags. Link: https://discord.com/channels/143867839282020352/1358651997745709267
8 replies
Is it possible to reverse a string letter by letter using only regular expression?
I am learning string manipulation. Learned a bit about
string
and StringBuilder
. Now onto Regex
and I'm trying to do everything which I do with string methods and StringBuilder methods by using Regex alone for learning purposes.
But reversing a string letter by letter seems pretty hard by just Regex.Replace(intialString, pattern, replacement)
I guess pattern can be:
But how to replace it initialString[len - i - 1]
with initialString[i]
character of the string initialString
?5 replies
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
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 linux9 replies
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
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.
10 replies
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