What you posted is not fully tested, reusable code. What you posted is a question which clearly falls under the default category of "discussion/question".

When you created this thread, right above the area where you pasted your code was:

DO NOT post code with errors or known bugs. Code snippets must be fully tested, reusable code to share with others.

Clearly you found those instructions confusing. Would you care to suggest alternate instructions?

The way I would do this is to make the tables more general. You have a table set up for a specific number of courses. If you need to add or remove courses you have to alter the table. Instead, you should have a table that maps courses to a course ID. Then you can have a table that tracks any number of courses. Adding a new course is simply a matter of adding a record to the mapping table, then adding one or more records to the tracking table. That gives you the ability to query the tracking table for how many times any value appears for any course without having to do the query for every course column.

If you want help with code

  1. post valid code (properly formatted)
  2. take the time to explain what you want
  3. if you have a specific problem please state with what (and where)

It seems to me that if you have something that really needs to be hidden, instead of creating a complex workaround to try to hide stuff in (sort of) private properties (resulting in something that may be impossible to maintain), you'd be better off writing the critical stuff in C/C++, compiling it, then adding a wrapper the same way that wxPython is a wrapper for wxWidgits.

"Driver Hell" is real

To be fair, it's much easier for Apple to minimize driver problems when they have complete control over the hardware. Microsoft can only provide the interface, then hope that the hardware manufacturers follow the rules when it comes to writing the drivers. Of course, that also depends on Microsoft providing proper (complete) documentation, and we know their record on that score.

I posted code that will do that. It's the only solution you have so far so use it until something better comes along. I tested it with the xml text that you provided, and requesting the fields you specified. I loaded the test data with

txtXML.Text = My.Computer.FileSystem.ReadAllText("D:\test.xml")




cheikh06 commented: thank you very much it works well with your function +0

Dang. I always complain when other people do this and now I did it. I left out the import when I posted the code. Please add the following:

Imports System.Text.RegularExpressions

I'll see if I can figure out the Linq version. I'll post it later if I have any luck.

cheikh06 commented: Thank you for your help with this function but it returns me not found +0

I've never had much luck working with XML and I'm sure there is a better way to do this via Linq but you could try a regular expression approace as in

Private Function GetField(name As String) As String

    Dim pattern = name & "=""(.*?)"""
    Dim rex = New Regex(pattern)
    Dim match = rex.Matches(txtXML.Text)

        Return match(0).Groups(1).Value
    Catch ex As Exception
        Return "not found"
    End Try

End Function

Pass it a field name like "supercollection name" (case sensitive) and it will return a field value as a string. If you want someone to post a Linq solution you'll have to post a complete xml sample document.

rproffitt commented: This is my story. Client hands me XML, Microsoft XMLreader blows up. I parse it with my own code. +15

For future reference, Code Snippet is meant for posting working and documented snippets of code. It is not to be used when you are posting a piece of code that you are having problems with. Please post under Discussion/Question.

You are allowed to edit your post within 30 minutes of iniitially posting it.

Gloak commented: I don't like it... I was planning to delete and post the same thing again... but I can't. +2

It's a combination of syntax and addressing. Try

const int NUMSTUDENTS = 10;

int main()
    int marks[2][NUMSTUDENTS];
    printf("Enter the marks of the %d students :\n",NUMSTUDENTS);

    for (int i = 0; i < NUMSTUDENTS; i++)
        printf("\nEnter the marks of student :%d", i+1);
        printf("\nAssignment Mark :");
        scanf("%d", &marks[0][i]);
        printf("Exam Mark :");
        scanf("%d", &marks[1][i]);
    for (int i = 0; i < NUMSTUDENTS; i++)
        printf("Student No :%d\n", i+1);
        printf("Assignment Marks :%d\n", marks[0][i]);
        printf("Exam Marks :%d\n", marks[1][i]);
    return 0;

Please note that I replaced the literal 10 with NUMSTUDENTS. You should really break the habit of hard coding literals. If you had a longer program with a 10 sprinkled throughout you could easily bury yourself in bugs if you later had to change the 10 to some other value. And you might end up changing a non-related 10 by mistake. The const NUMSTUDENTS is clear and unambiguous.

Malpractice makes malperfect.

There is a lot of the same old mindless drivel about SEO, backlinks and such, and a lot of homework posting. There was one interesting discussion a while back in the former geeks-lounge re Quebec's proposed religious symbols legislation. Aside from java questions (which I am not qualified to answer) there hasn't been much going on outside of pharma-banning and necro-posting.

it just told me no such command exists

You'd either have to:

  1. Run it from the folder containing the executable
  2. Run it from another folder but fully qualify the executable
  3. Place the executable in a folder contained in your PATH environment variable

I have a folder namedf D:\Utils and have added it to PATH. That way any custom command line apps I write or download can be placed there and accessible from anywhere.

You use it like it says.

nlist_it filename.ext

Run it with the name of a text file as a parameter and it will list that file to the console. I compiled and ran it and it works as it is supposed to.

By the way, no book will teach you a language in 21 days.

rproffitt commented: Or how to use the command line or what the command line is and all you can command on the command line. ;) +15

What part of "it's a hoax" was unclear?

rproffitt commented: I wonder how many don't know how to research such things. +0
  1. Open an Explorer window
  2. Right click on This PC and select Properties from the pop-up menu
  3. In the Control Panel window click on Advanced system settings
  4. Click on Environment Variables

At this point you have to decide if you want the change to apply to just the current user, or for all users. You will click on Path in either the upper list (current user) of the lower list (all users).

  1. Click on the appropriate Edit... button.
  2. In the Edit environment variable window click New
  3. Enter the desired path info into the edit box
  4. Click OK
  5. Click OK
  6. Click OK
rproffitt commented: OK. OK. OK. Don't take this wrong, that's how it's done. (Are your sure? OK!) +0

I suggest you do something like

dim qry as string = "INSERT INTO Table VALUES ('" & PatientID.Text & "', '" & fname.Text & "'," & lname.Text & "')"

and examine the contents of qry. There is no way for us to see what the query is without knowing the values of the text fields that make it up.

No one is going to do your homework for you. If you hadn't waited to the last minute you could have posted your code and asked for help.

At the risk of sounding callous, if your kids are falling for this then

  1. You have failed as a parent to teach your kids anything of value
  2. Chances are they are going to fail at life anyway

I suspect this is yet another in a long series of media scares. Remember the "punching game" thing from a few years ago where (supposedly) gangs were going around and viciously punching strangers at random? How about the "slender-man" scare? Remember, if they can keep you scared they can keep your eyes glued to the news feeds. If you are capable of making decisions rationally (out of logic) or emotionally (out of fear) but not both.

If by "correct" you mean "syntactically correct" your python interpreter will tell you that. If you mean does it have any logic errors, you'll have to determine that. We can only see what the code does. Only you know what you want it to do. Learning how to debug is part of learning how to code.

input takes zero or one parameters. Any more than one gives an error.

Two skills you will absolutely need:

  1. Ability to quickly pick up new skills.
  2. Ability to communicate clearly.

Pay special attention to #2 and remember that listening is a very important part of communication.

I generally compose anything of length with MarkDownPad (free) and then copy/paste once I have the formatting correct. It also saves me from having to retype anything in the event of a posting error.

I get an error message when I used this code

Then why not post the error message and identify the line that throws it?

Why not start with the simplest case. Create a textbox for one set of the IP address digits and use the keystroke events to restrict entry to only digits and values from 0-255. Once you have the logic for that you can expand to the full case. If you know how, you can subclass the TextBox control and build up a new IP address control from there.

I see you tagged this with both vb.net and visual-basic-6. The syntax for MessageBox differs between the two versions. Google "message box" with the version you are using to get the correct syntax. Based on the syntax of the line

Private Sub CommandButton4_Click()

I'll assume you are using vb6 in which case the syntax is

MsgBox(Prompt, [Buttons as VbMsgBoxStyle], [Title], [HelpFile], [Context]))

and you can get away with

MsgBox("The form has been sent")

You can use MessageBox. There are 21 variations but the most basic is

Dim result = MessageBox.Show("one or more lines of text")

The value of result depends on how the box is closed. This, in turn, depends of which combination of buttons you specify. Check out the intellisense popup after you press the opening (.

I wasn't trying to overly complicate things. I assumed this is for an assignment and I've lost points because the marker said "you didn't consider...". I suppose the easiest thing would be to use a regular expression that matches only words that start with an upper case letter. Then all you have to do is process them two at a time. The regex for that is \b[A-Z][a-z]+\b. That would reduce

Jack Jones, Gracie Burns and George Burns have three days in...

to a collection consisting of

Gracie Burns
George Burns

or you could use the regexp \b[A-Z][a-z]+ [A-Z][a-z]+\b which would give you full names collected as

Jack Jones
Gracie Burns
George Burns

You can start by googling how to convert node js script to exe

All of the strings have the names at the start of the line:

That may be the case but how do you know where the name(s) end. For example:

  1. Joe Smith will be attending.
  2. Joe Smith and family will be attending.

How do you determine whether or not and denotes the end of a name or separates two names?