Hi. I am having some trouble with my computer. Here is a quick review of issues...About a month ago my McAfee AV kept getting turned off. I could not figure out what was wrong. Nothing was found on any scans. I removed McAfee and got AVG free edition. It stopped doing that and has been working fine since then. Two days ago, my internet started going haywire. When I search for anything, the results are redirected to bogus advertising websites. You can type the URL in the address bar or go through Favorites and it works fine but clicking on …

Member Avatar
Member Avatar
+0 forum 1

I have a file, which I have read, and need to print a parse tree for it. What I am doing is a syntax checker only for open and close parentheses (). If the item read is a open parentheses, I put it on a stack. If it is a close parentheses, I pop it off the stack. But, as I am reading and writing, I need to write the parse tree to the file. The input file looks like this: OPAREN ( DEFUN Defun Name Acount OPAREN ( NAME L CPAREN ) OPAREN ( COND cond OPAREN ( ... …

Member Avatar
Member Avatar
+0 forum 5

I know there is a way for the user to enter input and be able to accept it without the user having to press the Enter key but I do not know the command. Does anyone here know? For example, I have a menu like this: A Add a record D Delete a record L Change last name etc. I want the user to type an 'A' and not have to hit the Enter key. The program just accepts the 'A' automatically. Thanks for any help. :p

Member Avatar
Member Avatar
+0 forum 5

Does anyone know basic pseudocode for a balanced k-way sort-merge? Thanks for any info you may have.

Member Avatar
Member Avatar
+0 forum 5

I know you use strcmp() with strings and that if it is equal to zero, they match. But, how do you see if one string is less than the other? I want to compare SSN's to see if 12345620 is less than or greater than 123456708. Thanks for any input.

Member Avatar
Member Avatar
+0 forum 5

Can anyone tell me why this is printing doubles out to the output file? [CODE] IndexFile.seekp(20, ios::beg); for (i = 0; i < NumOfSlots; i++) { if (RandomFile.peek() == 42) { Position = i; RandomFile.seekg(37, ios::cur); //cout << Position << " "; } else if (RandomFile.peek() != 42) { RandomFile.get(R.SSN, 10); NumberWritten = NumberWritten + 1; Position = i; //cout << Position << " "; IndexFile << R.SSN; I.RelativeAddress = Position; IndexFile << setw(3) << I.RelativeAddress; IndexFile << setw(3) << -1; IndexFile << setw(3) << -1; IndexFile.seekg(20, ios::beg); IndexFile.get(I.SSN, 10); IndexFile >> I.RelativeAddress; IndexFile >> I.LLink; IndexFile >> I.RLink; Position2 …

Member Avatar
Member Avatar
+0 forum 1

Can anyone help me with this snippet of code? I have 2 files, a random record containing random records in it and an index file, which contains the binary tree of the random record. Here is what the index file looks like: 123456720 4 -1 -1 123456708 6 -1 -1 123456703 10 -1 -1 123456723 30 -1 -1 ... etc. What I do is add 1 number from the random record file into the first position of the index file. Then, I need to search the index file for the record I just inserted. The first record I come across …

Member Avatar
+0 forum 0

I have a program that I need to do some matching in. For example, I need to match the lexemes in a LISP function and print the token out to a file. For example: if ($input =~ /(^\()/) { print OUTPUT "OPAREN $1\n"; $input =~ s/^\(//; } I need the matching for the parentheses, letters, digits, etc. I am confused when it comes to matching. Thanks for any input you may have.

Member Avatar
Member Avatar
+0 forum 1

Does anyone know how to match a negative number? What I am doing is printing the lexemes with their token to an output file. But, the problem is negative numbers. It should print like this: INT -1 Instead, it prints like this: SUB - INT 1 The SUB - is technically right because the minus sign is printed this way but I want it to recognize the -1 as an INT. Any suggestions? Thank a lot. TIRED OF PULLING MY HAIR OUT OVER SIMPLE THINGS! :mad:

Member Avatar
Member Avatar
+0 forum 1

Does anyone know how to ignore the rest of a line in Perl? I am reading a file and printing out tokens to an output file. I want to ignore the rest of a line after a colon is found, which indicates a comment. That way it will not print to the output file. I tried a range from (; - \n) but it does not work. Thanks for any input.

Member Avatar
Member Avatar
+0 forum 2

I have a problem that deals with reading a random access file and creating an index file, which is a file to hold the binary tree of the random access file. I have the index file created with SSN (key), relative address of the SSN in the random access file, and a left and right link. What I need to do is every time a node is inserted, compare the node with the root of the tree. If it's less than, find the first SSN record in the index file that has a left link set to a -1 (dummy) …

Member Avatar
+0 forum 0

I have a program that uses blocking/non-blocking direct and indirect communication. I need to have it randomly choose whether or not it should do the blocking or non-blocking method and I do not know how. Does anyone have any suggestions? Thank you.

Member Avatar
Member Avatar
+0 forum 2

Does anyone know how to have a thread randomly decide if it wants to do blocking or non-blocking mode with direct communication? I am using a bounded buffer with size of 5. I have the non-blocking mode right but I am not sure how exactly to change it to accommodate for blocking mode. I am not very proficient with Java. I am actually just learning. Does anyone also know how to do blocking direct communication with only 1 producer and 1 consumer used for blocking and non-blocking? Thanks for any help anyone may have.

Member Avatar
Member Avatar
+0 forum 1

I have a problem where I read in a 2D matrix and divide the matrix into 2 parts, where the sums of each part are equal. Each part must contain contiguous integers that can be networked together by following paths from one intger containing cell to another via shared sides. The first matrix is: 4 4 50 85 9 33 301 46 40 19 105 29 11 12 20 13 23 16 The solution is: 301 + 105 = 406 50 + 85 + 9 + 33 + 46 + 40 + 19 + 20 + 29 + 11 + …

Member Avatar
Member Avatar
+0 forum 2

I have an assignment that I need to do that designs the necessary classes to facilitate an indirect blocking and non-blocking communication environment between threads (producers and consumers) using a bounded buffer whose size is defined at run time. I am to test the working of these classes by creating an environment where 2 producers and 2 consumers communicate with each other by arbitrarily choosing either blocking or non-blocking mode. I also have to design the necessary classes to implement an emulated direct blocking and non-blocking communication between threads through a bounded buffer whose size is defined at run time. …

Member Avatar
+0 forum 0

I am having some trouble understanding pure LISP. I am confused about the concepts of atoms and flat lists vs. any lists. I have a problem that should be fairly simple, although it uses recursion, which I am not very familiar with using. The function takes 1 argument which can be any list. It returns the number of atoms named A in the list. I was trying to see if there was only one element in the list and, if so, is it an A. If it is, return a 1. This is what I have: (defun A-Count (L) (cond …

Member Avatar
Member Avatar
+0 forum 1

I am doing a 5-way balanced sort merge. I have 1, 000, 000 records and a toal of 10 temp files to work with (5 for input and 5 for output). After phase 1, the temp files F0 thru F4 are populated with clumps of sorted records. The clump size is 1000. I am using an array of files to work with, instead of hard coding 10 temp files. My phase 2 is not working correctly. What I am trying to do is read 1 record from each of the 5 temp files and write the smallest one to the …

Member Avatar
+0 forum 0

I have a problem that I am not sure how to even come up with a solution. So, I was wondering if anyone would have any input to the problem at hand. I have to divide a matrix that is defined by an input file into 2 distinct regions so that the sums of the integers in each region are equal. And also to dicover how many combinations of two distinct regions can be created. For example, the first matrix is defined in a file as: 4 4 // The size of the matrix (a 4x4 matrix) 50 85 9 …

Member Avatar
Member Avatar
+0 forum 1

Does anyone know how to compare a old style character string with a character in qoutes? Example: I want to compare the first character in a record that is stored in an old style character string with a `*`. Here's what I have in my code: char FirstCharacter[1]; // Character string to hold to value found by the peek() function OutputFile.seekp(Total * 60); //Seek to the correct position FirstCharacter[0] = OutputFile.peek(); //FirstCharacter set equal to peek() if (FirstCharacter[0] == "*") { cout << "Dummy Record"; } //Try to compare value stored in FirstCharacter with a "*". If it is true, …

Member Avatar
Member Avatar
+0 forum 2

I am trying to create a random access file from a sequential file. I have the random access file skeletonized with "dummy records". An example of my dummy record is: 100 *********ZZZZZZZZZZXXXXXXXXXXYYYYYYYYYYYYYYYYYYYY00.00 -1 *********ZZZZZZZZZZXXXXXXXXXXYYYYYYYYYYYYYYYYYYYY00.00 -1 The "*'s" are a SSN, "Z's" are the last name, etc, etc. The 100 and the -1's are a link at the end of each file (to be used with synonym chaining). The 100 is the next available slot in my overflow area. Anyway, the problem is that I read the first SSN, use a hash function on that SSN (hashes to position 69 in …

Member Avatar
Member Avatar
+0 forum 1

Can anyone tell me how to compare a string to an integer? I have a SSN stored as a string, SSN[10]. I need to compare each number in the SSN. What I need to do is to add up the ASCII values of the SSN to use for a hashing function. For example, the SSN is 222116666. I need to add the ASCII values up: 50 + 50 + 50 + 49 + 49 + 54 + 54 + 54 + 54 = 464. strcmp() does not work comparing a string and an integer. I have the string class and …

Member Avatar
Member Avatar
+0 forum 2

Does anyone know how to stop a Java thread? I am not very familiar with Java and am not really sure exactly what I am doing. I have to create the necessary classes to facilitate an indirect blocking and non-blocking communication environment between threads (producers and consumers) using a bounded buffer whose size is defined at run time. I have to test the working of these classes by creating an environments where 2 producers and 2 consumers communicate with each other by arbitrarily choosing either blocking or non-blocking communication. I have all of the classes defined, i.e., BoundedBuffer, Buffer, Producer, …

Member Avatar
Member Avatar
+0 forum 2

I have a program for a 5-way sort merge. I can get the program to read from the original file of 1,000,000 records and write them to 5 tempoary files (File0 thru File4). Then, I am suppose to close the temp files (Files 0 - 4) and open them as input, and open 5 more temp files (File 5 thru File 9). I cannot get the Files 0 - 4 to print to Files 5 - 9. Here is part of my code, as it is a little long. How do you get the % operator to print to Files …

Member Avatar
+0 forum 0

Does anyone know how to use an array of files? The array is defined as: fstream F[10]. I have 10 temp files that I need to use but am not sure how to open these temp files or write to them. I have a counter to keep up with which file to write to: F[Counter%5]. What I need to do is read 1000 records from a file, sort them, and write the 1st 1000 records to F[0], the next 1000 records to F[1]...etc. How would you open the array of files or write to the array of files? I have …

Member Avatar
Member Avatar
+0 forum 2

The End.