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

Can you please clarify what you mean by "corresponding integers"? As a guess as to your intentions, you could create a dictionary object where the key (string) is a given string and the value is the number of times that string occurs. Loop over the strings, adding the new ones with a value of 1 and incrementing that value by 1 if the string already exists in the dictionary. Iterating over the keys when completed will give you the unique strings. The final values will give you the number of occurrences of each string.

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

If you just want to see the hex values you can download any of a number of freeware hex editors. You can also download the TextPad demo and use it to open an exe file. It will display in hex.

For free hex editors just go to google and search on "free hex editor"

If you need to do it in code I can write you a bit of vbScript or vb.net.

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

I'm saying that running the Bayesian update function on X's programming ability

not said that P(X is a good programmer | X has a college degree) <= P(X is a good programmer | X does not have a college degree)

I'm sorry but I prefer to debate in English rather than in buzzwords and mathematical jargon. It has been my experience that people who resort to buzzwords and jargon do so to hide the fact that they really do not have a valid argument and are merely trying to sound more intelligent and informed than they really are.

I must also point out that in over 30 years of programming in medical research and real-time control systems, I was never asked to write a fizzbin, bubble sort or any of the other "trivial" programs you mention. I was, however, asked to spend 26 hours straight patching someone else's code when we upgraded our mainframe operating system. I was asked to write monitoring sub-systems to ensure the healthy running of our network. I was asked to develop software to mirror servers via daily system images. I was asked to develop software to maintain data connections between control systems located in Canada and the US. I have seen hundreds of people hired and a few fired. I only met two university graduates who could not program their way out of a paper bag (in this environment). The only programmer I met who was not certified was a complete failure as a …

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

I agree that there are some incredibly gifted programmers who have had no formal training. I disagree with the statement "if you know somebody's certified, you know that somebody is much more likely to be a bad programmer". You are saying that the level of incompetence increases with the level of education. I want to know how you came to that conclusion. I would like to see any studies that support this conclusion.

A recent item on the local news caught my attention. It seems there was a car accident in which the person survived only because he was not wearing a seat belt. I presume I can look forward to hearing my anti-seat belt friends claim that this proves that you are safer not wearing a seat belt in spite of numbers that show that you are much safer wearing a seat belt than not.

I mention this because it is my belief that for every gifted self-taught programmer there are numerous self-taught programmers who are completely delusional about their abilities. I, personally, after over 30 years as a "professional" programmer, have not met even one gifted amateur. I have, however, met dozens of keyboard cretins.

I got my computer science degree back in 1977. In order to get that degree I had to design and code a functioning assembler and a functioning compiler. I had to design and code programs to perform complex mathematical algorithms such as linear diophantine equations, splines for curve fitting, many …

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

Would you care to back up those sweeping generalizations with some actual facts?

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

DOH!

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

There also may be great surgeons out there who don't have medical degrees. Would you go to one of them for major surgery?

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

If you need an example of pseudo-code lets take the example of how to find the largest element in an array

pick the first element as the current largest

for each element in the array
    if this element is bigger than the current largest
        save this element as the current largest
    end if
next

And to be picky, I probably should not have included the "end if" and "next" statements because those are actual keywords and not pseudo-code. But you get the drift.

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

"If you write computer programs that work correctly and are used, then you are a programmer."

That's like saying if you can nail two pieces of wood together and they don't fall apart then you are a carpenter. I would have preferred to the the statement amended as

If you write computer programs that work correctly and are used, then you are a programmer. If you can write non-trivial computer programs that work correctly, are easily maintained and easily modified and are used then you are a good programmer. Mind you, even that is not sufficient in most cases. Personally, I think we should make a distinction between programmer (anyone who programs) and professional (or certified) programmer. That is, one who has a degree or diploma from an accredited institution indicating that the individual has demonstrated a certain level of proficiency in the field of computer programming.

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

I know this thread is marked as solved buy I think the following is still of interest.

Windows maintains several event logs (Application, Security, etc). You can use the Windows event subsystem to create and maintain a custom log which is viewable through the event viewer management console plugin (eventvwr.msc). Information on how to create the log is available at

http://msdn.microsoft.com/en-us/library/49dwckkz%28v=vs.80%29.aspx

and

http://technet.microsoft.com/en-us/library/ee176689.aspx

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Dim ch(TextBox1.Text.Count) As Char

For i As Integer = 0 To TextBox1.Text.Count - 1
    ch(i) = TextBox1.Text.Chars(i)
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Myprogram.exe could spawn osk.exe as well as an independent process (MyprogramMon.exe for example) that monitors Myprogram.exe. When the Myprogram.exe disappears, MyprogramMon.exe could terminate osk.exe then exit. This should work even if the main process crashes.

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

This version should do what I suggested. Save it as IncrementVersion.vbs

In the regular expression, "\d+" matches one or more consecutive digits and "\."
matches a period.

set fso  = CreateObject("Scripting.FileSystemObject")
set args = Wscript.Arguments

if args.Count <> 2 then
	wscript.Echo "IncrementVersion file field"
	wscript.Echo ""
	wscript.Echo "  Increment a field (1-4) of a version number string in a text file."
	wscript.Echo "  Version string is formatted as ""Version=#.#.#.#"" where # can be"
	wscript.Echo "  any sequence of digits."
	wscript.Quit 1
end if

file  = args(0)
field = args(1)

'you should verify here that
'1) the file exists
'2) field is a digit from 1-4

'The following regular expression will match a string of the form
'"Version=#.#.#.#" where # is any sequence of digits
'The search is case-sensitive and will find only the first
'occurrence of the string (because Global=False)

set rex = New RegExp
rex.Pattern = "Version=\d+\.\d+\.\d+\.\d+"
rex.Global  = False

'read the entire text file

text = fso.OpenTextFile(file).ReadAll

'search and replace

for each match in rex.Execute(text)
	'wscript.echo Match.FirstIndex,match.Value
	newver = UpdateVersion(match.Value,field)
	text = Replace(text,match.Value,newver)
next

'rewrite the xml file

set tso = fso.OpenTextFile(file,2)
tso.Write text
tso.Close()

'this function takes a version string in the form "Version=3.103.1.8"
'and increments the given field (one-relative)

Function UpdateVersion (oldver, field)

	dim tokens
	dim fields
	
	tokens = Split(oldver,"=")
	fields = Split(tokens(1),".")
	fields(field-1) = cint(fields(field-1)) + 1
	
	UpdateVersion = tokens(0) & "=" & Join(fields,".")
	
End Function
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

So the question (if I understand it) is to pass str1 and str2 as parameters to the vbScript so that you don't have to hard code the version numbers. In that case you can do

set arg = Wscript.Arguments

if arg.Count <> 2 then
	wscript.Echo "UpdateVersion oldversion newversion"
	wscript.Quit 1
end if

str1 = arg(0)
str2 = arg(1)

If you know where in the xml file the version number is stored it might be more appropriate to have a script that takes just one parameter to identify which field of the version number you want to increment. For example

IncrementVersionNumber 3

would take "Version=3.1016.0.0" and change it to "Version=3.1016.1.0". It should be a simple change and if you want to post a sample xml file I would be happy to slap it together.

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

I don't follow. Can you please restate the problem without referring to vbScript or bat? As this is the vb.NET forum I presume you are looking for a vb.NET solution. It appears from your description, however, that you want to write a bat file ("how can I give inputs which is BOLD in text to bat file"). Also, I don't see any "BOLD in text". If English is not your first language than that might be the cause of the confusion. I would be happy to offer suggestions once I understand the problem.

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

I just had a similar situation. I had ten controls that I wanted to access in a loop so I did the following:

Dim PlayerRounds(9) As System.Windows.Forms.TextBox

PlayerRounds(0) = txtPlayer01Round
PlayerRounds(1) = txtPlayer02Round
PlayerRounds(2) = txtPlayer03Round
PlayerRounds(3) = txtPlayer04Round
PlayerRounds(4) = txtPlayer05Round
PlayerRounds(5) = txtPlayer06Round
PlayerRounds(6) = txtPlayer07Round
PlayerRounds(7) = txtPlayer08Round
PlayerRounds(8) = txtPlayer09Round
PlayerRounds(9) = txtPlayer10Round

then you can do stuff like

for each player in PlayerRounds
    player.Text = "0"
next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This is an especially tricky problem which plagued me for years as a programmer in a real-time environment. No matter how careful you are there is always a window between when you check if the file is available and when you actually use it. In my case, one group (work group) would FTP 8000 analog data points (text file) at the top of the hour. Their method was

1) FTP the file
2) close the file
3) re-open the file and read the file size
4) compare to the original
5) resend if different size
6) close the connection

Technically, the file becomes available on my end after step 2. There is no way to determine that we were only at step 2 and not at step 6. The obvious solution (which was never implemented) was

1) FTP the file with an obvious "temp" file extension
2) close the file
3) re-open the file and read the file size
4) compare to the original
5) if same size, rename temp to final and close else resend

That way, when a file appears (other than a temp file name) I am guaranteed exclusive access. I suggest you set up your system the same way. If you do not, be prepared to curse loudly and frequently.

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

I have a textbox control for which I want to fit twelve double spaced lines of text so that the textbox is optimally filled (as little whitespace at the end as possible). So far the best I have come up with is

Dim fh As Integer = txtCategories.Height \ 40
txtCategories.Font = New Font(txtCategories.Font.FontFamily, fh, FontStyle.Regular)

Unfortunately, while this works for the start size of the form, as I increase the size of the form the whitespace at the bottom increases (seems to be non-linear). Numbers higher than 40 cause text to be clipped at the form start size. Is there a method or property which will calculate an appropriate font size for a given textbox height?

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

Then it was fortunate that the only form that I wanted to get values from after closing was the edit form as this was the only form that retained values after closing. Thanks very much for the explanation.

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

Thanks for the sample code. I'll plug it in as required. I still don't understand, though, why the two forms are handled differently. I created a simpler example. The main form has the following code under two buttons:

Private Sub btnShowModal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowModal.Click
        frmModal.ShowDialog()
    End Sub

    Private Sub btnShowNonModal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowNonModal.Click
        frmNonModal.Show()
    End Sub

The two forms, frmModal and frmNonModal are as follows:

Public Class frmModal

    Dim lastx As Integer = -1
    Dim lasty As Integer = -1

    Private Sub modal_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        lastx = Me.Left
        lasty = Me.Top
    End Sub

    Private Sub modal_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        If lastx >= 0 Then
            Me.Left = lastx
            Me.Top = lasty
        End If
    End Sub

End Class

Public Class frmNonModal

    Dim lastx As Integer = -1
    Dim lasty As Integer = -1

    Private Sub nonmodal_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        lastx = Me.Left
        lasty = Me.Top
    End Sub

    Private Sub nonmodal_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        If lastx >= 0 Then
            Me.Left = lastx
            Me.Top = lasty
        End If
    End Sub

End Class

As you can see, both forms have the same code, however, only frmModal retains the values of lastx and lasty. Why is this?

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

I have two forms that are called by the main form. One is named frmEdit, and is invoked by the ShowDialog (modal) method. The other is named frmSearch and is invoked by the Show (non modal) method. In both cases I want to preserve the last window position so each form (class) begins with

Public Class frmEdit (or frmSearch)

    Dim lastx as Integer = -1
    Dim lasty as Integer = -1

in the Shown event handler for each form I have the code

If lastx >= 0 Then
    Me.Left = lastx
    Me.Top = lasty
End If

and in the FormClosing handler I do

lastx = Me.Left
lasty = Me.Top

What I don't understand is why the frmEdit (modal) form remembers its previous position but the frmSearch (non-modal) does not. frmSearch always invokes with lastx and lasty equal to -1. Can someone please explain and suggest a fix?

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

How about moving your CSV file into another folder and changing strfilename to the fully qualified file name like "d:\temp\test.csv"

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

Excellent. That's exactly what I was looking for. Took me 5 minutes to plug it into my code. It's also great to see someone who understands the importance of whitespace. Over 32 years of programming I've learned that I spend a lot more time reading and modifying code than I do writing it so I appreciate it when the code is pleasing to the eye as well as well constructed.

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

Is that a specific example of a more general case?. For example, if the last three fields are always -1,-1,-1 then you just need to replace ",-1,-1,-1)" with ")". However, if the last three fields can take on other values then one solution would be a loop that would look for the last "," and strip off the last field. You could do (for example):

Private Function StripLast(ByVal flds As String, ByVal numflds As Integer) As String

	Do While numflds > 0
		flds = flds.Substring(0, flds.LastIndexOf(","))
		numflds -= 1
	Loop

	Return flds & ")"

End Function

will return the string with the last given number of fields stripped off. Sample call is:

flds = "YYYYYYYYYYYYYYYYYYY.',Y,'YYYYY YY YYYY YYY YYYY XX.XX',X,X,-1,-1,-1)"
flds = StripLast(flds,3)

'flds now has the value "YYYYYYYYYYYYYYYYYYY.',Y,'YYYYY YY YYYY YYY YYYY XX.XX',X,X)"

Is this what you intended?

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

I would appreciate a snippet of code for adding groups at run-time to a listview. I am currently listing books (and stats) without groups via the following code which is executed in a loop (one pass per book title).

item = New ListViewItem
item.Text = seq.ToString
item.SubItems.Add(Mid(titlenode.Nodes(N_CSTAT).Text, 3))
item.SubItems.Add(Mid(titlenode.Nodes(N_JSTAT).Text, 3))
item.SubItems.Add(titlenode.Nodes(N_PUBLISHED).Text)
item.SubItems.Add(titlenode.Text)
item.SubItems.Add(titlenode.Nodes(N_SERIES_NAME).Text)
item.SubItems.Add(titlenode.Nodes(N_SERIES_INDX).Text)
item.SubItems.Add(titlenode.Nodes(N_SYNOPSIS).Text)

lvwTitles.Items.Add(item)

The listview is set to details view. What I want to do is group the book titles by series. For example, books by Michael Connelly may be grouped by "Harry Bosch", "Jack McEvoy", "Mickey Haller", etc. I can create a new group for each new series by

groupnum += 1
group = New ListViewGroup("group" & groupnum, _
        System.Windows.Forms.HorizontalAlignment.Left)
group.Name = "group" & groupnum
group.Header = series

but I cannot find how to add the group to the listview and add the new item to the associated group.

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

The intellisense documentation clearly gives the parameters as minValue and maxValue. Apparently Microsoft has redefined the meaning of min and max in the online documentation and example. It reminds me of the Excel bug where the year 1900 was considered a leap year. Microsoft didn't fix the bug. It seems to me that they've taken the same approach here. Don't fix the bug, just redefine the meaning of max.

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

Am I missing something here? I am writing a game that requires some random number generation. I decided to use the System.Random class but I was getting strange results. The documentation says that if I have an instance of the class (let's call it r), the call

r.Next(1,6)

returns a random number in the range [1,6]. I always check random functions of this sort to ensure the accuracy of the "randomness". In this case I created a simple form with one button and the following code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

	Dim r As New System.Random
	Dim i, j As Integer
	Dim counts() As Integer = {0, 0, 0, 0, 0, 0, 0}

	Randomize()

	For i = 1 To 100000
		j = r.Next(1, 6)
		counts(j) += 1
	Next

	For i = 0 To 6
		Debug.WriteLine(i.ToString() & " = " & counts(i).ToString())
	Next

End Sub

This is the output that results:

0 = 0
1 = 19981
2 = 19950
3 = 20020
4 = 20041
5 = 20008
6 = 0

Clearly, the random numbers generated do not include the maxvalue (6) as stated in the intellisense popup. Am I missing something here? There is a famous quote that goes "the generation of random numbers is too important to be left to chance". If I am not missing something, and the random number generator is faulty then this is a giant oops …

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

I posted the following in the above forum this morning...

I understand that recent changes to google search (supposedly in order to reduce the ranking of content farms) has also harmed legitimate sites such as www.daniweb.com. This has apparently reduced traffic to the site by 50%. I have found this site to be a high quality source of technical help across a wide range of disciplines and would hate to see it die because it somehow got caught in the net. Surely with the technology available some kind of exception list could be added to google search such that the quality sites like daniweb that are mistakenly identified as content farms are not treated unfairly. I contribute regularly to the forums in my areas of expertise and likewise receive help in areas in which I am less proficient. Please give this matter serious consideration. The loss of daniweb would be felt by many.

I hope it helps.

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

Teamviewer can be run without installing so you should be able to run it from your thumb drive. Just make sure you copy the setup file to the thumbdrive. If you are concerned about your thumbdrive becoming infected then just wipe it when you are done. I suggest you set your own PC to NOT AUTORUN to protect yourself from malware on thumbdrives. Trend Micro provides a downloadable program called HouseCall (free) which you can use to create a bootable virus scan which you should run against the infected computer.

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

The recovery partition allows you to reset the computer back to the state it was in when it was purchased. I do free tech support for several people (friends/relatives). Lately this has consisted of installing Windows 7, then rescuing them when they destroy their system with crapware/trojans/etc. The steps I usually go through are:

1) full backup
2) wipe all partitions
3) create 40 gig C (system) partition and remainder of drive as D
4) install and configure Windows 7
5) apply all updates
6) create a disk image (I use Acronis)
7) install user apps and my choice of free apps/tools
8) create another system image
9) restore user data files to D partition

When the system gets trashed I just restore the latest C image, apply all updates since the last image then take a new image. For me, this is easier and more reliable than the recovery partition because I only ever have to configure once and apply only incremental updates. I also keep one image on the D drive and a copy on an external drive. The first image (Win 7 and updates with no apps) fits nicely on a DVD for the case when everything else fails. This way, the user is also protected if they have a hard drive failure (in which case a recovery partition would be useless anyway).

You only need the recovery partition if you want to get back to "factory".

jingda commented: Nice +6
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

To send a message to another user on the network you could try the "net send" command although I do not know if this available in your version of Windows.

royng commented: offset negative rep +5
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Copy the following code into a file named msgbox.vbs. Display a message from the
command prompt by:

C:\> msgbox "my message"
C:\> msgbox "my message" "my title"

If you want multiple lines then include \n as in

C:\> msgbox "this\nhas\nfour\nlines" "My Message Box"

set arg = Wscript.Arguments

select case arg.Count
    case 0
        Wscript.Echo ""
        Wscript.Echo "Display a message box with the given text and (optional) title"
        Wscript.Echo "\n in text will skip to a new line"
        Wscript.Echo ""
        Wscript.Echo "Usage:"
        Wscript.Echo ""
        Wscript.Echo "    msgbox text [title]"
        Wscript.Echo ""
        Wscript.Quit
    case 1
        prompt = arg(0)
        title  = "Message Box"
    case 2
        prompt = arg(0)
        title  = arg(1)
end select

prompt = Replace(prompt,"\n",vbCrLf)

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

http://support.microsoft.com/kb/315231

Shows you how to set auto login manually and also provides Fix-It buttons to do the setup for you.

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

Before retiring I managed two server installations (primary and backup). Each site had approx 10 (Windows) servers. We used Symantec Livestate Recovery to take daily images of all primary servers. The backup servers had identical hardware and disks and were booted into a maintenance mode whereby each day's image was restored to the paired backup server. This required a little prep work to ensure that the backup disks had the same disk signature (used HexProbe to do this). Different disk signatures would result in different drive letters being assigned on boot.

Anyway, the short answer is we had no problems with Livestate Recovery. I use Acronis for personal imaging but have never used it in a server environment.

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

Unless they have totally changed Virtual PC in the last three years, VPC is not an operating system. It is an environment which created virtual machines. In other words, you run VPC, then create a virtual machine into which you install whatever OS you want to run. If you have a copy of Windows Server then you install that OS. If you have a copy of Windows XP then you install that one. You can have multiple virtual machines. I used a similar (but better) product (VMWare) in which I set up multiple concurrent servers and workstations. Of course, if by "server" you meant something else like "web server" then I can't be of help.

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

Our secretary once complained about all the typing she had to do. I suggested she get implants but I don't think she took it like I intended ;P

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

One thing I hope never to lose is that sense of wonder. Our first SCADA system had disk drives with removable platters. The drive was the size of a washing machine and the stack of platters ($5000 for each stack) was about a fourteen inches across and ten inches high. Each stack was 300 meg. And now a USB key holds 32 gig and up. What's not to be amazed about.

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

They were system operators who used the computers to control several billion dollars worth of power grid equipment and would not accept the idea that they could not be trusted with admin rights on a $3000 PC. Also, there was a critical app developed by an outside company which required admin rights.

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

What happens if you type "gpedit.msc" in the Run box? If the gpedit console comes up then you should be able to set the Autoplay parameters by expanding

Computer Configuration
Administrative Templates
Windows Components

then double clicking on "AutoPlay Policies"

In the right panel, double click on Turn Off Autoplay and disable it

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

Our problem wasn't that the users were requesting unnecessary software and upgrades. Outside agencies would upgrade to newer versions of programs like Word, Excel and Visio and we would be unable to open the files without the appropriate upgrades. For that we had no choice but to upgrade. Our biggest problem was users installing unauthorized software. We would uninstall and the software would reappear. Then I got creative. I wrote a zapper which would flip a byte in the exe so that the user would get "This is not a Windows application" on running the program. I had a list of authorized programs. Anything that wasn't on that list got zapped at regular and frequent intervals. The users couldn't complain about problems with software they weren't supposed to have and I never had to remove the software.

For reasons which I will not go into here, this certain class of users were required to have administrative access to their computers. It's partly political and partly technical.

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

Imsai 8080 and Data General Nova. Mass storage was dual cassette on the DG and 8" floppy on the 8080. Debugging consisted of hand assembling and toggling bits on the front panel.

Next job was programming SPPCs (stored program process controllers) at two northern generating stations in Manitoba. Programs were written in assembler and cross compiled on the IBM mainframe in Winnipeg, then punched to paper tape before loading to audio cassette. Debugging was as above - front panel bit flipping.

We replaced the SPPCs with a dual redundant SEL mainframe. I finally got to program in FORTRAN. In '93 we started developing on PCs.

I ended up my career doing all PC work - software development, SQL DB admin, etc.

I can truthfully say I've just about seen and done it all. And, yes, I feel old.

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

You might want to check out Customizing Folders with Desktop.ini

http://msdn.microsoft.com/en-us/library/aa969337.aspx

jingda commented: Dead thread!! -1
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I was bored so I did the same thing but from within Excel. The disadvantage is that the code must be added to every workbook that you want to run it against. The vbs version is run from outside the Excel environment and is not part of the workbook. Please note that this code was written in Excel 2003. Your environment may differ. To add the embedded code, do the following:

1) load the data file into Excel
2) select menu items Tools -> Macro -> Macros
3) enter ProductReport as the macro name
4) click Create
5) replace the displayed code (all of it) with my code
6) save the workbook

To run, press Alt-F8 then select the ProductReport macro

Sub ProductReport()

    '  This macro scans the first sheet in the current workbook for all customers who
    '  have placed an order for a product which is entered at the prompt when the macro
    '  is run. The resulting report is copied into spare cells on that same worksheet.
    '  The location of the report is determined by the values of oRow and oCol. From
    '  the sample data it appears that the end of the customer data can be detected
    '  when both columns 1 and 4 are both blank.
    '
    '  2011-04-15 - JdG - original code

    Product = InputBox("Product:", "Enter product to search for")   'product name
    Match = LCase(Product)                                          'name in lower case
    
    iRow = 2    'the starting input …
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I have a Dell Inspiron 1720, my older son has an earlier model and my younger son has two Dells. Obviously we are pleased with the manufacturer.

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

I can write you something to use from within Excel but because you already have the csv files you can just process them from the command line. Copy the following code and save it into a file with the name "ProductReport.vbs". If your csv file is named myfile.csv you can use it as follows from the command line:

ProductReport widget1 myfile.csv

Output is to the console. If this isn't quite what you want let me know and I'll tweak it.

'fso is used for file operations
'arg is for accessing command line arguments

set fso = CreateObject("Scripting.FileSystemObject")
set arg = Wscript.Arguments

'if a file name is not specified show command syntax and exit

if arg.Count <> 2 then
	wscript.Echo "ProductReport product csvfile"
	wscript.Quit
end if

'the product you are looking for is the first argument.
'the csv file name is the second argument

product = arg(0)
csvfile = arg(1)

if not fso.FileExists(csvfile) then
	wscript.Echo "could not find file",csvfile
	wscript.Quit
end if

'open the csv file and process it one line at a time
'I am assuming that thformat of the file is strictly as you specified
'where all lines but the customer line start with a comma

set tso = fso.OpenTextFile(csvfile)

'add a comma to the start and end of the product so we don't accidentally
'confuse two products. for example, without the commas, "widget1" would
'match both "widget1" and "widget12"

match = "," & product & ","

'I know that the first line contains the column headers …
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sonofagun. I was closer than I thought. Go back to my first posting and do what I said about merging. The values under ShellNew are the entries that determine whether the associated object (eg .txt for text file) appears under the "New" context menu item. My ShellNew for .txt has the following values (in non-hex)

(Default) REG_SZ (value not set)
ItemName REG_EXPAND_SZ @%SystemRoot%\system32\notepad.exe,-470
NullFile REG_SZ

But don't add these values in manually. Use the files I exported otherwise you may screw up the REG_EXPAND_SZ entries. When these values are evaluated, the %parms% are replaced with the associated environment variables. If i have confused you I will be happy to try to explain further.

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

Oops. I read the posting then got called away and answered a question you hadn't asked. Please ignore the previous post and I'll see if I can find the registry entry for the desktop context menu.

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

In the registry under the first hive HKEY_CLASSES_ROOT you will find an entry with the name ".txt". I exported mine and it looks like this (without the ----- lines)...

---------------------------------------------------
REGEDIT4

[HKEY_CLASSES_ROOT\.txt]
"PerceivedType"="text"
@="txtfile"
"Content Type"="text/plain"

[HKEY_CLASSES_ROOT\.txt\OpenWithProgids]
"VisualStudio.txt.10.0"=""

[HKEY_CLASSES_ROOT\.txt\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.txt\ShellNew]
"ItemName"=hex(2):40,25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,\
33,32,5c,6e,6f,74,65,70,61,64,2e,65,78,65,2c,2d,34,37,30,00
"NullFile"=""
----------------------------------------------------------------

Note the line with @="txtfile"
Further down there is an entry named "txtfile". Mine looks like...

--------------------------------------------------------
REGEDIT4

[HKEY_CLASSES_ROOT\txtfile]
"EditFlags"=dword:00010000
@="Text Document"
"FriendlyTypeName"=hex(2):40,25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,\
74,65,6d,33,32,5c,6e,6f,74,65,70,61,64,2e,65,78,65,2c,2d,34,36,39,00

[HKEY_CLASSES_ROOT\txtfile\DefaultIcon]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,69,\
6d,61,67,65,72,65,73,2e,64,6c,6c,2c,2d,31,30,32,00

[HKEY_CLASSES_ROOT\txtfile\shell]

[HKEY_CLASSES_ROOT\txtfile\shell\open]

[HKEY_CLASSES_ROOT\txtfile\shell\open\command]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,4e,\
4f,54,45,50,41,44,2e,45,58,45,20,25,31,00

[HKEY_CLASSES_ROOT\txtfile\shell\print]

[HKEY_CLASSES_ROOT\txtfile\shell\print\command]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,4e,\
4f,54,45,50,41,44,2e,45,58,45,20,2f,70,20,25,31,00

[HKEY_CLASSES_ROOT\txtfile\shell\printto]

[HKEY_CLASSES_ROOT\txtfile\shell\printto\command]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,6e,\
6f,74,65,70,61,64,2e,65,78,65,20,2f,70,74,20,22,25,31,22,20,22,25,32,22,20,\
22,25,33,22,20,22,25,34,22,00
-----------------------------------------------------------

The values display here as hex but if you go into regedit, shell -> open -> command is displayed as %SystemRoot%\system32\NOTEPAD.EXE %1

you can reset these two entries by copying the first block into txt1.reg and the second block into txt2.reg, then merging them into the registry. Do a backup of your registry before you do this.

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

Free keyfinder at

http://download.cnet.com/3001-2094_4-10694022.html?spi=f34fce99a2880231b8f73c05a543996e

or you can Right-Click on My Computer and select "Properties". The bottom section of the window should say "Windows Activation" followed by "Windows is activate", then "Product ID: #####-#####etc"

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

Do a google search for "gparted live cd". The first one that came up on my PC was

http://gparted.sourceforge.net/livecd.php

It states, "GParted Live is a small bootable GNU/Linux distribution for x86 based computers. It enables you to use all the features of the latest versions of the GParted application."

There are instructions for creating a bootable CD or bootable USB stick. You can use the partition editor to shrink the OS down to the size you want. After that you can either create a new partition from the unused space with gparted or you can boot into Windows and do it from there. Probably best to do it through Windows. Grab a book. It may take a while.