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

Here's a tip for next time. Whenever I buy something that has a power adaptor, I put a label on the power pack identifying what it is for, and a label on what it plugs into identifying the specs of the adaptor.

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

Unless you are connecting to the db using the server name and the database instance in which case you server name in the connection string would look like

\\164.128.12.93\dbserver
\\merlin\dbserver

assuming that the IP address of the server is 164.128.12.93 or the server name is merlin.

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

I have set up a dozen or so systems for friends/family, several with SSD/HDD combos. Regardless, I always use the same configuration. I create a C partition and a D partition. For SSD/HDD, the C partition is the entire SSD and the D drive is the HDD.

Once I have Windows installed I create folders on the D drive named

  • Music
  • Pictures
  • Videos
  • Downloads
  • Documents

Then I open Explorer. For each of the current My Pictures, My Music, etc, I right click and select Properties then go to the Location tab. Click on Move, then select one of the newly created folders on D. You will be asked if you want to move all files in the original folder to the new folder. Click Yes.

If you have a very large SSD you may even want to create C and D partitions on the SSD, then an E partition on the HDD. My C partition (Windows 10) is 120 gig and with all the apps I have installed I have about 52 gig free. My wife's computer has C/D on the SSD and everything else on E. I use FastStone for viewing pictures and I have it configured to save the thumbnail database on D. This greatly reduces the FastStone startup time when you have a lot of pictures.

My younger son just got a gaming system built with an SSD/HDD combo. Several of his games run under Steam. The Steam engine is installed on C but the …

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

@Robert_57 - you do realize that the browser version being used when this thread was created have been upgraded so many times that the questiob no longer requires an answer.

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

The easiest way to convert is

ahodStat = IIf(chkAhod.Checked, "Yes", "No")

in which case your code could be simplified to

Private Sub btnCopyNotes_Click(sender As Object, e As EventArgs) Handles btnCopyNotes.Click

    'Copies Info to Clipboard

    Clipboard.SetText("BTN: " + txtWtn.Text + Environment.NewLine +
        "Acct Name: " + txtAcctName.Text + Environment.NewLine +
        "Spoke With: " + txtSpokeWith.Text + Environment.NewLine +
        "Verified: " + cboVerified.Text + Environment.NewLine +
        "Email: " + txtEmail.Text + Environment.NewLine +
        "Issue: " + txtIssue.Text + Environment.NewLine +
        "AHOD: " + IIf(chkAhod.Checked, "Yes", "No"))

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

Hang on. I'll drop everything I am doing just so I can do all your research for you.

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

You could also have someone take a video of you texting on it while

  1. Crossing in traffic
  2. Walking into a fountain
  3. etc.

and post it on youtube. If it's a really spectacular fail then you might get enough traffic to generate some revenue.

happygeek commented: ROFL :-) +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sorry you lost your code. You just learned the value of "save often". But we're still not going to write it for you. You haven't shown us any effort on your part. Not even pseudo-code. Try again and let us know where you are stuck.

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

There are several mistakes before we even get to your question.

  1. You posted the title in ALL CAPS WHICH IS KIND OF RUDE (I corrected that)
  2. You posted a mess of unformatted html and expected us to wade through it
  3. You didn't give any indication as to what error you are seeing
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In my experience, Microsoft has a poor record of cleaning up after itself when installing updates. I have never run into a problem deleting these leftover folders. Leaving them present but hidden just clutters things up.

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

That's not a request for help. That's a request to do your homework for you. We won't do that here. However, If you show us that you have put in the effort to solve it yourself we will help with the parts that are giving you trouble. Judging by your post it is possible that you have not read the Daniweb Posting Rules and Terms of Service. Please give these a read. You might also want to Read This Before Posting a Question to increase your chances of getting a timely (and more useful) response.

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

You can't upvote or downvote a comment. You can only upvote or downvote a post. If you just click on the thumbs up or thumbs down then the vote is anonymous and does not affect the poster's reputation. If you add a comment then it is not anonymous and the poster's rep gets affected up or down by an amount based on your standing in the Daniweb community.

I've used this feature hundreds of times with no problems.

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

Finally revealed - the reason that the TrumpCare plan is so much thinner than ObamaCare. It consists of only three words.

  • Don't
  • Get
  • Sick
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In general? Not that I'm aware of. Learn to use your IDE for source level debugging. The big secret is to avoid making the most common mistakes up front. To learn that I suggest googling "most common programming errors" and following the links.

A few big sources of bugs:

  • not initializing variables
  • one-off (indexing) boundary errors
  • not validating inputs
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Whitespace, properly used, increases code readability. Whitespace, used improperly, decreases readability, and can often introduce bugs.

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

Once you have Reflect running you can go to

Other Tasks -> Create Rescue Media

From there you can create a bootable USB or DVD. The first time you do this, Reflect will download a PE image that will be used to build the rescue media. I keep a bootable USB handy as well as an offline copy of a system image. This is my Armageddon image (in case of hard drive failure). For typical restores, however, you can go to

Other Tasks -> Add Recovery Boot Menu Option

What this does is allow you to boot into the rescue media image that is created on your computer when you buit the USB/DVD image. Once you have done this, every time you cold boot your computer you will see a screen that will ask you to choose between booting Windows or booting WindowsPE. If you do not choose one it will default into Windows.

All of my computers have been set up so that my C partition contains only Windows and installed applications. I relocated all user folders (video, pictures, documents, downloads, etc) to D:. That way I don't have to worry about blitzing my personal files when I restore an image. It also makes my images smaller, however, it means I have to back up my personal files separately (I just use robocopy for this).

You can restore by selecting an image from within Reflect (run from within Windows). You will be asked to reboot into the PE …

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

There is no "API" for c or VB6 or for any other language, for that matter. API stands for Application Programming Interface. The keyword here is "Application". You develop an application (or a framework) using a language (c, VB6, vb.Net, etc). Then, you may define an interface to that application that can be programmed. That is the API, not the language used to develop the application.

For example, you can run Microsoft Excel from the GUI, or you can create an Excel object from within another application and control that object by using the methods and properties defined in the Excel API (object model).

So when you say

My topic is how to use the api in C and how to use the api in vb6.

we can't really help because the question doesn't mean anything.

rproffitt commented: I wonder if they meant how to call the old Windows API in C/VB6. But that's not the question. +12
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Yes. It's the description of the structure and API (application programming interface) of a document. For details please see the w3 description.

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

I took APL in my second year of Comp Sci and loved it. I used it on almost all my numerical analysis courses after that (I still play with it from time to time). I actually went through the Life code operator by operator to see what was happening at each step.

But I only gave that example to show how "unlike" c a language can be. If anyone is interested, there is an excellent free version (the one I use) available at nars2000.

Traevel commented: So few weekends, so much to check out. Faved for later! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

They also say that once you learn how to think the C way you'll be able to program in every other single language because they are mostly the same.

That statement is complete nonsense.

Learning your first programming language can be hard (and that's just learning, not mastering). Learning a second language (just like human languages) can be difficult because you will be thinking in "language A" idioms. After that it gets easier (your brain has been stretched).

And that's not even considering the other stuff you might need to know to be useful like SQL (for database applications) or the IDE (if there is one specific for the language).

However, just because you can "think" in C doesn't in any way prepare you for Erlang, Forth, etc. Consider that in APL, summing all the elements of a vector, a looks like

+/a

and if you are familiar with Conway's Game of Life, here it is in one butt-ugly line of APL

APLLife.gif

There's absolutely no way that C can prepare you for that.

rproffitt commented: My code is ugly, but that's life. (me!) +0
Traevel commented: Let alone the ones made to be different, like COW and brainf**k +7
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

A Ceasar cyper encodes by shifting letters in one direction, and decodes by shifting in the opposite direction. key is the number of places to shift. If the user wants to decode then key is negated to shift in the opposite direction.

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

unless you were expecting a link to some pirated version

In case the OP didn't notice, Macrium Reflect is FREE for personal use and does cloning (plus a lot of other stuff).

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

It's this.

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

You can't define what is a garbage value any more than you can write down all the wrong answers to a question. You decide what constitutes a correct value and try to define a pattern that matches all correct values. Anything else is garbage. A pattern for an integer might be "an optional leading plus or minus sign followed by any number of digits." If you can't handle an arbitrarily large number of digits then your pattern becomes "an optional leading plus or minus sign followed by (as an example) ont to nine digits."

There are web sites that can help you with the patterns, such as regexpr and regular expression tester.

rproffitt commented: I get it. Only right answers, everything else is garbage (except in politics where all is garbage.) +12
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't have a link for the version you are looking for but I think you would be much better off using the free version of Macrium Reflect.

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

Use the value of PI = 3.14285714

To 8 decimal places, the value of PI is 3.14159265. What is the point of using 8 decimal places when your third place is already wrong?

and is it better to use while() or do{} while() ?

It doesn't matter unless your equations are correct.

ddanbe commented: Eagle eye! +15
rproffitt commented: Explainer. 22/7 thinking. Try 355/113 or the real Pi. +12
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Windows keeps encouraging me to switch to Edge

Yeah. Don't.

You have pressed the space bar. Would you like to make Edge your default browser?

Microsoft is not known for encouraging behaviour that is in your best interest.

rproffitt commented: To the Edge of Space it seems. I agree and use Firefox, Chrome with Ublock Origin+WOT+Privacy Badger. +12
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's a George Carlin reference. I figured if the OP was going to post nonsense then I'd reply the same.

happygeek commented: hehe, well played sir +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Instead of Barcode(a) = line(0) you should use Barcode(a) = Trim(line(0)). This will strip off leading and trailing blanks.

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

Definitely option 3.

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

If you break up the root parts of the word you get "poly" meaning "many" and "morphism" meaning "form" (loosely). Take method names. Let's say you want a method to find the absolute value of a number. In ore-OOP programming you would need (this is not necessarily a complete list

absint
absflt
abscmp

to take the absolute value of an integer, float or complex number. In other words, you would be programming for the specific case. In OOP you would define three methods, all called abs but with differently typed parameters. Your calling code would now use the general name abs rather than the specific name for each type.

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

Your barcode array has a trailing blank included with every barcode and the one you are comparing it with (user input) does not include the blank so you will never get a match. You could fix that by doing a Trim() before copying the string into the array.

That's the most obvious problem based on my running your code locally. There are a thousand ways that code can "not" work. It would help if you could be specific as to the difference between "the way it works" and "the way you expect it to work" ^_^

rproffitt commented: I added a Trim() to handle that. https://msdn.microsoft.com/en-us/library/system.string.trim(v=vs.90).aspx +12
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sometimes these folders are created during the installation process. They can safely be deleted but occasionally this can be difficult. You might try deleting the folder from a command shell running as Admin.

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

Which multi-threaded program is recommended for reducing CPU usage

I think the obvious answer to that is "the program that does the least amount of processing."

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

Seems a lot less convenient than just typing

dir /s something*

and it only finds strings at the start of a file name. You'd either have to edit it to modify the type of search or create (and remember) multiple search command files.

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

Definitely Everyrhing. Dir will find files but it is slow and not flexible. For example, try to find files with three particular strings but in any order. You'd have to do something like (using my files)

dir /s /b | grep -i adam | grep -i andrew | grep -i shebandowan

That will give me a list of all files containing the strings shown. Now I have al-most 88,000 files on my laptop so it takes some time to traverse the directory. On the other hand, I can bring up Everything and type the three strings in the search bar and it narrows the results list immediately while I type. I can also set the filter to show only picture files. If I press ALT-P then a preview panel is shown (like in Explorer) where I can preview the pictures by selecting them from the file list. Or I can display the results as icons (any size by using CTRL-Scroll). You can't do any of that with dir.

By the way, Everything is free (and it supports complex searches, even with regular expressions).

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

If the current Lenovo's are built to the same quality as the old ThinkPads then you'll have good machines. Those things were built to last. The one I bought for one son back in spring of 2004 is still chugging away. Of course, he has upgraded to newer machines since then but the original is still in use.

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

Either

if (int(dmin) - 30)

or

dmin = int(dsec / 60)
if (dmin = 30)

as for 0.50, I don't know what that represents. What are the units? Is that half a minute, half an hour or half a day?

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

“To announce that there must be no criticism of the President, or that we are to stand by the President, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public.”

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

By the way, if you are just working with time strings you get

>>> datetime.datetime.strptime("01:23 PM","%H:%M %p")
datetime.datetime(1900, 1, 1, 1, 23)

It defaults the date to 1900-01-01 which shouldn't be a problem if you are just interested in differences. You also might want to do an abs in case t2 < t1.

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

You can convert a datetime string to a datetime value as long as you properly match the format of the string. For example

import datetime

t1 = "02/11/2017 10:43 AM"
t2 = "02/27/2017 01:11 PM"

d1 = datetime.datetime.strptime(t1, "%m/%d/%Y %H:%M %p")
d2 = datetime.datetime.strptime(t2, "%m/%d/%Y %H:%M %p")

dsec = (d2 - d1).total_seconds()
dmin = dsec / 60

print(t1,t2)
print(d1,d2)
print(dsec)
print(dmin)

results in

02/11/2017 10:43 AM 02/27/2017 01:11 PM
2017-02-11 10:43:00 2017-02-27 01:11:00
1348080.0
22468.0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If I substitute some values and evaluate the first expression I get

UPDATE ptransaction  SET Quantityt = 23, Partial_totalt='24' WHERE Product_Codet =CODE''AND  soldtime = '2017-02-26 09:10:57'

You probably intended something like

UPDATE ptransaction  SET Quantityt = 23, Partial_totalt=24 WHERE Product_Codet ='CODE' AND  soldtime = '2017-02-26 09:10:57'

Check out the placement of your single quotes, especially after =CODE which is followed by two single quotes. You can avoid the hassle of composing queries by using parameterized queries.

Santanu.Das commented: Perfect & awesome +8
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

To continue: these same issues are relevant to SSDs (solid-state discs).

It is my understanding that SSDs are built to much higher standards such that they can be refreshed several order of magnitudes more times before failing. Also, SSDs have extra space, over and above the allocated space, so that spare sections can be allocated to replace the failed sections.

Having said that, I do regular backups of ALL my hard driv es, SSD or otherwise.

rproffitt commented: Sticks don't compare well to SSDs when it comes ot wear leveling. That is, SSDs do this, sticks almost never have this. +12
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

A suggestion - when someone posts in the community forum and adds tags like programming, c#, vb.net, etc, couldn't the thread be automatically relocated to the programming forum? Or perhaps when the user makes the post, the tags could be scanned and a suggestion popped up with something like "This appears to be programming related. Would you like this post moved top the programming forum?"

Traevel commented: Predictive analysis, I can't just let that pass unappreciated +0
ddanbe commented: Great idea. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

One other advantage was that my scripts had to determine whether or not a given date fell within daylight saving time or not (transition days were especially painful because of the skipping or duplication of the transition hour). I had dozens of scripts that relied on this logic. When Bush (younger) changed the start/stop dates I only had to modify the DST logic class code in one place (the library that was included in all the other scripts). Other programmers had to modify/test code changes in dozens of applications.

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

It does leave the app open to beginners tinkering with the external plain text files.

That's funny. I externalized scripts (mostly Excel) because the users had to have write access in order to allow modification of the Excel data, but because the script was external it could reside in a read-only folder. Also, the Excel files were generational (a new one for each day) and having the code in each file would have been a nightmare managing code changes. With an external script I only ever had to modify one file.

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

Can I pick "neither"?

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

Unfortunately your need does not correspond to any impetus for us to do your homework for you. Try your best to code a solution then feel free to ask for help with the parts you are having trouble with.

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

As I recall there was nothing inherently wrong with the database size or the size of any records. But I think I made my point and we are getting into a discussion that is best left for a separate thread.

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

I did not mention anything about MS Access

I realize that. My point was the the choice of a database engine is important. As for the 1 gig/2 gig size limit, the app in question was nowhere near the stated max limit. It was just an app that was running on a shitty database. In comparison, a system I developed on MS SQL processes almost three million records every day, has been running continuously since around 2000 and is currently about 85 gig. The OP didn't mention Access but he also didn't exclude it.

it does not crash because you were either quering or doing a transaction against as long as that was subject to its specification, the database engine specification

I have no idea what that means.