16,004,653 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 15047625 (Top 47 by date)
Member 15047625
12-Sep-22 7:57am
View
Ok thats smart. I have already did it on my own but it's definitely suboptimal - iterate through collection (except first and last element) and pick them with certain probability. Once selected, skip next adjacent element. If enough items have been selected exit, if not enough finish the job and get the rest by brute force without randomness (while respecting constraints).
Member 15047625
15-Mar-22 6:48am
View
This is solution for subset sum problem. I'm unsure how to convert it to my problem, and I hoped someone has any ideas.
Member 15047625
9-Mar-22 13:31pm
View
Your new version seems to work but I have to fully confirm it.
Empty string ε (also known as "", string.Empty, string of length 0) works like this: B = {"", "a"} C = {"a", "b"} => A = {"a", "b", "aa", "ab"}. A can be composed of these B and C, and we need to guess if such composition is possible or not. string.Empty + string = string. "" + "something" = "something".
Edit
Still doesn't work. https://onlinegdb.com/JvhxzTZ_g "" "a" "b" "aa" "ba" returns false, should be true.
Member 15047625
9-Mar-22 12:24pm
View
Pastebin data should return true. Which means it doesn't work at all.
I do appreciate your help but it seems we achieved nothing in the end.
Member 15047625
9-Mar-22 11:50am
View
Your c++ code run on onlinegdb.com returns true for set "", "a", "ab", which is incorrect, should return false. Link: https://onlinegdb.com/70yxdwKE6
Member 15047625
8-Mar-22 15:52pm
View
I see. Then I would like to ask what is the best equivalent of strchr and strcmp for c#.
Member 15047625
8-Mar-22 15:18pm
View
Still returns false instead of true for this set. This is my code https://pastebin.com/k5e6UJEj, as I mentioned above I actually do it in c#, I decided to accept answers for more languages because there is zero information about this problem online, so I wanted to widen my search area.
It seems to be exact copy of your c++ code, except now its in c#.
Member 15047625
8-Mar-22 13:56pm
View
File.ReadAllLines and saved to List<string>. First line is "" (string.Empty). The rest is just normal string without any spaces at the start or the end.
As I said so far everything works except this one, which implies something is off, which can also mean that correct results are accidents.
Member 15047625
8-Mar-22 13:32pm
View
I'm not the one who came up with this problem. Empty strings are tolerable and they can affect the result (set being divisible to two sets). That set in pastebin returns false, but it should return true. Which means that this solution is flawed, because it doesn't work for all cases. And I'm unsure how to adjust it to fix it.
Member 15047625
8-Mar-22 13:23pm
View
The "big" set fails, everything else passes. So far it seems it works fine but only for very small sets.
Member 15047625
8-Mar-22 12:56pm
View
I will try to figure something out but no promises. This is awfully complex problem.
P.S
Your C# version also fails for the big set.
Member 15047625
8-Mar-22 12:54pm
View
It's tricky because empty string is not part of the alphabet, but it can be used when creating two sets.
Like I said for example A = {"", "a", "b", "aa", "ba"} gives B = {"", "a", "b"} and C = {"", "a"}
Member 15047625
8-Mar-22 12:44pm
View
Removing empty string might affect result. Empty string ε is allowed.
Member 15047625
8-Mar-22 12:21pm
View
Well that change in 15 line only allows empty string to pass (set made of one element) which is wrong because it can't be divided into two that way.
Big set still isn't passing because there are no other changes (maybe "" needs to be added to alphabet somehow?)
Member 15047625
8-Mar-22 12:13pm
View
About to check out.
Member 15047625
8-Mar-22 12:12pm
View
But empty string also can be used and shouldn't be ignored, for example in set A = {"", "a", "b", "aa", "ba"}. Result for this one is true.
Member 15047625
8-Mar-22 11:23am
View
Now it works. But there is still one thing off. This set of strings: https://pastebin.com/tZwciVLk (first line is empty string of length 0). Returns false, but it should return true. I trust that this algorithm works fine so I'm unsure where is the problem.
Member 15047625
8-Mar-22 10:53am
View
Still crashing for me. j at some point becomes 1 and it gets out of range because I has size 1x1 for set of size 1. So it only has available indexes 0 and 0.
Member 15047625
8-Mar-22 9:22am
View
Program crashes for set of length 1 "abc". I can provide you my code (I prefer C# myself).
Member 15047625
6-May-21 6:16am
View
IsChecked is either true or false. Its WPF glitch, but it appears no one fixed it yet. Problematic.
Member 15047625
6-May-21 6:15am
View
Setting Background to #FF212121 makes whole ToolBar black. Not exactly what I want to do.
Member 15047625
30-Mar-21 11:54am
View
So, the answer is "just use what you found and stop complaining"? Understandable, but I always prefer to use LINQ when available.
Member 15047625
30-Mar-21 6:22am
View
Oh it's beautiful. Bootstrap is pretty damn huge, you have to forgive me for not finding sticky classes.
Member 15047625
30-Mar-21 6:21am
View
Simple as bootstrap. You just use class="btn btn-primary" and your button becomes not-ugly just like that. Don't tell me bootstrap is the only framework for that.
Member 15047625
28-Mar-21 15:35pm
View
It just replaces Environment.NewLine with raw < br > which displays on the website. It would be wiser to replace it with actual new line, and not let user compile html on their own in their head.
Member 15047625
28-Mar-21 6:43am
View
<%=@item.Body.Replace("\r\n", "br/")%> (br with <>)
Now the output looks like this:
<%=Example text. br/br/Etc.%>
Member 15047625
28-Mar-21 5:51am
View
string.Replace(Environment.NewLine, "< br>"). "\n" and "\r\n" also does not change the output.
P.S
There is no space in br but here br gets removed for reasons somewhat known.
Member 15047625
28-Mar-21 5:33am
View
.Replace() inside controller and view, both versions change nothing.
Member 15047625
26-Mar-21 13:55pm
View
I actually wouldn't call it not pretty.It's better than CSS version because it's fully responsive.
But both versions have certain flaw. Scroll bar appears even without text in columns.
Member 15047625
26-Mar-21 7:47am
View
Surprisingly stackoverflow helped me first. But thank you for sharing with us information that you know how to fix it.
Member 15047625
25-Mar-21 17:37pm
View
There is no BsonType.List. So, you also don't know how to actually fix the error. If MongoDB is not supporting it, I'm forced to switch to SQL Server.
Member 15047625
25-Mar-21 14:15pm
View
So are you implying that MongoDB is so poor that it can't just convert list to array? That makes code-behind operations problematic. Lists are superior to arrays.
Member 15047625
24-Mar-21 13:44pm
View
I'm just wondering why they would abandon perfectly fine class. Instead of one line, now I have to dig through the depths of the internet.
Member 15047625
24-Mar-21 13:28pm
View
Yes I have 5.0 but I'm trying to figure out how to use sidebar class. Bootstrap offers dozens of horizontal navbars, but it appears they hate sidebars. I have found one tutorial, it doesn't work, second one is collapsible, I want static sidebar.
Member 15047625
24-Mar-21 13:22pm
View
https://getbootstrap.com/1.0.0/#
Fluid layout, a few scrolls below. I have been searching for hours how to make a sidebar, solution is so close, yet so far.
Member 15047625
24-Mar-21 13:13pm
View
Sidebar and content are part of Twitter Bootstrap, but according to all laws of logic its part of Bootstrap 5.0. Because all download links lead to basic Bootstrap website.
Member 15047625
6-Mar-21 8:59am
View
System.Reactive.Linq, then it was throwing error that .Core is missing. With both of them everything works fine.
Member 15047625
6-Mar-21 7:21am
View
It was installed via NuGet, but for some reason it ignores System.Reactive.
Member 15047625
5-Mar-21 9:59am
View
Nice one, I can see some interesting toolkits. Do you perchance know 3D visualization addons? I'm almost sure everything I have seen is paid.
Member 15047625
4-Mar-21 15:01pm
View
I have to admit I did not use OxyPlot yet, but in one tutorial it was stated that OxyPlot does not support MVVM pattern.
Only used Microsoft Toolkit so far.
Member 15047625
4-Mar-21 14:59pm
View
Newest VS 2019 Community version. All projects. Reference is missing, but file is on the hard drive in proper location.
Member 15047625
4-Mar-21 12:29pm
View
I have went around it. Binded link to the Tag, and I'm reading the Tag inside Click method. Is it great? No. Does it work? Absolutely.
Member 15047625
4-Mar-21 12:23pm
View
System.Runtime is on the hard drive with all other files. Cleaning and rebuilding did not help.
I will try to fix installation, but it says it will reset everything.
Member 15047625
4-Mar-21 6:18am
View
But I don't know the link from code behind. I need to somehow bind it inside XAML.
Member 15047625
16-Jan-21 9:53am
View
Parallel.For is somewhat equal to 1 Task per one iteration, and I had an idea to divide it to chunks.
Member 15047625
16-Jan-21 9:46am
View
I know, i have manually made two Tasks already, but what if array.Length is 100 000, or 100 000 000. It begs to use more Tasks, but I'm not sure how to make it dynamically.
Member 15047625
16-Jan-21 9:34am
View
That void method does some complicated things. For example if array.Length is 10, i can divide it to 2 Tasks. First task will handle i 0 - 4, second 5 - 9. And it will be faster than sequence.
I have a feeling it should be easy, but for some reason i can't even divide it properly. I want to create tasks dynamically depending on size, and not declare X manually because it's terrible solution.
Show More