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

You start by learning python. Based on the minimal information you gave, what kind of an answer were you expecting?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
billtax= bill *6.75;

I'm assuming that tax here is 6.75%. What you have coded is actually 675%. I think you want

billtax= bill *.0675;

and if billtax is bill + tax then

billtax= bill * 1.0675;
Tarek_2 commented: With tax as mentioned in the println() in the next line, +1
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How about

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

It's still there but unnecessarily difficult to post in. Start by going to the programming area. Right underneath "Start New Discussion" and "Realtime Chat" you'ss some tabs labeled "ALL New Solved Unanswered More v". Click on "More v" and "Code Snippets" is at the bottom.

Start by making a regular post. Put the text (no code) in the post and post it. Then you have to edit the post and change "Topic Type" to code snippet. At that point you'll be presented with two text boxes: one for the post text and another for the code snippet.

Awkward, indeed.

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

A new golden rule for the modern age...

Tweet others the way you would like to be tweeted.

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

If ever a time should come, when vain and aspiring men shall possess the highest seats in government, our country will stand in need of its experienced patriots to prevent its ruin.

  • Samuel Adams
ryantroop commented: way to single handedly keep a thread alive :-P Keep on keeping on :-D +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Nothing but water until 8:30. We've been trying something new. We eat what we always eat but we make sure to eat it within a 9 hour window (for us it's 8:30 to 5:30). I've dropped15 pounds since Jan 1.

ddanbe commented: Nice tip! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can use the Windows disk management console, diskmgmt.msc. Right click the USB disk and select Format. Pick the file system type on the format dialog.

If that doesn't work you can always use the diskpart.exe utility from the command line, but you gave to be running the shell as Administrator. Be very careful using diskpart as it is easier to destroy your system if you select the wrong disk.

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

Are we supposed to pore over the code blindly or are you going to give us any hints? What are the symptoms? Are you getting any feedback like "syntax error"? If so, please post the error message and associated information.

Or is it a logic error - the SQL code executes, but does not do what you expect/want?

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

Posting the same question over and over is not going to get the results you want. What it WILL do is get you infracted. Play nice.

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

Please take the time to describe the problem in more detail. The more information you can provide, the better your chances of getting a meaningful response.

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

No one is going to do your homework for you. Please read this thread for suggestions on how to post meaningful questions.

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

Start with the axiom "computer code is for humans to read and only incidentally for computers to execute" and have another look at your code.

  1. it is poorly formatted (no indentation)
  2. it is uncommented

See this code snippet for an example of code that is commented and indented for humans to read. You may know what your code does when you look at it again tomorrow but what if you look at it in 6 months or a year? What about someone else looking at it? Get into good habits right from the start so they become ingrained. Bad habits also become ingrained. They say "practice makes perfect". Unfortunately it is also true that malpractice makes malperfect.

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

An often underused control from vb.Net is the FolderWatch control. But sometimes you need to throw something together that doesn't need a fancy GUI. Or perhaps the task seems too trivial to go to the hassle of coding it up in vb.Net (or C#). Because the FolderWatcher is built on underlying WMI (Windows Management Instrumentation) technology, it can actually be implemented quite simply from vbScript. Please see the sample below.

In actual use you would place more useful code in the Create/Delete/Modify Case clauses.

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

Do you have a question?

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

A few years ago Lewis Black did some schtick about how Michael Jackson had become his own punch line. Trump is there now. Unfortunately with Trump as the punch line, that makes the US the joke. Did you happen to catch the video of the comb-over on the back of his head blowing away?

BTW - Anyone ever figure out the Peewee Herman reference?

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

Over the years I've seen a lot of discussion (and several implementations) of the Quicksort algorithm. Most of what I have seen, unfortunately, lacks sufficient commenting as well as meaningful variable names. Hopefully the following vbScript code will more clearly show how Quicksort actually works.

A couple of incidental notes:

  1. I use PrimalScript for editing and I have comments set to display with a silver-grey background and black text. This makes comments very distinct from code (and is also why I have a closing single quote at the end of lines).
  2. The test code section at the end executes only if I run the QuickSort.vbs file directly (a trick I learned from Python).

    I keep all my common code in an include folder D:\Include with an envorment variable, %INCLUDE% set to that location. That way, the only code I have to duplicate is

    Function Include ( ByVal file )
    Dim wso: Set wso = CreateObject("Wscript.Shell")
    Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
    ExecuteGlobal(fso.OpenTextFile(wso.ExpandEnvironmentStrings(file)).ReadAll)
    End Function

in any script that needs library code. I can do

Include "%INCLUDE%\QuickSort.vbs"

<edit>The sample code was edited to correct a bug, not in the actual quicksort algorithm, but in the comparison test passed to quicksort. The original test was "X1 <= X2" and it has been corrected to "X1 < X2".

ddanbe commented: Indeed, nicely commented +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please read this thread for suggestions on how to post meaningful questions.

If you'd read the Posting Rules you would know that you won't get someone here to write your code for you.

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

We have seen many users asking for suggestions for a thesis topic or comp sci project or whatever. First of all, we do not know your skill level so we can't suggest something that would be appropriate. Secondly, we are not here to give you ideas. When you have an idea we will give you help when you hit a snag. I cannot recall a writer ever asking "does anyone have a good idea for a story I can write?".

rproffitt commented: "It was a dark and stormy night..." is a start, to a failing grade it seems. +0
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

The way this works is that before you get help you have to show that you have put in some effort to solve it yourself. It would help if you Read This Before Posting a Question.

Following that, please feel free to post your questions here.

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

If you can't show any effort why should we?

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

Technically, MySql is not a database server. It is a database engine and the engine plus the supporting hardware/software constitutes a database server. A database, however, is the set of tables/stored procedures, etc. specific to an implementation. That is why we refer to things like an employee database or a student database, meaning the specific implementation rather than the underlying hardware or DB engine.

But that's if you want to be pedantic. In the confines of an informal discussion everyone knows the OP's intentions.

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

Well, I had a boss (for far too many years) whose idea of a spec was "you've worked for me for long enough that you should know what I want". This is the same boss who said to my face "you're going to get shit no matter what you do". He's the reason I retired when I turned 55. He's also the reason I never regretted it.

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

There is also the possibility that some programmer wrote code that accesses the columns in a recordset by number rather than by name. I've seen it done more than once by someone new to DB programming.

rproffitt commented: Thanks. Something I never coded like that. I guess there's always someone that will find a way. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

A switch construct needs a switch statement. You don't have one. Look up the syntax.

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

What is the problem? Please do not just reply "it doesn't work". You wouldn't take your car to a mechanic and tell them only "it doesn't work".

rproffitt commented: Actually does happen. The owner employs other people to take care of such things. Companies call these folk employees. +14
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

There is a general rule in programming that states "if you don't know what your program is supposed to do then you shouldn't start writing it."

Start by writing the algorithm in English (pseudo-code). Then do a walk through of the pseudo-code to see if the algorithm is correct. After that you can start coding.

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

Typically, if you want to display multirow data from a database you use a DataGridView rather than a Textbox. I'm assuming multirow otherwise you wouldn't need to do a sum.

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

Can I assume you meant "deploying"? There are lots of apps I deplore.

rproffitt commented: Thanks for that. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

So the skiing wasn't great but the apres ski was fantastic. Started out trying to feed the squirrels but they wouldn't come close. Instead, a chickadee landed in my hand to take a peanut and two young deer took an interest.

Skiing.jpg

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

Does it matter which USB port you plug it into?

Is it a wired mouse, or a wireless mouse?

If it's a wireless mouse, are the batteries fully charged?

Do you have any problems with any other USB devices?

Have you run any diagnostics?

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

Since Date cannot be both Nov and Oct your Case will always return 0. Also, Date is possibly a reserved word and should be avoided as a field name. It's been a few years since I've had a SQL DB installed so I am a bit rusty (and I can't test it) but perhaps you are looking for

(SomeDate = 'Nov' OR SomeDate = 'Oct') AND
(Person1 = 'X' OR Person2 = 'X' OR Person3 = 'X')
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How long it takes to learn a new skill depends on many things. Among them are:

  1. Your current skill set. Do you have any experience in programming in any other language? You have given us no indication of this.
  2. What language you are planning to use. You haven't specified this either.
  3. How much time you have available to devote to developing this skill. If you have an hour a day it will take you a very long time. Six hours a day of quality, uninterrupted time will shorten this considerably.
  4. What resources you have available. Will you be working on a state of the art computer with appropriate tools or will you be trying to create a game with the equivalent of stone knives and bear skins (kudos to anone who gets the reference).
  5. Your commitment to developing the skill. There are many people who would do anything to be able to play the piano (for example) - anything except practise.

Are you getting my drift? You've asked a question that is impossible to answer except in the most general sense.

rproffitt commented: I'm waiting for a "There's got to be a better way" reply now. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Just for fun, if you have two values, lo and hi, the following line of APL displays the required values:

((0=3|r)∧(0=4|r))/r ← lo, lo + ⍳ hi - lo
JamesCherrill commented: Close but no cigar - you have to print 5 values per line +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think a google search and a little effort on your part should do the trick.

rproffitt commented: At times I worry that others never used a search engine. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Your explanation is not consistent. You state that the user is to enter a range as in "find me all numbers between x and y that are divisible by both 3 and 4." Later you state that you "input value 120 10 times". That is inconsistent with the problem so either the problem is stated incorrectly or you are not inputting the expected data. Decide what is the correct problem then write it up in pseudo-code before you write the actual code.

If a range is expected, make sure you test that it is a valid range (x <= y).

rproffitt commented: Programmers consistently solve the other problems first. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
  1. Read
  2. Write
  3. Repeat

We learn by doing. If you don't put in the effort you won't learn anything.

rproffitt commented: "How do I get to Carnegie Hall?" -> Practice, practice, practice. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The amount of energy needed to refute bullshit is an order of magnitude bigger than to produce it.

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

I have a foreboding of an America in my children's or grandchildren's time - when the United States is a service and information economy; when nearly all the key manufacturing industries have slipped away to other countries; when awesome technological powers are in the hands of a very few, and no one representing the public interest can even grasp the issues; when the people have lost the ability to set their own agendas or knowledgeably question those in authority; when, clutching our crystals and nervously consulting our horoscopes, our critical faculties in decline, unable to distinguish between what feels good and what's true, we slide, almost without noticing, back into superstition and darkness.

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

You might as well have said "I have the following code:"

int main() {

}

"I just need a little help with the middle."

Please read this thread for suggestions on how to post meaningful questions. You might get some ideas as to what is expected of you before you post.

JamesCherrill commented: Good advice from one of our most experienced members +14
rproffitt commented: +1 for seasoned advice and a link on how to prepare and pose questions. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And likewise, Pornography is wrong and it's spread and use should not be tolerated or encouraged by society

For those people who believe that increased access to porn would spur an increase in sexual assault, the exact opposite has occurred. Availability of porn via the internet has exploded since 1995, yet, according to the U.S. Justice Department’s authoritative National Crime Victimization Survey, since 1995, the U.S. sexual assault rate has FALLEN 44 percent.

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

I don't imagine anyone here is going to write your code for you but at least you were honest enough to admit it is for a school assignment. Having said that I want to mention that if I were marking your assignment (and it is something I used to do in university) I would give you a zero based solely on your complete lack of comments.

You should write code as if it is meant for people to read and understand, and only incidentally for computers to execute.

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

Read books.

Write code.

rproffitt commented: Repeat. +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What have you tried so far?