Archive for Uncategorized

Update Option

It’s written, I’m in the process of testing it. When I add a record to the file, I can find it again from options 3, 4, and 5, but not 6. I don’t understand why search would work for the first three but not the latter. Even when I search for records from the police data files, I get a display like this:

Name:     SSN: 1 –

Street:   City:

County: (00) OUT OF STATE   Zip Code: -   State: (00) **

Vehicle Make: (00) ***********    Vehicle Type: (0) ***********

Top Color: (00) *********      Bottom Color: (00) *********

Tag:

PersonToString()

Options 1-3 are tested and sound. Working on option 4, but my PersonToString() seems to be Abort coredumping. No idea why, it’s only calling the gets from Person. Well, it calls getSSN() just fine, but for everything after, it Abort coredumps. Also, I’ve checked the gets themselves, and they’re fine. Any ideas about what is going on?

Search

My search always says that it doesn’t find the record, even though I’m pulling SSNs straight from police 1 & 2. On Drew’s advice, I printed out all the SSNs that the input SSN is being compared to. After I tweaked a few things, it started finding the record – but it still said it didn’t. I found by using std::cerr that the program is going into the if (first > last) block that’s there as an initial precaution. No matter what I try, I can’t stop it from ending up in the (first > last) block. Here’s a snippet of the code:

for (first = 1; first < (numRecs – 1); first++) {
if (first > last) {
std::cerr << “inside if (first > last)\n”;
std::cerr << “Social Security Number ” << searchSSN.Hyphens() <<
” not found.\n”;
return 0;
}
middle = (first + last) / 2;

Error

Undefined                       first referenced
symbol                             in file
display(AuxDataMember const&, int)  opt2.o
displayRecord(Person const&)        opt3.o
ld: fatal: Symbol referencing errors. No output written to cbhproj
collect2: ld returned 1 exit status
make: *** [cbhproj] Error 1

Yet another error.

More Errors

Fixed the old errors, now I’m getting non-aggregate type errors. When I looked online to try to figure it out, everything I found said that these errors usually happen when you put parentheses after declaring a data member, which whouldn’t have them since it’s not a function. But the errors are for my DeleteRecord and Sort functions.

No Person skills

My SSN, Zip, and Car classes work. MasterData is nearing completion. I’ve written options 1, 2, 3, 5, and part of 4. I tried using the makefile for the first time today and it has a lot of problems with my Person class. In short, it’s not recognizing the names of the input strings that I declare in my prototypes, and it really hates my operator= overload. The errors for the operator= overload look like this:

Person.cpp:30: error: `const Person& operator=(const Person&)’ must be a
nonstatic member function
Person.cpp:30: error: `const Person& operator=(const Person&)’ must take
exactly two arguments
Person.cpp: In function `const Person& operator=(const Person&)’:
Person.cpp:31: error: invalid use of `this’ in non-member function
Person.cpp:31: error: invalid use of `this’ in non-member function
Person.cpp:32: error: `socsecnum’ undeclared (first use this function)
Person.cpp:33: error: `zip’ undeclared (first use this function)

etc., etc. I can’t figure it out.

EDIT: Tom caught this error without even looking at my code. I forgot to add the Person:: in front of operator=.

Question

My SSN class compiles just fine. I wrote a short test program, which also compiled just fine. But when I try to create an SSN object, I get a segfault core dump error. (I’ve tried with both constructors.) I can’t figure out where my error is hiding. My code looks like this:

SSN::SSN (const char * const input) {
set(dehyphenate());
}

Help?

project journal 2

Between last night and tonight, I’ve put in between 7 and 8 hours. I’ve written the menus for cbhproj and opt2. Zip is working and SSN is almost working, just one more squirrely error to hammer out. I’ve written AuxDataMember, but not tested it yet. Thanks to Nathan for the suggestion of adding int main() {return 0;} to the classes to test.

project journal 1

I meant to put this up earlier since I did the actual coding on Saturday. I’ve written the SSN and ZipCode class declarations. I got a little confused about exactly how to write the function that allows for implicit conversion, so I haven’t done that part yet. I haven’t tested it, but most of the stuff is there. I’ll be working more on this later today.

Quantum math vs. Google

OK, so it’s not vs. Google just yet.

But quantum math has inspired a new way of searching on the web. The way internet keyword searches work now is that the search engine compares the frequency of your keywords in documents with their frequency in a standard body of text from many sources. Physicists at the University of Malaga in Spain came to the conclusion that keywords should be an intrinsic property of a document, and that one document need not be compared to others to have value in the search.

Pedro Carpena uses random matrix theory, a technique for studying disorder in quantum systems, to search without comparisons. The new method calculates the importance of words based on where they appear in a document, rather than how often. This works because as authors develop their ideas, they tend to use the same words in clusters before moving onto the next paragraph or page or idea.

Random matrix theory searches have not been compared to standard keyword searches yet. And they may never become mainstream, considering that Google is already so prevalent. As one observer says, “This is potentially very promising, but they’re wading into a crowded field.”

« Previous entries