Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I get an error message when I used this code

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

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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")
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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 (.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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

Jack
Jones
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
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

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?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

While it's easy for a human to pick out the names by context, it's not so easy for code. How can you determine where the names end and the rest of the sentece begins? What constitutes a name? Is a name always a first name and a last name where both are single words? Without knowing the parameters you won't be able to parse the names.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The OP replied by PM (a no no) that he had mistyped the table name.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Are you sure you don't want 'sadasdsad','4' instead of 'sadasdsad''4'?

Sebas_1 commented: yeah, it's like that on the code but still failing +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I found it was safe to not rely on default behaviour. Pre-2008 (before retirement) the scripts I wrote/maintained had to bulk insert 8000+ records at a time. In order to maintain consistency I would massage the data and add a date/time field to the records. That way I could guarantee the accuracy of the date/time without having to rely on SQL. Also, any delay in the process would not affect the timestamps.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

All right. Now that I have used it for a bit and discovered/learned the new paridigm, all I have to say is sweet.

Excellent job, Dani.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I actually have a several vmware virtual machines configured for just that purpose. The small, potentially iffy stuff I install in a vm but the bigger, safe stuff I still prefer to test live. For example, earlier this spring I installed MicroAPL's APLX for Windows as well as Visual Studio 2017 (I had been plugging along with VS 2012 for some time) and when I get home in September I plan to install and evaluate Dyalog APL which bought out MicroAPL some months back. The Dialog version of APL downloads at about ten times the size for MicroAPL (about 250 meg compared to 21 meg).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's not just files (Windows.old). It's also the registry. I prefer to start with a clean registry unpolluted by old stuff. I also find that my computer eventually suffers from "windows rot". Of course, I tend to install/uninstall software for evaluation quite frequently so that likely contributes. Generally, I keep benchmark images. When I start to feel the rot kicking in I reload the last benchmark image, apply all outstanding updates, them take a new benchmark. Of course, I also keep a change log that I update whenever I make a change so I have something to look back on to see what might have caused a problem, or to see what I might want to reinstall that went away on the last restore.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Take a full disk image of the computer (I recommend Macrium Reflect) then try the WIndows 10 upgrade. Microsoft keeps extending the deadline. For example, last December I upgraded two machines to Windows 10 long after the official deadline. There is a good chance that the upgrade will go through.

After the upgrade, I recommend wiping the machine and doing a clean install of Windows 10. During the upgrade your computer will be registered with Microsoft and will thus be recognized as valid when you reinstall from scratch. The reason I recommend this second step is that upgrading from one OS version to another always leaves crap around from the previous OS.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And now the delete recent posts tool is gone again.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What is this "log out" thing you are talking about. Sounds like heresy to me ^_^

rproffitt commented: I make no bones about this. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If it's a Dell (for example) pressing Fn-Esc toggles the function keys between standard windows (F1=Help) and Dell functions (F1=Mute).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Using Task Manager, what apps are using the most CPU and memory? If you go to the Performance Tab and click on Open Resource Monitor (bottom of screen) you may get more useful info.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

cmbSearch.CommandText = "SELECT Assignment FROM Apu WHERE StudentID = '" & txtStudentID.Text & "';"

The format is

SELECT <fields> FROM <table> WHERE <conditions>

I strongly suggest, however, that instead of building queries by concatenation you use parameterized queries.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Make sure you have only one anti-virus package running. You might also try disabling your anti-virus (temporarily) to see if that speeds things up. If that works then it is time to switch to another anti-virus.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The loop continues as long as x is less than y. It isn't until x = 55 that the test fails.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Skype is worse since m$ took it over. First of all, I amn unable to defer/block updates while at the cottage but more importantly, there is now no way to block unsolicited requests to "kissieface wants to be added as a contact". Fortunately instead of getting 5-6 of these requests per day I now only get 1-2 per week. Still, I should be able to block all contact requests.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
  1. whby do you have to convert it?
  2. why can't you convert it?
  3. are there any error messages?
  4. what is the platform (windows/linux)?
  5. what compiler are you using?
  6. are you having any specific problems?
  7. what does the code do?

You want help but you can't be bothered to provide any details. The code is uncommented and I strongly suspect it was written by an engineer (based on the non-descriptive variable names).

At least, I am assuming you want help. Surely you wouldn't just post your code and expect someone here to convert it for you.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The criterion was "if more than two features do not match they are denied". In that case

IF no-match <1
    PRINT 'denied'

should be

IF no-match > 2
    PRINT 'denied'

and you will want to keep track of the denials via a counter as in

IF not 'photo' skin tone match 'scanned photo' THEN
    increment no-match
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Beware of RAS syndrome ;-)

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I suggest using a bitwise AND to test if the rightmost bit is a 0 or 1.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Unfortunately there is no easy way to read binary in vbScript. Too bad because I like to use vbScript for prototyping.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Also note that if you run stripcr against an exe you WILL destroy it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In that case you can run the following script on Windows. Copy the code into a file, stripcr.vbs. Run it in the current folder by specifying the file extensions that you want to process like stripcr cpp h txt. Note that if you haven't previously done

cscript //h:cscript //save

to set cscript as the default you will have to run the script as

cscript stripcr.vbs cpp h txt

or you will get a MsgBox popup for every file processed (really annoying).

set fso = CreateObject("Scripting.FileSystemObject")

for each ext in wscript.arguments

    ext = lcase(ext)

    for each file in fso.GetFolder(".").Files
        if lcase(fso.GetExtensionName(file)) = ext then
            Wscript.Echo "Processing",file.Name
            text = fso.OpenTextFile(file.Name).ReadAll
            text = Replace(text,vbCr,"")
            fso.OpenTextFile(file.Name,2).Write text
        end if
    next

next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Forgot to ask. Is this for Windows or for linux? I would imagine linux or there would be no need to strip cr but you never know.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Easily done, but what do you do if the folder contains an executable or an image file?You don't want to delete ^M in those.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There is a WMI Client For Linux as well.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Assuming it's a Windows program, you could run a WMI query to check for the presence of the particular hardware and abort if not found. Alternately, if you knew the name of the associated driver file you might, instead, check for the presence of that file.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

UseVisualStyleBackColor is True by default. To set other properties for all buttons you could do, as an example

For Each btn As Button In GroupBox1.Controls.OfType(Of Button)()
    btn.BackColor = Color.Cyan
Next

You can't change the defaults like

Button.DefaultBackColor = Color.Cyan

because default properties are read-only.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Are we supposed to guess what kind of problem you are having?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Nobody can help you with the little info you have provided. Can you post the code you are running?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

From a purely non-technical point it seems to me that the problem is you don't know what constitutes "correct" output.

The first issue is that on both the 32-bit and 64-bit systems, the simple assign of xrate to conrm does not seem to work, and it is a simple assignment statement.

This confirms that there is a bug in the original code. Do you have a set of test values for which you know the correct output values? If not, then the best you can hope for is to produce a 64 bit version that replicates the original bug.

rproffitt commented: Time to challenge beliefs and assumptions. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can't say anything useful without knowing the declared types of the variables in the missing include files. The variable names are terse and cryptic (ky, kky, etc.) and the code contains no useful comments. I strongly suspect (based on many years of working with them) that the code was written by engineers.

rproffitt commented: Engineers tend to make bridges that bare stand up. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't know about the array method but you might read it into a ListView then see here for how to do a custom sort on any column.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I presume delta (change in) x and delta y (calculus terms).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

OK. Done. Now what?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Seems like a very complex way to do a very simple thing, but as an intellectual exercise, neat.

Do not multiply entities needlessly. (William of Ockham)

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

@Assertnull - I've never so much as seen a single line of Ruby. However, the loop for the problem is 7 lines of vbscript.