Narue 5,707 Bad Cop Team Colleague

You shouldn't worry too much about efficiency yet. Just work on getting it functional. :) As for the functional part, pulling HTML tags from a file can be tricky for the general case. Probably the safest way is to walk through every character and build each tag individually before storing it. That way you can easily check to see if you're in a string or something.

Narue 5,707 Bad Cop Team Colleague

>Who celebrates Hanukkah and who celebrates Christmas? How do YOU
>celebrate the holidays and what do they mean to you?
I celebrate Christmas largely because I was raised to a Methodist family. However, due to my atheist leanings, the holiday really doesn't mean anything to me beyond a chance to spent time with family that I see rarely. My children will learn that the meaning of the holidays (whichever they choose to follow) is being with the people you love. Of course, if they want to add more meanings to that then I don't mind. :)

Then again, Wintereenmas is a holiday I can really get behind. :D

Narue 5,707 Bad Cop Team Colleague

>What is your favorite comfort or theme food? What do you like about it? What are your memories of it?
A glass of milk reminds me of family and the beach because when I was a kid, my grandmother always made me drink milk at meals. Now I don't need to be forced, and the taste reminds me of those fun years. :)

Narue 5,707 Bad Cop Team Colleague

>I'm taking all three subjects together....so you must imagine how mixed up im getting
I know that feeling all too well. I frequent forums for about nine different languages and I end up making more of those blunders than I'd like. ;)

Narue 5,707 Bad Cop Team Colleague

>I'm sorry if everyone is starting to be sarcastic with these question
>marks we don't mean anything, hopefully it doesn't offend you?
Yes, please don't take offense? Friendly banter is one of the best things about this forum? But our humor can be a little weird sometimes? Eh? Eh? Yes? No? :cheesy:

Narue 5,707 Bad Cop Team Colleague

>I believe sarcasm was supposed to be out of Daniweb..
What made you think that?

>And ya, if i need sarcasm , i would go, listen to my boss.
What you quoted wasn't sarcasm, it was a legitimate complaint about the readability of what you posted. Since we'd rather assume that you're an intelligent person and know how to post code, the only viable conclusion was that it was given to you poorly formatted.

>try it... u might like it..
Well, it's ugly and rather inelegant, but not a bad solution. I'm honestly not sure I could do better with the restrictions at first glance, but I would have to give it a think to be sure.

Narue 5,707 Bad Cop Team Colleague

Okay, it looks like you're confusing C, C++ and Java.

>#include <string.h>
This supports string handling on array based strings, not the string class. For that you want to include <string>. I know it's confusing, but sadly, that's how it is. :(

>boolean Ispalindrome()
boolean isn't a keyword in C++. You probably want bool instead.

>string s1 = s.reverse;
The string class doesn't have a reverse member, which is fascinating since I'm pretty sure there's a kitchensink member. ;) There's a reverse function in the <algorithm> header, and you pass it a start and end iterator. This might work for you:

#include <algorithm>
#include <iostream>
#include <conio.h>
#include <string>

using namespace std;


class palindrome
{
  string s;

public:

  palindrome()
  {
    s="null";
  }

  palindrome (string s1)
  {
    s=s1;
  }

  bool Ispalindrome()
  {
    string s1 = s;
    
    reverse(s1.begin(), s1.end());

    if (s==s1)
      return true;
    else
      return false;
  }
};

int main()
{
  palindrome s1("How are you");
  cout<<s1.Ispalindrome();
  palindrome s2("BOB");
  cout<<s2.Ispalindrome();

  getch();
  return 0;
}

On a side note, conio.h is a non-standard header, so your code isn't portable. You only include it for getch, and you can replace getch with cin.get to a similar effect without sacrificing portability.

Narue 5,707 Bad Cop Team Colleague

>I thought it was from the Japanese Manga "Narue no Sekai".
Nope, though I have flipped through the manga and seen the anime in its entirety. Most likely I took Naru from Love Hina and threw a suffix on it because I wanted another syllable or I thought Naru would be too cliche. *shrug*

Narue 5,707 Bad Cop Team Colleague

>I thought it was a movie.
I guess it was only a matter of time, what with the popularity of the book. Now when are they going to finally make the Dragonriders of Pern?

Narue 5,707 Bad Cop Team Colleague

>C is not a simple language.
C is a very simple language. It's just really hard to use. ;)

Narue 5,707 Bad Cop Team Colleague

Well, I see now that your personal attacks have increased, you've run out of interesting things to say. Enjoy the rest of your thread.

Narue 5,707 Bad Cop Team Colleague

>Off-topic: Narue, out of curiosity, where did you get your nick?
I just took a random Japanese name (Naru) and added a common suffix to it (e).

Narue 5,707 Bad Cop Team Colleague

>If I create a class called "tree" and inherit from it to classes
>called "elm" and "oak", can I, using all three header files, create a
>vector <tree> and use push_back to add an "elm" and an "oak" to that vector?
Polymorphism only works through references, so you'll want a vector<tree*> rather than vector<tree>. But if that's the case, yes you can do what you want. However, you'll end up with a heterogenous data structure, and you need a way to figure out which tree is which if you plan on using anything but inherited members.

Narue 5,707 Bad Cop Team Colleague

>and no one has a clue what they are doing
Get used to it. Confusion is a close friend to every programmer. :)

>Im not sure thats my problem.
You said it doesn't work. Describe what it does as opposed to what you expected it to do. That might not be the problem, but we'll have a hard time helping you without details.

Narue 5,707 Bad Cop Team Colleague

>Why no cat named Prelude?
I don't see that working out, especially considering where I pulled that handle from. ;)

Narue 5,707 Bad Cop Team Colleague

>Hopefully everyone has gotten to know each other's personalities a little better
I've learned a great deal. It was a very productive thread.

Narue 5,707 Bad Cop Team Colleague

Okay, from the beginning, before anyone attempts to turn this in to a "controversial thread" ha! I wish to clarify that this is not about gender dominance or alienating men. This is what it is, a simple question, cute and funny.

Let me say right now that you've totally overreacted. :rolleyes:

>Since I am a girl, my favorite pet is a dog, which I happen to own a beautiful Siberian Husky named Pearl
Since I'm a girl, my favorite pet is a cat. I have three house cats named Saya, Spot, and Narue. ;)

>I fail to follow the logic of
Me too. I've always heard that girls tend toward cats and boys tend toward dogs. :)

Narue 5,707 Bad Cop Team Colleague

>I tried to run this and it wont run.
It looks largely okay, can you describe how it doesn't run?

Narue 5,707 Bad Cop Team Colleague

>I personally think that is what seperates a human being from a good human being...
It's a matter of perspective. History is filled with wars caused by differences of perspective (can you say "Crusades"?), and who are you to say that one is better than the other? I'm sorry, but claiming that the difference between a human being and a "good" human being is solely based on your judgement strikes me as arrogant and ignorant.

>It's not your view that's the problem it's how you selfishly phrase it
>without any care for anyone but yourself.
In other words, you're telling me how I should act; forcing your way of things onto me.

>I think you just told everyone on this board that you can care less about the feelings of others
I told everyone that I can manipulate their feelings as I see fit through my words. That doesn't mean I don't care.

>choose to be willingly irresponsible and can care less as to whom you offend.
And not being nice automatically makes me irresponsible? :rolleyes:

>You are performing an insulting and hurtful act with one motive.......to demean and to degrade people.
You keep making the same mistake. You can only see one motive, so only one motive exists, which couldn't be further from the truth. I'm sorry that your vision is so narrow.

>Interesting how you "assumed" that my last post was directed to you, guilty conscience hmmm?

Narue 5,707 Bad Cop Team Colleague

>But...
But it doesn't change the fact that I come off as a jerk. I'm well aware of that.

>LOL. Is this meant to be humorous?
It's a kind of dry humor, yes.

>This must not be your first taste of criticism in regards to your demeanor.
Let's see, the number of people who have complained about my attitude would be...I don't think I can count that high. :D Then again, a surprising number of people find that my attitude adds to my charm. ;)

>I abhore Censorship for the most part.
That's something that the administration team has been working on recently (hence, my return to modship). I don't believe in editing content out of a post, or censoring people at all (ie. with a ban or by deleting threads) unless they intentionally hurt the community or seriously affect the ease with which people can get quality technical help. Despite how it seems when I open my mouth, I'm exceptionally tolerant of people's rights. ;)

>Can we all please try to come to terms with this and not only "drop it", but resolve it?
Doubtful. First, it's nearly impossible to get two sides with extreme and opposite opinions to resolve a problem without separation. Second, I'll speak for the moderators and say that an executive decision would be excessively draconian and you shouldn't expect it for trivial differences in opinion that should be handled by individuals in private. At the …

Narue 5,707 Bad Cop Team Colleague

>I have a simple philosophy on life, treat people with respect, kindness and compassion.
Respect, yes. Kindness and compassion will get you stepped on and taken advantage of. Ideals have their place, but you can't apply them everywhere and not end up disappointed. I always respect people, even if they don't see it, but I'm not going to be bubbly and nice for fear of hurting your precious feelings. Perhaps you should be tolerant of other perspectives rather than try to push your own beliefs on everyone.

>Anyone who posts stupid remarks in order to incite the other person
>for their own gain shows how immature that person is.
That's probably true. Since I imagine you had me in mind when you wrote that, I'll ask you this: what do I gain from it? You were on the receiving end, so naturally you feel injured, but I think that also blinds you to other perspectives. You say "Oh, that person hurt me!" without wondering why that person did it. You simply assume it was malicious.

>You can phrase your verbage in a responsible manner.
Yes, yes I can. Often I don't choose to, and I have my reasons for that choice. Just so you know, those reasons never involve pleasure in making people feel bad.

>I say what I see BUT "I think" before I speak keeping in mind the feelings of others.
So do I. In fact, I can accurately predict …

Narue 5,707 Bad Cop Team Colleague

>Oh, and your romanji is off...
That would be romaji or roumaji, or equivalents depending on your favorite romanization system. ;)

Narue 5,707 Bad Cop Team Colleague

This thread is over a year old. Please look at the time of the last post before replying, as resurrecting old threads is often counter-productive. Thanks.

Narue 5,707 Bad Cop Team Colleague

^ isn't restricted, it just means something other than what you're trying to do. ^ is the bitwise exclusive OR operator, not an exponentiation operator. What you want is the pow function:

#include <math.h>

pow ( 2, 3.0 );
Narue 5,707 Bad Cop Team Colleague

>What's your favorite cartoon....?
Just about anything anime. :) For more cartoonish cartoons, I couldn't help but enjoy any X-Men series.

Narue 5,707 Bad Cop Team Colleague

>Yes, this may well be deemed "sarcasm *cough"
If you want to view it that way, I won't stop you. However, I interpreted the original post as stated, there was no joking involved.

>This is my first, real "introduction" to Narue and I suppose I wish that I have never discovered this thread at all.
I would much rather your first real "introduction" be one of my good posts in the C++ forum, but sadly, not everything I write is eloquent and brilliant. I guess you'll just have to settle with the discovery that I am, in fact, human.

>>1) You couldn't think of anything better to talk about.
>This is just insulting.
Good, that's how I meant it to be.

>>2) You're trolling by subtly bringing up a topic that will divide people.
>Use the term "trolling" in a forum where the people reading the posts
>are either programmers, hackers, or just Net-addicts?
I know what trolling means, and I know you know what trolling means. What makes you think I meant anything but what I said?

>God help the person who asks an in-depth question.
You'll find that I'm more tolerant of in-depth questions, because it suggests a sincere desire for information rather than a thinly veiled attempt at getting people riled up.

>I should just stick to the Python and C++ rooms.
I moderate all of the software development forums, and I'm an …

Narue 5,707 Bad Cop Team Colleague

>Any ideas you guys could fish out would be most helpful.
Lazy deletion is definitely the easiest to implement, but it gets tricky when you want to clean the data structure by physically removing "deleted" nodes. So it really just defers the problem until later, where it becomes a bigger problem. :) The only reall reason for using lazy deletion is when the expense of removing a node is too great at the time.

Since you're storing references and not actual data, a deletion by copying scheme is probably much better for you. It's easier to wrap your head around because you only adjust links for a leaf node. You can find a couple of implementations and a description here.

Narue 5,707 Bad Cop Team Colleague

>what does using namespace std mean. Please tell me. haven't taught about it yet.
In 1998, C++ was standardized. The old headers that end with .h (iostream.h, fstream.h, etc..) were removed and replaced with headers of the same name without the .h extension. Also, a feature called namespaces was added to help with naming conflicts and every name in the standard library was placed in the std namespace. So in standard C++, you would have to do this:

#include <iostream>
#include <string>

int main()
{
  std::string name;

  std::cout<<"What's your name? ";
  std::getline ( std::cin, name );
  std::cout<<"Hello, "<< name <<"!\n";
}

Naturally, that's tedious. Programmers are lazy people and don't want to type std:: everywhere, so two tricks were added to remove that need. The first is a using declaration where you specify each name you're going to use. Just type the keyword 'using' followed by the fully prefixed name and every subsequent use of that name in scope won't require a prefix:

#include <iostream>
#include <string>

int main()
{
  // These are using declarations; one for each name
  using std::string;
  using std::cout;
  using std::getline;
  using std::cin;

  // Now you don't need the prefix, but have to add a
  // using declaration for each new name
  string name;

  cout<<"What's your name? ";
  getline ( cin, name );
  cout<<"Hello, "<< name <<"!\n";
}

If you're even lazier than that, you can create a using directive. A using directive basically creates using declarations for every name in the namespace. …

Narue 5,707 Bad Cop Team Colleague

>cin and cout are none of those.
>They are objects.
cin and cout are identifiers referencing objects.

Narue 5,707 Bad Cop Team Colleague

>c?
I suppose that would work, though the wording looks tricky.

>c?
You're so indecisive. One of them is right, so you can improve your chances to 50/50. :)

>c?
A pedantic view would say d for none of the above.

>d?
That's right, after a fashion, but you could be more right.

Narue 5,707 Bad Cop Team Colleague

Daniweb is a way for me to help people more easily learn the things that I've had to struggle through.

Narue 5,707 Bad Cop Team Colleague

>I found no help from this Forum...it is westing of time..
The feeling is mutual. After seeing how grateful you are that I saved you from making a huge mistake by not learning anything, I feel like I've wasted my time.

>People know how to give advice but don't know how to answer...
Here's an answer: Do your own homework! I've already done this stuff for myself, so why should I do it for you? What if you sail through your coarses and then become my co-worker? Then I have to deal with your incompetence because I did your work for you. Sorry, but I'm on a quest to improve the field, and people like you just drag it further into the gutter.

Narue 5,707 Bad Cop Team Colleague

>I've got a "Segmentation Fault" error in C++ when trying to allocate a vector with a dimension of 2 million.
2 million what? Chances are good you're exceeding the limits of a single allocation request. But it's hard to say without seeing some code.

Narue 5,707 Bad Cop Team Colleague

>In fact, I've been here waiting for you, tapping my digital foot out of sheer
>impatience, just to see what our beloved Narue has to say next.
What can I say? I have a bad habit of getting to know people by provoking them. :cheesy:

Narue 5,707 Bad Cop Team Colleague

It takes two to tango, slick. Keep that in mind when you hold grudges.

Narue 5,707 Bad Cop Team Colleague

I see you carefully read the replies to your threads. I'll keep that in mind when I feel the need to compose something time consuming and just ignore you.

Narue 5,707 Bad Cop Team Colleague

>80 k sounds much better, like you mentioned.....
Okay, let's just change the rules and start paying more because Justine thought the average isn't enough. I'll inform all of the companies that employ programmers straight away. You asked for average starting salary and I gave it to you for my area. There's nothing to disagree on.

By the way, when I say 40K starting salary, I mean starting salary. That's for a brilliant person such as yourself just starting out in the field with no worth at all to a company except a resume that claims an ability to write code. A good programmer commands a great deal more, and it just goes up from there, especially if you have niche skills.

Well, since I'm a moderator and my actions reflect on Daniweb, I'll refrain from speaking my mind this time. Good day.

Narue 5,707 Bad Cop Team Colleague

>I find it interesting that a female is the first to object to the question.
I'm a woman working in a field that's predominately male. I've categorically exceeded my peers in every professional way. You'd be surprised how many people assume I'm a boorish feminist just from that. Questions like purple rainx's promote that stereotype, and it irritates me because I have to live with the results.

I'm also regularly tempted to disrupt the world around me just for fun...:twisted:

>Would we have gotten so hot if she had asked "who likes brussel sprouts?"
I'm sure when questions about brussels sprouts have subtle and controversial connotations, they'll cause debate as well. ;)

Narue 5,707 Bad Cop Team Colleague

>but that doens't mean that women can't do a peice or work which men can.
Please point out where I said otherwise.

>some are good at somethings some are not, its not just a thing associated only with women.
We can narrow it down even more. People who eat a healthy breakfast have been proven to perform better than people who don't. Where do you draw the line?

>With a broken defination of equality, it sure is.
And how is my definition broken? Because you don't agree with it?

Narue 5,707 Bad Cop Team Colleague

>An assembler produces machine code for the machine (i.e. processor) not the operating system.
Correct, but that doesn't make the machine code portable because it relies on knowledge of the operating system that it's assembled on. It very likely makes system calls that are not portable. It's required to match object file formats if the machine code is to be executable. Just because "in theory" portable machine code for a processor can be produced with some mythical universal assembler, it doesn't mean that the real world works that way.

The difference between an assembler and compiler is that there is a direct one to one correspondence between assembly language instructions and machine code instructions, whereas a line of code in a high level language could correspond to a whole subroutine in machine code.

I take it you're not familiar with macro assembly then. The one-to-one dealie hasn't logically applied in a long time. Sure, after macro expansion it's one-to-one, but that step is usually a part of the assembly and nobody sees it.

>without calls to the operating system, the code is as portable as could be wished for OS wise.
The assembly code might be portable, the machine code cannot be. For example, you can assemble a COFF program on Windows and it won't work on Linux because the two systems use slightly different formats for COFF. You need to take the portable assembly and assemble it individually for each system to get machine code that …

Narue 5,707 Bad Cop Team Colleague

>Today, arguably all jobs can be performed by either boy or a girl.
Too many people try so hard to pretend that there are no differences between men and women, and that's just not true. There are physical, mental, and emotional differences that have to be accounted for. Equality is impossible. Men are better at some things by nature and women are better at some things.

I believe that opportunities should be universal, but expecting performance to be universal is the height of ignorance. This entire thread strikes me as silly, but it would take too long to enumerate all of the reasons why.

Narue 5,707 Bad Cop Team Colleague

>I'm not one to tell my"friend" as YOU put it to go in to another field, that will be entirely her decision.
Well, then maybe you should offer her your opinion directly instead of making incorrect statements here, where she probably isn't paying attention.

>Atlanta?
Yes, Atlanta. The city that I was using for my estimate.

>if you want to live there and I'm sure that doesn't apply to all people in Atlanta, merely your opinion.
You said that people making 40K or less would struggle. Since my estimate was assuming the city of Atlanta, and I'm well aware that it's not the case, you're wrong. Unless, of course, you can gather an unbiased focus group that makes less than 40K in Atlanta and will admit that they struggle to survive.

>We all have our opinions/views, you are entitled to your and the rest of us can have ours.
Finally, you say something that I can't dispute.

>I just don't agree with you, can you handle that
I can handle it just fine. But I'm not going to sit quietly when I know that your opinion is wildly incorrect.

Narue 5,707 Bad Cop Team Colleague

>Well after two semesters and three absolutely 'horrible' teachers I've
>decided to drop my C, C++ courses and move over to a different line of study at college.
To be perfectly frank, if that's all it takes for you to quit, you wouldn't have made a good programmer anyway.

>If anyone knows of any good C/C++ certificate courses that can be done online, please let me know.
I know of a couple, but they're worthless and nobody cares about them. Certifications and diplomas don't mean nearly as much as a good portfolio, and most of the best programmers taught themselves. You might consider a bit of self study before jumping ship. Programming is a very rewarding field.

Narue 5,707 Bad Cop Team Colleague

WOW....thanks for the warm welcome. Some of you sound pathetically ignorant and immature. I asked a simple question, contributing to the spirit of the board in getting to know people. I'm a woman who was interested in seeing how many other women, like myself are in to computers. I didn't ask for psychoanalysis or to be judged. I can care less what you think as you don't know me and you're opinion means very little...Those who have manners here thanks.......Justine

I am a free spirit, loving and caring. I have no interest in dividing anyone, that's YOUR personal mental problem and your scewed opinion. If a strong woman frightens/challenges you, then take your meds and go to bed. I'm sure there are many fun guys here and won't let a few ignorant people taint the rest.....Justine

If you don't care, why does it bother you so much? :rolleyes:

Narue 5,707 Bad Cop Team Colleague

Goofy teeth? :cry:

Narue 5,707 Bad Cop Team Colleague

>After "Da Vinci Code" who wouldn't?
I have no idea, I've never read it. ;)

Narue 5,707 Bad Cop Team Colleague

>40k to start? That's surprising, I thought the IT industry is one of the highest paying.
Experience dictates your salary. When you have years under your belt and knowledge to back it up, you can command higher pay. I don't see why you would expect an entry level position in an easy to enter field to earn more than that.

>Many fields start you of with a higher salary
Such as? I'm willing to bet that they have a huge cost of learning, a fairly solid guarantee of quality in new hires, or a lot of danger. Programming has none of those.

>on 40k it would be hard to exist given the high cost of living
If you're talking about Atlanta, then it's BS. Most Atlantans live well on quite a bit less than 40K.

>And if you live in a big city you will struggle
So tell your "friend" to get into another field if it sounds that bad.

Narue 5,707 Bad Cop Team Colleague

C Unleashed by Richard Heathfield and friends should cover most of what you need.

Narue 5,707 Bad Cop Team Colleague

Did you even try to do it yourself? I'm not against borrowing code to get the job done, but this is clearly homework, and homework is meant to be solved so that you can learn to be a better programmer.

Narue 5,707 Bad Cop Team Colleague

>Does it matter?
Not really, as long as you're consistent and document the functions.