15,884,176 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 Python 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 M-Badger (Top 32 by date)
M-Badger
4 days ago
View
Glad you got it working
M-Badger
5 days ago
View
What does "does not work" mean ? Do you get no data or not the data you expect ?
What does "it works" mean ? Do you get the data you expect ?
M-Badger
5 days ago
View
Does the hardcoded version still work if you correct the order of the month and the day?, i.e. DATE(2024/7/17) ?
M-Badger
5 days ago
View
Does DATE(2024/04/13) evaluate to the same thing ?
M-Badger
5 days ago
View
What does that expression evaluate as ? Does it return a value that PowerBI recognises as a date ?
M-Badger
5 days ago
View
In the hardcoded version the month and the day seem to be reversed, it's DATE(Year, Month, Day) - hence DATE(2024,17,7) is the 7th day of the 17th month of the year 2024.
What is the format of [EndOfWeekDate] ?
M-Badger
25-Mar-24 8:20am
View
You're not going to get far with that question, nobody is going to provide you with the code for a full reservation system.
Start by either
a) using an existing system (search for "open source seat reservation system"), there are several in existence
b) writing some code
c) using generative AI with a prompt such as "how can I create a movie theatre hall seat reservation system to reserve seats by number using php"; you won't get code for a complete application but you'll get a basic structure and then you can start putting it together
Then when you get stuck on a specific problem come back asking for help with solving it
M-Badger
25-Mar-24 6:47am
View
Should the GetHashCode method have a 'return code' line or does the compiler know what to do with that ?
M-Badger
3-Mar-24 9:26am
View
What overloads of the Render method exist ?
Do any of them take the types that you are calling with ?
What is the definition of the CreateStream method ?
What is its return type ?
Does that match the signature of the Render method ?
M-Badger
27-Feb-24 11:02am
View
I think you need to be more specific, pick one aspect of the code that you think can be improved, post the code and why you think it needs work and you're more likely to get some feedback
M-Badger
11-Feb-24 9:00am
View
It sounds like the changes it makes are therefore predictable even if they aren't as simple as 'change the top property of all controls by minus 10 pixels'. If you can predict them then you can reverse them with a simple piece of code to find all top properties and modify them appropriately.
M-Badger
10-Feb-24 12:29pm
View
Good to see you moving away from 2010 to a newer version that includes Yield in VB :-)
Good luck!
M-Badger
5-Feb-24 9:28am
View
I am not sure what "instead of passing integer values I pass strings or dots" means, especially "dots".
The IEnumerable and IEnumerator are specific to the enumerable object in the IEnumerable class that you create so you can have an array of strings or any other type of object; you can have Lists, Colections etc. In your case you had a 1-dimensional array of integers so the code was written to that, if it was a 2-dimensional array or an array of double then the code would need to be adapted. I don't know if it possible to write equivalent late binding code to make it generic and I'm not going to try.
My answer showed you how to modify your "What have I tried?" code.
It may be my lack of ability but your C# does not make a lot of sense to me. For example you create a Range object and then instantiate it with a reference to 'this', so 'this' must be a Range object (a tuple of Index) and then you call the GetRanges method of that Range object but the Range class doesn't have a GetRanges method (nor for that matter does it have a SelectAll method). I wonder if 'this' is actually a string?
So assuming what you want is an array of range objects that indicate the start and end indexes of all occurrences of the search string within a larger string then, as the saying goes, I wouldn't start by trying to convert that C# code to a VB equivalent. Personally (not a professional) I'd create a List or a Collection of Range objects (if Collections/Lists were available in 2010) based on code that does the pattern matching and which populates the List/Collection. You then have an object which is enumerable. Or you can create an array of Range objects and implement IEnumerable/IEnumerator as shown.
M-Badger
28-Jan-24 5:55am
View
It would be much more helpful if you included the code that you have tried
M-Badger
21-Jan-24 8:43am
View
Thank you. I've updated the answer to reflect why I did that
M-Badger
6-Jan-24 6:24am
View
I had assumed that the point was that I could have added that as a comment to the OP rather than as an answer, which wasn't unreasonable.
But thank you :-)
M-Badger
26-Nov-23 16:27pm
View
Have you tried -n+2 to check that it is not zero based ?
M-Badger
22-Oct-13 17:02pm
View
I think it may help if you assume I'm a rank amateur.
(I wonder if there is some confusion? I am looking at a library rather than an application, does that make a difference?)
Do you mean that it (and it would be only one) would work with a hidden color space, say CIE 1931 XYZ since it is the common reference, and that to obtain a model or a space, whichever is desired, this object would have methods that kick out a new object of the desired type? Presumably it could then construct itself on the basis of being given any color object, model or space - the reverse to the previous sentence and that perhaps the constructor could have an optional parameter of space, the default of which exposes the default space which is not directly accessible otherwise? How would you assign colors the model that it contains without specifying a model type and exposing its members, Red, Green and Blue for example?
M-Badger
22-Oct-13 16:25pm
View
Let's see if I've understood:
The classes, as conceived, don't think at all about actual drawing, they are just objects to manage colors, either color models or color spaces plus the conversions and the transitions between spaces and models (which is often confused). A color space being the manner in which a model becomes something real rather than abstract.
However, I think you are suggesting this:
A class called Color which contains as a member an interface, let's call it IColorModel.
The classes that manage the color models must implement IColorModel, RGB, CMYK etc.
The Color class should have a second member called IColorSpace which allows the model to be interpreted in such a way that it can be rendered correctly.
Color model conversions, e.g. RGB to CMYK, simply change the IColorModel member.
Color space changes, e.g. CIE 1931 XYZ to Adobe RGB change the IColorSpace member and have consequent changes on the IColorModel member, either a complete change or a change in the detail: CIELAB to sRGB would change both, Adobe RGB to sRGB would change the space and the detail of the model.
The ToGray methods, as an example, would call the relavant method of the IColor member which would probably also implement the IColorToGrey interface, both interface members pointing at the same actual object.
Have I understood anything?
M-Badger
20-Oct-13 16:48pm
View
aCMYK newColor = new aCMYK();
newColor.ToGrey(GreyScaleMethod.RedChannel)
Public Interface IToGrey
Sub ToGrey(ByRef color As IColorModelConvertible)
End Interface
Public Interface IColorModelConvertible
Function ToARGB(Optional ByVal alpha As Integer = 255) As aRGB
Function ToColor(Optional ByVal alpha As Integer = 255) As Color
Function ToAHSB() As aHSB
Function ToAHSL() As aHSL
Function ToACMYK() As aCMYK
Function ToHex(Optional ByVal alpha As Integer = 255) As String
End Interface
Public Class RGBAverage
Implements IToGrey
Public Sub ToGrey(ByRef color As IColorModelConvertible) Implements IToGrey.ToGrey
Dim newARGB As aRGB = color.ToARGB()
newRGB.Green = newRGB.Red()
newRGB.Blue = newRGB.Red()
color = newRGB.To [Help: Don't know original class type!)
End Sub
M-Badger
27-Aug-13 16:27pm
View
Out of interest (sorry for the delay) why custom rather than InvalidEnumArgumentException or ArgumentOutOfRangeException?
I get the idea / benefit of writing your own exceptions, however those two seem pretty well aligned with the problem at hand?
M-Badger
27-Aug-13 16:23pm
View
Struggled a bit to understand your articles, they are, at least as yet, a bit ahead of me - hopefully I'll get there sooner or later.
I did however find this: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/11/22/applying-strategy-pattern-instead-of-using-switch-statements.aspx
I found it be a usefully simpler explanation for my level.
M-Badger
25-Aug-13 13:16pm
View
Thanks, I've started doing a thorough examination of how it works in a variety of circumstances.
My question here was linked to the one linked below and the implementation of a
Switch...Case...Default
http://www.codeproject.com/Questions/639070/Exceptions-for-Enum-Method-Parameters
M-Badger
19-Aug-13 2:29am
View
Thanks, I will keep this for futur e reference. In this case however it feels a bit like overkill since the chances of me inventing a significantly increased number of ways of converting colour to greyscale are limited (and hence changing the enumeration).
The switch remains ugly but 'more readable' (to me) than adding the code from your two articles.
M-Badger
19-Aug-13 2:26am
View
Thanks, useful and straightforward. I guess I was wondering if the compiler added the relevant code to handle problems gracefully and informatively if, for example, someone passed in a typecast integer that was out of range. Or if it would throw a largely useless and informative error. The latter case, in my original thinking, would be the only justification for adding my own error..throw code, however...
You're second point is the same as that of RLH68? (his comment on my question). I'd forgotten to think of the error from both directions in either case.
For interest, which error type do you throw?
M-Badger
14-Apr-13 9:15am
View
Can you show the code you have found and which you can't follow
M-Badger
14-Apr-13 9:11am
View
There are lots of sources out there, as you have said.
Do you mean you don't understand the code they use?
Or that you don't fully understand the language used (presuming English isn't your first language)?
The obvious approach of taking each letter of the string and working away from it in both directions appears to be the least efficient (but it should be simple to code). Do you need to find 'better' answers?
M-Badger
24-Mar-13 3:18am
View
You will need tom specify the question a bit more.
Do you mean how do you use the OpenFileDialog componenrt to open images?
Do you mean you want to set an image preoperty for a control (such as a PictureBox)
Or something else?
M-Badger
15-Mar-13 3:25am
View
See the following answer.
M-Badger
24-Nov-12 6:12am
View
You could argue that C# is hiding the behaviour that MSDN describes and that VB reveals in indirectly by doing 'weird' stuff. A win for VB.
Or you could say that C# is saying 'don't worry about what crazy stuff the compiler is going to do, I'll make you be sufficiently clear that it doesn't matter'.
A Win for C#. In some weird way the behaviour MS have chosen makes sense to me (maybe it goes back to having learnt procedural coding on a BBC Model B). Choice your posion and off you go, whatever you decide someone is gonna say 'brilliant' and right after someone else will say 'idiot'.
M-Badger
24-Nov-12 6:11am
View
Deleted
You could argue that C# is hiding the behaviour that MSDN describes and that VB reveals in indirectly by doing 'weird' stuff. A win for VB.
Or you could say that C# is saying 'don't worry about what crazy stuff the compiler is going to do, I'll make you be sufficiently clear that it doesn't matter'. A Win for C#.
In some weird way the behaviour MS have chosen makes sense to me (maybe it goes back to having learnt procedural coding on a BBC Model B).
Choice your posion and off you go, whatever you decide someone is gonna say 'brilliant' and right after someone else will say 'idiot'.
M-Badger
22-Oct-12 4:19am
View
What was your expectation?
Show More