Click here to Skip to main content
15,346,659 members

Comments by BillWoodruff (Top 200 by date)

BillWoodruff 4 days ago View
thanks, i'll report that as a site bug to CP.
BillWoodruff 4 days ago View
Well, great :) Perhaps it's tine you upvoted my solution ?

For some reason, I am getting 2 email notifications for each of your comments.
BillWoodruff 4 days ago View
Hi, I wanr to help you if I can !

Right now, I need more specific information on what your problem is.

I suggest you post a new question which includes your current code and an example of output that is not what you expect.

Please do not send the same comment twice.

cheers, Bill
BillWoodruff 5 days ago View
What have you tried ? And what solution are you after ?

Please be very specific.
BillWoodruff 21-Feb-22 0:55am View
+5 amen !
BillWoodruff 11-Feb-22 18:13pm View
a node can have only one child node ? that's a linked list ?

what is the reason you need to traverse up and down at the same time ?
BillWoodruff 25-Jan-22 9:40am View
That indicates some kind of install error: you've got to identify the exact dependency that is not implemwnted, and remove the older whatever that is invoked now. Sorry I can't be more helpful.
BillWoodruff 22-Jan-22 8:37am View
but, your code does not cause an error ? Try putting a break-point at the start of your code, then single-step (F11), observing the state of variables.
BillWoodruff 22-Jan-22 7:45am View
What happens ... or does not happen ... when you run your code ?
BillWoodruff 19-Jan-22 21:24pm View
While a TabPage doesn't expose an 'Enabled property at design-time, you can set it at runtime in code, and, the TabPage can still be selected.

see revised solution.
BillWoodruff 19-Jan-22 20:15pm View
if this is C#, why are you using low-level API calls rather than controls on a Form or WPF Window ?
BillWoodruff 19-Jan-22 20:12pm View
This idea and its code is so confused i suggest you get a good back on C# and study the "basics," and, re-think your design. What type of calculator increments some variable by #7 each time a mouse-click on a button occurs ?

There are lots of examples of C# calculators on-line: study them !
BillWoodruff 18-Jan-22 8:01am View
'base ? what is the context here that makes you use ;base ?

I suggest you set your MDIForm size in its code, then use use the Dock Property to make amy one of child Forms fill it.
BillWoodruff 17-Jan-22 0:36am View
Name:John,Age:18,Hobby:(text message)
Name:May,Age:17,Hobby:(text message)
Name:Jane,Age:17,Hobby:(text message)

this is the string output you want ? where each "text message" can havew any number of lines ?
BillWoodruff 14-Jan-22 14:13pm View
from the "builders" of C# Tuples (.NET 4.0 release):

"The first major decision was whether to treat tuples either as a reference or value type. Since they are immutable any time you want to change the values of a tuple, you have to create a new one. If they are reference types, this means there can be lots of garbage generated if you are changing elements in a tuple in a tight loop. F# tuples were reference types, but there was a feeling from the team that they could realize a performance improvement if two, and perhaps three, element tuples were value types instead. Some teams that had created internal tuples had used value instead of reference types, because their scenarios were very sensitive to creating lots of managed objects. They found that using a value type gave them better performance. In our first draft of the tuple specification, we kept the two-, three-, and four-element tuples as value types, with the rest being reference types. However, during a design meeting that included representatives from other languages it was decided that this "split" design would be confusing, due to the slightly different semantics between the two types. Consistency in behavior and design was determined to be of higher priority than potential performance increases. Based on this input, we changed the design so that all tuples are reference types, although we asked the F# team to do some performance investigation to see if it experienced a speedup when using a value type for some sizes of tuples. It had a good way to test this, since its compiler, written in F#, was a good example of a large program that used tuples in a variety of scenarios. In the end, the F# team found that it did not get a performance improvement when some tuples were value types instead of reference types. This made us feel better about our decision to use reference types for tuple."
BillWoodruff 14-Jan-22 6:02am View
just to keep things interesting :)

// Flight is a Class
IEnumerable<flight> testflight = null;

// => true
bool isnull1 = testflight is null;

// ValueType assignment compile error
// (Flight, Flight) testflights = null;

// no compile error
// (Flight, Flight) testflights = default;

// no compile error
// (Flight, Flight) testflights = (null, null);

// no error
(Flight, Flight) testflights = (new Flight("X"), null);

// => false
bool isnull2 = testflights.Item1 is null && testflights.Item2 is null;

testflights.Item2 = new Flight("Y");

// => true
bool isnull3 = testflights.Item1 != null && testflights.Item2!= null;

consider: if testflights is immutable, what will/won't happen when its Item2 is assigned after its first use ?
BillWoodruff 14-Jan-22 5:20am View
:) Tony Hoare in 2009, speaking of his 1965 inventor of null: "I call it my billion-dollar mistake…At that time, I was designing the first comprehensive type system for references in an object-oriented language. My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years."
BillWoodruff 14-Jan-22 4:32am View
Thanks ! I expanded the comment you just responded to. The second type declaration in your first example does not have a ? suffix ... accident ?

Since an IEnumerable is by definition nullable, why is the ? required ?
BillWoodruff 14-Jan-22 4:00am View
You use DisplayMember and ValueMember ONLY when you use binding. If you ARE using binding: reset them after you add items and reset the DataSource and see if that makes a difference.
BillWoodruff 14-Jan-22 3:51am View
As over-engineered as the Pragma weirdness :) ?
BillWoodruff 14-Jan-22 3:50am View
One other thought: is there something special about the Tuple Type that is a factor here ? In .NET 4.0, the new Tuple Type is a reference type; then, in 7.0, the "literal" Tuple (ValueType) was introduced.

So, if I'm using a Tuple that I believe is not literal: why, if I just return null, does the compiler shout:

Error CS0037 Cannot convert null to '(IEnumerable<flight>, IEnumerable<flight>)' because it is a non-nullable value type

Clearly it sees the Tuple I define as a ValueType which explains why returning 'default works, but, makes the fact (null,null) works ... strange.
BillWoodruff 13-Jan-22 12:03pm View
+5 as usual :)

i am wondering if there's a better syntax for returning a null value for a Tuple like this where type T in an IEnumerable<t> is a reference type.

(null, null) does work.
BillWoodruff 13-Jan-22 3:49am View
see second example added to solution.
BillWoodruff 12-Jan-22 4:58am View
excellent answers are timeless :) ... and deserve up-votes !
BillWoodruff 11-Jan-22 23:30pm View
BillWoodruff 11-Jan-22 23:28pm View
+5 very useful !
BillWoodruff 11-Jan-22 3:11am View
Have you considered opening an issue on the GitHub site ?
BillWoodruff 8-Jan-22 0:53am View
Got it. Wonder how many DFA gurus are using the internet from their Himalayan caves OMG :)

Happy New Year !
BillWoodruff 8-Jan-22 0:37am View
Writing a function that takes string data and a list of regex's as inputs, and then executes the regex's in sequence is not acceptable ?
BillWoodruff 7-Jan-22 8:37am View
1) ListBox Items are Type Object: when you assign them at design-time they will be Strings.

2) assigning other Types will work if their Type implements 'ToString.

3) your code:

a) every time you create a new "something" inside a method (locally), the reference to that something is lost when the method exits (goes out of scope). That is almost always a bad thing. Define variables of Type something outside the method, andassign new whatevers tp them inside the method: that way you don't lose the reference.

b) I can't tell what you are trying to do with this code: revise your original post, and clearly explain it.
BillWoodruff 5-Jan-22 7:41am View
fyi: there is a Dapper area on StackOverFlow:
BillWoodruff 5-Jan-22 0:37am View
then, you'll have to do the hard work of finding that icon file in Windows using the techniques I directed you to. but, first, you need to research if Windows includes a 128x128 or larger icon for "This PC" which is a rather unique icon in terms of usage.

when/if you have the Icon file, you can display it in a Picturebox:

picturebox1.Image = TheIcon.ToBitmap();
BillWoodruff 4-Jan-22 15:48pm View
What shows up on screen for a UFO ... a bitmap ? an icon ? a character in a font of picture/symbols ? ?
BillWoodruff 4-Jan-22 12:27pm View
Unclear: are you asking how to report the state/value of something you did not find, or did not expect to fins ?
BillWoodruff 4-Jan-22 10:41am View
Sorry, that's the only thing i can think of ... one way to check that might be to look for some other call to that librarys facilities and see if that, also, breaks ?
BillWoodruff 4-Jan-22 10:38am View
Are you sure Win 10/11 does nor have a 128x128 size This PC icon ? You can almost certainly find a graphic you can capture or download on Google:
BillWoodruff 2-Jan-22 23:43pm View
well, i should not have mentioned "actual code" ... no time to try and decipher other people's complex code ... i'd be surprised if any of us who volunteer here would do that.
BillWoodruff 2-Jan-22 12:01pm View
Is there any way you can examine the project file, or other app settings, to see if there is a valid reference to 'System.Runtime, Version= ?
BillWoodruff 2-Jan-22 11:58am View
I wish I could assist further, but, without using your actual source code, I can only think of one more thing to check:

Set break-points after the DataGridView loads, and after you have reset the binding source:

When you hit the break-points: examine the 'Enabled and 'EditMode properties of the DataGridView: see any difference ?
BillWoodruff 30-Dec-21 6:09am View
Your solution is logically inconsistent: you say OG's is correct, and it is ... then, you show an example of inserting a Form into another Form's Controls which is not only a bad practice, but also is not relevant to the OP's question.
BillWoodruff 29-Dec-21 22:51pm View
Voted #1: Putting a Form inside another Form is always a bad idea. In this case the user asks how to load a Form.
BillWoodruff 28-Dec-21 2:49am View
If we do your homework/coding for you, you will learn nothing.
BillWoodruff 28-Dec-21 2:46am View
"Difficult to help OP as he clain no problem and just want a full blowup solution with explanation."

So, a statement with no content deserves a solution with no content ?

You are a tourist, lost in a big city: you ask a local for directions to the bank; they reply: " 'bank' is found in the 'B' section of the dictionary." :)
BillWoodruff 28-Dec-21 1:27am View
voted #1: this reply has no content that might help the OP.
BillWoodruff 28-Dec-21 1:25am View
+5 a thorough, satisfying, reply !
BillWoodruff 24-Dec-21 4:37am View
If this is an assignment, you need to clarify what the assignment actually is.

An assignment to create a structure that emulates a C# Array, but provides Add/Remove functions makes no sense: if you remove an element the indexes may no longer point to the elements they were originally accessed by.
BillWoodruff 24-Dec-21 4:31am View
Yes, a possible hypothesis, but, i think we don't have enough information to make that a probable hypothesis. imho, the most probable hypothesis is that the OP is confused.

I've added another comment to the OP's post.
to try and get them to clarify,

Merry Xmas :)
BillWoodruff 23-Dec-21 14:45pm View
+5 at last the voice of reason speaks :)
BillWoodruff 22-Dec-21 4:12am View
Start experimenting and post code here with specific questions.
BillWoodruff 22-Dec-21 4:10am View
The date data you show here are not Hjri dates ? Is the problem how to convert to Hijri date ?
BillWoodruff 20-Dec-21 12:39pm View
+5 what a thorough analysis !
BillWoodruff 14-Dec-21 15:10pm View
Look carefully at the difference in structure between the first two entries, and the third: variations like that make parsing much more complex,

Is there any way you re-structure the data to avoid inconsistency in format ?
BillWoodruff 13-Dec-21 9:19am View
Consider using a GIF file.
BillWoodruff 12-Dec-21 7:57am View
Hi, that partly clarifies the context for me, thanks, but, i define my role here as "educator," and, the idea of helping you write code for some project of which you are a team-member, and. you can't disclose details ... that is not the dance music my feet are keen to move to :)

A general solution to creating a grid of sub-grids, and then efficiently
accessing/selecting "cells" by any arbitrarily defined row, #rows, column, #columns, sub-grid, etc., is an interesting problem ... particularly, if you have nested sub-grids beyond 1 level deep.

In your case, i don't think you'll need to get recursive (deal with more than one level of sub-grids).

Depending on my energy level, I may post some general ideas about one strategy you might pursue.

cheers, bill
BillWoodruff 12-Dec-21 1:50am View
Hi, This question is specific enough i can help you with some specific code :)

First, i need to see/understand the code/strategy that creates the grid:

Are you binding the grid to a DataTable; or, creating it directly in a nested for loop ?

And, i believe you omit the case that you need to check for duplicates in a 3x3 sub-grid.

Are you looking for a generic solution for any size grid, or, only a solution for the classic Sudoku 3x3 sub-grids each 3x3 ?
BillWoodruff 12-Dec-21 1:22am View
As Richard said, this is pretty simple, but, imho, a program that shows a moving picture until it exits is almost always annoying.

If you want the user to be able to do "other things" while the picture is being displayed, doing that in the SAME Form means you'll have to run it in a separate thread.
BillWoodruff 11-Dec-21 11:19am View
you just go ahead and quibble all you need to :)
BillWoodruff 11-Dec-21 9:17am View
to compare different methods of string to number conversion:
BillWoodruff 11-Dec-21 4:00am View
appears to be a repost of:
BillWoodruff 11-Dec-21 0:15am View
look ma, no errors:

000533 => 533
6.626E-34 => 6.626E-34
BillWoodruff 10-Dec-21 16:03pm View
see comments in my solution below :)
BillWoodruff 10-Dec-21 14:22pm View
okay, but, conversion will result in values of the same type ?
BillWoodruff 10-Dec-21 13:39pm View
Are the numbers represented by the line-strings always of the same Type ? i.e. : Int32, or Double /
BillWoodruff 6-Dec-21 18:16pm View
Hi, I don't want to see your script code ... I do want to see if I can help you to "pin down/define" what you want in a way that you can get more specific feedback :)

Please revise your original post to include;

The context in which you plan to use Unity ... in WPF, or, WinForms ? other ? What language is your script written in and what is its execution context ... in Unity ?

Describe the structure of your grid; show your code method that defined the Grid,
BillWoodruff 6-Dec-21 0:50am View
Sleep well, GMT+7 here :)

Are you using WinForms, or WPF ?

I do know you can use Unity 3d in WinForms, although I have never tried that:
BillWoodruff 6-Dec-21 0:40am View
I'm having difficulty visualizing what the different size grids are. Let's take the typical 3x3 sub-grid case where each sub-grid is 3x3 cells ... 9 rows, 9 columns, 81 cells.

I assume your script will "seed" the grid with valid initial values ... right ?

Then, the user will input a value in a cell, and you wish to check if that value is valid for the row and column where the value is entered ... right ?

One obvious strategy is to define the data structure for the grid, then pass it by reference to the code that seeds it with initial values ... does that seem relevant ?

"3d ness" ? Are only the contents of the cells 3d elements ? I am not familiar with Unity 3d, so don't know what data structures are available.
BillWoodruff 5-Dec-21 23:58pm View
Glad you found my response relevant.

"making the 2D Array to hold the selected values for all subgrids."

please clarify what "selected" means here: this refers to cells the user has selected, or cells containing user entered values ... or ?

"I have been able to get a script that generates the whole grid"

what structure is returned by the script ? an array ?
BillWoodruff 5-Dec-21 21:14pm View
What makes your game 3d ? What does the player see that a 2d flat grid doesn't show ?
BillWoodruff 4-Dec-21 0:44am View
BillWoodruff 4-Dec-21 0:36am View
BillWoodruff 30-Nov-21 8:42am View
If you study this book, your question will be answered.
BillWoodruff 29-Nov-21 1:33am View
If we do your homework, you will learn nothing.
BillWoodruff 29-Nov-21 1:32am View
Interesting: I am evaluating why the T here is not declared IEnumerable, and why People is not passed, as a param, to DistributeChocolates ... makes me "nervous" ... I'll get over it :)
BillWoodruff 29-Nov-21 1:26am View
I was hoping to give you enough of a "clue" that you could complete the code by yourself. By removing the thread, you prevent anyone else seeing my response.

"Double posting" like this is technically against forum guidelines.

I find it unfortunate that other responders here write your code for you, rather than educate you. If we do your homework, you will learn nothing.

Think about it.
BillWoodruff 29-Nov-21 0:44am View
Did you remove your previous question, and my responses ?
BillWoodruff 28-Nov-21 21:47pm View
'TRyParse returns a boolean 'true if the conversion was successful:
BillWoodruff 27-Nov-21 9:18am View
BillWoodruff 26-Nov-21 4:51am View
Start by searching CodeProject.
BillWoodruff 25-Nov-21 23:38pm View
What happens now when you run your code ? Errors ? Unexpected bresults ?
BillWoodruff 24-Nov-21 12:43pm View
The revised code in my answer triggers the Dialog only when dataGridView3 has #0 rows.

All Selected rows are deleted with each button press.
BillWoodruff 23-Nov-21 23:52pm View
Sorry, I'm too busy trying to post useful solutions to on-topic posts to continue wasting time on you.

p.s. a "suggestion" should avoid use of the word "should."
BillWoodruff 23-Nov-21 23:35pm View
As expected, use of an ad hominem non-question to deflect response to the substance of my comment. Yawn.
BillWoodruff 23-Nov-21 23:25pm View
Do you need rep points so badly you will post a non-solution to a non-question that will almost certainly get removed from QA ?
BillWoodruff 23-Nov-21 23:03pm View
this is a comment, not a solution.
BillWoodruff 23-Nov-21 23:01pm View
The revised code triggers the Dialog only when dataGridView3 has #0 rows. I that not what you asked for ?
BillWoodruff 23-Nov-21 12:21pm View
See revised code above.
BillWoodruff 23-Nov-21 7:51am View
You need to research genetic algorithms, select a programming language, and start experimenting. When you have code to show, and specific questions, come back here.

See those link to the right under "related question:" start there.
BillWoodruff 22-Nov-21 23:27pm View
Indeed, 'Return of the Sophist' re-run.
BillWoodruff 22-Nov-21 23:22pm View
please translate to English, and tag your question with appropriate Tags, like Excel.
BillWoodruff 22-Nov-21 6:35am View
Extremely doubtful the OP is using Win 11.
BillWoodruff 22-Nov-21 1:16am View
You need to state clearly what you are trying to do.

Tag your question with appropriate tags: C# version, FrameWork version. Visual Studio/Code info.

Clarify exactly what is done in Win Forms, and what the use of AvastUI is about.

Are the Button and Panel standard WinForm controls on a Form ?
BillWoodruff 21-Nov-21 23:06pm View
Are you asking how to make a Button or a Panel with rounded corners in WinForms ?
BillWoodruff 20-Nov-21 8:03am View
Maybe ?

BillWoodruff 16-Nov-21 21:51pm View
"if I want to load the txt file back into the datagrid I get an error from the compiler again"

I wish I were psychic :) What error: where did it occur ?

Set break-points and single-step through your code (F11) until you find exaxtly where an error occurs.
BillWoodruff 14-Nov-21 19:58pm View
i treasure these moments when i can see we are, temporarily, in different universes :)

"No he is asking how to ensure only one execution of a specific application is running at any one time."

uhhh ... that is what I said.

"You can run any number of copies of an application, even if it contains a singleton class within it."

The OP is talking about an application, not a class: i assume the OP is/has written the App, and the task is to enforce singleton behavior on one machine. Use of Mutex is one standard way to create a Singleton in a context where thread safety is critical.

It's been over 15 years since i touched C++, and i am not aware of current issues in creating Win apps.
BillWoodruff 14-Nov-21 10:58am View
hi, we are talking about making an app behave like a singleton class here.

"What is a Singleton class in C++?
Singleton in C++

"Singleton is a creational design pattern, which ensures that only one object of its kind exists and provides a single point of access to it for any other code. ... You can't just use a class that depends on Singleton in some other context. You'll have to carry the Singleton class as well."
BillWoodruff 12-Nov-21 19:16pm View
If we/others do your homework, you will learn nothing.

How do you code a program that simulates MARIE? - Reddit › AskProgramming › comments
2 days ago — Find the specs for how a MARIE CPU is supposed to work, implement a ... Going deeper, maybe you want to simulate each clock cycle, ...

How do I code a program in C# within Visual Studio that ... › questions › how-do-i-code-...
4 hours ago — I have a coding assignment due in 3 days that requires me to create a program in C#, within Visual Studio, that simulates MARIE.
BillWoodruff 11-Nov-21 17:15pm View
what does "extract" mean ? break each record into a series of strings ? or, create instances of a strongly typed structure ?
BillWoodruff 11-Nov-21 9:32am View
A key factor in determining the complexity of the code you'll need to write is how reliable the data is; for each field, like "ip address," will you need to write validation code (or use a RegEx) to check it ?
BillWoodruff 11-Nov-21 0:40am View
BillWoodruff 11-Nov-21 0:36am View
Why aren't you asking Telerik support ?
BillWoodruff 10-Nov-21 6:49am View
once again:

"I dock the FlowLayoutPanel on TableLayouPanel to enable the autosize of the User Control."

Why are you using both a FlowLayoutPanel and a TableLayouPanel ?
BillWoodruff 9-Nov-21 22:19pm View
"I dock the FlowLayoutPanel on TableLayouPanel to enable the autosize of the User Control."

Why are you using both a FlowLayoutPanel and a TableLayouPanel ?
BillWoodruff 8-Nov-21 8:46am View
define what "custom commands" are
BillWoodruff 7-Nov-21 20:36pm View
no apology necessary, but, my time here is limited; any code you post here i will look at. i think you'll find folks here, or, on StackOverFlow, will not go to any external site to view content (security issues).

whatever your code is, i believe it must provide the three facilities i describe in my answer.

cheers, Bill
BillWoodruff 7-Nov-21 17:50pm View
Hi, i am here to teach you how to help yourself develop your own code, not to write code for you.

Your question is relatively simple: start by completing the steps i outlined for you in my answer. Post your code here, and ask specific questions about the code.

cheers, Bill
BillWoodruff 7-Nov-21 13:56pm View
BillWoodruff 6-Nov-21 17:34pm View
BillWoodruff 5-Nov-21 11:09am View
2nd. repost
BillWoodruff 5-Nov-21 8:57am View
Please define exactly what "alignment" means. What do you expect to SEE after "alignment" ? What are "Transformation" and "PCALib" ?

We can't read your mind.
BillWoodruff 5-Nov-21 7:15am View
put breakpoints in your code; single-step through it using F11, examine the values of variables ,,, that will show you what the problem is.
BillWoodruff 4-Nov-21 9:59am View
If we do your homework, you will learn NOTHING !
BillWoodruff 4-Nov-21 9:42am View
Is brushing your teeth after a meal a good idea if your house is on fire ?

One non-sequitur deserves another :)
BillWoodruff 4-Nov-21 9:17am View
BillWoodruff 4-Nov-21 9:15am View
saying to a homework shirker whose plea for someone else to do their work, and, whose no-content post is almost certain to be removed: "go elsewhere and educate yourself," has no benefit except to inflate your reputation.

if a post like this is not removed, then the forum is cluttered, and, other users will also ignore the forum guidelines clearly described in the FAQ.
BillWoodruff 3-Nov-21 11:24am View
i'm unable to replicate the behavior in the update you describe.


name Column1 displayindex : 0
name Column2 displayindex : 1
name Column3 displayindex : 2
name Column4 displayindex : 3
name Column5 displayindex : 4

dataGridView1.Columns[4].DisplayIndex = 2;


name Column1 displayindex : 0
name Column2 displayindex : 1
name Column3 displayindex : 3
name Column4 displayindex : 4
name Column5 displayindex : 2

i do know that weird results can occur if you move column #0 to another location, or move a > #0 column to #0.

put breakpoints before and after you set the DisplayIndex, and examine the runtime Columns state.
BillWoodruff 2-Nov-21 19:04pm View
This is too abstract for me to respond. Please add more detail. What is the purpose of this application, who are its users ?
BillWoodruff 2-Nov-21 14:54pm View
Okay, i can see that, now :) Have you explored the possibility of defining your own custom DataGridViewColumnHeaderCell ? While i would override CellPaint ... because i often have several reasons for doing that ... i would check out: (i have not tried it)
BillWoodruff 2-Nov-21 12:34pm View
you're welcome :) i find myself wondering why you would want to hide a specific ColumnHeader Text. i can imagine changing the column header text for various reasons. cheers, bill
BillWoodruff 2-Nov-21 1:14am View
Well, good luck wit that.
BillWoodruff 1-Nov-21 3:56am View
Define a "real" OS. Unless you are an experienced developer with years of experience, and intimate knowledge of Win and .NET internals, I believe you will waste your time, and achieve nothing.

Why aren't you reading and studying the Cosmos docs:

COSMOS Repository on GitHub - The COSMOS source, issue tracker and other downloads
COSMOS Discussions on GitHub - Ask general questions, get help and show off your projects
COSMOS Discord Server - Ask any COSMOS related questions or just chat with other Cosmos users
COSMOS Facebook Page - Our blog where we post updates and other news.
COSMOS YouTube Channel
The current Cosmos DevKit and UserKit API Reference.
BillWoodruff 1-Nov-21 1:32am View
Why not ask the author of the article ? Be sure and include the version of C# and FrameWork you are using.
BillWoodruff 31-Oct-21 9:05am View
imho, this OP needs education, not having his code written for him.
BillWoodruff 30-Oct-21 7:16am View
Any knowledge you have about patterns in the data can be exploited. "Real world data," is often not random.

If the data is "meaningfully" random, then you may be able to omit sorting. Of course, if sorting is a requirement ...
BillWoodruff 30-Oct-21 4:15am View
okay, i'll study your explanation when i am more rested. another possibility is: a point may be on more than one segment. to the extent you can narrowly define the results you want, and exclude testing for other cases, you can optimize the code.

in "real world code," skilled programmers often optimize using assumptions about the likely frequency of what types of values the data holds. for example, if i can assume every point is on the line, i can omit testing for that; if the data os organized by magnitude, maybe i don't need to sort.

Different search functions may be used to optimize searching.
BillWoodruff 30-Oct-21 2:40am View
Hi, maybe my brain is not at 100% today :) If i think of a horizontal line from x0,y to x1,y then any point on the line can be defined by an x value, and any segment by two x values. In the case the segments do not fully cover the width of the line, there is a possibility that a point can be on the line, and not on any segment.

Other possibilities include: a point is outside the line; or, a segment is "not legal" ... however you define "not legal."

If this accurately describes your "context," please help me understand how the sample data shown "work."
BillWoodruff 29-Oct-21 23:46pm View
Don't play with guns !
BillWoodruff 29-Oct-21 21:23pm View
An interesting question which i upvoted ... i only upvote class/homework posts that, like yours, show code and substantial work on implementation.

? Check the data for the Samples: they don't seem to be accurate given the description.
BillWoodruff 29-Oct-21 6:25am View
once again you are posting a kind of semantic fantasia, where you pose as some kind of sophist disputing documentation.

if you want to learn C#, experiment, and observe behavior, and generate hypotheses, as well as study documentation.

imagine a carpenter that can tell you how a saw works, but, has never tried to use one.
BillWoodruff 29-Oct-21 6:19am View
You're kinder than i am :) Indeed, strings are weird critters, and i hear echoes of Eric's classic mantra "implementation detail" every time i wander into the wilderness of what a char[] is doing in a box like 'string.
BillWoodruff 29-Oct-21 6:15am View
Rude ? This is not about You.
BillWoodruff 29-Oct-21 5:14am View
BillWoodruff 29-Oct-21 5:13am View
Please define what "INLINE" means; why would you sort a ListBox's contents rather than sort a column in your DataTable, or other structured data source ?
BillWoodruff 29-Oct-21 4:38am View
i think this post might be from the latest incarnation of someone we know, whose specialty is semantic confusion. New member, #1 post.

What String is vis-à-vis reference/value-type, and how Strings are managed vis-à-vis heap/stack has some complexity that Eric Lippert has written about. Reference on request.
BillWoodruff 28-Oct-21 21:07pm View
great, please tag your question to indicate context. context is important to know since search facilities/methods vary.
BillWoodruff 28-Oct-21 20:26pm View
please tag your question to indicate if this is ASP, or WinForms, or whatever.

what would would the type of search queries you want to perform look like ? what syntax; what results expected ?

are you saving the blogs to a file, to a DB ?

my inability to read your language is at work here :)
BillWoodruff 28-Oct-21 12:49pm View
Hi George, I will not engage with this thread further because i see no positive outcome in terms of enduring CP quality, and, my time is limited by vision problems.

Trying to drag information out of you piece-by-piece to try and get the big picture of what you are doing is a waste of time. Amd, i qn not about to go baxk to Win 7 and an early .NET Framework to test your code.

i have carefully verified your code, and Luc's, will not work in a standard VS 2019, C@ 4.8 Console app for reasons i understand completely.

i believe the idea/strategy of using both a Form and a Console is a serious mistake that will result in unnecessary complications.

What i will do, that i think will be valuable for CP in the long run, and will not waste my time, is to post a tip/trick showing what i consider a useful architecture for interactive run-time control of a WinForm's behavior where "control" is defined as response to a well-defined set of commamds, and/or queries.
BillWoodruff 28-Oct-21 9:21am View
voted #3; i do not believe this post addresses the key issue for the OP which involves Office interop stuff in ASP. You ignore the possibility OpenXML use may be involved (mentioned in the OP's comments), and, assume the OP knows how to use4 Office Interop when it is clear he does not know how to use it.
BillWoodruff 28-Oct-21 9:17am View
voted #3; i do not believe this post addresses the key issue for the OP which involves how to use Office interop stuff in ASP.

You tell the OP to use OpenXML, but, you do not say why, or indicate you have actually done this yourself.

Using StringBuilder is always good advice, but in this case, if the OP can use Office interop, they may not need to use it.
BillWoodruff 28-Oct-21 9:12am View
I read your post in full, and your comment in full. And, i never down-vote a poster with your track record on CP without very careful consideration.
BillWoodruff 28-Oct-21 9:10am View
Awesome ! Wish i could upvote this comment.

As a young poet, i tried to achieve synesthesia through chemistry, inspired by Verlaine's "Voyelles," and clinical case histories: i'm afraid all that led to was ... drab word-salad.

those were the ... daze OMG
BillWoodruff 28-Oct-21 8:57am View
Voted #1: this is a vague response that ignores the equally vague question, that invents a hypothetical "Employee" class the OP never mentions, and ignores the possible implications of the fact the one method the OP shows us is declared 'static.

imho, my esteemed colleague CHill is way too smart to have posted this.
BillWoodruff 28-Oct-21 8:25am View
what is JObject, jtoken ? that doesn't look like C#. we can't read your mind.
BillWoodruff 28-Oct-21 8:21am View
Put breakpoints in the code and single step (F11) through it, examining the state of variables.
BillWoodruff 28-Oct-21 8:19am View
I'm afraid 'WritLine' was in the 1840CE version of C# :)
BillWoodruff 28-Oct-21 8:16am View
please format all your code examples.

Right now, the class Connexion is not declared 'static; why ?

If it's not declared static, show the constructor (if any), and show the code in your Form that creates a new instance of Connexion.
BillWoodruff 28-Oct-21 8:10am View
how is this relevant to the question asked ?
BillWoodruff 28-Oct-21 7:14am View
This use scenario is so far outside my experience with threading i can't be helpful.

In .NET 5 and Core 3, you've now got: public void Kill (bool entireProcessTree);

See this about changes in usage of Thread.Abort:

cheers, Bill
BillWoodruff 28-Oct-21 6:49am View
what version of .NET are you using ?
BillWoodruff 27-Oct-21 12:00pm View
BillWoodruff 27-Oct-21 7:52am View
H Maciej, Why not use interop with the App ? i can use interop in WinForms to get paragraph count, get the text of a specific paragraph, etc. i don't use ASP right now, and don't have the Office interop stuff installed, so, i can't test that.
BillWoodruff 27-Oct-21 7:43am View
You get busy researching what facilities OPenXMl offers, and experiment: then ... ask questions.
BillWoodruff 26-Oct-21 22:16pm View
"So basically everyone that says that that WPF and Winforms are dead are full of it?"

i don't know about "everyone;" but, i know i would never say that :)

My old friend Andrej, author of what are in my opinion the best suite of WinForms controls, has now moved on to creating web controls for Blazor, check his work out at he tells me you can create desktop-equivalent apps that run in the browser, leveraging your C#/.NET skills.

Keep a watch on Microsoft's Maui, which they claim is the next step after Xamarin.

Now, back to programming using ... WinForms.

cheers, Bill
BillWoodruff 26-Oct-21 5:52am View
TreeListView is not a standard WinForm, or WPF, Control: what Control are you using ? Telerik ?

Where's the code for the Buttons click handlers ?
BillWoodruff 25-Oct-21 5:36am View
"I do not like declaring methods and variables as static. So I use the following Main" a Console app is a static context that requires fields and methods declared static; your work-around is one of the weirdest hacks i've ever seen :)

i still don't see the place where 'show_images is called from.
BillWoodruff 24-Oct-21 14:06pm View
sorry, i thought your name was 'Feorge :)
BillWoodruff 24-Oct-21 14:00pm View
Hi, follow-up questions (i am unable to duplicate your results, and i get exactly the type of errors i expect to see):

0) what does the user enter into the Console ? a Directory of files ?

1) when you created this project, did you select Console as the project type /

2) did you make any change to the application output type (accessed by the solution property window) ?

3) i notice the show_images method is not declared static: why ?

4) if you would show what the Main method code is, that would be useful

cheers, bill the bloodhound
BillWoodruff 23-Oct-21 21:31pm View
thanks, George, i will study and test this code today, comparing it to the non-working Console app i am currently testing.

You mention Mono for future use in Linux; please verify this a standa4d C# Console app created on a Win PC.

cheers, Bill
BillWoodruff 23-Oct-21 0:36am View
Hi, i was hoping that Luc would revise his code to handle the "obvious" ... the answer is literally staring him in the face.

Please respond to the specific questions i asked you, so, possibly, i can come away from the negative experience of participating in this thread with a few crumbs of knowledge.

i take pride in posting solutions i have verified.
BillWoodruff 23-Oct-21 0:23am View
Hi, since solution #3 (as is) does not work in a "standard" Console app i created (specifically to test this code) in VS 2019, using framework 4.8, on a pc running Win 10/64, i am curious to ask you:

0. are you using the exact code shown in solution #3 ?

1. what is your pc's OS, what IDE are you using.

2. when you run solution #3, what do you see on the screen ?

i am always willing to learn :)

thanks, Bill
BillWoodruff 22-Oct-21 13:55pm View
do you realize that you have an accepted an answer that does not work ?
BillWoodruff 22-Oct-21 13:52pm View
good grief ... i give up: your code does not work for an obvious reason.
BillWoodruff 22-Oct-21 2:29am View
1) WinForm controls created in a Console app have 'DoubleBuffered set to 'true by default/

2) your code will not display the created Form for an obvious reason: a reason you obviously understand :)

i agree that this type of hybrid app is a bad design. much better to make it a WinForm app.

knowing you are not perfect gives me no "pleasure," and does not put a dent in the high-esteem i hold you in :) it does give me hope that i too can keep learning !
BillWoodruff 22-Oct-21 1:44am View
Is it too much trouble to interrupt your wheel-spinning and read my solution where i explain exactly what is going onw irh code examples ?
BillWoodruff 22-Oct-21 1:11am View
Your comment, and this on, have nothing to do with my comment to the OP.

"Actually a lot of PB get created and disposed of, however they all get added to the Form.Controls collection which doesn't look quite right (although there is some built-in mechanism that might remove them on dispose, can't remember the details as I don't ever write code in that way)."

how many neurons does it take to remember that objects instantiated in using(){} statements are automatically disposed ? :) see my answer to George below.
BillWoodruff 22-Oct-21 0:59am View
my vote of #1: clearly, you did not test this: the PictureBox will never show up because you misused 'using the same way the OP did. the statements you added do nothing.
BillWoodruff 21-Oct-21 23:27pm View
Hi Luc, I think you meant this comment for the OP, not for me.
BillWoodruff 21-Oct-21 22:48pm View
sorry, i plead insomnia.
BillWoodruff 21-Oct-21 22:47pm View
George did add the PictureBox to the Form, and then he hid it: picture_box.Visible = false;

BillWoodruff 21-Oct-21 21:29pm View
Clarify "does not work:" what happens, what doesn't happen, error messages ?
BillWoodruff 21-Oct-21 19:59pm View
repost of

however: requirement to ignore negative numbers is new.
BillWoodruff 21-Oct-21 6:17am View
that's a very gracious response, and very appreciated ! Luc is one of my CP "heroes" :) ... any comments from him are "gold" !
BillWoodruff 20-Oct-21 16:26pm View
Describe exactly what you want to end up with: a lis of integers ? or ?

We can't read your mind.
BillWoodruff 20-Oct-21 12:41pm View
i respect that choice :)
BillWoodruff 20-Oct-21 6:37am View
OP: "actions I do in the second project must be passed on to the first one."

Your answer is good, but it doesn't address the two-way interaction between processes the OP describes. Of course, that is a very advanced topic !
BillWoodruff 20-Oct-21 5:36am View
"Close" means hide, or means dispose of the instance ?
BillWoodruff 20-Oct-21 5:33am View
BillWoodruff 19-Oct-21 14:31pm View
The future users appear in my dreams, voting solutions i have not posted yet to questions they have not asked yet ... #5's :)

imho, the current poster needs an overview of benchmarking; based on awareness of techniques, they can, in the future, make appropriate choices for implementation. Using 'DateTime is a sign to me of lack of knowledge which you address in your post.
BillWoodruff 19-Oct-21 13:38pm View
Good point ! Is there anything in my post you think is valid, or valuable for this OP, or, for future CP members ?
BillWoodruff 19-Oct-21 11:58am View
"the actions I do in the second project must be passed on to the first one."

is having two processes (.exe) running a requirement /
BillWoodruff 19-Oct-21 8:48am View
great !
BillWoodruff 19-Oct-21 8:09am View
where does the zone information data come from ?
BillWoodruff 19-Oct-21 3:10am View
What happens when you run your code ? Errors ? Unexpected results ?

Are you the person who creates the data/text file ?

Why aren't you using a database ?
BillWoodruff 19-Oct-21 3:06am View
BillWoodruff 18-Oct-21 18:10pm View
Hi, "as the words fail me" reminds me of one of my favorite poems "In Broken Images:" by Robert Graves :)
BillWoodruff 18-Oct-21 17:47pm View
BillWoodruff 18-Oct-21 17:47pm View
Olease give us a clue what "Cosmos Library" is ... is it one of these:
BillWoodruff 18-Oct-21 17:44pm View
this is a comment, not a solution, please delete this and add your comment
BillWoodruff 18-Oct-21 17:43pm View
+5 nice to see you here again, Luc !
BillWoodruff 18-Oct-21 11:44am View
When are you going to stop spinning your wheels in semantic sand and start learning how to use the language.

Those of us who volunteer here to answer questions are here to help people learn; not to get side-tracked into discussions of 3rd. party conversations.

Sending multiple comments harping on wanting my opinion is annoying, and inappropriate.

BillWoodruff 17-Oct-21 19:32pm View
This is not a code writing service. Do some research, experiment with code, ask specific questions related to code you have posted here.
BillWoodruff 17-Oct-21 15:33pm View
"I guess what I'm asking is what your opinion on what that other user said."

as i said, i can't react meaningfully to a conversation i'm not a party to :)
BillWoodruff 17-Oct-21 15:22pm View
Hi Tom, i can't react meaningfully to a conversation i'm not a party to :)

My opinions here are deliberately expressed "provocatively."

i prefer a language with very strict strong-typing: is that bias, or preference, habit, or wisdom learned from experience ?

Perhaps you'd enjoy my rant/story about a recent semantic clash i found:
BillWoodruff 17-Oct-21 4:41am View
I like to think of reserved words as sacred cows, and contextual keywords as ordinary livestock.
BillWoodruff 17-Oct-21 4:37am View
good essay/question ! for the DevX and DevComp components, I'd ask the companies what they are planning.
BillWoodruff 17-Oct-21 4:35am View
BillWoodruff 16-Oct-21 22:57pm View
check the LoadProcess form: is the TextBox on the Form named textBox1000 ? does the error occur when you build/compile ?

i tested the code example before posting it; here's the button click handler for a button on Form1 :

private void button1_Click(object sender, EventArgs e)
if (Loading == null) return;

ProJex.LoadingState = "Setting up data adapters\r\n";
BillWoodruff 16-Oct-21 18:26pm View
is textBox1000 sited in the LoadProcess Form ? is your ProJex,Variables class defined as static and LoadingState field defined as static ?

put a breakpoint on the first line of Form1_Load and single-step through the code, examining what's happening. describe the errors in more detail if possible.

cheers, Bill
BillWoodruff 16-Oct-21 13:53pm View
inho, this would get #5's if posted as a solu5ion
BillWoodruff 16-Oct-21 11:48am View
glad i could assist :)